Last active
August 10, 2022 20:12
-
-
Save douglascrp/0e6379dfdac1afc3ee73eed523cac9ee to your computer and use it in GitHub Desktop.
Using Alfresco's AttributeService with javascript
This file contains hidden or 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 context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext(); | |
var attributeService = context.getBean("attributeService", Packages.org.alfresco.repo.attributes.AttributeServiceImpl); | |
attributeService.getAttributes(function(id, value, keys) { | |
logger.warn("id: " + id + " - key: " + keys[0] + " - " + keys[1] + " - value: " + value); | |
if (keys[0] == "project-repo.sequencial.documentos.operacoes") { | |
attributeService.removeAttribute([keys[0], keys[1]]); | |
} | |
return true; | |
}, ["project-repo.sequencial.documentos.operacoes"]); |
This file contains hidden or 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 context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext(); | |
var attributeService = context.getBean("attributeService", Packages.org.alfresco.repo.attributes.AttributeServiceImpl); | |
attributeService.setAttribute([1459], ["project-repo.sequencial.documentos.operacoes", "numero"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment