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
Script url /slingshot/node/content/workspace/SpacesStore/5930e336-37ae-4db4-ab96-eb9e29b77ec4/File-20151014.docx | |
does not support the method HEAD | |
17:49:46,379 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 01270029 Script url /slingshot/node/content/workspace/SpacesStore/5930e336-37ae-4db4-ab96-eb9e29b77ec4/File-20151014.docx does not support the method HEAD | |
org.springframework.extensions.webscripts.WebScriptException: 01270029 Script url /slingshot/node/content/workspace/SpacesStore/5930e336-37ae-4db4-ab96-eb9e29b77ec4/File-20151014.docx does not support the method HEAD | |
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:179) | |
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132) | |
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) | |
... |
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
// log the docs that currently contain the word 'Alfresco' to a log file | |
var logFile = space.childByNamePath("alf docs.txt"); | |
if (logFile == null) | |
{ | |
logFile = space.createFile("alf docs.txt"); | |
} | |
rules.enableRules(logFile); | |
print(rules.rulesEnabled(logFile)); |
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
print(permissions.getPermissions(repository.getCompanyHome()); | |
print(permissions.hasPermission(repository.getCompanyHome().nodeRef,"Delete")); | |
print(permissions.hasPermission(repository.getCompanyHome().nodeRef,"Delete","abeecher")); | |
permissions.setPermission(repository.getCompanyHome().nodeRef,"Delete","abeecher",true); | |
print(permissions.hasPermission(repository.getCompanyHome().nodeRef,"Delete","abeecher")); | |
permissions.deletePermission(repository.getCompanyHome().nodeRef,"Delete","abeecher"); | |
print(permissions.hasPermission(repository.getCompanyHome().nodeRef,"Delete","abeecher")); |
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
// check if the company home node is a favorite of the current user | |
print(favorites.isFavorite(repository.getCompanyHome())); | |
// get all favorites of the current user with start =0 and limit 20 | |
print(favorites.getFavorites(0,20)); | |
// add the company home node as favorite of the user | |
favorites.add(repository.getCompanyHome()); |
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
var download = downloads.create(repository.getCompanyHome(),true); | |
print(downloads.getStatus(download).getStatus()); |
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
fileWriter.createFile(); | |
fileWriter.appendLine("Hello"); | |
var logfile = fileWriter.persist( | |
"Test"+java.lang.System.nanoTime(), | |
repository.getCompanyHome(), | |
"text/plain", | |
"cm:content", | |
false); | |
print(logfile.content); |
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
database.query("dataSource", "Select * from alf_node where id=?",2); | |
database.update("dataSource", "Update alf_node set id=? where id=?",2,2); |
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'; |
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
print(jmxClient.listSystemProperties()); | |
print('Java version:'+jmxClient.getSystemProperty('java.version')); | |
print(jmx.listAlfProperties()); | |
print('Activiti enabled?'+jmx.getAlfProperty('system.workflow.engine.activiti.enabled')); |
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
var node = search.findNode(<nodeRefOfADocumentOrFolder>); | |
var modified = node.properties.modified; | |
policies.disableForNode(node); | |
node.setName("C10"); | |
node.save(); | |
node.reset(); | |
policies.enableForNode(node); | |
var modifiedAfter = node.properties.modified; |
NewerOlder