Implementing middleware specified details on Job Details view

Overview

Jobs view show only basic information about job like: id, status, submission date. All other information about the job can be found on view Job Details. When you are implementing job for new middleware you may notice that view "Job Details" for that job display two sections: "General" and "Applications". These sections appears for all instances of IGridJob and IGridJobStatus so you have it for your new middleware without any line of code. But if your middleware support more information about the job, you have to contribute to "Job Details" view, what is described below.

Structure of Job Details view

Job Details view

Details on the view are grouped in sections. Currently g-Eclipse offer two implementations of single detail:

Implemention of IJobDetailsFactory

Details specified for given middleware should be created in the plugin containing this middleware. So we have to implement factory and register it by contributing to the extension point:
  1. Create new class implementing interface eu.geclipse.ui.views.jobdetails.IJobDetailsFactory
  2. Contribute to extension point eu.geclipse.ui.jobDetailsFactory with the following values:

Create IJobDetail objects

Main method of IJobDetailsFactory is:
List getDetails( final IGridJob gridJob,
	        final JobDetailSectionsManager sectionManager );
For passed gridJob it should return list of IJobDetail objects. Each object provide information about one detail.

For simple detail just return instance of eu.geclipse.ui.views.jobdetails.JobTextDetail.
This is an abstract class, so for every instance you have to implement method returning string representing detail value:

String getValue( final IGridJob gridJob )

For complex detail return instance of eu.geclipse.ui.views.jobdetails.JobComplexDetail. Pass into contructor id of editor, which will be opened when user click on button "Glasses". For standard text editor use id org.eclipse.ui.DefaultTextEditor.

If you would like to implement more complicated detail, then create new class extending eu.geclipse.ui.views.jobdetails.JobDetail. But in this case you have to create widgets representing the details. For examples see class eu.geclipse.glite.ui.jobdetails.LoggingEventsDetail.

IJobDetailsSection objects passed to the details

During creation instance of IJobDetail you have to pass to the constructor section, onto which detail will be placed (object implementing IJobDetailsSection).

If you want to add your detail to standard section "General" or "Application", just get object sectionManager passed in IJobDetailsFactory#getDetails and call it method: getSectionGeneral or getSectionApplication.

If you would like to place your detail on new section (specific for your middleware), just call on sectionManager:

Integer createSection( final String name, final int order )
and then:
IJobDetailsSection getSection( final Integer sectionId )

Section may be created as lazy. Lazy sections are collapsed after creation (doesn't show any detail - methods JobTextDetail#getValue are not called) and during expanding they force refreshing the view. Lazy sections are useful, when values on some details have to be computed, what causes that view is refreshed much slower. Thanks of lazy section view works smoothly when section is collapsed, but user still has possibility so see all details.

Forcing downloading job status in full version

Method IGridJobService#getJobStatus allow to download job status with different amount of data: in short version and full version. Full version is needed to show Job Details view. Therefore view is responsible for forcing updating job status in full version. In order to avoid updating job status before every refreshing, view calls method IJobDetailsFactory#shouldUpdateJobStatus. So details factory should decide if selected job has valid long status. If not, then view schedule status update for that job.