Showing posts with label Taleo. Show all posts
Showing posts with label Taleo. Show all posts

Saturday, January 31, 2026

Download Resumes from Taleo

Taleo stores resume files or resume attachments in base64gz format at rest. The WriteBase64StringToBinary peoplecode file function will do only half of the job as it will not take care of uncompressing the gz format.

One option could be to use the peoplecode WriteBase64StringToBinary to get the decoded but compressed string and then use another 3rd party command line or java command line to uncompress the file.

Following method shows performing the decryption using delivered java classes.

Local JavaObject &fileOutgz, &gzFile, &fileIn, &fileOut;
Local JavaObject &gzipIn, &filebuffer, &decoder, &bytes_decoded;
Local string &gzFilePath;
Local number &byteCount;

   try

        /* some location to write the decoded but compressed file */
      &gzFilePath = "e:\\temp\\resume.gz";

      /* Get the Java Base64 decoder instance */
      &decoder = GetJavaClass("java.util.Base64").getDecoder();

      /* Decode the string into a byte array */
     /* &encoded_string is the value received from Taleo */
      &bytes_decoded = &decoder.decode(&encoded_string);
      &fileOutgz = CreateJavaObject("java.io.FileOutputStream", &gzFilePath);
      &fileOutgz.write(&bytes_decoded);
      &fileOutgz.flush();
      &fileOutgz.close();

      /* Create a FileInputStream for the compressed .gz file */
      &resumeFilePath = "e:\\temp\\resume.pdf";
      &fileIn = CreateJavaObject("java.io.FileInputStream", &gzFilePath);
      &fileOut = CreateJavaObject("java.io.FileOutputStream", &resumeFilePath);

      /* Chain it to a GZIPInputStream to decompress as it reads */
      &gzipIn = CreateJavaObject("java.util.zip.GZIPInputStream", &fileIn);

      /* Use a byte array to read chunks of decompressed data */
      &filebuffer = CreateJavaArray("byte[]", 1024);

      /* Read decompressed bytes until the end of the stream */
      &byteCount = &gzipIn.read(&filebuffer);

      While &byteCount > 0
         /* Process the uncompressed bytes, write to file */
         &fileOut.write(&filebuffer, 0, &byteCount);
         &byteCount = &gzipIn.read(&filebuffer);
      End-While; 

      /* Close the input streams to release resources */
      &gzipIn.close();
      &fileOut.close();
      &fileIn.close();

      &gzFile = CreateJavaObject("java.io.File", &gzFilePath);

      /* delete the temporary gz file */
      If &gzFile.exists() Then
         &gzFile.delete();
      End-If;

   catch Exception &ex      
        /* handle error conditions here */
          &bError = True;
     
   end-try;


Monday, January 6, 2025

Taleo Web API - managing user groups in a user profile

I have been using Taleo (or Oracle's) SOAP based web API to transmit data to Taleo from PeopleSoft. As part of this service I am creating/updating user profiles in Taleo based on actions taken in PeopleSoft. Recently received a request to manage/update the user groups associated with a user profile based on action done in PeopleSoft.

I am running PeopleTools 8.61.x, HCM 9.2 but this should be possible as long as you can make a SOAP call out from PeopleSoft. 

User Groups are part of the UserAccount construct as shown below. Following is a simple construct to pull up or search for an user account and then assign a user group to the user account.

<?xml version="1.0" encoding="UTF-8"?> <UserAccount> <Loginname searchType="search" searchTarget="../../.." searchValue="user@emaildomain.com" /> <Groups> <Group> <Name searchTarget="." searchType="search" searchValue="Group-Code-01" /> </Group> </Groups> </UserAccount>
To delete all the User Groups assigned to an user the request XML will be like below.

<?xml version="1.0" encoding="UTF-8"?> <UserAccount> <Loginname searchType="search" searchTarget="../../.." searchValue="user@emaildomain.com" /> <Groups action="reset" /> 
</UserAccount>
  
To delete only a specific user group from the list of assigned user groups on an user profile the request will be like below.

<?xml version="1.0" encoding="UTF-8"?> <UserAccount> <Loginname searchType="search" searchTarget="../../.." searchValue="user@emaildomain.com" /> <Groups> <Group action="remove"> <Name searchType="search" searchTarget="." searchValue="Group-Code-01" /> </Group> </Groups> </UserAccount>

One can combine the above actions in a single request like removing all or one user group and assigning a new user group.