Class ScriptFormService

All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension, Scopeable

public class ScriptFormService extends BaseScopableProcessorExtension
Script object representing the form service.
Author:
Neil McErlean
  • Constructor Details

    • ScriptFormService

      public ScriptFormService()
  • Method Details

    • setFormService

      public void setFormService(FormService formService)
      Set the form service
      Parameters:
      formService - the form service
    • getForm

      public ScriptForm getForm(String itemKind, 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 for
      itemId - The identifier of the item to retrieve a form for
      Returns:
      The form
    • getForm

      public ScriptForm getForm(String itemKind, String itemId, 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 for
      itemId - The identifier of the item to retrieve a form for
      fields - String array of fields to include, null indicates all possible fields for the item should be included
      Returns:
      The form
    • getForm

      public ScriptForm getForm(String itemKind, String itemId, String[] fields, 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 for
      itemId - The identifier of the item to retrieve a form for
      fields - String array of fields to include, null indicates all possible fields for the item should be included
      forcedFields - 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 Object saveForm(String itemKind, String itemId, Object postData)
      Persists the given data object for the item provided
      Parameters:
      itemKind - The kind of item to retrieve a form for
      itemId - The identifier of the item to retrieve a form for
      postData - The post data, this can be a Map of name value pairs, a webscript FormData object or a JSONObject
      Returns:
      The persisted object