1 Reply Latest reply on May 27, 2014 8:46 AM by N.J

    Java api namespaces from xquery




      We are using the O2A cartridges and  I saw for example that in some xquerys a java api namespace like this


      declare namespace dateUtil = "java:oracle.communications.ordermanagement.util.date.DateUtil";


      Searching in the cartridges i found that in the OracleComms_OSM_O2A_CommonUtility in resources there is a osm-o2a-utility.jar.  I opened the jar i found a DateUtil Class. I decompiled the file and saw the funcionts used from xquery..


      I created my custom class and I added it to this jar.  Then i try to invoke the custom function from xquery but it did not work.


      My question is:  is there a way to include java classes in this jar? What is the correct procedure?


      Thanks for your help



        • 1. Re: Java api namespaces from xquery

          Hi Juan,


             We actually don't need to add or customize any class in osm-o2a-utility.jar. Instead, we can have our class file in any custom cartridge except solution cartridges(like TypicalSolution/SimpleSolution) because having the class file in solution cartridge won't get compiled/built.


          Simple way could be, having the class file in any of the custom cartridge(as you know it should under the src folder, something like DSLCartridge/src/testPackage/abc.class) and the xquery being in same/different cartridge's resources folder.


          From the XQuery inorder to invoke the class file, we have to declare the reference.

          declare namespace callAbc = "java:testPackage.abc";



          Naveen Jabade