Thanks in advance.
Without more context the best I can do is suggest that you read the source. Specifically, take a look at
Depending on what you want to do you might also pick up a few tips by looking at org/alfresco/repo/processor/ScriptServiceImpl.java.
Mr. Jeff , Mr. Axel thank you for the reply and the precise answer.
I did took a look at those classes and did some research. I found this :
// Create the script node reference NodeRef script = this.nodeService.createNode( this.folder, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "testScript.js"), ContentModel.TYPE_CONTENT).getChildRef(); this.nodeService.setProperty(script, ContentModel.PROP_NAME, "testScript.js"); ContentWriter contentWriter = this.contentService.getWriter(script, ContentModel.PROP_CONTENT, true); contentWriter.setMimetype("text/plain"); contentWriter.setEncoding("UTF-8"); contentWriter.putContent("\"VALUE\";"); // Create the action Action action1 = this.actionService.createAction(ScriptActionExecuter.NAME); action1.setParameterValue(ScriptActionExecuter.PARAM_SCRIPTREF, script); // Execute the action this.actionService.executeAction(action1, this.nodeRef);
Sorry if I misunderstood something, I'm new to this field.
Thanks a lot.
Thank you Mr. Jeff Potts for your reply. But how to get this code works inside my Java class ? there is classes not defined, how do I import them all to my code and execute them. If you can please Mr. Jeff describe to me the steps. Thanks a lot.
Have you tried using the Alfresco SDK?
Retrieving data ...