Class ExtendUtils
java.lang.Object
fr.paris.lutece.plugins.extend.util.ExtendUtils
ExtendUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A> StringbuildStopMessage(Set<jakarta.validation.ConstraintViolation<A>> listErrors) Builds the stop message.static voidfillTypeLabels(BiConsumer<String, Object> model, Collection<ResourceExtenderDTO> listExtenders, Locale locale) Puts in the model the labels of the extender types and resource types of the given extenders, by code.static StringgetExtenderTypeLabel(String strExtenderType, Locale locale) Returns the label of an extender type, or its code when no extender answers it.static StringgetResourceTypeLabel(String strResourceType, Locale locale) Returns the label the resource service gives a resource type, or its code when no service knows it.static <A> Stringvalidate(jakarta.servlet.http.HttpServletRequest request, A bean) Validate.static StringvalidateResourceExtender(jakarta.servlet.http.HttpServletRequest request, ResourceExtenderDTO resourceExtender) Validate resource extender.static StringvalidateResourceType(jakarta.servlet.http.HttpServletRequest request, ExtendableResourceType resourceType) Validate.
-
Method Details
-
validate
Validate.- Type Parameters:
A- the generic type- Parameters:
request- the requestbean- the resource type- Returns:
- the JSP error
-
validateResourceType
public static String validateResourceType(jakarta.servlet.http.HttpServletRequest request, ExtendableResourceType resourceType) Validate.- Parameters:
request- the requestresourceType- the resource type- Returns:
- the string
-
validateResourceExtender
public static String validateResourceExtender(jakarta.servlet.http.HttpServletRequest request, ResourceExtenderDTO resourceExtender) Validate resource extender.- Parameters:
request- the requestresourceExtender- the resource extender- Returns:
- the string
-
buildStopMessage
public static <A> String buildStopMessage(Set<jakarta.validation.ConstraintViolation<A>> listErrors) Builds the stop message.- Type Parameters:
A- the generic type- Parameters:
listErrors- the list errors- Returns:
- the string
-
getExtenderTypeLabel
Returns the label of an extender type, or its code when no extender answers it.- Parameters:
strExtenderType- the extender typelocale- the locale- Returns:
- the label
-
getResourceTypeLabel
Returns the label the resource service gives a resource type, or its code when no service knows it.- Parameters:
strResourceType- the resource typelocale- the locale- Returns:
- the label
-
fillTypeLabels
public static void fillTypeLabels(BiConsumer<String, Object> model, Collection<ResourceExtenderDTO> listExtenders, Locale locale) Puts in the model the labels of the extender types and resource types of the given extenders, by code.- Parameters:
model- the put operation of the modellistExtenders- the extenderslocale- the locale
-