10-27-2008 11:44 AM
var createVersion = "true";
var space = document.parent;
var tempFolder = companyhome;
var fileName = document.properties.name;
var parentFolderParent=space.parent;
var destFolder = parentFolderParent.childByNamePath("Approved");
var destFile = destFolder.childByNamePath(fileName);
// Check for existing PDF
if (destFile==null){
var success = document.move(destFolder);
createVersion="false";
}
else if (!destFile.hasAspect("cm:versionable")){
destFile.addAspect("cm:versionable");
}
if (createVersion=="true"){
var updatedVersion = document.copy(tempFolder);
var workingCopy = destFile.checkout();
workingCopy.properties.content.write(updatedVersion.properties.content);
workingCopy.checkin();
updatedVersion.remove();
document.remove();
}
<config evaluator="node-type" condition="rg:approvableType">
<actions>
<action id="NB_approve_action">
<permissions>
<permission allow="true">Write</permission>
</permissions>
<label>NBApprove Action</label>
<image>/images/icons/approve.gif</image>
<script>/Company Home/Data Dictionary/Scripts/ApproveDoc.js</script>
<params>
<param name="noderef">#{actionContext.nodeRef}</param>
</params>
</action>
<action-group id="document_browse_menu">
<action idref="preview_doc" hide="true" />
<action idref="update_doc" hide="true" />
<action idref="cancelcheckout_doc" hide="true" />
<action idref="approve_doc" hide="true" />
<action idref="reject_doc" hide="true" />
<action idref="cut_node" hide="false" />
<action idref="copy_node" hide="false" />
<action idref="start_workflow" hide="true" />
<action idref="NB_approve_action" />
</action-group>
</actions>
</config>
org.alfresco.error.AlfrescoRuntimeException: Error during command servlet processing:
Failed to execute script 'workspace://SpacesStore/3c5111ae-63e1-11dd-9e28-53b14ffe9004':
Failed to execute script 'workspace://SpacesStore/3c5111ae-63e1-11dd-9e28-53b14ffe9004':
ReferenceError: "document" is not defined. (AlfrescoScript#2)
caused by:
org.alfresco.service.cmr.repository.ScriptException:
Failed to execute script 'workspace://SpacesStore/3c5111ae-63e1-11dd-9e28-53b14ffe9004':
Failed to execute script 'workspace://SpacesStore/3c5111ae-63e1-11dd-9e28-53b14ffe9004':
ReferenceError: "document" is not defined. (AlfrescoScript#2)
02-20-2009 02:33 AM
05-07-2009 08:33 AM
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.