Class ScriptFormService

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      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.
      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.
      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
      void setFormService​(FormService formService)
      Set the form service
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScriptFormService

        public ScriptFormService()
    • 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 for
        itemId - 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 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​(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 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 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 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