viernes, 1 de abril de 2022

[JD Edwards - BSSV] Import external JAVA library (ENG)

Hi jde friends,

Sometimes, we find ourselves with need to extend JD Edwards functionalities and we find many functionalities in JAVA packages or libraries, JAVA is one of the most languages and platform used in technologies. For example, recently I worked in a project to implement Bidimensional code QR. So, what is the JDE solution?


Well, we use a JAVA library to facilitate the coding. In this case IdAutomation (that is license paid, but there are other as Google (Zxing) and many other open source, depending on each case and use). So, this provider provides a java library in witch it has a class and a method for facility implementation, that we pass the string to be encoded and it return as array string encoded. Later, to this array we put a font in BIPublisher and we already have our encoded QR code. Easy right?

Then, we generated our BSSV object (and we cannot forget our BSFN in C to communicate our report or application with BSSV component), with our class and main method. But, how import IdAutomation QR library to our JD Developer project?

1. On our project, we press the rigth button and in the context menu click on Project Properties:

2. Press in Librares and Classpath menu and next press button Add JAR Directory

3. Select the JAVA library (I recommend leaving in the JDE Path JDE system\Classes (later I explain the reason)

4. Press on Open button in the dialog, and it is added to the project:

5. Press OK and save the project. We can use library classes and method importing to our java class.

               boolean bestMask = true;           // Best pattern mask
               
               String resultQREncode = qre.FontEncode(dataToEncode, applyTilde, encodingMode, errorCorrectionLevel, version, bestMask);
               internalVO.setSzQREncodedData(resultQREncode);
               
               printMsg(context, "Encoded => ");
               printMsg(context, resultQREncode);

And we have everything ready in our project!!!

To deploy, we have to configure system to use a external library for when compiling and generating deploy package it imports the external library in jar jde deploy package. This configuration is done in deploy server (although I also configure it in my fat client).

1. Copy the library to system\Classes folder:

2. Modify the file sbffoundation.ini inside the same folder, in the section [Foundation] y and add a line "LIB" + "next sequence" + "=" + "library name"

And with this we already our BSSV project with an external library ready to deploy!

Pd: I have also used an external library for Datamatrix code, integrate with Webcenter Content through RIDC standard java package, and recently to create a proxy client webservice through an external library with java wsimport command to integrate with Salesforce that you can see here.

Good code JDE Friends!