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 java.lang.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)
 java.util.Collection<AttributeTypeParameter> getAttributeParametersValues(int nAttributeId, java.util.Locale locale)
          Gets parameters values for the attribute
 java.lang.String getAttributeTypeCode()
          Return the attribute Type code
 java.lang.String getAttributeXmlValue(Document document, DocumentAttribute attribute)
          Get the XML data corresponding to the attribute to build the document XML content
 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
 java.lang.String getCreateParametersFormHtml(java.util.Locale locale)
          Gets the part of an HTML form to enter parameters data
 java.util.List<AttributeTypeParameter> getExtraParameters(java.util.Locale locale)
          Gets extra parameters for the attribute
 java.util.Collection<AttributeTypeParameter> getExtraParametersValues(java.util.Locale locale, int nAttributeId)
          Gets extra parameters values for the attribute
 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
 java.lang.String getModifyParametersFormHtml(java.util.Locale locale, int nAttributeId)
          Gets the part of an HTML form to modify parameters data
 void setAttributeTypeCode(java.lang.String strCode)
          Define the attribute Type code
 java.lang.String validateValue(int nAttributeId, java.lang.String strValue, java.util.Locale locale)
          Validate the value for the attribute
 java.lang.String validateValueParameters(java.util.List<AttributeTypeParameter> listParameters, java.util.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 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:
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 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:
getModifyFormHtml in interface AttributeManager
Parameters:
attribute - The attribute
document - The Document Object
locale - The current Locale
strBaseUrl - 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:
getCreateParametersFormHtml in interface AttributeManager
Parameters:
locale - The current Locale
Returns:
A part of the HTML form

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:
getModifyParametersFormHtml in interface AttributeManager
Parameters:
locale - The current Locale
nAttributeId - Attribute Id
Returns:
A part of the HTML form

getExtraParameters

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

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

getExtraParametersValues

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

Specified by:
getExtraParametersValues in interface AttributeManager
Parameters:
locale - The current Locale
nAttributeId - The attribute identifier
Returns:
a list of parameters

setAttributeTypeCode

public void setAttributeTypeCode(java.lang.String strCode)
Define the attribute Type code

Specified by:
setAttributeTypeCode in interface AttributeManager
Parameters:
strCode - The Attribute Type Code

getAttributeTypeCode

public java.lang.String getAttributeTypeCode()
Return the attribute Type code

Specified by:
getAttributeTypeCode in interface AttributeManager
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:
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 java.lang.String validateValueParameters(java.util.List<AttributeTypeParameter> listParameters,
                                                java.util.Locale locale)
Validate the value for the parameters

Specified by:
validateValueParameters in interface AttributeManager
Parameters:
listParameters - The list of parameters to check
locale - The current 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 document XML content

Specified by:
getAttributeXmlValue in interface AttributeManager
Parameters:
document - The document
attribute - The attribute
Returns:
The XML value of the attribute

getAttributeParametersValues

public java.util.Collection<AttributeTypeParameter> getAttributeParametersValues(int nAttributeId,
                                                                                 java.util.Locale locale)
Gets parameters values for the attribute

Parameters:
nAttributeId - The attribute Id
locale - The current Locale
Returns:
Collection list of attribute type 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


Copyright © 2010 Mairie de Paris. All Rights Reserved.