Class FormServiceImpl

  • All Implemented Interfaces:
    FormService

    public class FormServiceImpl
    extends java.lang.Object
    implements FormService
    Form Service Implementation.
    Author:
    Gavin Cornwell
    • Constructor Summary

      Constructors 
      Constructor Description
      FormServiceImpl()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Form getForm​(Item item)
      Returns a form representation of the given item, all known fields for the item are included.
      Form getForm​(Item item, java.util.List<java.lang.String> fields)
      Returns a form representation of the given item consisting only of the given fields.
      Form getForm​(Item item, java.util.List<java.lang.String> fields, java.util.List<java.lang.String> forcedFields)
      Returns a form representation of the given item consisting only of the given fields.
      Form getForm​(Item item, java.util.List<java.lang.String> fields, java.util.List<java.lang.String> forcedFields, java.util.Map<java.lang.String,​java.lang.Object> context)
      Returns a form representation of the given item consisting only of the given fields.
      Form getForm​(Item item, java.util.List<java.lang.String> fields, java.util.Map<java.lang.String,​java.lang.Object> context)
      Returns a form representation of the given item consisting only of the given fields.
      Form getForm​(Item item, java.util.Map<java.lang.String,​java.lang.Object> context)
      Returns a form representation of the given item, all known fields for the item are included.
      java.lang.Object saveForm​(Item item, FormData data)
      Persists the given form representation for the given item.
      void setProcessorRegistry​(FormProcessorRegistry registry)
      Sets the FormProcessorRegistry
      • Methods inherited from class java.lang.Object

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

      • FormServiceImpl

        public FormServiceImpl()
    • Method Detail

      • setProcessorRegistry

        public void setProcessorRegistry​(FormProcessorRegistry registry)
        Sets the FormProcessorRegistry
        Parameters:
        registry - The FormProcessorRegistry instance to use
      • getForm

        public Form getForm​(Item item)
        Description copied from interface: FormService
        Returns a form representation of the given item, all known fields for the item are included.
        Specified by:
        getForm in interface FormService
        Parameters:
        item - The item to get a form for
        Returns:
        The Form representation
      • getForm

        public Form getForm​(Item item,
                            java.util.Map<java.lang.String,​java.lang.Object> context)
        Description copied from interface: FormService
        Returns a form representation of the given item, all known fields for the item are included.
        Specified by:
        getForm in interface FormService
        Parameters:
        item - The item to get a form for
        context - Map representing optional context that can be used during retrieval of the form
        Returns:
        The Form representation
      • getForm

        public Form getForm​(Item item,
                            java.util.List<java.lang.String> fields)
        Description copied from interface: FormService
        Returns a form representation of the given item consisting only of the given fields.
        Specified by:
        getForm in interface FormService
        Parameters:
        item - The item to get a form for
        fields - Restricted list of fields to include, null indicates all possible fields for the item should be included
        Returns:
        The Form representation
      • getForm

        public Form getForm​(Item item,
                            java.util.List<java.lang.String> fields,
                            java.util.Map<java.lang.String,​java.lang.Object> context)
        Description copied from interface: FormService
        Returns a form representation of the given item consisting only of the given fields.
        Specified by:
        getForm in interface FormService
        Parameters:
        item - The item to get a form for
        fields - Restricted list of fields to include, null indicates all possible fields for the item should be included
        context - Map representing optional context that can be used during retrieval of the form
        Returns:
        The Form representation
      • getForm

        public Form getForm​(Item item,
                            java.util.List<java.lang.String> fields,
                            java.util.List<java.lang.String> forcedFields)
        Description copied from interface: FormService
        Returns a form representation of the given item consisting only of the given fields.
        Specified by:
        getForm in interface FormService
        Parameters:
        item - The item to get a form for
        fields - Restricted list 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 representation
      • getForm

        public Form getForm​(Item item,
                            java.util.List<java.lang.String> fields,
                            java.util.List<java.lang.String> forcedFields,
                            java.util.Map<java.lang.String,​java.lang.Object> context)
        Description copied from interface: FormService
        Returns a form representation of the given item consisting only of the given fields.
        Specified by:
        getForm in interface FormService
        Parameters:
        item - The item to get a form for
        fields - Restricted list 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
        context - Map representing optional context that can be used during retrieval of the form
        Returns:
        The Form representation
      • saveForm

        public java.lang.Object saveForm​(Item item,
                                         FormData data)
        Description copied from interface: FormService
        Persists the given form representation for the given item.
        Specified by:
        saveForm in interface FormService
        Parameters:
        item - The item to persist the form for
        data - An object representing the form data to persist
        Returns:
        The object persisted