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 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)Collection<AttributeTypeParameter>getAttributeParametersValues(int nAttributeId, Locale locale)Get the attribute type parameters of an attributeStringgetAttributeTypeCode()Return the attribute Type codeStringgetAttributeXmlValue(Document document, DocumentAttribute attribute)Get the XML data corresponding to the attribute to build the docuemnt XML contentStringgetCreateFormHtml(DocumentAttribute attribute, Locale locale, String strBaseUrl)Gets the part of an HTML form to enter attribute dataStringgetCreateParametersFormHtml(List<AttributeTypeParameter> listParameters, Locale locale)Gets the part of an HTML form to enter parameters dataStringgetCreateParametersFormHtml(List<AttributeTypeParameter> listParameters, Locale locale, Map<String,Object> model)StringgetCreateParametersFormHtml(Locale locale)Gets the part of an HTML form to enter parameters dataList<AttributeTypeParameter>getExtraParameters(Locale locale)Gets extra parameters for the attributeList<AttributeTypeParameter>getExtraParametersValues(Locale locale, int nAttributeId)Gets extra parameters values for the attributeStringgetModifyFormHtml(DocumentAttribute attribute, Document document, Locale locale, String strBaseUrl)Gets the part of an HTML form to modify attribute dataStringgetModifyParametersFormHtml(Locale locale, int nAttributeId)Gets the part of an HTML form to modify parameters dataStringgetModifyParametersFormHtml(Locale locale, int nAttributeId, Map<String,Object> model)List<AttributeTypeParameter>getValueParameters(javax.servlet.http.HttpServletRequest request, Locale locale)Get the value parametersvoidsetAttributeTypeCode(String strCode)Define the attribute Type codeStringvalidateValue(int nAttributeId, String strValue, Locale locale)Validate the value for the attributeStringvalidateValueParameters(List<AttributeTypeParameter> listParameters, Locale locale)Validate the value for the parameters
-
-
-
Method Detail
-
getCreateFormHtml
public String getCreateFormHtml(DocumentAttribute attribute, Locale locale, 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 String getModifyFormHtml(DocumentAttribute attribute, Document document, Locale locale, 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 String getCreateParametersFormHtml(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 String getCreateParametersFormHtml(List<AttributeTypeParameter> listParameters, 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 String getCreateParametersFormHtml(List<AttributeTypeParameter> listParameters, Locale locale, Map<String,Object> model)
-
getModifyParametersFormHtml
public String getModifyParametersFormHtml(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 String getModifyParametersFormHtml(Locale locale, int nAttributeId, Map<String,Object> model)
-
getExtraParameters
public List<AttributeTypeParameter> getExtraParameters(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 List<AttributeTypeParameter> getExtraParametersValues(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(String strCode)
Define the attribute Type code- Specified by:
setAttributeTypeCodein interfaceAttributeManager- Parameters:
strCode- The Attribute Type Code
-
getAttributeTypeCode
public String getAttributeTypeCode()
Return the attribute Type code- Specified by:
getAttributeTypeCodein interfaceAttributeManager- Returns:
- The Attribute Type Code
-
validateValue
public String validateValue(int nAttributeId, String strValue, 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 String validateValueParameters(List<AttributeTypeParameter> listParameters, 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 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 Collection<AttributeTypeParameter> getAttributeParametersValues(int nAttributeId, 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 List<AttributeTypeParameter> getValueParameters(javax.servlet.http.HttpServletRequest request, Locale locale)
Get the value parameters- Specified by:
getValueParametersin interfaceAttributeManager- Parameters:
request- the HTTP requestlocale- the locale- Returns:
- a list of
AttributeTypeParameter
-
-