Skip to content

Eclipse

Johannes Heucher edited this page Jun 13, 2022 · 2 revisions

Eclipse is an Integrated development environment (IDE) often used to develop Java applications.

It is mentioned here as a representation of an arbitrary IDE used for the development of programmable Xyna Factory plugins such as Coded Services, Trigger or Filter.

There are two different ways Xyna Factory interacts with Eclipse development:

  1. Updating and Deployment manually and using Ant
  2. Updating and Deployment using SVN and SVN Access
This article explains the use cases experienced by an Eclipse developer.

Table of Contents

General

Plugin development is typically started from a Java Template provided by the Xyna Factory containing empty classes and methods to be implemented. Used interfaces and classes are contained in JAR files. Deployment of the plugin implies building a JAR file containing the implementation classes, transferring it to the server and notifying the server of it. Some changes occurring in the Xyna Factory make it necessary to update the used JAR files in Eclipse: Coded Service signature changes, changes of used XMOM Objects, etc.

JAR Files

The following JAR files might be used by plugin templates:

File Structure

The following structure is recommended:

 /projectroot
 /projectroot/server.properties (used by Ant)
 /projectroot/common/lib
 /projectroot/servicegroups/<servicegroupname>
 /projectroot/servicegroups/<servicegroupname>/src
 /projectroot/servicegroups/<servicegroupname>/lib
 /projectroot/servicegroups/<servicegroupname>/build.xml (if using Ant)
 /projectroot/servicegroups/<servicegroupname>/xmldefinition/<servicegroupname>.xml
 /projectroot/filter/<filtername>
 ... (see above)
 /projectroot/trigger/<triggername>
 ... (see above)

Ant

Always use build.xml, not buildService.xml to execute Ant targets.

Download of Plugin Templates

Templates can be obtained through the CLI and partially (only Coded Services and Instance Services) in the Xyna Process Modeller.

If using SVN Access they can just be checked out from SVN. CLI commands are: ./xynafactory.sh buildserviceproject/buildfilterproject/buildtriggerproject

Import Java Project in Eclipse

The downloaded ZIP file contains two Eclipse projects:

  1. CommonLibs (common/) is the project shared between all Java projects for commonly used libraries. It must only be imported once.
  2. Project (mdmimpl/<ServiceName>/) is the Java project to implement.
Unzip the ZIP file and then in Eclipse choose File --> Import --> Existing Projects into Workspace, select the directory containing the .project file and finish import.

Deployment with Ant

Calling ant deploy builds and then deploys the JAR file on the server.

Deployment through SVN

Committing changes to SVN notifies the Xyna Factory to check out the changes, triggering the server-side build and deployment process.

Deployment manually (CLI)

Copy the new JAR files to the server in the saved folder of the revision folder corresponding to the workspace you are developing in, e.g. $XYNA_HOME/revisions/rev_<id>/saved/services/<servicegroupname> or $XYNA_HOME/revisions/rev_<id>/saved/filter/<filtername>. CLI commands are:

  • ./xynafactory.sh deploydatatype
  • ./xynafactory.sh addtrigger
  • ./xynafactory.sh addfilter
In case the specific revision is unknown, a way get the revision id is described in the Revision article.

Deployment manually (Xyna Process Modeller)

New libraries can be deployed by using the Xyna Process Modeller by opening a certain Service Group and clicking upload libraries.

JAR Updates with Ant

Calling ant updateMDMandXynaFactoryJar updates mdm.jar and xynafactory.jar. This is typically necessary when changes occured in used Data Types.

Calling ant updateServiceDefinition updates servicedefinition.jar. This is typically necessary when changes occured in the signatures of the Services contained in the Service Group or Data Type.

JAR Updates through SVN

Changes are committed by the server, which then only have to be checked out by the Eclipse user. Afterwards, the Eclipse project has to be refreshed.

JAR Updates manually (CLI)

Related CLI commands are:

  • ./xynafactory.sh buildmdmjar
  • ./xynafactory.sh buildservicedefinitionjar

Adding your own Libraries

The following options are available in order to use additional libraries:

  • Add the libraries to the global classpath ($XYNA_HOME/server/lib) and restart the server
  • Add the libraries to a Shared Library
  • Add the libraries to the plugin

Use of Shared Library

When the JAR files have been added to the Shared Library, change the used Shared Libraries here.

Use of Additional Local JAR Files

See Uploading Libraries.

See Also

Clone this wiki locally