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, Cloneable, Comparable<BasicStorable>
Direct Known Subclasses:
Bookmark, Category, DataExtension, DataRight, DBForumWatcher, ForumDiscussionMetadata, Group, Member, Notification, NotificationCriteria, PollVote, Publication, ReaderTracker, WFNote, WKRole, Workspace, WSTypeEntry

public abstract class Data
extends BasicStorable
implements JcmsConstants, ImportConstants

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

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

Nested Class Summary
static class Data.AuthorComparator
           
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
          This comparator compares two Data using their Data Name.
static class Data.DeletableSelector
          DataSelector to select Data that can be deleted (i.e. data whose checkDelete() returns ok).
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
           
 
Nested classes/interfaces inherited from class com.jalios.jstore.BasicStorable
BasicStorable.CdateComparator, BasicStorable.IdComparator, BasicStorable.MdateComparator
 
Field Summary
protected  Member author
           
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 importMap
           
protected  Date lockDate
           
protected  Member lockMember
           
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, CRYPT_MD5, CRYPT_UNDEFINED, CRYPT_UNIX, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DAILY_MAIL_ALERT, 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, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, MONTHLY_MAIL_ALERT, NO_MAIL_ALERT, OP_CREATE, OP_DEEP_COPY, OP_DEEP_DELETE, OP_DELETE, OP_MERGE, OP_UPDATE, PDATE_SEARCH, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, 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, WEEKLY_MAIL_ALERT, 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
 
Constructor Summary
Data()
           
Data(Data other)
           
Data(Member author, DataExtension extension)
           
 
Method Summary
 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.
 void checkLock()
          Checks the current lock.
 ControllerStatus checkMember(int op, Member mbr, Map context)
          Checks if the given member can perform the given operation.
 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
 String exportXml()
          Returns the XML export this data.
 StringBuffer exportXml(StringBuffer sb)
          Fill the given StringBuffer with the XML export this data.
 StringBuffer exportXml(StringBuffer sb, 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 exportXmlFiles(StringBuffer sb, int indentLevel)
          Fills the given StringBuffer with the XML export of files of this data.
 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()
          Get the value of author.
static Comparator getAuthorComparator(Comparator memberComparator)
           
 String getAuthorId()
          Returns the JStore ID of the author (only for DBData)
static DataSelector getAuthorSelector(Member author)
           
 boolean getBooleanFieldValue(String fieldName)
          Gets the value of the given boolean field name for the current Data.
static Comparator getCaddyComparator()
           
 TreeSet getCategoryFieldValue(String fieldName, Member mbr)
          Gets the value of the given Category field name for the current Data.
static Comparator getCdateComparator()
           
static Data.CdateSelector getCdateSelector(Date begin, Date end)
           
static Comparator getComparator(String str, boolean reverse)
          Retrieves a new Comparator given a name representing it.
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 Comparator 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 getDisplayUrl(Locale locale)
          Return the URL to access this data in the front office.
 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.
 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.
static Comparator getIdComparator()
           
 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 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. the XML export URL of the original data.
 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.
 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.
 Member getLockMember()
          Return the member who locked this data
 long getLongFieldValue(String fieldName)
          Gets the value of the given long field name for the current Data.
static Comparator getMdateComparator()
           
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)
          Returns a TreeMap representing the Extra Data description and default value.
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)
          Returns a TreeMap representing the Extra Data description and default value.
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 Comparator getOpAuthorComparator(Comparator 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 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.
 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()
           
 boolean isPersisted()
          Returns true if this data has been persisted (either in JStore or in the database).
 void lock(Member mbr)
          Locks this data for a given member.
 void markNewImport()
          Internal method used to mark an imported data.
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
 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)
          Set the value of author.
 void setAuthorId(String authordId)
          Sets the JStore ID of the author (only for DBData)
 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
 Object setExtraInfo(String name, Object obj)
          Stores an extra information in this 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 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 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)
          Create a new Map with new key/value properties and update already authorised properties (remove no longer declared one).
 void updateExtraDBDataMap(String[] keys, String[] values)
          Create a new Map with new key/value properties and update already authorised properties (remove no longer declared one).
protected  void updateIndexTreeSet(String indexName, Object obj, boolean add)
          Update the given index.
 
Methods inherited from class com.jalios.jstore.BasicStorable
clearId, clone, compareTo, equals, getAttribute, getAttributes, getCdate, getDdate, getId, getMdate, 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