Appendix : Legacy Presto components : Mashables and Mashups : 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 ascustom XPath classes, to an external configuration folder simplifies futuredeployments or MashZone NextGen Serverclusters.
*web-apps-home/mashzone/WEB-INF/classes.This is the default location, but is not recommended as it complicates MashZone NextGen Serverdeployments.
*web-apps-home/mashzone/WEB-INF/lib.This is the default location, but is not recommended as it complicates MashZone NextGen Serverdeployments.
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 inputparameters for the Java method and an <output> declaration to receive themethod return, if any.
*Add a <script> statement to invoke the Java code. See Using Java Classes in a <script> Statementfor instructions and examples.
Copyright © 2013-2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback