08-27-2013 08:42 AM
09-14-2013 01:14 PM
09-16-2013 08:06 AM
09-16-2013 11:38 PM
09-20-2013 07:52 AM
09-21-2013 08:18 AM
09-21-2013 09:02 AM
09-21-2013 09:05 AM
09-23-2013 06:28 AM
<action id="document-archive" type="javascript" label="actions.document.archive">
<param name="function">onActionBackup</param>
<permissions>
<permission allow="true">Delete</permission>
</permissions>
<param name="successMessage">message.archive.success</param>
<param name="failureMessage">message.archive.failure</param>
<evaluator negate="true">evaluator.doclib.action.isLocked</evaluator>
</action>
package org.alfresco.repo.action.executer;
import java.util.List;
import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileNotFoundException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class ArchiveActionExecuter extends ActionExecuterAbstractBase{
private static Log logger = LogFactory.getLog(ArchiveActionExecuter.class);
public static final String NAME = "archive";
public static final String PARAM_DESTINATION_FOLDER = "archive_store";
private FileFolderService fileFolderService;
public void setFileFolderService(FileFolderService fileFolderService)
{
this.fileFolderService = fileFolderService;
}
@Override
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
{
logger.debug("######################1");
NodeRef destinationParent = (NodeRef)ruleAction.getParameterValue(PARAM_DESTINATION_FOLDER);
try
{
logger.debug("######################2");
fileFolderService.move(actionedUponNodeRef, destinationParent, null);
logger.debug("######################3");
}
catch (FileNotFoundException e)
{
logger.debug("######################4");
// Do nothing
}
}
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_FOLDER, DataTypeDefinition.NODE_REF, true, getParamDisplayLabel(PARAM_DESTINATION_FOLDER)));
}
}
(function()
{
/**
* Backup single document.
*
* @method onActionBackup
* @param file {object} Object literal representing one or more file(s) or folder(s) to be actioned
*/
YAHOO.Bubbling.fire("registerAction",
{
actionName: "onActionBackup",
onActionBackup: function dlA_onActionBackup(record)
{
alert("TEST");
var displayName = record.displayName;
var nodeRef = record.nodeRef;
this.modules.actions.genericAction(
{
success:
{
event:
{
name: "metadataRefresh"
},
message: this.msg("message.archive.success", record.displayName)
},
failure:
{
message: this.msg("message.archive.failure",record.displayName)
},
webscript:
{
name:"/slingshot/doclib/action/archive/site/{site}/{container}",
method: Alfresco.util.Ajax.POST
},
params:
{
site: this.options.siteId,
container: this.options.containerId
},
config:
{
requestContentType: Alfresco.util.Ajax.JSON,
dataObj:
{
nodeRefs: [record.nodeRef]
}
}
});
}
});
})();
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.