com.jalios.jcms
Class Data

java.lang.Object
  extended by com.jalios.jstore.BasicStorable
      extended by com.jalios.jcms.Data
All Implemented Interfaces:
JcmsConstants, ImportConstants, MashupConstants, Storable, JaliosConstants, LangPropertyArgument, Cloneable, Comparable<BasicStorable>
Direct Known Subclasses:
AccessControlList, Category, DataExtension, DataRight, FileProcessingInfo, FileProcessingLog, Group, Member, Notification, NotificationCriteria, Publication, PublicationFollower, ReaderTracker, StrongLock, WFNote, WKRole, Workspace, WSTypeEntry

public abstract class Data
extends BasicStorable
implements JcmsConstants, ImportConstants, LangPropertyArgument

This abstract class is the super class of all the persistent classes of a JCMS Channel.

Version:
$Revision: 68424 $
Author:
Olivier Dedieu , Olivier Jaquemet

Nested Class Summary
static class Data.AuthorComparator<T extends Data>
           
static class Data.AuthorSelector
           
static class Data.CdateSelector
          DataSelector to select Data which have a creation date between the given begin and end Date.
static class Data.DataNameComparator<T extends Data>
          This comparator compares two Data using their Data Name.
static class Data.DeletableSelector
          DataSelector to select Data that can be deleted (i.e.
static class Data.ImportSelector
          DataSelector to select Data which have been imported.
static class Data.MdateSelector
          DataSelector to select Data which have a modification date between the given begin and end Date.
static class Data.OpAuthorComparator<T extends Data>
           
static class Data.RowIdComparator<T extends Data>
           
static class Data.StrongLockSelector
          DataSelector selecting only Data having a strong lock (isStrongLocked()).
 
Nested classes/interfaces inherited from class com.jalios.jstore.BasicStorable
BasicStorable.CdateComparator<T extends Storable>, BasicStorable.IdComparator<T extends Storable>, BasicStorable.MdateComparator<T extends Storable>
 
Field Summary
protected  Member author
           
protected  String authorDBID
           
protected static Channel channel
           
static String DISPLAY_URL_EXTRA_INFO
          Extra info to key to override default display URL String.
protected  DataExtension extension
           
protected  HashMap<String,String> extraDataMap
           
protected  Map<String,String> extraDBDataMapToSaveOnOp
           
protected  HashMap<String,Object> importMap
           
protected  Member opAuthor
           
protected  Member opDelegate
           
static String REVISION
           
 
Fields inherited from class com.jalios.jstore.BasicStorable
cdate, ddate, id, mdate, store
 
Fields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_DEEP_COPY, OP_DEEP_DELETE, OP_DELETE, OP_MERGE, OP_UPDATE, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
 
Fields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
 
Fields inherited from interface com.jalios.jcms.mashup.ImportConstants
IMPORT_ALARM_MGR, IMPORT_AUTHOR_PROP, IMPORT_CATEGORY_DEFAULT, IMPORT_DC_ATTR, IMPORT_DC_STEP, IMPORT_DIR, IMPORT_ENABLED, IMPORT_JDOM_ELEMENT, IMPORT_LOG_FILE, IMPORT_LOG_MAX, IMPORT_OPTIONS, IMPORT_OPTIONS_DC_CONTEXT, IMPORT_ROOT_PROP, IMPORT_SOURCE_FILE, IMPORT_SOURCE_PREFIX_PROP, IMPORT_SOURCES_DIR, IMPORT_STEP_CLEAN, IMPORT_STEP_IMPORT, IMPORT_STEP_UPDATE_REF, IMPORT_WS_PROP
 
Fields inherited from interface com.jalios.jcms.mashup.MashupConstants
DATA_TAG, DATASET_TAG, FIELD_CLASS, FIELD_ENTRY, FIELD_ITEM, FIELD_KEY, FIELD_NAME, FIELD_TAG, FIELD_VALUE, FILE_FIELD, FILE_ID, FILE_MTIME, FILE_SIZE, FILE_TAG, FILE_TICKET, FILESET_TAG, RELATED_TAG
 
Constructor Summary
Data()
           
Data(Data other)
           
Data(Member author, DataExtension extension)
           
 
Method Summary
 boolean canRequestLock(Member mbr)
          Returns true if the given member can request the lock (by mail).
 ControllerStatus checkCreate(Member mbr)
          Checks if the creation can be performed
 ControllerStatus checkCreate(Member mbr, Map context)
          Checks if the creation can be performed
 ControllerStatus checkDelete(Member mbr)
          Checks if the deletion can be performed
 ControllerStatus checkDelete(Member mbr, Map context)
          Checks if the deletion can be performed
 ControllerStatus checkIntegrity()
          Checks whether or not data integrity constraints are respected.
 ControllerStatus checkIntegrity(Map context)
          Checks whether or not data integrity constraints are respected.
 boolean checkLockMember(Member mbr)
          Returns true if the given member has locked the given data or if the data is not locked.
 ControllerStatus checkMember(int op, Member mbr, Map context)
          Checks if the given member can perform the given operation.
 boolean checkStrongLockMember(Member mbr)
          Check if the specified member has locked this Data or if the Data is not locked.
 ControllerStatus checkUpdate(Member mbr)
          Checks if the update can be performed
 ControllerStatus checkUpdate(Member mbr, Map context)
          Checks if the update can be performed
 ControllerStatus checkWrite(int op, Member mbr, boolean checkIntegrity, Map context)
          Checks if the given write operation can be performed
 Object clone()
           
protected  String[] computeDBIDArray(Data[] array)
          Extract the DBData from the given array and return an array of identifier of those DBData.
 String exportXml()
          Returns the XML export this data.
 String exportXml(String[] relateds)
          Returns the XML export this data.
 StringBuffer exportXml(StringBuffer sb, String[] relateds)
          Fill the given StringBuffer with the XML export this data.
 StringBuffer exportXml(StringBuffer sb, String[] relateds, int indentLevel)
          Fill the given StringBuffer with the XML export this data.
 void exportXmlField(StringBuffer sb, int indentLevel)
          Fills the given StringBuffer with Xml export of fields of this data.
 void exportXmlRelated(StringBuffer sb, String[] relateds, int indentLevel)
          Fills the given StringBuffer with Xml export of related of this data.
protected  void exportXmlRelated(StringBuffer sb, String related, int indentLevel)
           
 void fillExportXmlFieldAttributes(StringBuffer sb)
          Fill the given string buffer with specific attributes of this data.
 TreeSet getAllReferrerSet()
          Return all the referrers of this data
 TreeSet getAllReferrerSet(Class referrerClass)
          Return all the referrers of this data, instance of the given class
static TypeFieldEntry[] getAllTypeFieldEntry()
          Return an array of TypeFieldEntry bound to Data.
 Member getAuthor()
          Returns the author of this Data.
 Member getAuthor(boolean queryDB)
          Returns the author of this Data.
static
<T extends Data>
Comparator<T>
getAuthorComparator(Comparator<Member> memberComparator)
           
 String getAuthorDBID()
          Returns a JCMS ID of the author if it is persisted in the DB.
 String getAuthorId()
          Returns the JStore ID of the author (only for DBData)
static DataSelector getAuthorSelector(Member author)
           
 boolean getBooleanFieldValue(JcmsJspContext ctxt, String fieldName)
          Gets the boolean value of the specified field name for this Data.
 boolean getBooleanFieldValue(String fieldName)
          Gets the value of the given boolean field name for the current Data.
static
<T extends Data>
Comparator<T>
getCaddyComparator()
           
 TreeSet<Category> getCategoryFieldValue(JcmsJspContext ctxt, String fieldName)
          Gets the Category value of the specified field name for this Data.
 TreeSet getCategoryFieldValue(String fieldName, Member mbr)
          Gets the value of the given Category field name for the current Data.
static Data.CdateSelector getCdateSelector(Date begin, Date end)
           
static
<T extends Data>
Comparator<T>
getComparator(String str, boolean reverse)
          Deprecated. use ComparatorManager
static String getCSVHeader(String lang)
          Returns the CSV header of this object
 String getDataImage()
          Retrieves the image path of this data in the channel's main language.
 String getDataImage(String lang)
          Retrieves the image path of this data in the specified language.
 String getDataImage(String lang, boolean useDefault)
          Retrieves the image path of this data.
 String getDataName(String language)
          Return the name of this Data, every sub class Data which will be displayed to user should implements this method already.
static
<T extends Data>
Comparator<T>
getDataNameComparator(String language)
           
 Date getDate(String dateType)
          Return the date corresponding to the given parameter : date/cdate, mdate or null if nothing match or the matching date is null.
 Date getDate(String dateType, Date defaultDate)
          Return the date corresponding to the given parameter : date/cdate, mdate, or null if nothing match or the matching date is null.
static DataSelector getDateSelector(String str, Date begin, Date end)
          Retrieves a new DataSelector given a name representing it.
static DataSelector getDeletableSelector(Member opAuthor)
           
 String getDisplayLink(Locale locale)
          Retrieve an HTML a tag suitable to display this Data
 String getDisplayLink(Locale locale, String baseURL, String params, String anchor, String title, String accessibilityInfo, String css, String htmlAttributes)
          Retrieve an HTML a tag suitable to display this Data
 String getDisplayUrl(Locale locale)
          Return the URL to access this data in the front office.
 double getDoubleFieldValue(JcmsJspContext ctxt, String fieldName)
          Gets the double value of the specified field name for this Data.
 double getDoubleFieldValue(String fieldName)
          Gets the value of the given double field name for the current Data.
 String getExportXmlDataValue()
          Returns a string representation of this data used by exportXml().
 DataExtension getExtension()
          Get the value of extension.
 String getExtraData(String name)
          Returns the value of the named extra data as an String, or null if no extra info of the given name exists.
 HashMap<String,String> getExtraDataMap()
          Returns a java.util.Map of the extra infos of this results.
 String getExtraDBData(String name)
          Returns the value of the named extra data as an String, or null if no extra info of the given name exists.
 Map<String,String> getExtraDBDataMap()
          Returns a java.util.Map of the extra infos of this results.
 Object getExtraInfo(String name)
          Returns the value of the named extra info as an Object, or null if no extra info of the given name exists.
 Map<String,Object> getExtraInfoMap()
          Returns a java.util.Map of the extra infos of this results.
 Map<String,FieldStatus> getFieldStatusMap(Member mbr)
          Returns the FieldStatus map of this data for the given member (currently only works for Publication).
 Object getFieldValue(JcmsJspContext ctxt, String fieldName)
          Gets the value of the given Object field name for this Data.
 Object getFieldValue(String fieldName)
          Gets the value of the given Object field name for the current Data.
 Object getFieldValue(String fieldName, String lang)
          Gets the value of the given Object field name for the current Data.
 Object getFieldValue(String fieldName, String lang, boolean useDefault)
          Gets the value of the given Object field name for the current Data.
 String getGenericThumbnail()
          Returns a generic thumbnail for this Data as defined by properties data.thumb.{short-class-name}.
 String getImportAuthor()
          Get the value of importAuthor.
 String getImportBatch()
          Get the value of importBatch.
 Date getImportDate()
          Get the value of importDate.
 String getImportDisplayUrl()
          Get the value of importDisplayUrl.
 String getImportId()
          Get the value of importId.
 HashMap<String,Object> getImportMap()
          Get the value of importMap.
 Date getImportMdate()
          Get the value of importMdate.
static DataSelector getImportSelector()
           
 String getImportSignature()
          Get the value of importSignature.
 String getImportSource()
          Get the value of importSource.
 String getImportSourceUrl()
          Get the value of importSourceUrl.
 String getImportUrl()
          Returns the import URL of this publication, i.e.
 int getIntFieldValue(JcmsJspContext ctxt, String fieldName)
          Gets the integer value of the specified field name for this Data.
 int getIntFieldValue(String fieldName)
          Gets the value of the given int field name for the current Data.
 String getLangPropertyValue(String language)
          Retrieve the string value of this object in the specified language, when being used inside a language property.
 int getLinkCount()
           
<T> TreeSet<T>
getLinkIndexedDataSet(Class<T> clazz)
          Returns the Set of clazz instances referring this data
<T> TreeSet<T>
getLinkIndexedDataSet(Class<T> clazz, String field)
          A convenient method which returns the Set of clazz instances referring this data with a given field.
 Date getLockDate()
          Returns the lock date.
 String getLockInfo(String userLang, Locale userLocale, boolean confirm)
          Returns an information message about the lock state.
 Member getLockMember()
          Return the member who locked this data
 long getLongFieldValue(JcmsJspContext ctxt, String fieldName)
          Gets the long value of the specified field name for this Data.
 long getLongFieldValue(String fieldName)
          Gets the value of the given long field name for the current Data.
static Data.MdateSelector getMdateSelector(Date begin, Date end)
           
 TreeMap<String,String> getNewDefaultExtraDataMap(boolean shortKey)
          Returns a LangProperties representing the Extra Data description and default values.
static TreeMap<String,String> getNewDefaultExtraDataMap(Class<? extends Data> clazz, boolean shortKey)
          Deprecated.  
static TreeMap<String,String> getNewDefaultExtraDataMap(Class<? extends Data> clazz, String suffix, boolean shortKey)
          Returns a TreeMap representing the Extra Data description and default value.
static TreeMap<String,String> getNewDefaultExtraDataMap(Class<? extends Data> clazz, String suffix, boolean shortKey, boolean useSuperClasses)
          Returns a TreeMap representing the Extra Data description and default value.
 TreeMap<String,String> getNewDefaultExtraDBDataMap(boolean shortKey)
          Returns a LangProperties representing the Extra Data description and default values.
static TreeMap<String,String> getNewDefaultExtraDBDataMap(Class<? extends Data> clazz, boolean shortKey)
          Deprecated.  
static TreeMap<String,String> getNewDefaultExtraDBDataMap(Class<? extends Data> clazz, String suffix, boolean shortKey)
          Returns a TreeMap representing the Extra Data description and default value.
static TreeMap<String,String> getNewDefaultExtraDBDataMap(Class<? extends Data> clazz, String suffix, boolean shortKey, boolean useSuperClasses)
          Returns a TreeMap representing the Extra Data description and default value.
 Member getOpAuthor()
          Get the value of opAuthor.
static
<T extends Data>
Comparator<T>
getOpAuthorComparator(Comparator<Member> memberComparator)
           
 Member getOpDelegate()
          Retrieves the Member who is really doing the operation (through right delegation) as opposed to the opAuthor, who is the Member having the right to do it.
 Long getRowId()
          Returns the value of rowId (DBData ID).
static
<T extends Data>
Comparator<T>
getRowIdComparator()
           
 StrongLock getStrongLock()
          Returns the StrongLock bound to this Data, if any.
 Date getStrongLockDate()
          Returns the date of the strong lock.
 String getStrongLockInfo(Locale locale)
          Returns a string which explains who has the lock (return "" if this Data has no strong lock)
 Member getStrongLockMember()
          Returns the member who has strongly locked this Data.
static DataSelector getStrongLockSelector()
          Retrieves a new instance of DataSelector based on the strong lock status of the data.
static TypeEntry getTypeEntry()
          Returns the TypeEntry bound to Data.
static TypeFieldEntry[] getTypeFieldsEntries()
          Return an array of TypeFieldEntry bound to Data.
 Data getUpdateInstance()
          Returns an instance of this object to update it.
 int hashCode()
          This method return the HashCode of a storable using the storable id's hashcode if id is not null.
 void importXml(org.jdom.Element elt, ImportOptions options)
          Fill this data with the values contains in the JDOM element.
protected  void importXmlFieldsWithReferences(org.jdom.Element elt, ImportOptions options)
           
 void importXmlFiles(Map fieldFileMap, ImportOptions options)
           
 void importXmlReferences(org.jdom.Element elt, ImportOptions options)
          Resolves imported references for this data.
 void initializeDBDataCollections()
          This methods force the collections of the DBData to be initialized()
 boolean isDBData()
          Returns true if this objet is an instance of DBData.
 boolean isImported()
          Returns true if this data has been imported.
 boolean isImportUpdated()
          Get the value of isImportUpdated.
 boolean isInDatabase()
          Returns true if this data is stored in the database (false if it is stored in JStore).
 boolean isLocked()
          Returns true if this data is locked.
 boolean isPersisted()
          Returns true if this data has been persisted (either in JStore or in the database).
 boolean isStrongLocked()
          Check if this data is strongly locked.
 void lock(Member mbr)
          Locks this data for a given member.
 void markNewImport()
          Internal method used to mark an imported data.
protected
<T extends Data>
T[]
mergeHybridLink(Class<T> clazz, T[] storableArray, String[] dbidArray)
          Returns the merge from the given array of storable with the given array of DBID.
protected  void performAfterWrite(int op, Member mbr, Map context)
          Called to perform some action after the write.
protected  void performBeforeWrite(int op, Member mbr, Map context)
          Called to perform some action before the write.
 void performCreate(Member mbr)
          Performs data creation.
 void performCreate(Member mbr, Map context)
          Performs data creation.
 void performDelete(Member mbr)
          Performs data deletion.
 void performDelete(Member mbr, Map context)
          Performs data deletion.
 void performUpdate(Member mbr)
          Performs data update.
 void performUpdate(Member mbr, Map context)
          Performs data update.
 void prepareUpdateContext(Map context)
           
 void printDataName(StringBuilder sb, Locale locale, String accessibilityInfo)
          Print the data name in the specified StringBuilder.
 void printDisplayLinkEnd(StringBuilder sb)
          Print closing tag </a>.
 void printDisplayLinkStart(StringBuilder sb, Locale locale, String baseURL, String params, String anchor, String title, String accessibilityInfo, String css, String htmlAttributes, javax.servlet.http.HttpServletRequest request, boolean update, String[] paramNames, String[] paramValues, String[] paramRemove)
          Print opening tag <a...
 void printDisplayUrl(StringBuilder sb, Locale locale, String baseURL, String params, String anchor)
          Prints URL using parameter of this tag.
 void printDisplayUrl(StringBuilder sb, Locale locale, String baseURL, String params, String anchor, javax.servlet.http.HttpServletRequest request, boolean update, String[] paramNames, String[] paramValues, String[] paramRemove)
          Prints URL using parameter of this tag.
 void putStrongLock(Member mbr)
          Put (and save) a strong lock on this Data.
 void releaseStrongLock()
          Releases the strong lock, without checking the member.
 void releaseStrongLock(Member mbr)
          Release the lock on this Data
 String removeExtraData(String name)
          Removes an extra data from this Data.
 String removeExtraDBData(String name)
          Removes an extra data from this Data.
 Object removeExtraInfo(String name)
          Removes an extra information from this Data.
 void setAuthor(Member v)
          Sets the author of this Data
 void setAuthorDBID(String v)
          Sets the authorDBID of this Data.
 void setAuthorId(String authordId)
          Sets the JStore ID of the author (only for DBData).
 void setBooleanFieldValue(String fieldName, boolean value)
          Sets the value of the given boolean field name for the current Data.
 void setCategoryFieldValue(String fieldName, TreeSet value)
          Sets the value of the given Category field name for the current Data.
 void setDoubleFieldValue(String fieldName, double value)
          Sets the value of the given double field name for the current Data.
 void setExtension(DataExtension v)
          Set the value of extension.
 String setExtraData(String name, String value)
          Stores an extra data in this Data.
 void setExtraDataMap(HashMap<String,String> extraDataMap)
          Override the current extraDataMap with the given one
 String setExtraDBData(String name, String value)
          Stores an extra data in this Data.
 void setExtraDBDataMap(Map<String,String> extraDBDataMap)
          Override the current extraDBDataMap with the given one
 void setExtraDBDataMap(Map<String,String> extraDBDataMap, boolean inMemoryOnly)
          Override the current extraDBDataMap with the given one
 Object setExtraInfo(String name, Object obj)
          Stores an extra information in this Data.
 void setFieldValue(String fieldName, Object value)
          Sets the value of the given Object field name for the current Data.
 void setFieldValue(String fieldName, Object value, String lang)
          Sets the value of the given Object field name for the current Data.
 void setImportAuthor(String v)
          Set the value of importAuthor.
 void setImportBatch(String v)
          Set the value of importBatch.
 void setImportDate(Date v)
          Set the value of importDate.
 void setImportDisplayUrl(String v)
          Set the value of importAuthor.
 void setImportId(String v)
          Set the value of importId.
 void setImportMap(HashMap<String,Object> v)
          Set the value of importMap.
 void setImportMdate(Date v)
          Set the value of importMdate.
 void setImportSignature(String v)
          Set the value of importSignature.
 void setImportSource(String v)
          Set the value of importSource.
 void setImportSourceUrl(String v)
          Set the value of importSourceUrl.
 void setImportUpdated(boolean v)
          Set the value of isImportUpdated.
 void setIntFieldValue(String fieldName, int value)
          Sets the value of the given int field name for the current Data.
 void setLongFieldValue(String fieldName, long value)
          Sets the value of the given long field name for the current Data.
 void setMdate(Date v)
          Set the value of mdate
 void setOpAuthor(Member v)
          Set the value of opAuthor.
 void setOpDelegate(Member mbr)
          Defines the Member who is really doing the operation (through right delegation) as opposed to the opAuthor, who is the Member having the right to do it.
 void setRowId(Long rowId)
          Sets the value of rowId (DBData ID).
 String toCSV(String lang)
          Returns a CSV view of this object
 String toFullString()
           
 String toString()
           
 void unlock()
          Unlocks this data.
 void unlock(Member mbr)
          Unlocks this data if lock has been put by the given member.
 void unmarkNewImport()
          Internal method used to unmark an imported data.
 void updateExtraDataMap(String[] keys, String[] values)
          Update editable ExtraDBData of this data with the updated/new specified key/value
 void updateExtraDBDataMap(String[] keys, String[] values)
          Update editable ExtraDBData of this data with the updated/new specified key/value
protected  void updateIndexTreeSet(String indexName, Object obj, boolean add)
          Update the given index.

When used inside a StoreListener, in the method StoreListener.handleCommitUpdate(com.jalios.jstore.Storable, com.jalios.jstore.Storable, boolean), the oldStorable can be given as a parameter of this method to remove it from the index, Indeed removing old object from TreeSet or HashSet index works because both object are the same when compared using BasicStorable.compareTo(BasicStorable) or BasicStorable.hashCode() methods.
 
Methods inherited from class com.jalios.jstore.BasicStorable
clearId, compareTo, equals, getAttribute, getAttributes, getCdate, getCdateComparator, getDdate, getId, getIdComparator, getMdate, getMdateComparator, getStore, getUrid, hasBeenUpdated, isStored, resolveAtt, resolveVal, setAttributes, setCdate, setDdate, setId, setStore, toXml
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

channel

protected static final Channel channel

DISPLAY_URL_EXTRA_INFO

public static final String DISPLAY_URL_EXTRA_INFO
Extra info to key to override default display URL String.

Use your custom display URL String as the value (need to be done only once).

Example :

data.setExtraInfo(Data.DISPLAY_URL_EXTRA_INFO, "customDisplay.jsp?id=" + data.getId());
Later, any invokation of data.getDisplayUrl() returns "customDisplay.jsp?id=...".

See Also:
Constant Field Values

author

protected Member author

authorDBID

protected String authorDBID

opAuthor

protected Member opAuthor

opDelegate

protected Member opDelegate

extension

protected DataExtension extension

importMap

protected HashMap<String,Object> importMap

extraDataMap

protected HashMap<String,String> extraDataMap

extraDBDataMapToSaveOnOp

protected transient Map<String,String> extraDBDataMapToSaveOnOp
Constructor Detail

Data

public Data()

Data

public Data(Member author,
            DataExtension extension)

Data

public Data(Data other)
Method Detail

getDataName

public String getDataName(String language)
Return the name of this Data, every sub class Data which will be displayed to user should implements this method already.
Can be seen as a smart multi-language toString(), but never returning null.
Default behaviour is to return toFullString() of Data or empty string if toFullString is null.

Parameters:
language - the language in which to return the name if multilang available for the data.
Returns:
a String, MUST NOT return null.

getLangPropertyValue

public String getLangPropertyValue(String language)
Retrieve the string value of this object in the specified language, when being used inside a language property.

This method is the implementation of LangPropertyArgument.getLangPropertyValue(String) for automatic translation of Object in language properties.
You should not invoke this method directly, use getDataName(String) instead.

Specified by:
getLangPropertyValue in interface LangPropertyArgument
Parameters:
language - the ISO-639 language code to be used to retrieve the localized Object's name
Returns:
this object as a string value in the specified language

getDataImage

public String getDataImage()
Retrieves the image path of this data in the channel's main language.

This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
Default behaviour is to return empty string.

Returns:
a path relative to the webapp root.
Since:
jcms-6.0.0

getDataImage

public String getDataImage(String lang,
                           boolean useDefault)
Retrieves the image path of this data.

This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
Default behaviour is to return empty string.

Parameters:
lang - the user language (ISO-639 language code)
useDefault - should the default language be used if no value is found for the specified language
Returns:
a path relative to the webapp root.
Since:
jcms-6.0.0

getDataImage

public String getDataImage(String lang)
Retrieves the image path of this data in the specified language.

Parameters:
lang - the user language (ISO-639 language code)
Returns:
a path relative to the webapp root.
Since:
jcms-6.0.0

getGenericThumbnail

public String getGenericThumbnail()
Returns a generic thumbnail for this Data as defined by properties data.thumb.{short-class-name}.

If no property was defined for the class of this Data, the thumbnail specified in property data.thumb.unknown is used.

FileDocument uses its own implementation, see FileDocument.getGenericThumbnail().

Returns:
a thumbnail path relative to the webapp root, eg images/jalios/icons/data/article.gif
Since:
jcms-6.1.1

toString

public String toString()
Overrides:
toString in class Object

toFullString

public String toFullString()

toCSV

public String toCSV(String lang)
Returns a CSV view of this object

Parameters:
lang - the output language
Returns:
a CSV view of this object
Since:
jcms-5.0.0

getCSVHeader

public static String getCSVHeader(String lang)
Returns the CSV header of this object

Parameters:
lang - the output language
Returns:
the CSV header of this object
Since:
jcms-5.0.0

updateIndexTreeSet

protected void updateIndexTreeSet(String indexName,
                                  Object obj,
                                  boolean add)
Update the given index.

When used inside a StoreListener, in the method StoreListener.handleCommitUpdate(com.jalios.jstore.Storable, com.jalios.jstore.Storable, boolean), the oldStorable can be given as a parameter of this method to remove it from the index, Indeed removing old object from TreeSet or HashSet index works because both object are the same when compared using BasicStorable.compareTo(BasicStorable) or BasicStorable.hashCode() methods.

Parameters:
obj - the object to be added or removed
add - add if true, remove if false
Since:
jcms-5.0.1

getLinkIndexedDataSet

public <T> TreeSet<T> getLinkIndexedDataSet(Class<T> clazz)
Returns the Set of clazz instances referring this data

Type Parameters:
T - class of wanted objects
Parameters:
clazz - the class to search the referring instances
Returns:
a TreeSet of Data
Since:
jcms-3.0

getLinkIndexedDataSet

public <T> TreeSet<T> getLinkIndexedDataSet(Class<T> clazz,
                                            String field)
A convenient method which returns the Set of clazz instances referring this data with a given field. (it delegates on channel.getLinkIndexedDataSet(this, clazz, field))

Type Parameters:
T - class of wanted objects
Parameters:
clazz - the class to search the referring instances
field - the name of the field which contains the reference
Returns:
TreeSet
Since:
jcms-4.1

getLinkCount

public int getLinkCount()
Returns:
the number of instances referring this data
Since:
jcms-3.0

getAllReferrerSet

public TreeSet getAllReferrerSet(Class referrerClass)
Return all the referrers of this data, instance of the given class

Parameters:
referrerClass - the class to search the referring instances
Returns:
TreeSet
Since:
jcms-4.1

getAllReferrerSet

public TreeSet getAllReferrerSet()
Return all the referrers of this data

Returns:
TreeSet
Since:
jcms-4.1

fillExportXmlFieldAttributes

public void fillExportXmlFieldAttributes(StringBuffer sb)
Fill the given string buffer with specific attributes of this data.

Parameters:
sb - the StringBuffer
Since:
jcms-5.7.1

getExportXmlDataValue

public String getExportXmlDataValue()
Returns a string representation of this data used by exportXml().

Returns:
a string representation of this data used by exportXml().
Since:
jcms-5.7.2

importXml

public void importXml(org.jdom.Element elt,
                      ImportOptions options)
Fill this data with the values contains in the JDOM element.

Parameters:
elt - the JDOM element
options - the ImportOptions
Since:
jcms-5.7.0

importXmlReferences

public void importXmlReferences(org.jdom.Element elt,
                                ImportOptions options)
Resolves imported references for this data.

Parameters:
elt - the JDOM element
options - the ImportOptions
Since:
jcms-6.0.0

importXmlFieldsWithReferences

protected void importXmlFieldsWithReferences(org.jdom.Element elt,
                                             ImportOptions options)

importXmlFiles

public void importXmlFiles(Map fieldFileMap,
                           ImportOptions options)

exportXml

public String exportXml()
Returns the XML export this data.

Returns:
the XML export for the given data. The returned String does not contain the XML declaration ().
Since:
jcms-5.7.2

exportXml

public String exportXml(String[] relateds)
Returns the XML export this data.

Parameters:
relateds - possible relateds to be added to the export
Returns:
the XML export for the given data. The returned String does not contain the XML declaration ().
Since:
jcms-5.7.2

exportXml

public StringBuffer exportXml(StringBuffer sb,
                              String[] relateds)
Fill the given StringBuffer with the XML export this data. The StringBuffer does not contain the XML declaration ().

Parameters:
sb - the StringBuffer
relateds - possible relateds to be added to the export
Returns:
the given in parameter sb parameter with content added
Since:
jcms-5.7.2

exportXml

public StringBuffer exportXml(StringBuffer sb,
                              String[] relateds,
                              int indentLevel)
Fill the given StringBuffer with the XML export this data. The StringBuffer does not contain the XML declaration ().

Parameters:
sb - the StringBuffer.
relateds - possible relateds to be added to the export
indentLevel - indentation level to be used.
Returns:
the given in parameter sb parameter with content added
Since:
jcms-5.7.2

exportXmlField

public void exportXmlField(StringBuffer sb,
                           int indentLevel)
Fills the given StringBuffer with Xml export of fields of this data.

Parameters:
sb - the StringBuffer
indentLevel - the indent level
Since:
jcms-5.7.2

exportXmlRelated

public void exportXmlRelated(StringBuffer sb,
                             String[] relateds,
                             int indentLevel)
Fills the given StringBuffer with Xml export of related of this data. Related are data computed or stored in memory (index), but not persisted as is. Only invoked related are given (through relateds parameter).

Parameters:
sb - the StringBuffer
relateds - possible relateds to be added to the export
indentLevel - the indent level
Since:
JCMS-6.1

exportXmlRelated

protected void exportXmlRelated(StringBuffer sb,
                                String related,
                                int indentLevel)

isImported

public boolean isImported()
Returns true if this data has been imported.

Returns:
true if this data has been imported.
Since:
jcms-5.7.2

setMdate

public void setMdate(Date v)
Set the value of mdate

Specified by:
setMdate in interface Storable
Overrides:
setMdate in class BasicStorable
Parameters:
v - Value to assign to mdate.
Since:
jcms-5.7.2

markNewImport

public void markNewImport()
Internal method used to mark an imported data. Use with care.

Since:
jcms-5.7.2

unmarkNewImport

public void unmarkNewImport()
Internal method used to unmark an imported data. Use with care.

Since:
jcms-6.0.0

getImportMap

public HashMap<String,Object> getImportMap()
Get the value of importMap.

Returns:
Value of importMap.
Since:
jcms-5.7.2

setImportMap

public void setImportMap(HashMap<String,Object> v)
Set the value of importMap.

Parameters:
v - Value to assign to importMap.
Since:
jcms-5.7.2

getImportId

public String getImportId()
Get the value of importId.

Returns:
Value of importId.
Since:
jcms-5.7.2

setImportId

public void setImportId(String v)
Set the value of importId.

Parameters:
v - Value to assign to importId.
Since:
jcms-5.7.2

getImportDate

public Date getImportDate()
Get the value of importDate.

Returns:
Value of importDate.
Since:
jcms-5.7.2

setImportDate

public void setImportDate(Date v)
Set the value of importDate.

Parameters:
v - Value to assign to importDate.
Since:
jcms-5.7.2

getImportMdate

public Date getImportMdate()
Get the value of importMdate.

Returns:
Value of importMdate.
Since:
jcms-5.7.2

setImportMdate

public void setImportMdate(Date v)
Set the value of importMdate.

Parameters:
v - Value to assign to importMdate.
Since:
jcms-5.7.2

getImportBatch

public String getImportBatch()
Get the value of importBatch.

Returns:
Value of importBatch.
Since:
jcms-5.7.2

setImportBatch

public void setImportBatch(String v)
Set the value of importBatch.

Parameters:
v - Value to assign to importBatch.
Since:
jcms-5.7.2

isImportUpdated

public boolean isImportUpdated()
Get the value of isImportUpdated.

Returns:
Value of isImportUpdated.
Since:
jcms-5.7.2

setImportUpdated

public void setImportUpdated(boolean v)
Set the value of isImportUpdated.

Parameters:
v - Value to assign to isImportUpdated.
Since:
jcms-5.7.2

getImportSignature

public String getImportSignature()
Get the value of importSignature.

Returns:
Value of importSignature.
Since:
jcms-5.7.2

setImportSignature

public void setImportSignature(String v)
Set the value of importSignature.

Parameters:
v - Value to assign to importSignature.
Since:
jcms-5.7.2

getImportSource

public String getImportSource()
Get the value of importSource.

Returns:
Value of importSource.
Since:
jcms-5.7.2

setImportSource

public void setImportSource(String v)
Set the value of importSource.

Parameters:
v - Value to assign to importSource.
Since:
jcms-5.7.2

getImportSourceUrl

public String getImportSourceUrl()
Get the value of importSourceUrl.

Returns:
Value of importSourceUrl.
Since:
jcms-5.7.2

setImportSourceUrl

public void setImportSourceUrl(String v)
Set the value of importSourceUrl.

Parameters:
v - Value to assign to importSourceUrl.
Since:
jcms-5.7.2

getImportAuthor

public String getImportAuthor()
Get the value of importAuthor.

Returns:
Value of importAuthor.
Since:
jcms-5.7.2

setImportAuthor

public void setImportAuthor(String v)
Set the value of importAuthor.

Parameters:
v - Value to assign to importAuthor.
Since:
jcms-5.7.2

getImportDisplayUrl

public String getImportDisplayUrl()
Get the value of importDisplayUrl.

Returns:
Value of importDisplayUrl.
Since:
jcms-5.7.2

setImportDisplayUrl

public void setImportDisplayUrl(String v)
Set the value of importAuthor.

Parameters:
v - Value to assign to importAuthor.
Since:
jcms-5.7.2

getImportUrl

public String getImportUrl()
Returns the import URL of this publication, i.e. the XML export URL of the original data.

Returns:
the import URL of this publication.
Since:
jcms-5.7.2

getAuthor

public Member getAuthor()
Returns the author of this Data. If the author is a DBMember it is loaded. This method must not be called before the database as been initialized (e.g. it must not be called by a StoreListener). The author returned by method must not be kept in data structures that are longer than the DB transaction (e.g. an index). In those cases, call getAuthor(false).

Returns:
the author of this Data.
See Also:
getAuthor(boolean)

getAuthor

public Member getAuthor(boolean queryDB)
Returns the author of this Data. If queryDB is true query the DB to find the author from authorDBID.

Parameters:
queryDB - indicates if the database must be re.
Returns:
the author of this Data.
Since:
jcms-6.1.0

setAuthor

public void setAuthor(Member v)
Sets the author of this Data

Parameters:
v - the author
Since:
jcms-6.1.0

getAuthorDBID

public String getAuthorDBID()
Returns a JCMS ID of the author if it is persisted in the DB.

Returns:
a JCMS ID.
Since:
jcms-6.1.0

setAuthorDBID

public void setAuthorDBID(String v)
Sets the authorDBID of this Data.

Parameters:
v - the authorDBID
Since:
jcms-6.1.0

getOpAuthor

public Member getOpAuthor()
Get the value of opAuthor.

Returns:
Value of opAuthor.
Since:
jcms-4.0

setOpAuthor

public void setOpAuthor(Member v)
Set the value of opAuthor.

Parameters:
v - Value to assign to opAuthor.
Since:
jcms-4.0

getOpDelegate

public Member getOpDelegate()
Retrieves the Member who is really doing the operation (through right delegation) as opposed to the opAuthor, who is the Member having the right to do it.

Returns:
Value of opDelegate.
Since:
jcms-5.7.0

setOpDelegate

public void setOpDelegate(Member mbr)
Defines the Member who is really doing the operation (through right delegation) as opposed to the opAuthor, who is the Member having the right to do it.

Parameters:
mbr - Value to assign to opDelegate.
Since:
jcms-5.7.0

getExtension

public DataExtension getExtension()
Get the value of extension.

Returns:
Value of extension.

setExtension

public void setExtension(DataExtension v)
Set the value of extension.

Parameters:
v - Value to assign to extension.

getDate

public Date getDate(String dateType)
Return the date corresponding to the given parameter : date/cdate, mdate or null if nothing match or the matching date is null.

Parameters:
dateType - the date type
Returns:
the date
Since:
jcms-4.0

getDate

public Date getDate(String dateType,
                    Date defaultDate)
Return the date corresponding to the given parameter : date/cdate, mdate, or null if nothing match or the matching date is null.

Parameters:
dateType - the date type
defaultDate - the default date
Returns:
the date
Since:
jcms-4.0

getCdateSelector

public static Data.CdateSelector getCdateSelector(Date begin,
                                                  Date end)

getMdateSelector

public static Data.MdateSelector getMdateSelector(Date begin,
                                                  Date end)

getDateSelector

public static DataSelector getDateSelector(String str,
                                           Date begin,
                                           Date end)
Retrieves a new DataSelector given a name representing it. The returned selector can be passed to the method JcmsUtil.applyDataSelector(java.util.Collection, DataSelector) to allow precise control over the selection of Data in a Collection.

You can specify any of the following value:
  • null, "date", "cdate": getCdateSelector(Date begin, Date end)
  • "mdate": getMdateSelector(Date begin, Date end)
  • Parameters:
    str - a string representing the selector
    begin - the begin Date to use for selection
    end - the end Date to use for selection
    Returns:
    a new instance of Comparator.

    getImportSelector

    public static DataSelector getImportSelector()

    getDeletableSelector

    public static DataSelector getDeletableSelector(Member opAuthor)

    getAuthorSelector

    public static DataSelector getAuthorSelector(Member author)

    getCaddyComparator

    public static <T extends Data> Comparator<T> getCaddyComparator()
    Type Parameters:
    T - subclass of Data
    Returns:
    a new instance of CaddyComparator.
    Since:
    jcms-5.7

    getAuthorComparator

    public static <T extends Data> Comparator<T> getAuthorComparator(Comparator<Member> memberComparator)
    Type Parameters:
    T - subclass of Data
    Parameters:
    memberComparator - a member comparator
    Returns:
    a new instance of Data.AuthorComparator built with the given member comparator, usually a Member.getNameComparator().

    getOpAuthorComparator

    public static <T extends Data> Comparator<T> getOpAuthorComparator(Comparator<Member> memberComparator)
    Type Parameters:
    T - subclass of Data
    Parameters:
    memberComparator -
    Returns:
    a new instance of Data.OpAuthorComparator built with the given member comparator, usually a Member.getNameComparator().
    Since:
    jcms-4.0

    getDataNameComparator

    public static <T extends Data> Comparator<T> getDataNameComparator(String language)
    Type Parameters:
    T - subclass of Data
    Parameters:
    language - the language that will be used by the DataNameComparator
    Returns:
    a new DataNameComparator built with the given language.
    Since:
    jcms-5.5.0

    getRowIdComparator

    public static <T extends Data> Comparator<T> getRowIdComparator()
    Returns:
    a new RowIdComparator
    Since:
    jcms-6.2.0

    getComparator

    public static <T extends Data> Comparator<T> getComparator(String str,
                                                               boolean reverse)
    Deprecated. use ComparatorManager

    Retrieves a new Comparator given a name representing it. The returned comparator can be used to sort any Collection containing Datas.
    You can specify any of the following value:
  • null, "date", "cdate": BasicStorable.getCdateComparator()
  • "mdate": BasicStorable.getMdateComparator()
  • "author": getAuthorComparator(Comparator) with a Member.getNameComparator()
  • "opauthor": getOpAuthorComparator(Comparator) with a Member.getNameComparator()
  • "id": BasicStorable.getIdComparator()
  • "caddy": getCaddyComparator(), since jcms-5.7.
  • Type Parameters:
    T - specialization of Data
    Parameters:
    str - a string representing the comparator
    reverse - a boolean indicating whether the comparator should have its behavior reversed (true) or unchanged (false)
    Returns:
    a new instance of Comparator.

    getStrongLockSelector

    public static DataSelector getStrongLockSelector()
    Retrieves a new instance of DataSelector based on the strong lock status of the data.

    Returns:
    a new instance of Data.StrongLockSelector
    Since:
    jcms-6.2.0

    setExtraInfo

    public Object setExtraInfo(String name,
                               Object obj)
    Stores an extra information in this Data.
    If the object passed in is null, the effect is the same as calling removeExtraInfo(java.lang.String).
    Data's extra information are transient (not stored upon a site restart).

    Parameters:
    name - a String specifying the name of the extra info
    obj - the Object to be stored
    Returns:
    previous value associated with specified name, or null if there was no mapping for name. A null return can also indicate that null was associated with the specified name.
    Since:
    jcms-5.5.0

    removeExtraInfo

    public Object removeExtraInfo(String name)
    Removes an extra information from this Data.

    Parameters:
    name - a String specifying the name of the extra info
    Returns:
    previous value associated with specified name, or null if there was no mapping for name. A null return can also indicate that null was associated with the specified name.
    Since:
    jcms-5.5.0

    getExtraInfo

    public Object getExtraInfo(String name)
    Returns the value of the named extra info as an Object, or null if no extra info of the given name exists.

    Parameters:
    name - the name of the extrainfo to retrieve
    Returns:
    previous value associated with specified name, or null if there is no mapping for name. A null return can also indicate that null was associated with the specified name.
    Since:
    jcms-5.5.0

    getExtraInfoMap

    public Map<String,Object> getExtraInfoMap()
    Returns a java.util.Map of the extra infos of this results.

    Returns:
    the internal Map used by this results, modify with care.
    Since:
    jcms-5.5.0

    getExtraDataMap

    public HashMap<String,String> getExtraDataMap()
    Returns a java.util.Map of the extra infos of this results.

    Returns:
    the internal Map used by this results, modify with care.
    Throws:
    IllegalStateException - if this method is invoked on instance of DBData
    Since:
    jcms-5.7.1

    setExtraDataMap

    public void setExtraDataMap(HashMap<String,String> extraDataMap)
    Override the current extraDataMap with the given one

    Parameters:
    extraDataMap - the new extraDataMap
    Throws:
    IllegalStateException - if this method is invoked on instance of DBData
    Since:
    jcms-5.7.1

    getExtraData

    public String getExtraData(String name)
    Returns the value of the named extra data as an String, or null if no extra info of the given name exists.

    Parameters:
    name - a String specifying the name of the extra data to retrieve
    Returns:
    previous value associated with specified name, or null if there is no mapping for name. A null return can also indicate that null was associated with the specified name.
    Throws:
    IllegalStateException - if this method is invoked on instance of DBData
    Since:
    jcms-5.7.1

    setExtraData

    public String setExtraData(String name,
                               String value)
    Stores an extra data in this Data.
    If the object passed in is null, the effect is the same as calling removeExtraData(java.lang.String).

    Parameters:
    name - a String specifying the name of the extra data
    value - the String to be stored
    Returns:
    previous value associated with specified name, or null if there was no mapping for name. A null return can also indicate that null was associated with the specified name.
    Throws:
    IllegalStateException - if this method is invoked on instance of DBData
    Since:
    jcms-5.7.1

    removeExtraData

    public String removeExtraData(String name)
    Removes an extra data from this Data.

    Parameters:
    name - a String specifying the name of the extra data
    Returns:
    previous value associated with specified name, or null if there was no mapping for name. A null return can also indicate that null was associated with the specified name.
    Throws:
    IllegalStateException - if this method is invoked on instance of DBData
    Since:
    jcms-5.7.1

    getNewDefaultExtraDataMap

    @Deprecated
    public static TreeMap<String,String> getNewDefaultExtraDataMap(Class<? extends Data> clazz,
                                                                              boolean shortKey)
    Deprecated. 

    Returns a TreeMap representing the Extra Data description and default value. Note: this implementation always create a new TreeMap because keys are sorted

    Parameters:
    clazz - the class to work with
    shortKey - if true, returns a Map using short properties (someprop instead of someprop.boolean)
    Returns:
    TreeMap object
    Since:
    jcms-5.7.1

    getNewDefaultExtraDataMap

    public static TreeMap<String,String> getNewDefaultExtraDataMap(Class<? extends Data> clazz,
                                                                   String suffix,
                                                                   boolean shortKey)
    Returns a TreeMap representing the Extra Data description and default value. Note: this implementation always create a new TreeMap because keys are sorted

    Parameters:
    clazz - the class to work with
    suffix - a suffix to the properties
    shortKey - if true, returns a Map using short properties (someprop instead of someprop.boolean)
    Returns:
    TreeMap object
    Since:
    jcms-5.7.4

    getNewDefaultExtraDataMap

    public static TreeMap<String,String> getNewDefaultExtraDataMap(Class<? extends Data> clazz,
                                                                   String suffix,
                                                                   boolean shortKey,
                                                                   boolean useSuperClasses)
    Returns a TreeMap representing the Extra Data description and default value. Note: this implementation always create a new TreeMap because keys are sorted

    Parameters:
    clazz - the class to work with
    suffix - a suffix to the properties
    shortKey - return a Map using shot properties
    useSuperClasses - true to retrieve default extradata for super classes of the specified class
    Returns:
    TreeMap object
    Since:
    jcms-5.7.5

    getNewDefaultExtraDataMap

    public TreeMap<String,String> getNewDefaultExtraDataMap(boolean shortKey)
    Returns a LangProperties representing the Extra Data description and default values.

    Parameters:
    shortKey - if true, returns a Map using short properties (someprop instead of someprop.boolean)
    Returns:
    LangProperties object
    Throws:
    IllegalStateException - if this method is invoked on instance of DBData
    Since:
    jcms-5.7.1

    updateExtraDataMap

    public void updateExtraDataMap(String[] keys,
                                   String[] values)
    Update editable ExtraDBData of this data with the updated/new specified key/value

    .

    This method will NOT allow add/modification of non-editable extradbdata, ie : extradata which are not explicitely declared in properties.

    This method is meant to be invoked on a working data (new object before its creation or updateinstance before its update).

    It is used Edit Handlers of all Data.

    Implementation detail : this method creates a new Map to simplify update of a cloned JStore object (fix issue when extraDataMap has not been cloned prior update)

    Parameters:
    keys - String[] representing authorized properties
    values - String[] representing new values of properties
    Throws:
    IllegalStateException - if this method is invoked on instance of DBData

    getExtraDBDataMap

    public Map<String,String> getExtraDBDataMap()
    Returns a java.util.Map of the extra infos of this results.

    Returns:
    the internal and unmodifiable Map.
    Since:
    jcms-6.0

    setExtraDBDataMap

    public void setExtraDBDataMap(Map<String,String> extraDBDataMap)
    Override the current extraDBDataMap with the given one

    Parameters:
    extraDBDataMap - the new extraDBDataMap
    Since:
    jcms-6.0

    setExtraDBDataMap

    public void setExtraDBDataMap(Map<String,String> extraDBDataMap,
                                  boolean inMemoryOnly)
    Override the current extraDBDataMap with the given one

    Parameters:
    extraDBDataMap - the new extraDBDataMap
    inMemoryOnly - if specified to true, the map will be kept in memory (as a ariable of this Data) variable and will only be saved if invoking performupdate later
    Since:
    jcms-7.0.1

    getExtraDBData

    public String getExtraDBData(String name)
    Returns the value of the named extra data as an String, or null if no extra info of the given name exists.

    Parameters:
    name - a String specifying the name of the extra data to retrieve
    Returns:
    previous value associated with specified name, or null if there is no mapping for name. A null return can also indicate that null was associated with the specified name.
    Since:
    jcms-6.0

    setExtraDBData

    public String setExtraDBData(String name,
                                 String value)
    Stores an extra data in this Data.
    If the object passed in is null, the effect is the same as calling removeExtraDBData(String).

    Parameters:
    name - a String specifying the name of the extra data
    value - the String to be stored
    Returns:
    previous value associated with specified name, or null if there was no mapping for name. A null return can also indicate that null was associated with the specified name.
    Since:
    jcms-6.0

    removeExtraDBData

    public String removeExtraDBData(String name)
    Removes an extra data from this Data.

    Parameters:
    name - a String specifying the name of the extra data
    Returns:
    previous value associated with specified name, or null if there was no mapping for name. A null return can also indicate that null was associated with the specified name.
    Since:
    jcms-6.0

    getNewDefaultExtraDBDataMap

    @Deprecated
    public static TreeMap<String,String> getNewDefaultExtraDBDataMap(Class<? extends Data> clazz,
                                                                                boolean shortKey)
    Deprecated. 

    Returns a TreeMap representing the Extra Data description and default value. Note: this implementation always create a new TreeMap because keys are sorted

    Parameters:
    clazz - the class to work with
    shortKey - if true, returns a Map using short properties (someprop instead of someprop.boolean)
    Returns:
    TreeMap object
    Since:
    jcms-6.0

    getNewDefaultExtraDBDataMap

    public static TreeMap<String,String> getNewDefaultExtraDBDataMap(Class<? extends Data> clazz,
                                                                     String suffix,
                                                                     boolean shortKey)
    Returns a TreeMap representing the Extra Data description and default value. Note: this implementation always create a new TreeMap because keys are sorted

    Parameters:
    clazz - the class to work with
    suffix - a suffix to the properties
    shortKey - if true, returns a Map using short properties (someprop instead of someprop.boolean)
    Returns:
    TreeMap object
    Since:
    jcms-6.0

    getNewDefaultExtraDBDataMap

    public static TreeMap<String,String> getNewDefaultExtraDBDataMap(Class<? extends Data> clazz,
                                                                     String suffix,
                                                                     boolean shortKey,
                                                                     boolean useSuperClasses)
    Returns a TreeMap representing the Extra Data description and default value. Note: this implementation always create a new TreeMap because keys are sorted

    Parameters:
    clazz - the class to work with
    suffix - a suffix to the properties
    shortKey - return a Map using shot properties
    useSuperClasses - true to retrieve default extradata for super classes of the specified class
    Returns:
    TreeMap object
    Since:
    jcms-6.0

    getNewDefaultExtraDBDataMap

    public TreeMap<String,String> getNewDefaultExtraDBDataMap(boolean shortKey)
    Returns a LangProperties representing the Extra Data description and default values.

    Parameters:
    shortKey - if true, returns a Map using short properties (someprop instead of someprop.boolean)
    Returns:
    LangProperties object
    Since:
    jcms-6.0

    updateExtraDBDataMap

    public void updateExtraDBDataMap(String[] keys,
                                     String[] values)
    Update editable ExtraDBData of this data with the updated/new specified key/value

    .

    This method will NOT allow add/modification of non-editable extradbdata, ie : extradata which are not explicitely declared in properties.

    This method is meant to be invoked on a working data (new object before its creation or updateinstance before its update).

    It is used Edit Handlers of all Data.

    Parameters:
    keys - String[] representing authorized properties
    values - String[] representing new values of properties
    Since:
    jcms-6.0

    lock

    public void lock(Member mbr)
    Locks this data for a given member.

    Parameters:
    mbr - the member who locks this data
    Since:
    jcms-5.5.0

    unlock

    public void unlock(Member mbr)
    Unlocks this data if lock has been put by the given member.

    Parameters:
    mbr - the member who locked this data
    Since:
    jcms-5.5.0

    unlock

    public void unlock()
    Unlocks this data.

    Since:
    jcms-5.5.0

    getLockMember

    public Member getLockMember()
    Return the member who locked this data

    Returns:
    the member who locked this data
    Since:
    jcms-5.5.0

    getLockDate

    public Date getLockDate()
    Returns the lock date.

    Returns:
    the lock date
    Since:
    jcms-5.5.0

    isLocked

    public boolean isLocked()
    Returns true if this data is locked.

    Returns:
    true if this data is locked.
    Since:
    jcms-5.5.0

    checkLockMember

    public boolean checkLockMember(Member mbr)
    Returns true if the given member has locked the given data or if the data is not locked.

    Parameters:
    mbr - the member
    Returns:
    true if the given member has locked the given data or if the data is not locked.
    Since:
    jcms-7.0.0

    getStrongLockMember

    public Member getStrongLockMember()
    Returns the member who has strongly locked this Data.

    Returns:
    the member who has strongly locked this Data.
    Since:
    jcms-7.0.0

    getStrongLockDate

    public Date getStrongLockDate()
    Returns the date of the strong lock.

    Returns:
    the date of the strong lock.
    Since:
    jcms-7.0.0

    putStrongLock

    public void putStrongLock(Member mbr)
    Put (and save) a strong lock on this Data.

    Parameters:
    mbr - the member who puts the strong lock.
    Since:
    jcms-7.0.0

    releaseStrongLock

    public void releaseStrongLock(Member mbr)
    Release the lock on this Data

    Parameters:
    mbr - the member who releases the lock (only the member who has locked and the admin can release the lock).
    Since:
    jcms-7.0.0

    releaseStrongLock

    public void releaseStrongLock()
    Releases the strong lock, without checking the member.

    Since:
    jcms-7.0.0

    getStrongLockInfo

    public String getStrongLockInfo(Locale locale)
    Returns a string which explains who has the lock (return "" if this Data has no strong lock)

    Parameters:
    locale - the locale
    Returns:
    a string which explains who has the lock.
    Since:
    jcms-7.0.0

    canRequestLock

    public boolean canRequestLock(Member mbr)
    Returns true if the given member can request the lock (by mail).

    Parameters:
    mbr - the member who request the lock
    Returns:
    true if the given member can request the lock (by mail).
    Since:
    jcms-7.0.0

    getStrongLock

    public StrongLock getStrongLock()
    Returns the StrongLock bound to this Data, if any.

    Returns:
    the StrongLock instance if there is any for this Data, null otherwise
    Since:
    jcms-6.2.0
    See Also:
    StrongLockManager.getStrongLock(Data)

    isStrongLocked

    public boolean isStrongLocked()
    Check if this data is strongly locked.

    Returns:
    true if this Data has a StrongLock, false otherwise
    Since:
    jcms-6.2.0
    See Also:
    StrongLockManager.isLocked(Data)

    checkStrongLockMember

    public boolean checkStrongLockMember(Member mbr)
    Check if the specified member has locked this Data or if the Data is not locked.

    Parameters:
    mbr - the member to check
    Returns:
    true if the given member has locked the given data or if the data is not locked.
    Since:
    jcms-6.2.0
    See Also:
    StrongLockManager.checkLockMember(Data, Member)

    getLockInfo

    public String getLockInfo(String userLang,
                              Locale userLocale,
                              boolean confirm)
    Returns an information message about the lock state.

    Parameters:
    userLang - the user language
    userLocale - the user locale
    confirm - true for a confirm message
    Returns:
    an information message about the lock state.
    Since:
    jcms-6.2.0

    getUpdateInstance

    public Data getUpdateInstance()
    Returns an instance of this object to update it.

    Returns:
    an instance of this object to update it.
    Since:
    jcms-6.0.0

    checkIntegrity

    public ControllerStatus checkIntegrity()
    Checks whether or not data integrity constraints are respected.

    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    checkIntegrity

    public ControllerStatus checkIntegrity(Map context)
    Checks whether or not data integrity constraints are respected.

    Parameters:
    context - a map which contains context parameters (may be null)
    Returns:
    a ControllerStatus
    Since:
    jcms-6.1.0

    getFieldStatusMap

    public Map<String,FieldStatus> getFieldStatusMap(Member mbr)
    Returns the FieldStatus map of this data for the given member (currently only works for Publication).

    Parameters:
    mbr - the member
    Returns:
    the FieldStatus map (the field names are the keys)
    Since:
    jcms-6.0.1

    checkWrite

    public ControllerStatus checkWrite(int op,
                                       Member mbr,
                                       boolean checkIntegrity,
                                       Map context)
    Checks if the given write operation can be performed

    Parameters:
    op - the operation (OP_CREATE, OP_UPDATE, ...)
    mbr - the member which requests the write operation
    checkIntegrity - if true, requires the constraints integrity to be checked
    context - a map which contains context parameters (may be null)
    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    checkMember

    public ControllerStatus checkMember(int op,
                                        Member mbr,
                                        Map context)
    Checks if the given member can perform the given operation. This method is called by checkWrite. It should be overrided by sub-classes.

    Parameters:
    op - the operation (OP_CREATE, OP_UPDATE, ...)
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    checkCreate

    public ControllerStatus checkCreate(Member mbr)
    Checks if the creation can be performed

    Parameters:
    mbr - the member which requests the write operation
    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    checkCreate

    public ControllerStatus checkCreate(Member mbr,
                                        Map context)
    Checks if the creation can be performed

    Parameters:
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    checkUpdate

    public ControllerStatus checkUpdate(Member mbr)
    Checks if the update can be performed

    Parameters:
    mbr - the member which requests the write operation
    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    checkUpdate

    public ControllerStatus checkUpdate(Member mbr,
                                        Map context)
    Checks if the update can be performed

    Parameters:
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    checkDelete

    public ControllerStatus checkDelete(Member mbr)
    Checks if the deletion can be performed

    Parameters:
    mbr - the member which requests the write operation
    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    checkDelete

    public ControllerStatus checkDelete(Member mbr,
                                        Map context)
    Checks if the deletion can be performed

    Parameters:
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Returns:
    a ControllerStatus
    Since:
    jcms-5.0.0

    performCreate

    public final void performCreate(Member mbr)
    Performs data creation. This method cannot be overridden.

    Parameters:
    mbr - the member which requests the write operation
    Since:
    jcms-5.0.0

    performCreate

    public void performCreate(Member mbr,
                              Map context)
    Performs data creation.

    Parameters:
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Since:
    jcms-5.0.0

    performUpdate

    public final void performUpdate(Member mbr)
    Performs data update. This method cannot be overridden.

    Parameters:
    mbr - the member which requests the write operation
    Since:
    jcms-5.0.0

    performUpdate

    public void performUpdate(Member mbr,
                              Map context)
    Performs data update.

    Parameters:
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Since:
    jcms-5.0.0

    prepareUpdateContext

    public void prepareUpdateContext(Map context)

    performDelete

    public final void performDelete(Member mbr)
    Performs data deletion. This method cannot be overridden.

    Parameters:
    mbr - the member which requests the write operation
    Since:
    jcms-5.0.0

    performDelete

    public void performDelete(Member mbr,
                              Map context)
    Performs data deletion.

    Parameters:
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Since:
    jcms-5.0.0

    performBeforeWrite

    protected void performBeforeWrite(int op,
                                      Member mbr,
                                      Map context)
    Called to perform some action before the write.

    Parameters:
    op - the operation (OP_CREATE, OP_UPDATE, ...)
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Since:
    jcms-5.7.2

    performAfterWrite

    protected void performAfterWrite(int op,
                                     Member mbr,
                                     Map context)
    Called to perform some action after the write.

    Parameters:
    op - the operation (OP_CREATE, OP_UPDATE, ...)
    mbr - the member which requests the write operation
    context - a map which contains context parameters (may be null)
    Since:
    jcms-6.0.0

    getTypeEntry

    public static TypeEntry getTypeEntry()
    Returns the TypeEntry bound to Data.

    Default implementation for Data will propably return null as no TypeEntry is available for Data, this method is available mainly to be overriden by subclasses.

    Returns:
    the TypeEntry bound to Data.
    Since:
    jcms-5.5
    See Also:
    Channel.getTypeEntry(Class)

    getTypeFieldsEntries

    public static TypeFieldEntry[] getTypeFieldsEntries()
    Return an array of TypeFieldEntry bound to Data.
    This array does not contain inherited TypeFieldEntry from super classes of Data.

    Default implementation for Data will propably return an empty array as no TypeFieldEntry is available for Data, this method is available mainly to be overriden by subclasses.

    Returns:
    an array of TypeFieldEntry containing all Field used by Data or an empty array (never return null)
    Since:
    jcms-5.5
    See Also:
    Channel.getTypeFieldEntries(Class)

    getAllTypeFieldEntry

    public static TypeFieldEntry[] getAllTypeFieldEntry()
    Return an array of TypeFieldEntry bound to Data.
    This array does contain inherited TypeFieldEntry from super classes of Data.

    Default implementation for Data will propably return an empty array as no TypeFieldEntry is available for Data, this method is available mainly to be overriden by subclasses.

    Returns:
    an array of TypeFieldEntry containing all Field used by Data or an empty array (never return null)
    Since:
    jcms-5.5
    See Also:
    Channel.getAllTypeFieldEntries(Class)

    getIntFieldValue

    public int getIntFieldValue(String fieldName)
                         throws NoSuchFieldException
    Gets the value of the given int field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the int field value
    Throws:
    NoSuchFieldException - if the field was not found.

    setIntFieldValue

    public void setIntFieldValue(String fieldName,
                                 int value)
                          throws NoSuchFieldException
    Sets the value of the given int field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    value - the int field value
    Throws:
    NoSuchFieldException - if the field was not found.
    Since:
    jcms-7.0.0

    getLongFieldValue

    public long getLongFieldValue(String fieldName)
                           throws NoSuchFieldException
    Gets the value of the given long field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the long field value
    Throws:
    NoSuchFieldException - if the field was not found.

    setLongFieldValue

    public void setLongFieldValue(String fieldName,
                                  long value)
                           throws NoSuchFieldException
    Sets the value of the given long field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    value - the long field value
    Throws:
    NoSuchFieldException - if the field was not found.
    Since:
    jcms-7.0.0

    getDoubleFieldValue

    public double getDoubleFieldValue(String fieldName)
                               throws NoSuchFieldException
    Gets the value of the given double field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the double field value
    Throws:
    NoSuchFieldException - if the field was not found.

    setDoubleFieldValue

    public void setDoubleFieldValue(String fieldName,
                                    double value)
                             throws NoSuchFieldException
    Sets the value of the given double field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    value - the double field value
    Throws:
    NoSuchFieldException - if the field was not found.
    Since:
    jcms-7.0.0

    getBooleanFieldValue

    public boolean getBooleanFieldValue(String fieldName)
                                 throws NoSuchFieldException
    Gets the value of the given boolean field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the boolean field value
    Throws:
    NoSuchFieldException - if the field was not found.

    setBooleanFieldValue

    public void setBooleanFieldValue(String fieldName,
                                     boolean value)
                              throws NoSuchFieldException
    Sets the value of the given boolean field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    value - the boolean field value
    Throws:
    NoSuchFieldException - if the field was not found.
    Since:
    jcms-7.0.0

    getCategoryFieldValue

    public TreeSet getCategoryFieldValue(String fieldName,
                                         Member mbr)
                                  throws NoSuchFieldException
    Gets the value of the given Category field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    mbr - the member used to check rigth access to categories.
    Returns:
    a TreeSet of Category
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.

    setCategoryFieldValue

    public void setCategoryFieldValue(String fieldName,
                                      TreeSet value)
                               throws NoSuchFieldException
    Sets the value of the given Category field name for the current Data.

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    value - TreeSet of Category
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    Since:
    jcms-7.0.0

    getFieldValue

    public Object getFieldValue(String fieldName)
                         throws NoSuchFieldException
    Gets the value of the given Object field name for the current Data.
    If the field is multilingual, the default language will be used. If the field value is not available (empty) in the given language, the field value in the main language of this publication is return.
    Do not retrieve Category fields, see #getCategoryFieldValue(Member).

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the Object field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    See Also:
    getFieldValue(String, String, boolean)

    setFieldValue

    public void setFieldValue(String fieldName,
                              Object value)
                       throws NoSuchFieldException
    Sets the value of the given Object field name for the current Data.
    If the field is multilingual, the default language will be used.
    Do not set Category fields, see #setCategoryFieldValue(String, TreeSet).

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    value - the Object field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    Since:
    jcms-7.0.0
    See Also:
    setFieldValue(String, Object, String)

    getFieldValue

    public Object getFieldValue(String fieldName,
                                String lang)
                         throws NoSuchFieldException
    Gets the value of the given Object field name for the current Data.
    If the field is multilingual, the given language will be used. If the field value is not available (empty) in the given language, the field value in the main language of this publication is return.
    Do not retrieve Category fields, see #getCategoryFieldValue(String, Member).

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    lang - the language (ISO-639 code) in which to retrieve the field value (used only for multilingual fields).
    Returns:
    the Object field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    See Also:
    getFieldValue(String, String, boolean)

    getFieldValue

    public Object getFieldValue(String fieldName,
                                String lang,
                                boolean useDefault)
                         throws NoSuchFieldException
    Gets the value of the given Object field name for the current Data.
    If the field is multilingual, the given language will be used.
    Do not retrieve Category fields, see #getCategoryFieldValue(String, Member).

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    lang - the language (ISO-639 code) in which to retrieve the field value (used only for multilingual fields).
    useDefault - whether to use the publication main language if the field value is not available in the requested language (used only for multilingual fields).
    Returns:
    the Object field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.

    setFieldValue

    public void setFieldValue(String fieldName,
                              Object value,
                              String lang)
                       throws NoSuchFieldException
    Sets the value of the given Object field name for the current Data.
    If the field is multilingual, the given language will be used.
    Do not set Category fields, see #getCategoryFieldValue(String, Member).

    Parameters:
    fieldName - the field name from which to retrieve the field value.
    value - the Object field value
    lang - the language (ISO-639 code) in which to retrieve the field value (used only for multilingual fields).
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    Since:
    jcms-7.0.0

    getFieldValue

    public Object getFieldValue(JcmsJspContext ctxt,
                                String fieldName)
                         throws NoSuchFieldException
    Gets the value of the given Object field name for this Data.
    Do not retrieve Category fields and primitive fields values.

    Parameters:
    ctxt - the current context in which this field's value is request.
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the Object field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    See Also:
    PortalPolicyFilter.getFieldValue(JcmsJspContext, String, Data, Object)

    getIntFieldValue

    public int getIntFieldValue(JcmsJspContext ctxt,
                                String fieldName)
                         throws NoSuchFieldException
    Gets the integer value of the specified field name for this Data.

    Parameters:
    ctxt - the current context in which this field's value is request.
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the int field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    Since:
    jcms-6.0.0
    See Also:
    PortalPolicyFilter.getFieldValue(JcmsJspContext, String, Data, Object)

    getLongFieldValue

    public long getLongFieldValue(JcmsJspContext ctxt,
                                  String fieldName)
                           throws NoSuchFieldException
    Gets the long value of the specified field name for this Data.

    Parameters:
    ctxt - the current context in which this field's value is request.
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the long field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    Since:
    jcms-6.0.2, jcms-6.1.1
    See Also:
    PortalPolicyFilter.getLongFieldValue(JcmsJspContext, String, Data, long)

    getDoubleFieldValue

    public double getDoubleFieldValue(JcmsJspContext ctxt,
                                      String fieldName)
                               throws NoSuchFieldException
    Gets the double value of the specified field name for this Data.

    Parameters:
    ctxt - the current context in which this field's value is request.
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the double field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    Since:
    jcms-6.0.2, jcms-6.1.1
    See Also:
    PortalPolicyFilter.getDoubleFieldValue(JcmsJspContext, String, Data, double)

    getBooleanFieldValue

    public boolean getBooleanFieldValue(JcmsJspContext ctxt,
                                        String fieldName)
                                 throws NoSuchFieldException
    Gets the boolean value of the specified field name for this Data.

    Parameters:
    ctxt - the current context in which this field's value is request.
    fieldName - the field name from which to retrieve the field value.
    Returns:
    the boolean field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    Since:
    jcms-6.0.2, jcms-6.1.1
    See Also:
    PortalPolicyFilter.getBooleanFieldValue(JcmsJspContext, String, Data, boolean)

    getCategoryFieldValue

    public TreeSet<Category> getCategoryFieldValue(JcmsJspContext ctxt,
                                                   String fieldName)
                                            throws NoSuchFieldException
    Gets the Category value of the specified field name for this Data.

    Parameters:
    ctxt - the current context in which this field's value is request.
    fieldName - the field name from which to retrieve the field value.
    Returns:
    a TreeSet of Category field value
    Throws:
    NoSuchFieldException - if the field was not found in the given Data.
    Since:
    jcms-6.0.2, jcms-6.1.1
    See Also:
    PortalPolicyFilter.getCategoryFieldValue(JcmsJspContext, String, Data, TreeSet)

    getDisplayUrl

    public String getDisplayUrl(Locale locale)
    Return the URL to access this data in the front office.
    If descriptive URLs are enabled in JCMS (DescriptiveURLs) the url will be generated using DescriptiveURLs.getDescriptiveURL(Data, Locale) otherwise, a standard "display.jsp?id=" URL is generated.

    Warning: The return url may or may not contains a query string

    Parameters:
    locale - the Locale to use for I18N and localized operations
    Returns:
    a path relative to the webapp path, (no '/' at begining).
    Since:
    jcms-5.7.0
    See Also:
    JcmsUtil.getDisplayUrl(Data, Locale)

    getDisplayLink

    public String getDisplayLink(Locale locale)
    Retrieve an HTML a tag suitable to display this Data

    Parameters:
    locale - the current Locale to use for I18N of the URL and other title information
    Returns:
    an HTML fragment
    Since:
    jcms-7.1.0

    getDisplayLink

    public String getDisplayLink(Locale locale,
                                 String baseURL,
                                 String params,
                                 String anchor,
                                 String title,
                                 String accessibilityInfo,
                                 String css,
                                 String htmlAttributes)
    Retrieve an HTML a tag suitable to display this Data

    Parameters:
    locale - the current Locale to use for I18N of the URL and other title information
    baseURL - optionnal baseURL to use in the URL
    params - optionnal additionnal params to in the URL (eg foo=bar&zig=42)
    anchor - optionnal anchor to print in the URL (eg #foobar
    title - the value to use in the title attribute (highly recommended, do not encode)
    css - optionnal classname to use in the tag
    accessibilityInfo - a string indicating where to print accessibility information of FileDocument : "title" to print them in title attribute, "content" to print them in the body of the a tag, anything else will not print additionnal accessibility information
    htmlAttributes - optionnal additionnal html attributes to use in the tag (must no be href, title and class)
    Returns:
    an HTML fragment
    Since:
    jcms-7.1.0

    printDisplayLinkStart

    public void printDisplayLinkStart(StringBuilder sb,
                                      Locale locale,
                                      String baseURL,
                                      String params,
                                      String anchor,
                                      String title,
                                      String accessibilityInfo,
                                      String css,
                                      String htmlAttributes,
                                      javax.servlet.http.HttpServletRequest request,
                                      boolean update,
                                      String[] paramNames,
                                      String[] paramValues,
                                      String[] paramRemove)
    Print opening tag <a... href attribute with URL and other attributes.

    Parameters:
    sb - the StringBuilder in which start of a tag will be appended
    locale - the user Locale
    baseURL - optionnal baseURL to use in the URL
    params - optionnal additionnal params to in the URL (eg foo=bar&zig=42)
    anchor - optionnal anchor to print in the URL (eg #foobar
    title - the value to use in the title attribute (highly recommended, do not encode)
    accessibilityInfo - a string indicating where to print accessibility information of FileDocument : "title" to print them in title attribute, anything else will not print additionnal accessibility information
    css - optionnal classname to use in the tag
    htmlAttributes - optionnal additionnal html attributes to use in the tag (must no be href, title and class)
    request - the HttpRequest. Requested if update or paramNames is provided.
    update - specify this parameter to true to generate a display URL for the given data while keeping all the current others parameters.
    paramNames - Optionnal request parameters names to be updated from the current request parameters. You must specify the 'values' attributes with an array of the same dimension. Trigger the same url generation behavior as when specifying the 'update' attribute to true.
    paramValues - Request parameters values to be updated from the current request parameters. This array must match the correponding names array specified in the 'names' attribute. Trigger the same url generation behavior as when specifying the 'update' attribute to true.
    paramRemove - Request parameters names to be removed from the current request parameters. Trigger the same url generation behavior as when specifying the 'update' attribute to true.
    Since:
    jcms-7.1.0 (was in LinkTag before)

    printDataName

    public void printDataName(StringBuilder sb,
                              Locale locale,
                              String accessibilityInfo)
    Print the data name in the specified StringBuilder.

    Parameters:
    sb - the StringBuilder
    locale - the user Locale
    accessibilityInfo -
    Since:
    jcms-7.1.0 (was in LinkTag before)

    printDisplayLinkEnd

    public void printDisplayLinkEnd(StringBuilder sb)
    Print closing tag </a>.

    Parameters:
    sb - the StringBuilder
    Since:
    jcms-7.1.0 (was in LinkTag before)

    printDisplayUrl

    public void printDisplayUrl(StringBuilder sb,
                                Locale locale,
                                String baseURL,
                                String params,
                                String anchor)
    Prints URL using parameter of this tag.

    Parameters:
    sb - the StringBuilder
    locale - the user Locale
    baseURL - optionnal baseURL to use in the URL
    params - optionnal additionnal params to in the URL (eg foo=bar&zig=42)
    anchor - optionnal anchor to print in the URL (eg #foobar
    Since:
    jcms-7.1.0 (was in LinkTag before)

    printDisplayUrl

    public void printDisplayUrl(StringBuilder sb,
                                Locale locale,
                                String baseURL,
                                String params,
                                String anchor,
                                javax.servlet.http.HttpServletRequest request,
                                boolean update,
                                String[] paramNames,
                                String[] paramValues,
                                String[] paramRemove)
    Prints URL using parameter of this tag.

    Parameters:
    sb - the StringBuilder
    locale - the user Locale
    baseURL - optionnal baseURL to use in the URL
    params - optionnal additionnal params to in the URL (eg foo=bar&zig=42)
    anchor - optionnal anchor to print in the URL (eg #foobar
    request - the HttpRequest. Requested if update or paramNames is provided.
    update - specify this parameter to true to generate a display URL for the given data while keeping all the current others parameters.
    paramNames - Optionnal request parameters names to be updated from the current request parameters. You must specify the 'values' attributes with an array of the same dimension. Trigger the same url generation behavior as when specifying the 'update' attribute to true.
    paramValues - Request parameters values to be updated from the current request parameters. This array must match the correponding names array specified in the 'names' attribute. Trigger the same url generation behavior as when specifying the 'update' attribute to true.
    paramRemove - Request parameters names to be removed from the current request parameters. Trigger the same url generation behavior as when specifying the 'update' attribute to true.
    Since:
    jcms-7.1.0 (was in LinkTag before)

    getRowId

    public Long getRowId()
    Returns the value of rowId (DBData ID).

    Returns:
    the value of rowId (DBData ID).
    Since:
    jcms-6.0.0

    setRowId

    public void setRowId(Long rowId)
    Sets the value of rowId (DBData ID).

    Parameters:
    rowId - the rowId
    Since:
    jcms-6.0.0

    getAuthorId

    public String getAuthorId()
    Returns the JStore ID of the author (only for DBData)

    Returns:
    the JStore ID of the author (only for DBData)
    Since:
    jcms-6.0.0

    setAuthorId

    public void setAuthorId(String authordId)
    Sets the JStore ID of the author (only for DBData).

    If the specified authorId is an invalid ID (non existing Member), the author will be set to the Member specified by property channel.default-author (or left null if this property has not been set).

    Parameters:
    authordId - the JStore author id
    Since:
    jcms-6.0.0

    isDBData

    public boolean isDBData()
    Returns true if this objet is an instance of DBData.

    Returns:
    true if this objet is an instance of DBData.
    Since:
    jcms-6.2.0

    isInDatabase

    public boolean isInDatabase()
    Returns true if this data is stored in the database (false if it is stored in JStore).

    Returns:
    true if this data is stored in the database (false if it is stored in JStore).
    Since:
    jcms-6.0.0

    isPersisted

    public boolean isPersisted()
    Returns true if this data has been persisted (either in JStore or in the database).

    Returns:
    true if this data has been persisted (either in JStore or in the database).
    Since:
    jcms-6.0.0

    hashCode

    public int hashCode()
    Description copied from class: BasicStorable
    This method return the HashCode of a storable using the storable id's hashcode if id is not null.

    Overrides:
    hashCode in class BasicStorable
    Returns:
    int HashCode of the storable

    clone

    public Object clone()
    Specified by:
    clone in interface Storable
    Overrides:
    clone in class BasicStorable

    mergeHybridLink

    protected <T extends Data> T[] mergeHybridLink(Class<T> clazz,
                                                   T[] storableArray,
                                                   String[] dbidArray)
    Returns the merge from the given array of storable with the given array of DBID.

    Parameters:
    clazz - the class of the data contains in the returned array.
    storableArray - the array of storable data
    dbidArray - the array of DBID
    Returns:
    the merge from the given array of storable with the given array of DBID.
    Since:
    jcms-6.1.0

    computeDBIDArray

    protected String[] computeDBIDArray(Data[] array)
    Extract the DBData from the given array and return an array of identifier of those DBData. The given array is cleaned.

    Parameters:
    array - the array to clean.
    Returns:
    an array of DBID
    Since:
    jcms-6.1.0

    initializeDBDataCollections

    public void initializeDBDataCollections()
    This methods force the collections of the DBData to be initialized()

    Since:
    jcms-6.2.0


    Copyright © 2001-2010 Jalios SA. All Rights Reserved.