Create a Java Plug-in
"Plug-ins" give Logi developers the ability to programmatically extend the functionality of their Logi applications. This topic discusses the development of Logi plug-ins using Java.
IMPORTANT: If you wish to upgrade to JDK 8 release build 261 (1.8.0_261), or any later build of JDK 8, you will need to replace the mscorlib.jar file in the application folder with the new one and restart your server. The mscorlib.jar file can be found on our Product Download page. Please contact Support for additional assistance.
If you haven't done so already, you should read Logi Plug-ins for important supporting information before proceeding.
If you're developing a .NET plug-in, see Create a .NET Plug-in instead.
Plug-in Class Methods and Properties
Logi plug-ins for Java are written in Eclipse or a similar development tool, using the either the LogiPluginObjects10 or LogiPluginObjects (pre-v10.0.337) class. Except as noted, this document refers to LogiPluginObjects10. The class files are:
yourLogiApp/WEB-INF/classes/com/logixml/plugins/LogiPluginObjects10.java - or -
yourLogiApp/WEB-INF/classes/LogiPluginObjects.java
You instantiate this class in your code and it provides access to the Logi application and its data. The class object is defined in your code as:
public class LogiPluginObjects10 (or LogiPluginObjects)
extends java.lang.Object
Once instantiated, the object provides the following properties and methods for use with your custom code. Those with an asterisk are not included in the LogiPluginObjects object:
Here are the object's methods and parameters:
addDebugMessage |
Inserts an entry into the Debugging Trace page. (v10.0.337+) void addDebugMessage(java.lang.String currentEvent) Parameters: The time value for the entry is automatically provided. Note that if an error occurs within the plug-in, a fresh Trace page is generated, so any earlier messages placed with addDebugMessage are lost. |
getCurrentData / setCurrentData |
Gets/sets an XML Document object containing the data in all of the datalayers. public org.w3c.dom.Document getCurrentData() |
getCurrentDataFile / setCurrentDataFile |
Gets/sets a string object containing of the fully-qualified path and filename for the cache file containing the XML data retrieved by the datalayer. public java.lang.String getCurrentDataFile() |
getCurrentDefinition / setCurrentDefinition |
Gets/sets a string object containing the XML source code of the current report definition. public java.lang.String getCurrentDefinition() |
getCurrentElement / setCurrentElement |
Gets/sets a string object containing the XML source code of the current report definition. public org.w3c.dom.Element getCurrentElement() |
getCurrentHttpContext / setCurrentHttpContext |
Gets/sets an XmlDocument object containing all HTTP-specific information, including Application, Session, Server, Request, and Response objects public javax.servlet.ServletContext getCurrentHttpContext() |
getPluginParameters / setPluginParameters |
Gets/sets a Hashtable object containing the parameters, if any, passed to the plug-in. public java.util.Hashtable getPluginParameters() |
replaceTokens |
Returns a string object containing the sTokens parameter with some or all of its tokens replaced with their current values, and with other optional effects applied. (v10.0.337+) replaceTokens(java.lang.String sTokens) Parameters: Throws: |
setRequest |
Sets an HttpServletRequest object and passes it as an argument to the servlet's service methods. public void setRequest(javax.servlet.http.HttpServletRequest req) |
getRequestParameterNames |
Gets an array of the HTTP Request names sent by the client to a Logi application. public java.util.Vector getRequestParameterNames() |
getRequestParameterValues |
Gets an array of the HTTP Request values sent by the client to a Logi application. public java.util.Vector getRequestParameterValues() |
getResponse / setResponse |
Gets/sets an HttpServletResponse object containing the rendered HTML response page; available when the FinishHtml event completes. public javax.servlet.http.HttpServletResponse getResponse() |
getResponseHtml / setResponseHtml |
Gets/sets a String object containing the rendered HTML response page, available when the FinishHtml event completes. public java.lang.String getResponseHtml() |
getReturnedDataFile / setReturnedDataFile |
Gets/sets a String object containing the fully-qualified path and filename for the cache file which contains the manipulated XML data after processing. public java.lang.String getReturnedDataFile() |
getSession / setSession |
Gets/sets an HttpSession object, which is used to access Session values for the current Logi application session. public javax.servlet.http.HttpSession getSession() Note that most session variables are replicated back and forth between the Logi Engine and the web server with every plug-in call. |
getSettingsDefinition |
Gets an XML Document object representation of the _Settings definition. (v10.0.337) public org.w3c.dom.Document getSettingsDefinition() Throws: |
Keywords: plugin, plugins