Class FormsEntryUtils
java.lang.Object
fr.paris.lutece.plugins.forms.util.FormsEntryUtils
Utility class for plugin Form
-
Method Summary
Modifier and TypeMethodDescriptionstatic fr.paris.lutece.plugins.genericattributes.business.EntrycreateEntryByType(int nIdType) Return an instance of IEntry function of type entrystatic fr.paris.lutece.plugins.genericattributes.business.FieldfindFieldByCode(fr.paris.lutece.plugins.genericattributes.business.Entry entry, String strCode) Finds a field with the specified code in the specified entrystatic StringgetFirstResponseValue(List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponses) Get the first response value of the list given in parameter.static intgetIndexFieldInTheFieldList(int nIdField, List<fr.paris.lutece.plugins.genericattributes.business.Field> listField) Return the index in the list of the field whose key is specified in parameterstatic List<fr.paris.lutece.plugins.genericattributes.business.EntryType>Build a list with the different entry types excluding Group and MyLuteceUserstatic fr.paris.lutece.util.ReferenceListBuild a reference list with the different entry types excluding Group and MyLuteceUserstatic booleanisFirstResponseValueChanged(List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponseReference, List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponseNew) Check if there is a difference between the current value and the new value in a form.
-
Method Details
-
createEntryByType
public static fr.paris.lutece.plugins.genericattributes.business.Entry createEntryByType(int nIdType) Return an instance of IEntry function of type entry- Parameters:
nIdType- the entry type id- Returns:
- an instance of IEntry function of type entry
-
getIndexFieldInTheFieldList
public static int getIndexFieldInTheFieldList(int nIdField, List<fr.paris.lutece.plugins.genericattributes.business.Field> listField) Return the index in the list of the field whose key is specified in parameter- Parameters:
nIdField- the key of the fieldlistField- the list of field- Returns:
- the index in the list of the field whose key is specified in parameter
-
initRefListEntryType
public static fr.paris.lutece.util.ReferenceList initRefListEntryType()Build a reference list with the different entry types excluding Group and MyLuteceUser- Returns:
- reference list of entry type
-
initListEntryType
public static List<fr.paris.lutece.plugins.genericattributes.business.EntryType> initListEntryType()Build a list with the different entry types excluding Group and MyLuteceUser- Returns:
- list of entry type
-
findFieldByCode
public static fr.paris.lutece.plugins.genericattributes.business.Field findFieldByCode(fr.paris.lutece.plugins.genericattributes.business.Entry entry, String strCode) Finds a field with the specified code in the specified entry- Parameters:
entry- the entrystrCode- the code- Returns:
- the found field, or
nullotherwise
-
isFirstResponseValueChanged
public static boolean isFirstResponseValueChanged(List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponseReference, List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponseNew) Check if there is a difference between the current value and the new value in a form.- Parameters:
listResponseReference- List of current responses.listResponseNew- List of new responses.- Returns:
- true if the value is changed, false otherwise.
-
getFirstResponseValue
public static String getFirstResponseValue(List<fr.paris.lutece.plugins.genericattributes.business.Response> listResponses) Get the first response value of the list given in parameter. Return null if the list is null there is no value in it.- Parameters:
listResponses- List of responses- Returns:
- the first response value of the list given in parameter
-