09-21-2007 10:02 AM
09-25-2007 08:41 AM
09-25-2007 09:29 AM
10-01-2007 12:57 PM
10-02-2007 04:47 AM
var document = search.findNode(args["node"]);
var space = document.parent;
var parentFolderName = space.properties.name;
var releasable;
var fileName = document.properties.name;
var fileNameBase = fileName.substring(0,fileName.length-4);
var reply;
var version=document.properties.versionLabel;
//Test if the document is releasable
if(document.hasAspect("cm:releasable"))
{
releasable=document.properties.releasable;
}
else
{
releasable=false;
}
if(releasable)
{
var parentFolderParent=space.parent.parent;
var destFolder = parentFolderParent.childByNamePath("Released/"+parentFolderName);
//Remove current document if it exists
var destFile = destFolder.childByNamePath(fileNameBase + ".pdf")
if (destFile!=null)
{
destFile.remove();
}
//Transform and move the document
var trans = document.transformDocument("application/pdf");
var copy = trans.copy(destFolder);
//Set version according to source document
copy.addAspect("cm:versionable");
copy.properties.initialVersion=false;
copy.properties.versionLabel=version;
copy.save();
trans.remove();
//reply="The document has been successfully released. Push the back button to return to Alfresco.";
var goBack = "<script>history.back();</script>";
goBack;
}
else
{
reply="The document is not releasable. Push the back button to return to Alfresco.";
}
10-03-2007 12:21 PM
10-04-2007 04:28 PM
10-05-2007 09:51 AM
// assume you have a document node called 'document' and that you have permissions to write to the current space
// first create a new node in the current space
var destNode = space.createFile("copy.txt");
// write the content from the current document into the destination
document.properties["cm:content"].write(destNode.properties["cm:content"]);
05-31-2008 01:00 AM
// write the content from the current document into the destination
document.properties["cm:content"].write(destNode.properties["cm:content"]);
// write the content from the current document into the destination
destNode.content.write(document.properties.content);
06-02-2008 09:22 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.