Class DerivedEntryTypeService
java.lang.Object
fr.paris.lutece.plugins.genericattributes.service.entrytype.DerivedEntryTypeService
Service managing the entry types derived from another one: they use the entry type service of their parent and add a regular expression control
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn error found by the validation of an entry type: the key of its message, and its argument -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSave a new derived entry type, last of the entry types of its pluginbooleanisRegularExpressionSupported(EntryType entryType) Tell whether the entry type service of an entry type checks the regular expression of its entry typenewDerivedEntryType(EntryType entryTypeParent, String strTitle, String strIconName, String strRegexPattern, String strRegexErrorMessage) Build an entry type derived from a parent one, not saved yetresolveImportedEntryType(EntryType importedEntryType) Find the local entry type matching an entry type read from an export made on another instance.Validate an entry type before saving it
-
Field Details
-
MAX_LENGTH_TITLE
public static final int MAX_LENGTH_TITLE- See Also:
-
MAX_LENGTH_REGEX_PATTERN
public static final int MAX_LENGTH_REGEX_PATTERN- See Also:
-
MAX_LENGTH_REGEX_ERROR_MESSAGE
public static final int MAX_LENGTH_REGEX_ERROR_MESSAGE- See Also:
-
-
Constructor Details
-
DerivedEntryTypeService
public DerivedEntryTypeService()
-
-
Method Details
-
isRegularExpressionSupported
Tell whether the entry type service of an entry type checks the regular expression of its entry type- Parameters:
entryType- the entry type- Returns:
- true if a regular expression can be set on a type derived from this entry type
-
validate
Validate an entry type before saving it- Parameters:
entryType- the entry type- Returns:
- the errors, empty if the entry type is valid
-
newDerivedEntryType
public EntryType newDerivedEntryType(EntryType entryTypeParent, String strTitle, String strIconName, String strRegexPattern, String strRegexErrorMessage) Build an entry type derived from a parent one, not saved yet- Parameters:
entryTypeParent- the parent entry typestrTitle- the titlestrIconName- the iconstrRegexPattern- the regular expressionstrRegexErrorMessage- the error message, null for the generic one- Returns:
- the derived entry type
-
create
Save a new derived entry type, last of the entry types of its plugin- Parameters:
entryType- the derived entry type- Returns:
- the saved entry type
-
resolveImportedEntryType
Find the local entry type matching an entry type read from an export made on another instance. The ids of the derived entry types differ from one instance to the other: the entry type is matched by its entry type service and its regular expression, and a derived entry type missing here is created.- Parameters:
importedEntryType- the entry type of the export- Returns:
- the local entry type, or the imported one when nothing local answers its entry type service
-