Skip to content

Instantly share code, notes, and snippets.

@flox1an
flox1an / gist:2a726224e23381fa41f9
Created January 28, 2015 15:12
Change username for cm:owner cm:creator cm:modifier in Alfresco Javascript Console
var ctx = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var behaviourFilter = ctx.getBean("policyBehaviourFilter");
// -----------------------------------------------------------------
function findAndReplaceAttribute(query, attribute, value) {
nodes = search.luceneSearch(query);
for each(var node in nodes) {
@douglascrp
douglascrp / How to disable alfresco policy using javascript.js
Last active March 11, 2024 03:00
Disable alfresco policy in Javascript.js
var context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var model = Packages.br.com.dgcloud.model.CustomerXModel;
var policyBehaviourFilter = context.getBean('policyBehaviourFilter', Packages.org.alfresco.repo.policy.BehaviourFilter);
try {
policyBehaviourFilter.disableBehaviour(node.nodeRef, model.TYPE_DOCUMENT_EMPLOYEE_QNAME);
// your code here
} finally {
@douglascrp
douglascrp / Importing JS
Created September 12, 2017 15:21 — forked from CesarCapillas/Importing JS
Alfresco Javascript Console Recipes
Import a script from the repository using a name-based path:
<import resource="/Company Home/Data Dictionary/Scripts/library.js">
Import a script from the repository using a NodeRef reference:
<import resource="workspace://SpacesStore/6f73de1b-d3b4-11db-80cb-112e6c2ea048">
Import a script from a Java classpath location: