(English) Liferay 7: Scheduler Manager Gogo Shell Commands

Ci spiace, ma questo articolo è disponibile soltanto in Inglese Americano. Per ragioni di convenienza del visitatore, il contenuto è mostrato sotto nella lingua alternativa. Puoi cliccare sul link per cambiare la lingua attiva.

For the development of a project based on Liferay 7, I had to create a module for job management. Scheduler Manager Gogo Shell Commands implements a set of Gogo Shell commands that handle Liferay jobs. The tasks you can perform are:

  1. list: List of the all Jobs filtered by state (default ALL)
  2. info: Print detail info of the job
  3. pause: Pause one or more Jobs by Job Name, Group Name and Storage Type
  4. resume: Resume one or more Jobs by Job Name, Group Name and Storage Type

If you are impatient you can immediately download the bundle from the repository GitHub and install it on your Liferay instance.

Scheduler Manager #GogoShell Commands @Liferay plugin for handle #liferay jobsClick To Tweet

The version 1.3.0 of this project was tested on Liferay 7.2.0 Community Edition GA1

1. Getting Started

To start testing the plugin you need:

  1. clone this repository
  2. build project
  3. deploy OSGi module (it.dontesta.labs.liferay.gogo.scheduler.manager-$version.jar)

The last gradle command, create a OSGi bundle that you must deploy on your Liferay instance. You can deploy with this command (replace auto deploy directory with your).

You could deploy also with the deploy gradle task, but must setting the auto.deploy.dir in gradle.properties file.

2. After deploy bundle

After the deploy of the bundle you can check if the bundle is correctly installed. Connect to Gogo Shell via telnet and execute lb command.

Well done! The bundle is in state ACTIVE.

3. How to use commands

Via Gogo Shell we check deployed commands (that have scheduler as scope) via completion.

The list of commands obtained are those described at the beginning. You can see for each command the usage, by this command (help scope:commandName). Follow the help of the four available commands.

The storage types are defined in StorageType

The states of the trigger defined in TriggerState Enumeration

3.1 Scheduler List

List of the jobs filtered by state

Figure 1 – List of the jobs filtered by state

List of the jobs filtered by state

Figure 2 – List of the jobs filtered by state

3.2 Scheduler Pause and Resume

3.3 Scheduler Info

This command (compared to the list of jobs) shows additional information:

  1. Cron Expression
  2. Destination Name
  3. Job Exceptions
Detail of the jobs

Figure 3 – Detail of the jobs

4. Resources

  1. Liferay 7 CE/Liferay DXP Scheduled Task post by David H Nebinger (on Liferay Blog)
  2. Scheduler Example on my GitHub account
  3. How to implement a custom Gogo shell command for Liferay 7 post by Marco Napolitano
3 Condivisioni

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC (http://it.wikipedia.org/wiki/Olivetti_M24) bought by my father for his work. Day after day, quickly taking control until … Now doing business consulting for projects in the enterprise application development using web-oriented technologies such as J2EE, Web Services, ESB, TIBCO, PHP.

Potrebbero interessarti anche...