Liferay 7: Scheduler Manager Gogo Shell Commands

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 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
Liferay Portal Security AuditCos'è e come funzione il framework di Security Audit

Vi siete mai chiesti cos'è e come funziona il sistema di Security Audit di Liferay? Ho cercato di rispondere alla domanda non soffermandomi solo al "cosè e come funziona", sono andato ben oltre. Non vi resta che leggere questo EBook per scoprire.

Ottieni il tuo EBook

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC ( 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.

You may also like...

Liferay SSL/TLS SecurityCome configurare il bundle Liferay per abilitare il protocollo SSL/TLS

Sei curioso di scoprire come configurare il bundle Liferay per funzionare in modalità sicura tramite protocollo SSL/TLS? In questo eBook ( #LFRDEPGUIDE ) ti spiego come farlo step-by-step; per il bundle Apache Tomcat e WildFly. Ricorda di lasciare un tuo feedback dopo averlo letto.