Last active
December 19, 2016 12:18
-
-
Save jgoldhammer/e6a91672da18ba90fd3a978b8737fb8e to your computer and use it in GitHub Desktop.
Create a temporary (not persisted) job in alfresco to run javascript code in the backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs.scheduleTemporaryJob({ | |
jobName: 'SimpleAuthorModificationJob', | |
runAs: 'system', | |
cronExpression: '0 0/1 * 1/1 * ? *', | |
script: function(){ | |
batchExecuter.processFolderRecursively({ | |
'root': repository.getCompanyHome(), | |
onNode: function(node) { | |
if (node.isDocument) { | |
node.properties['cm:author'] = 'Alfresco'; | |
node.save(); | |
} | |
} | |
}); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment