Search in sources :

Example 11 with Progress

use of com.cognifide.cq.cqsm.api.logger.Progress in project APM by Cognifide.

the class ScriptManagerImpl method process.

@Override
public Progress process(Script script, final Mode mode, final Map<String, String> customDefinitions, ResourceResolver resolver) throws RepositoryException, PersistenceException {
    Progress progress;
    try {
        progress = execute(script, mode, customDefinitions, resolver);
    } catch (ExecutionException e) {
        progress = new ProgressImpl(resolver.getUserID());
        progress.addEntry(Message.getErrorMessage(e.getMessage()), Status.ERROR);
    }
    process(script, mode, progress.isSuccess(), resolver);
    return progress;
}
Also used : ProgressImpl(com.cognifide.cq.cqsm.core.progress.ProgressImpl) Progress(com.cognifide.cq.cqsm.api.logger.Progress) ExecutionException(com.cognifide.cq.cqsm.api.exceptions.ExecutionException)

Aggregations

Progress (com.cognifide.cq.cqsm.api.logger.Progress)11 RepositoryException (javax.jcr.RepositoryException)6 Script (com.cognifide.cq.cqsm.api.scripts.Script)4 Mode (com.cognifide.cq.cqsm.api.executors.Mode)3 ResourceResolver (org.apache.sling.api.resource.ResourceResolver)3 ExecutionException (com.cognifide.cq.cqsm.api.exceptions.ExecutionException)2 ProgressImpl (com.cognifide.cq.cqsm.core.progress.ProgressImpl)2 ActionDescriptor (com.cognifide.cq.cqsm.api.actions.ActionDescriptor)1 ActionResult (com.cognifide.cq.cqsm.api.actions.ActionResult)1 Context (com.cognifide.cq.cqsm.api.executors.Context)1 InstanceDetails (com.cognifide.cq.cqsm.api.history.InstanceDetails)1 ModifiableScript (com.cognifide.cq.cqsm.api.scripts.ModifiableScript)1 ActionExecutor (com.cognifide.cq.cqsm.core.actions.executor.ActionExecutor)1 ScriptImpl (com.cognifide.cq.cqsm.core.scripts.ScriptImpl)1 SessionSavingPolicy (com.cognifide.cq.cqsm.core.sessions.SessionSavingPolicy)1 OperateCallback (com.cognifide.cq.cqsm.core.utils.sling.OperateCallback)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 Calendar (java.util.Calendar)1 HashMap (java.util.HashMap)1