Package org.alfresco.repo.forms.script
Class ScriptFormService
- java.lang.Object
-
- org.alfresco.repo.processor.BaseProcessorExtension
-
- org.alfresco.repo.jscript.BaseScopableProcessorExtension
-
- org.alfresco.repo.forms.script.ScriptFormService
-
- All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension,Scopeable
public class ScriptFormService extends BaseScopableProcessorExtension
Script object representing the form service.- Author:
- Neil McErlean
-
-
Constructor Summary
Constructors Constructor Description ScriptFormService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScriptFormgetForm(java.lang.String itemKind, java.lang.String itemId)Returns a form representation of the given item, all known fields for the item are included.ScriptFormgetForm(java.lang.String itemKind, java.lang.String itemId, java.lang.String[] fields)Returns a form representation of the given item consisting only of the given fields.ScriptFormgetForm(java.lang.String itemKind, java.lang.String itemId, java.lang.String[] fields, java.lang.String[] forcedFields)Returns a form representation of the given item consisting only of the given fields.java.lang.ObjectsaveForm(java.lang.String itemKind, java.lang.String itemId, java.lang.Object postData)Persists the given data object for the item providedvoidsetFormService(FormService formService)Set the form service-
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension
getScope, setScope
-
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
-
-
-
-
Method Detail
-
setFormService
public void setFormService(FormService formService)
Set the form service- Parameters:
formService- the form service
-
getForm
public ScriptForm getForm(java.lang.String itemKind, java.lang.String itemId)
Returns a form representation of the given item, all known fields for the item are included.- Parameters:
itemKind- The kind of item to retrieve a form foritemId- The identifier of the item to retrieve a form for- Returns:
- The form
-
getForm
public ScriptForm getForm(java.lang.String itemKind, java.lang.String itemId, java.lang.String[] fields)
Returns a form representation of the given item consisting only of the given fields.- Parameters:
itemKind- The kind of item to retrieve a form foritemId- The identifier of the item to retrieve a form forfields- String array of fields to include, null indicates all possible fields for the item should be included- Returns:
- The form
-
getForm
public ScriptForm getForm(java.lang.String itemKind, java.lang.String itemId, java.lang.String[] fields, java.lang.String[] forcedFields)
Returns a form representation of the given item consisting only of the given fields.- Parameters:
itemKind- The kind of item to retrieve a form foritemId- The identifier of the item to retrieve a form forfields- String array of fields to include, null indicates all possible fields for the item should be includedforcedFields- List of field names from 'fields' list that should be forcibly included, it is up to the form processor implementation to determine how to enforce this- Returns:
- The form
-
saveForm
public java.lang.Object saveForm(java.lang.String itemKind, java.lang.String itemId, java.lang.Object postData)Persists the given data object for the item provided- Parameters:
itemKind- The kind of item to retrieve a form foritemId- The identifier of the item to retrieve a form forpostData- The post data, this can be a Map of name value pairs, a webscript FormData object or a JSONObject- Returns:
- The persisted object
-
-