Job name:

Register Custom Event Listeners

Job description:

Registers the following event listeners:
- check for album objects on the user profile: UpdateUserProfilesEventListener

Job cron expression:

0 0/5 * * * ?

Job script:

import org.xwiki.observation.*;
import com.xpn.xwiki.web.*;
import com.xpn.xwiki.*;
import org.slf4j.LoggerFactory;

def LOGGER = LoggerFactory.getLogger("RegisterEventListeners");
// Register against the Observation Manager
def observation = Utils.getComponent(ObservationManager.class);
def l = observation.getListener("ProfileUpdater");
if (l == null) {
 def profileUpdater = xwiki.getDocument("CdlsatdCode.UpdateUserProfilesEventListener");
if(profileUpdater) {
    LOGGER.warn("Registered CdlsatdCode.UpdateUserProfilesEventListener" );
} else
    LOGGER.warn("CdlsatdCode.UpdateUserProfilesEventListener not available (try to resave the document)" );

Back to the job list

About the website contents

All of the information contained within these questions and answers is for education purposes only. The place to get specific medical advice, diagnoses, and treatment is your doctor. Use of this site is strictly at your own risk. If you find something that you think needs correction or clarification, please let us know, contact see below.