Skip to content

EclipsePlugin

stockiNail edited this page Oct 12, 2015 · 3 revisions

JEM Eclipse Plugin

Many developers use Eclipse as IDE to develop their applications. Some of those applications are batch applications and can be better developed by capability to test them directly from IDE. For this reason, a Eclipse plugin has been developed to access to JEM, with following main features:

  • access to job queues
  • access to job produced output
  • submit jobs
  • access to global file system to see the data

JEM has got 2 JCL engines out-of-the-box: Apache ANT and Spring Batch.

Using the great capabilities of Eclipse to develop XML files, you can improve the development phase and with JEM plugin you can test easily your business logic. In Eclipse you can easily developed a JCL and submit for testing and retrieve the output, checking the result.

Installation

A plugin site has been prepared to easily install the plugin.

To install the plugin you can:

  1. Drag and drop this into your eclipse
  2. Search JEM the BEE inside Eclipse Marketplace
  3. Go to "Help" and "Install new software..." * press "Add" button. * insert the plugin site (http://www.pepstock.org/jem/eclipse/plugin) and install it!!

Currently the plugin has been tested on Eclipse Juno (4.2) and Kepler (4.3).

How to use

A single instance of JEM plugin is able to connect to different JEM environments, giving the capabilities to save the coordinates on own preferences. You can access to one environment at a time.

Manage JEM Environments

Select Windows and then Preferences from Eclipse menu and the search for JEM, the BEE

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Preferences50.png

You can see all defined JEM environments, with all necessary attributes to connect to.

From this panel, you can

  • Add new JEM environment
  • Edit a defined JEM environment, only if is not currently in use. If yes, a message error will be showed
  • Remove a defined JEM environment, only if is not currently in use. If yes, a message error will be showed

Adding new environments

Now click Add to add a new JEM environment

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Coordinate.png

Some information are requested to configure the connection to JEM environmen:

  • Host: is a mandatory attribute which represents the HTTP url to connect JEM enviroment.
  • REST context: is mandatory attribute which represents the REST web context, used to publish REST engine. Default is rest.
  • Name: is optional attribute which is the name of JEM environment. If set, it will check with the real name of JEM environment. If it doesn't match, a message error will be showed. If the connection is not available (web part of JEM environment is not reachable) the inserted name won't be checked and maintained as JEM environment name.
  • Userid: is optional attribute which represents the userid to connect to JEM.
  • Password: is optional attribute which represents the password of userid to connect to JEM.
  • Default: is optional attribute which, is checked, defines the coordinate as default. This will do that when you ask to open JEM view, automatically it will try to connect to default JEM enviroment.

Submit a job

To submit a job into JEM enviroment just right click on the XML file that contains the job and select Submit JCL from JEM contextual menu

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Submit.png

If no JEM envrioment has been selected before submitting, the plugin will use the JEM environment defined as default, asking credentials to connect if not configured.

You can submit a job dragging your JCL from your project and dropping it on Jobs view.

Working with JEM

To work with JEM, plugin provides 3 views. These views allow you:

  • to manage your jobs on different queues, by Jobs view. You can see input, running, output and routing queues and their contents
  • to inspect a selected job, seeing its general job info, JCL and produced ouptut, by Inspector view
  • to explorer the global file system and to access to the files, if authorized, by Explorer view

To open one of the view select Windows Show view and then Other ... from Eclipse menu and the search for JEM, the BEE

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Views.png

Jobs view

Into Jobs view you can manage and search your jobs into JEM different queues: Input, Running, Output and Rotuing

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Queues.png

When you decide to open Jobs view, if a JEM environment is defined as Default, plugin tries to conntect to JEM automatically. If userid and/or password are missing, a form will popup asking for account to connect to JEM:

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Login.png

When connected, you can search your jobs, using the filters (the same used for web interface):

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Jobs-Search.png

In the example, the search use name and returnCode filters on Output queue.

The total amount of jobs found are reported on bottom.

The view shows the user and group (related to userid used to connect to JEM), as following

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Jobs-Header.png

On top right corner, you can have the list of defined JEM which you can connect to. You can also logoff from current JEM, clicking on Logoff link.

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Environment.png

Inspecting a job

Double clicking on selected job into Jobs view to inspect it, opening the Inspector view.

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Inspector.png

From this view, you are able to see:

  • General information about job instance and its JCL.
  • JCL of job which, double-clicking on it, will be open in editor part (with highlighting) to modify and submitted again.
  • Output files produced by job, both standand output and error stream and custom ouptut which, double-clicking on them, will be open in editor part.

Both JCL and every output files can be dragged and dropped on editor part.

Here is the example, editing a JCL:

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-JCL.png

And here editing a output file:

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Output.png

Exploring global file system

The Explorer views allows you to navigate inside of global file systems, seeing files on different files categories of GFS.

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Explorer.png

GFS is composed by specific file system for different type of files.

When you decide to open Explorer view, if a JEM environment is defined as Default, plugin tries to connect to JEM automatically. If userid and/or password are missing, a form will pop-up asking for account to connect to JEM:

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Login.png

The total amount of files found are reported on bottom.

The view shows the user and group (related to userid used to connect to JEM), as following

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Jobs-Header.png

On top right corner, you can have the list of defined JEM which you can connect to. You can also logoff from current JEM, clicking on Logoff link.

http://www.pepstock.org/wiki/eclipse-plugin/JEM-Plugin-Environment.png

Double clicking on selected file into Explorer view to inspect it, opening it in a editor. You can drag and drop it on your editor part to see files content.

Excluding the data path, you can upload files to GFS dragging and dropping the files on explorer. This is very helpful to deploy jars and files to reused at runtime. To be able to do it, you must be authorized, having the following permissions:

gfs:library, gfs:sources, gfs:classpath, gfs:binary

Clicking with right button of mouse on an existing file of GFS, you can remove it. This is allowed ONLY for files, not for folders.

Deploy objects on JEM by ANT task

With the Eclipse user interface, it is possible to navigate on the JEM global file system and upload and download the files stored in GFS. This approach is valid but doesn't give us the possibility to deploy automatically artifacts or sources or whatever on JEM, without a human activity. For this reason a special ANT task to deploy object on GFS of JEM. The task is implemented by org.pepstock.jem.ant.tasks.utilities.Upload which uses REST interface to upload the files. Here is an example:

<project name="DEPLOY" default="main" basedir=".">
	<description>
        test
    </description>
	
	<property name="userid" value="root"/>

	<taskdef name="upload" classname="org.pepstock.jem.ant.tasks.utilities.Upload">
		<classpath>
			<pathelement location="../../../classes" />
			<fileset dir="../../../lib">
				<filename name="**/*.jar"/>
			</fileset>
		</classpath>
	</taskdef>

	<target name="main">
		<upload  url="https://localhost:8888/rest" userid="${userid}" password="sss">
			<destination type="source" path="/stock/">
				<fileset dir="../../../lib">
					<filename name="**/jem*.jar"/>
				</fileset>
			</destination>	
		</upload>
	</target>

</project>

These are the attributes of task:

Attribute Description Required
url necessary to set the REST URL, published inside of web part of JEM. The URL must contain the web URL and the web context where REST application is published on. yes
userid necessary to set the user to use in the REST interface. yes
password necessary to set the password of he user, put in the userid attribute. yes

Inside of the ANT task, there is another element you must define, destination. These are the attributes of destination element:

Attribute Description Required
type necessary to set which part of GFS must used and on which file system to put the files. The attribute could have a set of specific values: "Data", "Library", "Source", "Class", "Binary". yes
path necessary to set the relative path where the files will be uploaded. This path will be added to the mount point path of the file system of the type attribute yes

The destination element supports any number of nested <fileset> elements to specify the files to be retrieved and to be uploaded.

Clone this wiki locally