fr.paris.lutece.plugins.document.service.attributes
Class DefaultManager

java.lang.Object
  extended by 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
DefaultManager()
           
 
Method Summary
 boolean canBeUsedAsThumbnail()
          Tells if the attrubute can be used as Thumbnail (image)
 Collection<AttributeTypeParameter> getAttributeParametersValues(int nAttributeId, Locale locale)
          Get the attribute type parameters of an attribute
 String getAttributeTypeCode()
          Return the attribute Type code
 String getAttributeXmlValue(Document document, DocumentAttribute attribute)
          Get the XML data corresponding to the attribute to build the docuemnt XML content
 String getCreateFormHtml(DocumentAttribute attribute, Locale locale, String strBaseUrl)
          Gets the part of an HTML form to enter attribute data
 String getCreateParametersFormHtml(List<AttributeTypeParameter> listParameters, Locale locale)
          Gets the part of an HTML form to enter parameters data
 String getCreateParametersFormHtml(Locale locale)
          Gets the part of an HTML form to enter parameters data
 List<AttributeTypeParameter> getExtraParameters(Locale locale)
          Gets extra parameters for the attribute
 Collection<AttributeTypeParameter> getExtraParametersValues(Locale locale, int nAttributeId)
          Gets extra parameters values for the attribute
 String getModifyFormHtml(DocumentAttribute attribute, Document document, Locale locale, String strBaseUrl)
          Gets the part of an HTML form to modify attribute data
 String getModifyParametersFormHtml(Locale locale, int nAttributeId)
          Gets the part of an HTML form to modify parameters data
protected  Map<String,List<String>> getParameters(int nAttributeId, Locale locale)
          Get parameters map
 List<AttributeTypeParameter> getValueParameters(javax.servlet.http.HttpServletRequest request, Locale locale)
          Get the value parameters
 void setAttributeTypeCode(String strCode)
          Define the attribute Type code
 String validateValue(int nAttributeId, String strValue, Locale locale)
          Validate the value for the attribute
 String validateValueParameters(List<AttributeTypeParameter> listParameters, Locale locale)
          Validate the value for the parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultManager

public DefaultManager()
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:
getCreateFormHtml in interface AttributeManager
Parameters:
attribute - The attribute
locale - The current Locale
strBaseUrl - 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:
getModifyFormHtml in interface AttributeManager
Parameters:
attribute - The attribute
document - The attribute document
locale - The current Locale
strBaseUrl - 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:
getCreateParametersFormHtml in interface AttributeManager
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:
getCreateParametersFormHtml in interface AttributeManager
Parameters:
listParameters - list attribute type parameters
locale - The current Locale
Returns:
A part of the HTML form

getModifyParametersFormHtml

public String getModifyParametersFormHtml(Locale locale,
                                          int nAttributeId)
Gets the part of an HTML form to modify parameters data

Specified by:
getModifyParametersFormHtml in interface AttributeManager
Parameters:
locale - The current Locale
nAttributeId - Attribute Id
Returns:
A part of the HTML form

getExtraParameters

public List<AttributeTypeParameter> getExtraParameters(Locale locale)
Gets extra parameters for the attribute

Specified by:
getExtraParameters in interface AttributeManager
Parameters:
locale - The current Locale
Returns:
A collection of attribute parameters

getExtraParametersValues

public Collection<AttributeTypeParameter> getExtraParametersValues(Locale locale,
                                                                   int nAttributeId)
Gets extra parameters values for the attribute

Specified by:
getExtraParametersValues in interface AttributeManager
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:
setAttributeTypeCode in interface AttributeManager
Parameters:
strCode - The Attribute Type Code

getAttributeTypeCode

public String getAttributeTypeCode()
Return the attribute Type code

Specified by:
getAttributeTypeCode in interface AttributeManager
Returns:
The Attribute Type Code

validateValue

public String validateValue(int nAttributeId,
                            String strValue,
                            Locale locale)
Validate the value for the attribute

Specified by:
validateValue in interface AttributeManager
Parameters:
nAttributeId - The attribute identifier
strValue - The value to check
locale - 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:
validateValueParameters in interface AttributeManager
Parameters:
listParameters - The list of parameters to check
locale - 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:
getAttributeXmlValue in interface AttributeManager
Parameters:
document - The document
attribute - 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 of
locale - The locale
Returns:
The list of parameters

canBeUsedAsThumbnail

public boolean canBeUsedAsThumbnail()
Tells if the attrubute can be used as Thumbnail (image)

Specified by:
canBeUsedAsThumbnail in interface AttributeManager
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:
getValueParameters in interface AttributeManager
Parameters:
request - the HTTP request
locale - the locale
Returns:
a list of AttributeTypeParameter

getParameters

protected Map<String,List<String>> getParameters(int nAttributeId,
                                                 Locale locale)
Get parameters map

Parameters:
nAttributeId - the attribute identifier
locale - The current locale
Returns:
a map of parameters


Copyright © 2013 Mairie de Paris. All Rights Reserved.