Mashups in EMML : Advanced Mashup Techniques : Wrapping POJO Classes with Mashups
Wrapping POJO Classes with Mashups
 
Using Java Classes in a <script> Statement
You can use any Java class accessible to the Presto Server within the mashup <script> statement using JavaScript. Because of this feature, you can easily use POJO classes as Presto mashables by wrapping them in mashup scripts.
Note:  
Based on the JDK version used with the application server that hosts the Presto Server, Java language classes are also available within mashup <script> statements.
To wrap POJO classes in mashup scripts
1. Include the POJO classes in the Presto Server classpath by copying the compiled class file or JAR file to one of these folders:
*The external configuration folder, if any, for the Presto Server. See Setting Up an External Presto Configuration Folder for more information.
Important:  
Deploying additional resources, such as custom XPath classes, to an external configuration folder simplifies future deployments or Presto Server clusters.
*web-apps-home/presto/WEB-INF/classes. This is the default location, but is not recommended as it complicates Presto Server deployments.
*web-apps-home/presto/WEB-INF/lib. This is the default location, but is not recommended as it complicates Presto Server deployments.
2. Create a separate wrapper mashup script for each POJO method that you want to expose as a Presto mashable information source.
3. In the wrapper mashup script:
*Add <input> declarations, if needed, to accept input parameters for the Java method and an <output> declaration to receive the method return, if any.
*Add a <script> statement to invoke the Java code. See Using Java Classes in a <script> Statement for instructions and examples.
Copyright © 2006-2015 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback