Wednesday, April 8, 2015

TCC - Exporting Attachments

 

This is something I struggled a lot with, and I am posting this in the hope that the next person struggling with this will find it helpful.

Taleo Enterprise Edition has a complex data model, and this becomes a problem when it comes to mass updates/exports. They provide a windows tool called the Taleo Connect Client (TCC) for this purpose. But the tool does not provide any out-of-box option to export/import files and attachments. For this purpose, consultants were using a custom library called TCCCustomSteps. But there is very little documentation around the subject area, and automating it requires bat files.

cleartext.blogspot.com

1:First, download the TCCCustomSteps library. This used to be hosted on Taleo's knowledge exchange forum, but the links no longer work. You can download a copy from here.

2:Extract the jar files into the \extensions\exernaljars\ folder under your TCC installation.

image

3. There is a product defect in current releases of TCC, you will get jar files when you try to use the TCCCustomsteps library. The fix is to replace commons-lang-2.0.jar with commons-lang-2.6.jar [TCC installation folder]\lib\endorsed.

4. Restart your TCC client.

5. Set up your TCC export and configuration files. Choose XML as the output type in both the files, CSV won't do. In the Projections tab of the export file, map the filename and file contents fields.

image

image

6. Create your TCC config file now, you can choose to create it from the  export file created in the previous step. In the projections tab, remove the StripSoap step, and add an XSL transformation step. cleartext.blogspot.com

image

The XSL step is to filter out only the tags required for the ExtractFile step. Here is the contents of the XSL file:

--------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
    xmlns:to="http://www.taleo.com/ws/integration/toolkit/2005/07"
    xmlns:util="http://www.mavixconsulting.com/2013/XSL/transform"
    exclude-result-prefixes="to util">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

<xsl:template match="to:record">
<xsl:element name="file">
    <xsl:attribute name="path">
        <xsl:value-of select="./to:field[@name='FirstName']"/><xsl:value-of select="./to:field[@name='LastName']"/>_<xsl:value-of select="./to:field[@name='AttachedFiles,FileName']"/>
    </xsl:attribute>
    <xsl:element name="content">
        <xsl:value-of select="./to:field[@name='AttachedFiles,FileContent']"/>
    </xsl:element>
</xsl:element>

</xsl:template>
</xsl:stylesheet>

---------------------------------------------------------------------------------------------------------------------------------------

Here is the content of the XML file: cleartext.blogspot.com

---------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<files>
[RECORD_OUTPUT]
</files>

---------------------------------------------------------------------------------------------------------------------------------------

7. Add the TCCCustom Step in the config file. For this, add one more "Custom Step" in the "Post-Processing" tab, and select Custom step and "Default custom step" as options.

image

8. For Java Class, enter "com.taleo.integration.client.customstep.xml.ExtractAttachedFilePostStep". Add the remaining values are below:

image

9. Save the config file and run it. The first time you run the export, you might want to change the filter to select a single record and text the export. When the run completes, the file attached will be exported into the output folder.

cleartext.blogspot.com

And that is all. There are other classes in the JAR which can be used to change filters , convert to PDF, and further manipulate the xml file.

 

This article first appeared on cleartext.blogspot.com

25 comments:

  1. Hello Static Variable,
    Thanks for posting this article. I'm the next person struggling with Exporting Attachments.
    I followed the instructions but i'm getting "An internal error occurred during running export script."
    There is no error code or log message. Any advise on troubleshooting it? Thanks much.

    ReplyDelete
    Replies
    1. Hey..have you got the resolution for the error you are receiving. Kindly share it as I'm also facing the same issue.

      Thanks in advance.

      Umesh

      Delete
  2. Hi,
    I am unable to download the TCCCustomStep library from Dropbox can you please tell me from where i can get it.
    I want to exports attachments from taleo to System through TCC is there any other way to export attachments from taleo through TCC. Can you provide detail steps how to exports attachments through TCC

    ReplyDelete
    Replies
    1. Were you able to get a copy of the Custom Step library?

      Delete
  3. I am also looking for the Custom Step Library.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Where can I download TCCCustomSteps library, I really need it to extract CV from TCC. As of now all process of TCC extraction is working well except last step on customsteps, it always said that cannot find JAR file. Please help me to define this problem

    ReplyDelete
  6. Go to ohug.or and seach in the Enterprise Integrations (TCC) SIG

    ReplyDelete
  7. Hi Guys,
    I have done all the setup as explained above but while running I'm receiving the error "An internal error occurred during: Running cfg.xml". The actual error is "java.lang.NoClassDefFoundError: org/dom4j/Element Handler". Can anyone help me how can I resolve this error.

    Any help would be much appreciated :)

    Thanks
    Umesh

    ReplyDelete
  8. First, thank you much for this article.

    I'm getting the following error during some, but not all, exports. In other words, the code I've got (thanks to the help here) works some times not all the time. Here's the error message:
    Code: basetransformer.input.invalid
    Description: The XML input format is invalid.
    Reason: The root element containing the records has not been found
    Step: Transform with XSL

    The google isn't coming up with any answer. I've set filters to all fields so that no nulls are being picked up, but it's not working, either. Any thoughts?

    Thank you!

    ReplyDelete
    Replies
    1. Change the Request - SQ-XML, Response as XML and make Export mode as T-XML and Output Format as XML in Transform with XML in Post Processing steps.

      This really help me in exporting attachments.

      Regards,
      Dilip

      Delete
  9. does this work for mass attachment export, or only one by one ?

    ReplyDelete
  10. where is the output folder? whats '[CFGFOLDER]\Output'

    ReplyDelete
  11. where is the output folder? whats '[CFGFOLDER]\Output'

    ReplyDelete
  12. I had the same jar Please share your EmailId

    ReplyDelete
    Replies
    1. Hi, Pls send me at taleomahendra@gmail.com

      Delete
  13. Can someone point me to where I can find a copy of the TCCCustomsteps and the the updated commons-lang-2.6.jar? I do not have a login for the OHUG website.

    ReplyDelete
    Replies
    1. Hi David, where did you get the TCCCustomsteps file? If possible could you send it to me. Thanks, Art
      ida_s@gmx.com

      Delete
  14. Could someone please email or let me know where a working link is for the TCCCustomSteps.zip file. I have searched and all the links I found are broken. Thanks in advance!
    ida_s@gmx.com

    ReplyDelete
  15. Could anyone send me the a working link for the TCCCustomSteps.zip file. I have searched and all the links I found are broken, Or let me know where i can find. Thanks in advance!
    shruti.k@altencalsoftlabs.com

    ReplyDelete
  16. output file is xml still.how to convert it to pdf or word format?

    ReplyDelete
  17. I would like to download Custom files, i clicked on (You can download a copy from here) but no attachments are available.

    ReplyDelete