use of com.cognifide.cq.cqsm.api.history.InstanceDetails in project APM by Cognifide.
the class RemoteScriptExecutionActionReceiver method handleAction.
@Override
public void handleAction(final ValueMap valueMap) {
Preconditions.checkState(instanceTypeProvider.isOnAuthor(), "Action Receiver has to be called in author");
String userId = valueMap.get(ReplicationAction.PROPERTY_USER_ID, String.class);
SlingHelper.operateTraced(resolverFactory, userId, new OperateCallback() {
@Override
public void operate(ResourceResolver resolver) throws Exception {
// FIXME would be lovely to cast ValueMap -> ModifiableEntryBuilder
String scriptLocation = valueMap.get(ModifiableEntryBuilder.FILE_PATH_PROPERTY, String.class);
Resource scriptResource = resolver.getResource(scriptLocation);
Script script = scriptResource.adaptTo(ScriptImpl.class);
InstanceDetails instanceDetails = getInstanceDetails(valueMap);
Progress progress = getProgress(valueMap, resolver.getUserID());
Calendar executionTime = getCalendar(valueMap);
Mode mode = getMode(valueMap);
history.logRemote(script, mode, progress, instanceDetails, executionTime);
}
});
}
Aggregations