Class DefaultManager
- java.lang.Object
-
- fr.paris.lutece.plugins.document.service.attributes.DefaultManager
-
- All Implemented Interfaces:
AttributeManager
- Direct Known Subclasses:
DateManager,FileManager,InternalLinkManager,ListBoxManager,MultilineManager,RichTextManager,TextManager
public abstract class DefaultManager extends java.lang.Object implements AttributeManager
Default implementation of an attribute manager
-
-
Constructor Summary
Constructors Constructor Description DefaultManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeUsedAsThumbnail()Tells if the attrubute can be used as Thumbnail (image)java.util.Collection<AttributeTypeParameter>getAttributeParametersValues(int nAttributeId, java.util.Locale locale)Get the attribute type parameters of an attributejava.lang.StringgetAttributeTypeCode()Return the attribute Type codejava.lang.StringgetAttributeXmlValue(Document document, DocumentAttribute attribute)Get the XML data corresponding to the attribute to build the docuemnt XML contentjava.lang.StringgetCreateFormHtml(DocumentAttribute attribute, java.util.Locale locale, java.lang.String strBaseUrl)Gets the part of an HTML form to enter attribute datajava.lang.StringgetCreateParametersFormHtml(java.util.List<AttributeTypeParameter> listParameters, java.util.Locale locale)Gets the part of an HTML form to enter parameters datajava.lang.StringgetCreateParametersFormHtml(java.util.List<AttributeTypeParameter> listParameters, java.util.Locale locale, java.util.Map<java.lang.String,java.lang.Object> model)java.lang.StringgetCreateParametersFormHtml(java.util.Locale locale)Gets the part of an HTML form to enter parameters datajava.util.List<AttributeTypeParameter>getExtraParameters(java.util.Locale locale)Gets extra parameters for the attributejava.util.List<AttributeTypeParameter>getExtraParametersValues(java.util.Locale locale, int nAttributeId)Gets extra parameters values for the attributejava.lang.StringgetModifyFormHtml(DocumentAttribute attribute, Document document, java.util.Locale locale, java.lang.String strBaseUrl)Gets the part of an HTML form to modify attribute datajava.lang.StringgetModifyParametersFormHtml(java.util.Locale locale, int nAttributeId)Gets the part of an HTML form to modify parameters datajava.lang.StringgetModifyParametersFormHtml(java.util.Locale locale, int nAttributeId, java.util.Map<java.lang.String,java.lang.Object> model)java.util.List<AttributeTypeParameter>getValueParameters(javax.servlet.http.HttpServletRequest request, java.util.Locale locale)Get the value parametersvoidsetAttributeTypeCode(java.lang.String strCode)Define the attribute Type codejava.lang.StringvalidateValue(int nAttributeId, java.lang.String strValue, java.util.Locale locale)Validate the value for the attributejava.lang.StringvalidateValueParameters(java.util.List<AttributeTypeParameter> listParameters, java.util.Locale locale)Validate the value for the parameters
-
-
-
Method Detail
-
getCreateFormHtml
public java.lang.String getCreateFormHtml(DocumentAttribute attribute, java.util.Locale locale, java.lang.String strBaseUrl)
Gets the part of an HTML form to enter attribute data- Specified by:
getCreateFormHtmlin interfaceAttributeManager- Parameters:
attribute- The attributelocale- The current LocalestrBaseUrl- the base url- Returns:
- A part of the HTML form
-
getModifyFormHtml
public java.lang.String getModifyFormHtml(DocumentAttribute attribute, Document document, java.util.Locale locale, java.lang.String strBaseUrl)
Gets the part of an HTML form to modify attribute data- Specified by:
getModifyFormHtmlin interfaceAttributeManager- Parameters:
attribute- The attributedocument- The attribute documentlocale- The current LocalestrBaseUrl- The base url- Returns:
- A part of the HTML form
-
getCreateParametersFormHtml
public java.lang.String getCreateParametersFormHtml(java.util.Locale locale)
Gets the part of an HTML form to enter parameters data- Specified by:
getCreateParametersFormHtmlin interfaceAttributeManager- Parameters:
locale- The current Locale- Returns:
- A part of the HTML form
-
getCreateParametersFormHtml
public java.lang.String getCreateParametersFormHtml(java.util.List<AttributeTypeParameter> listParameters, java.util.Locale locale)
Gets the part of an HTML form to enter parameters data- Specified by:
getCreateParametersFormHtmlin interfaceAttributeManager- Parameters:
listParameters- list attribute type parameterslocale- The current Locale- Returns:
- A part of the HTML form
-
getCreateParametersFormHtml
public java.lang.String getCreateParametersFormHtml(java.util.List<AttributeTypeParameter> listParameters, java.util.Locale locale, java.util.Map<java.lang.String,java.lang.Object> model)
-
getModifyParametersFormHtml
public java.lang.String getModifyParametersFormHtml(java.util.Locale locale, int nAttributeId)Gets the part of an HTML form to modify parameters data- Specified by:
getModifyParametersFormHtmlin interfaceAttributeManager- Parameters:
locale- The current LocalenAttributeId- Attribute Id- Returns:
- A part of the HTML form
-
getModifyParametersFormHtml
public java.lang.String getModifyParametersFormHtml(java.util.Locale locale, int nAttributeId, java.util.Map<java.lang.String,java.lang.Object> model)
-
getExtraParameters
public java.util.List<AttributeTypeParameter> getExtraParameters(java.util.Locale locale)
Gets extra parameters for the attribute- Specified by:
getExtraParametersin interfaceAttributeManager- Parameters:
locale- The current Locale- Returns:
- A collection of attribute parameters
-
getExtraParametersValues
public java.util.List<AttributeTypeParameter> getExtraParametersValues(java.util.Locale locale, int nAttributeId)
Gets extra parameters values for the attribute- Specified by:
getExtraParametersValuesin interfaceAttributeManager- Parameters:
locale- The current Locale- Returns:
- The extra parameters values for the attribute
-
setAttributeTypeCode
public void setAttributeTypeCode(java.lang.String strCode)
Define the attribute Type code- Specified by:
setAttributeTypeCodein interfaceAttributeManager- Parameters:
strCode- The Attribute Type Code
-
getAttributeTypeCode
public java.lang.String getAttributeTypeCode()
Return the attribute Type code- Specified by:
getAttributeTypeCodein interfaceAttributeManager- Returns:
- The Attribute Type Code
-
validateValue
public java.lang.String validateValue(int nAttributeId, java.lang.String strValue, java.util.Locale locale)Validate the value for the attribute- Specified by:
validateValuein interfaceAttributeManager- Parameters:
nAttributeId- The attribute identifierstrValue- The value to checklocale- The current Locale- Returns:
- null if valid, otherwise error message
-
validateValueParameters
public java.lang.String validateValueParameters(java.util.List<AttributeTypeParameter> listParameters, java.util.Locale locale)
Validate the value for the parameters- Specified by:
validateValueParametersin interfaceAttributeManager- Parameters:
listParameters- The list of parameters to checklocale- The locale- Returns:
- null if valid, otherwise message property
-
getAttributeXmlValue
public java.lang.String getAttributeXmlValue(Document document, DocumentAttribute attribute)
Get the XML data corresponding to the attribute to build the docuemnt XML content- Specified by:
getAttributeXmlValuein interfaceAttributeManager- Parameters:
document- The documentattribute- The attribute- Returns:
- The XML value of the attribute
-
getAttributeParametersValues
public java.util.Collection<AttributeTypeParameter> getAttributeParametersValues(int nAttributeId, java.util.Locale locale)
Get the attribute type parameters of an attribute- Parameters:
nAttributeId- The id of the attribute to get the parameter oflocale- The locale- Returns:
- The list of parameters
-
canBeUsedAsThumbnail
public boolean canBeUsedAsThumbnail()
Tells if the attrubute can be used as Thumbnail (image)- Specified by:
canBeUsedAsThumbnailin interfaceAttributeManager- Returns:
- true if the attrubute can be used as Thumbnail, otherwise false
-
getValueParameters
public java.util.List<AttributeTypeParameter> getValueParameters(javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
Get the value parameters- Specified by:
getValueParametersin interfaceAttributeManager- Parameters:
request- the HTTP requestlocale- the locale- Returns:
- a list of
AttributeTypeParameter
-
-