Search in sources :

Example 1 with SessionSavingMode

use of com.cognifide.cq.cqsm.core.sessions.SessionSavingMode in project APM by Cognifide.

the class SessionSave method process.

private ActionResult process(final Context context, boolean execute) {
    ActionResult actionResult = new ActionResult();
    if (execute) {
        try {
            SessionSavingMode savingMode = SessionSavingMode.valueOfMode(mode);
            SessionSavingPolicy savingPolicy = context.getSavingPolicy();
            savingPolicy.setMode(savingMode);
            actionResult.logMessage("Session saving mode set to: " + mode);
        } catch (IllegalArgumentException e) {
            actionResult.logError(MessagingUtils.createMessage(e));
        }
    }
    return actionResult;
}
Also used : ActionResult(com.cognifide.cq.cqsm.api.actions.ActionResult) SessionSavingMode(com.cognifide.cq.cqsm.core.sessions.SessionSavingMode) SessionSavingPolicy(com.cognifide.cq.cqsm.core.sessions.SessionSavingPolicy)

Aggregations

ActionResult (com.cognifide.cq.cqsm.api.actions.ActionResult)1 SessionSavingMode (com.cognifide.cq.cqsm.core.sessions.SessionSavingMode)1 SessionSavingPolicy (com.cognifide.cq.cqsm.core.sessions.SessionSavingPolicy)1