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 MashZone NextGen Server within the mashup <script> statement using JavaScript. Because of this feature, you can easily use POJO classes as MashZone NextGen mashables by wrapping them in mashup scripts.
Note:  
Based on the JDK version used with the application server that hosts the MashZone NextGen 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 MashZone NextGen Server classpath by copying the compiled class file or JAR file to one of these folders:
*The external configuration folder, if any, for the MashZone NextGen Server.
Important:  
Deploying additional resources, such as custom XPath classes, to an external configuration folder simplifies future deployments or MashZone NextGen Server clusters.
*web-apps-home/presto/WEB-INF/classes. This is the default location, but is not recommended as it complicates MashZone NextGen Server deployments.
*web-apps-home/presto/WEB-INF/lib. This is the default location, but is not recommended as it complicates MashZone NextGen Server deployments.
2. Create a separate wrapper mashup script for each POJO method that you want to expose as a MashZone NextGen 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 © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback