Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

com.adobe.livecycle.rca.common.utils.StringUtils

Avatar

Level 6

Hi,

I want to convert Document object to byte array. For that I want to use StringUtils. I've installed LiveCycle workbence ES2 but I couldn't find it anywhere. Can you please let me know how can I get it?

8 Replies

Avatar

Level 3

Hi Sam,

You might not get all the services in workbench corresponding to every API.

What you can do is that you can use 'execute script' service in workbench. Write a java code in this script and call the com.adobe.livecycle.rca.common.utils.StringUtils.documentToBytes(com.adobe.idp.Document document) API.

Something like byte[] ba = StringUtils.documentToBytes(patExecContext.getProcessDataDocumentValue("/process_data/@doc"));

where doc is the document variable in the process.

For using the execute script service, you can refer below link:

http://help.adobe.com/en_US/LiveCycle/9.5/WorkbenchHelp/WS92d06802c76abadb-1cc35bda128261a20dd-7ef3....

Regards,

Varun


Avatar

Level 6

Thanks Varun for your input.

The main problem is I do not have jar file. What is the name of jar file and  where can I get the jar file which contains StringUtils class?

Avatar

Employee

Sam

Are you on ADEP?

This class should be available in adobe-rca-client.jar

Avatar

Level 6

Hi Santosh,

I'm new to LiveSycle. I am asked to create a service to convert a xdp to byte array. For that I wanted to use this jar file. But unfortunately I did not see that jar file in my installation directory where LiveCyle workbench is installed. Will it be possible for you to send me email at sumantapakira@gmail.com

Thanks for your help!

Avatar

Employee

sumant

which version of LiveCycle are you using?

Log on to http://hostname:port/adminui as administrator , Click About and let me know the version of LiveCycle you are using.

This jar should be available along with the installation , based on your version of LiveCycle I can let you know where to find the jar

--Santosh

Avatar

Employee

XDP to bytearray can be done without that class too. Please see if elow is what you need.

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

string xdpPath = "C:\\Adobe\\Loan.xdp";

                FileStream fs = new FileStream(xdpPath, FileMode.Open);

                //Get the length of the file stream

                int len = (int)fs.Length;

                byte[] xdpByteArray = new byte[len];

                //Populate the byte array with the contents of the FileStream object

                fs.Read(xdpByteArray, 0, len);

Avatar

Level 6

Hi Santosh,

Thanks for your reply. I'm using LC 9.5. Kindly let me know the path of the jar file.

Avatar

Level 6

Hi Siddhartha,

I'm not stroring xdp in file system. In my service, I'm getting com.adobe.idp.Document object as a paramenter and this object I need to convert into byte array.

Thanks for your help.