mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
1) Minor mods to Rhinoscript Actions
- rename createAction to create - add (read-only) name property to action 2) Addition of createPackage to Workflow Service API (no implementation yet) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3510 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -91,7 +91,7 @@ public final class Actions implements Scopeable
|
||||
* @param actionName the action name
|
||||
* @return the action
|
||||
*/
|
||||
public ScriptAction createAction(String actionName)
|
||||
public ScriptAction create(String actionName)
|
||||
{
|
||||
ScriptAction scriptAction = null;
|
||||
ActionService actionService = services.getActionService();
|
||||
@@ -147,6 +147,21 @@ public final class Actions implements Scopeable
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the action name
|
||||
*
|
||||
* @return action name
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return this.actionDef.getName();
|
||||
}
|
||||
|
||||
public String jsGet_name()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all the properties known about this node.
|
||||
*
|
||||
@@ -174,7 +189,7 @@ public final class Actions implements Scopeable
|
||||
return this.parameters;
|
||||
}
|
||||
|
||||
public Map<String, Serializable>jsGet_parameters()
|
||||
public Map<String, Serializable> jsGet_parameters()
|
||||
{
|
||||
return getParameters();
|
||||
}
|
||||
|
@@ -28,9 +28,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.ScriptException;
|
||||
import org.alfresco.service.cmr.repository.ScriptService;
|
||||
import org.alfresco.service.cmr.repository.TemplateImageResolver;
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package org.alfresco.repo.jscript;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -25,7 +24,6 @@ import java.util.Map;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.dictionary.DictionaryComponent;
|
||||
import org.alfresco.repo.dictionary.DictionaryDAO;
|
||||
import org.alfresco.repo.dictionary.M2Model;
|
||||
@@ -34,7 +32,6 @@ import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.transaction.TransactionUtil;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// create add action
|
||||
var addAspectAction = actions.createAction("add-features");
|
||||
var addAspectAction = actions.create("add-features");
|
||||
addAspectAction.parameters["aspect-name"] = "cm:lockable";
|
||||
|
||||
// execute action against passed in node
|
||||
|
@@ -1,10 +1,10 @@
|
||||
// create mail action
|
||||
var mail = actions.createAction("mail");
|
||||
mail.parameters["to"] = "davidc@alfresco.com";
|
||||
mail.parameters["subject"] = "Hello from JavaScript";
|
||||
mail.parameters["from"] = "david.caruana@alfresco.org";
|
||||
mail.parameters["template"] = root.childByNamePath("Company Home/Data Dictionary/Email Templates/notify_user_email.ftl");
|
||||
mail.parameters["text"] = "some text, in case template is not found";
|
||||
var mail = actions.create("mail");
|
||||
mail.parameters.to = "davidc@alfresco.com";
|
||||
mail.parameters.subject = "Hello from JavaScript";
|
||||
mail.parameters.from = "david.caruana@alfresco.org";
|
||||
mail.parameters.template = root.childByNamePath("Company Home/Data Dictionary/Email Templates/notify_user_email.ftl");
|
||||
mail.parameters.text = "some text, in case template is not found";
|
||||
|
||||
// execute action against passed in node
|
||||
mail.execute(doc);
|
||||
|
Reference in New Issue
Block a user