Class EntryService

  • All Implemented Interfaces:
    java.io.Serializable

    public final class EntryService
    extends fr.paris.lutece.portal.service.util.RemovalListenerService
    implements java.io.Serializable
    Service to manage entries
    Author:
    Laurent Payen
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BEAN_NAME
      Name of the bean of this service
    • Constructor Summary

      Constructors 
      Constructor Description
      EntryService()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void addListEntryToModel​(int nIdForm, java.util.Map<java.lang.String,​java.lang.Object> model)
      Add the entries to the model
      static fr.paris.lutece.plugins.genericattributes.business.EntryFilter buildEntryFilter​(int nIdForm)
      Build an entry filter with static parameter
      static fr.paris.lutece.plugins.genericattributes.business.Entry createEntryByEntryType​(int nIdType)
      Create a new Entry element with a specific EntryType
      static java.util.List<fr.paris.lutece.plugins.genericattributes.business.Entry> findListEntry​(int nIdForm)
      Find all the entries (with its fields) of a form
      static java.lang.String getEntryUrl​(fr.paris.lutece.plugins.genericattributes.business.Entry entry)
      Add parameters to the url with the entry given
      static java.util.List<fr.paris.lutece.plugins.genericattributes.business.Entry> getFilter​(int iform, boolean bDisplayFront)
      Get the list of entries filtered
      static void getHtmlEntry​(java.util.Map<java.lang.String,​java.lang.Object> model, int nIdEntry, java.lang.StringBuilder stringBuffer, java.util.Locale locale, boolean bDisplayFront, AppointmentDTO appointmentDTO)
      Get the html part of the additional Entry of the form
      static java.util.List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> getResponseEntry​(javax.servlet.http.HttpServletRequest request, int nIdEntry, java.util.Locale locale, AppointmentDTO appointment)
      Add to the map of the appointment the response of the additional entry of the form
      static EntryService getService()
      Get an instance of the service
      static java.lang.Boolean isFieldInTheResponseList​(int nIdField, java.util.List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponse)
      Tell if the id of the field given is in the response list
      void moveDownEntryOrder​(int nOrderToSet, fr.paris.lutece.plugins.genericattributes.business.Entry entryToChangeOrder)
      Change the attribute's order to a greater one (move down in the list)
      void moveEntryIntoGroup​(fr.paris.lutece.plugins.genericattributes.business.Entry entryToMove, fr.paris.lutece.plugins.genericattributes.business.Entry entryGroup)
      Move EntryToMove into entryGroup
      void moveOutEntryFromGroup​(fr.paris.lutece.plugins.genericattributes.business.Entry entryToMove)
      Remove an entry from a group
      void moveUpEntryOrder​(int nOrderToSet, fr.paris.lutece.plugins.genericattributes.business.Entry entryToChangeOrder)
      Change the attribute's order to a lower one (move up in the list)
      void removeEntriesByIdAppointmentForm​(int nIdForm)
      Remove every entries associated with a given appointment form
      • Methods inherited from class fr.paris.lutece.portal.service.util.RemovalListenerService

        checkForRemoval, registerListener
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • BEAN_NAME

        public static final java.lang.String BEAN_NAME
        Name of the bean of this service
        See Also:
        Constant Field Values
    • Constructor Detail

      • EntryService

        public EntryService()
    • Method Detail

      • getService

        public static EntryService getService()
        Get an instance of the service
        Returns:
        An instance of the service
      • buildEntryFilter

        public static fr.paris.lutece.plugins.genericattributes.business.EntryFilter buildEntryFilter​(int nIdForm)
        Build an entry filter with static parameter
        Parameters:
        nIdForm - the Form Id
        Returns:
        the entry filter
      • moveDownEntryOrder

        public void moveDownEntryOrder​(int nOrderToSet,
                                       fr.paris.lutece.plugins.genericattributes.business.Entry entryToChangeOrder)
        Change the attribute's order to a greater one (move down in the list)
        Parameters:
        nOrderToSet - the new order for the attribute
        entryToChangeOrder - the attribute which will change
      • moveUpEntryOrder

        public void moveUpEntryOrder​(int nOrderToSet,
                                     fr.paris.lutece.plugins.genericattributes.business.Entry entryToChangeOrder)
        Change the attribute's order to a lower one (move up in the list)
        Parameters:
        nOrderToSet - the new order for the attribute
        entryToChangeOrder - the attribute which will change
      • moveEntryIntoGroup

        public void moveEntryIntoGroup​(fr.paris.lutece.plugins.genericattributes.business.Entry entryToMove,
                                       fr.paris.lutece.plugins.genericattributes.business.Entry entryGroup)
        Move EntryToMove into entryGroup
        Parameters:
        entryToMove - the entry which will be moved
        entryGroup - the entry group
      • moveOutEntryFromGroup

        public void moveOutEntryFromGroup​(fr.paris.lutece.plugins.genericattributes.business.Entry entryToMove)
        Remove an entry from a group
        Parameters:
        entryToMove - the entry to remove from a group
      • removeEntriesByIdAppointmentForm

        public void removeEntriesByIdAppointmentForm​(int nIdForm)
        Remove every entries associated with a given appointment form
        Parameters:
        nIdForm - The id of the appointment to remove entries of
      • addListEntryToModel

        public static void addListEntryToModel​(int nIdForm,
                                               java.util.Map<java.lang.String,​java.lang.Object> model)
        Add the entries to the model
        Parameters:
        nIdForm - The form Id
        model - the model
      • findListEntry

        public static java.util.List<fr.paris.lutece.plugins.genericattributes.business.Entry> findListEntry​(int nIdForm)
        Find all the entries (with its fields) of a form
        Parameters:
        nIdForm - the form Id
        Returns:
        a list of all the entries
      • getHtmlEntry

        public static void getHtmlEntry​(java.util.Map<java.lang.String,​java.lang.Object> model,
                                        int nIdEntry,
                                        java.lang.StringBuilder stringBuffer,
                                        java.util.Locale locale,
                                        boolean bDisplayFront,
                                        AppointmentDTO appointmentDTO)
        Get the html part of the additional Entry of the form
        Parameters:
        model - The Map to fill with the additional entry's content
        nIdEntry - The Entry's ID
        stringBuffer - The StringBuffer containing the Entry's filled template
        locale - The locale
        bDisplayFront - Whether this method is used in the Front Office (true) or Back Office (false)
        appointmentDTO - The appointment being processed
      • getResponseEntry

        public static java.util.List<fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError> getResponseEntry​(javax.servlet.http.HttpServletRequest request,
                                                                                                                                int nIdEntry,
                                                                                                                                java.util.Locale locale,
                                                                                                                                AppointmentDTO appointment)
        Add to the map of the appointment the response of the additional entry of the form
        Parameters:
        request - the Request
        nIdEntry - the Entry Id
        locale - the Locale
        appointment - the Appointment
        Returns:
        the list of possible errors
      • isFieldInTheResponseList

        public static java.lang.Boolean isFieldInTheResponseList​(int nIdField,
                                                                 java.util.List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponse)
        Tell if the id of the field given is in the response list
        Parameters:
        nIdField - the id of the field
        listResponse - the list to search in
        Returns:
        true if the id is in the list
      • getEntryUrl

        public static java.lang.String getEntryUrl​(fr.paris.lutece.plugins.genericattributes.business.Entry entry)
        Add parameters to the url with the entry given
        Parameters:
        entry - the entry
        Returns:
        the url
      • getFilter

        public static java.util.List<fr.paris.lutece.plugins.genericattributes.business.Entry> getFilter​(int iform,
                                                                                                         boolean bDisplayFront)
        Get the list of entries filtered
        Parameters:
        iform - the form id
        bDisplayFront - true if it is displayed on FO
        Returns:
        the list of entries
      • createEntryByEntryType

        public static fr.paris.lutece.plugins.genericattributes.business.Entry createEntryByEntryType​(int nIdType)
        Create a new Entry element with a specific EntryType
        Parameters:
        nIdType - The ID of the EntryType assigned to the created Entry
        Returns:
        the new Entry Object