By Tim Dexter-Oracle on Mar 15, 2017
We had a couple of requests for some help this past week with customers' custom font encoders. With 11g/12c BIP its not straightforward to embed your code with the BIP code. In fact; its really simple but it took me a while and some trial and error to get the encoder classes to the right spot and in the right format so that BIP could 'see' and use them.
In 11g/12c the BIP application is exploded out under the servers below the DOMAIN_HOME, in my 184.108.40.206.x install thats ./oracle/BI/user_projects/domains/bifoundation_domain/servers/AdminServer/tmp/_WL_user/bipublisher_11.1.1/6uc731
Under the last directory (which will be different for you) will be a lib directory. Thats where your encoder classes need to sit wrapped in a jar file. Its not the best place to have them as upgrades to the code line may not preserve them but its the only place I found where the classes get loaded that BIP can access the encoder. There are other more standard places under the WLS server but BIP can not access the class and the encoder is not reached.
Just to lay out some of the things I have found out during this investigation:
1. When you compile your class make sure the target java version is appropriate. For the 220.127.116.11.x codeline the version needs to be 1.6. For 12g, its 1.8. If you dont do this, you'll get errors when calling the class.
2. You need to wrap your class up in a jar file. If you use JDeveloper, you can create a deployment profile that will build the jar for you. Its then a case of copying it into the appropriate directory.
3. Make sure your RTF barcode register field command matches the 'package' line in your class. In my class I have:
So my template command is:
make sure they match.
4. In the encode command in the template. Make sure the encoding routine you want to use case matches the one in your encoding class.
In my class:
ENCODERS.put("pdf417", mUtility.getClass().getMethod("pdf417", arrayOfClass));
In my RTF template:
5. When you are testing the RTF template on the server. Forget the barcode font for now and use a clear text font. That way you can make sure the encoder is being called. Once you are happy. Just update the template with the barcode font you need.
6. When JDeveloper creates the jar file it will create the directory structure that matches your package path in the jar.
With all of the steps followed above. You are now ready to deploy the jar file into the server. Depending on how you have configured your server it is going to influence the location of the jar file. On my server, I have a simple install with just an Admin server. You may have multiple managed servers. The jar file will need to reside in all locations for the BIP server to find it.
On my 11g server, I copied the jar file to:
On my 12c server:
Once copied, you need to bounce the WLS server to get the class loaded. You will then be able to see the encoder at work in the output.
Make a post upgrade note for yourself and others to ensure, that after a patch application. You check that the encoder jar is still present in the above directories. It'll save some head scratching later :0)
Here are my files from testing the solution on 11g.7.x and 12c
Update: we have had a couple of customers get through this now and they have helpfully noted a couple of points that helped them out.
1. When moving from 10g to 11g or 12c. On compiling the custom class For example, from 10G to 11G, the location of XDOBarcodeEncoder changes from oracle.apps.xdo.template.rtf.util to oracle.xdo.template.rtf.util. so you will need to update your class to reflect the new import location.
2. A reference to "Oracle® Fusion Middleware Developer's Guide for Oracle Business Intelligence Publisher 11g Release 1 (11.1.1) E22259-04
Section 7.13, "Advanced Barcode Formatting" It provides an example of source code for a custom class.
and for 12c - Fusion Middleware Report Designer's Guide for Oracle Business Intelligence Publisher