com.jalios.jcms.workspace
Class Workspace

java.lang.Object
  extended by com.jalios.jstore.BasicStorable
      extended by com.jalios.jcms.Data
          extended by com.jalios.jcms.workspace.Workspace
All Implemented Interfaces:
EditableData, JcmsConstants, ImportConstants, MashupConstants, Storable, JaliosConstants, Cloneable, Comparable<BasicStorable>

public class Workspace
extends Data
implements EditableData

This class represents a Workspace

Since:
jcms-4.1
Version:
$Revision: 22158 $
Author:
Jean-Philippe Encausse

Nested Class Summary
static class Workspace.GroupSizeComparator
           
static class Workspace.MemberSizeComparator
           
static class Workspace.NameComparator
           
static class Workspace.OrderComparator
           
static class Workspace.TextSelector
          Select a set of workspace matching the given text in the Title.
static class Workspace.TitleSelector
          Select categories by their name.
 
Nested classes/interfaces inherited from class com.jalios.jcms.Data
Data.AuthorComparator, Data.AuthorSelector, Data.CdateSelector, Data.DataNameComparator, Data.DeletableSelector, Data.ImportSelector, Data.MdateSelector, Data.OpAuthorComparator
 
Nested classes/interfaces inherited from class com.jalios.jstore.BasicStorable
BasicStorable.CdateComparator, BasicStorable.IdComparator, BasicStorable.MdateComparator
 
Field Summary
protected  ArrayList<Member> administrators
           
static String ALL_WORKSPACE_ICON
           
protected  Category cachedHomeCat
           
protected  HashSet<Category> catSet
           
protected  HashMap<Class<?>,Set<Publication>> classPubSetMap
           
protected static Map<String,Set<String>> cssGlobalMap
           
static boolean DEBUG
           
protected  String email
           
protected  String[] globalCSS
           
protected  TreeSet<Group> groupSet
           
protected  boolean isClosed
           
protected  boolean isModel
           
protected  String language
           
protected  int order
           
protected  TreeSet<Publication> pubSet
           
static String REVISION
           
protected  HashMap<String,WKRole> roleMap
           
protected  String title
           
protected  HashMap<String,String> titleML
           
protected  HashMap<Class<?>,Object> typeMap
           
static String WORKSPACE_CLOSED_ICON
           
static String WORKSPACE_ICON
           
static String WORKSPACE_MODEL_CLOSED_ICON
           
static String WORKSPACE_MODEL_ICON
           
 
Fields inherited from class com.jalios.jcms.Data
author, channel, DISPLAY_URL_EXTRA_INFO, extension, extraDataMap, extraDBDataMapToSaveOnOp, importMap, lockDate, lockMember, opAuthor, opDelegate
 
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
Workspace()
           
Workspace(Workspace other)
           
 
Method Summary
 boolean canPublish(Class clazz)
          Checks if the given class can be published in this workspace.
 ControllerStatus checkCreate(Member mbr, Map context)
          Checks if the creation 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 checkMember(int op, Member mbr, Map context)
          Checks if the given member can perform the given operation.
 ControllerStatus checkUpdate(Member mbr, Map context)
          Checks if the update can be performed
 void exportXmlField(StringBuffer sb, int indentLevel)
          Fills the given StringBuffer with Xml export of fields of this data.
 void flushHomeUrl()
          Reset the cache of the home category.
 ArrayList<Member> getAdministrators()
           
static Set<Workspace> getAllWorkspaceSet()
          Returns a Set with all workspace, model or not.
static Set<Workspace> getAllWorkspaceSet(Member member)
          Returns a Set of workspace, for the given member.
static Set<Workspace> getAllWorkspaceSetModel()
          Returns a Set with all workspace model.
static Set<Workspace> getAllWorkspaceSetWithoutModel()
          Returns a Set with all workspace without workspace model.
 HashSet<Category> getCatSet()
           
 HashMap<Class<?>,Set<Publication>> getClassPubSetMap()
           
static Comparator<Workspace> getComparator(String str, boolean reverse)
           
static String getCSVHeader(String lang)
          Returns the CSV header of this object
 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.
 String getEmail()
           
 Category getFirstWorkspaceCat(Category cat)
          Returns first workspace category mathching (or parent) given category.
 String getFullEmail()
          Returns the full email in the form "WorkspaceTitle ".
 String getFullEmail(String lang)
          Returns the full email in the form "WorkspaceTitle ".
 String[] getGlobalCSS()
          Getter for globalCSS
 Set<String> getGlobalWYSIWYGStyle()
          Returns a Set of global style for the current workspace.
static Map<String,Set<String>> getGlobalWYSIWYGStyleMap()
           
 TreeSet<Group> getGroupSet()
           
static Comparator<Workspace> getGroupSizeComparator(String lang)
          Returns a new Comparator instance to compare workspace based on the number of groups in each workspace.
 String getHomeUrl(Locale userLocal)
          Returns the home url for the given workspace calculated from portal categories that belongs to workspace
protected  Category getHomeUrlVisitor(Collection<Category> collect, Set<Publication> portalSet)
          Internal methods to check home url
 String getIcon()
          Returns the image path icon for the given workspace
 String getLanguage()
           
 Set<String> getLocalWYSIWYGStyle(String global)
          Returns a Set of local style for a given global style
 Set<Member> getMemberSet()
          Convenient method that return a set of members representing members that belongs to groups of this workspace or administrators of this workspace
static Comparator<Workspace> getMemberSizeComparator(String lang)
          Returns a new Comparator instance to compare workspace based on the number of members in each workspace.
static Comparator<Workspace> getNameComparator(String lang)
          Returns a new Comparator instance to compare workspace based on their title.
 int getOrder()
           
static Comparator<Workspace> getOrderComparator(String lang)
          Returns a new Comparator instance to compare workspace based on their order.
<T extends Publication>
Set<T>
getPublicationSet(Class<?> clazz)
          Return all publication for a given Clazz
<T extends Publication>
Set<T>
getPublicationSet(Class<?> clazz, boolean specialState)
          Return all the publication in/not a special state for the given class
 Set<Publication> getPublicationSet(Workflow workflow)
          Return all publication for a given Workflow
 Set<Publication> getPublicationSet(Workflow workflow, boolean specialState)
          Return all the publication in/not a special state for the given Workflow
 TreeSet<Publication> getPubSet()
           
static Workspace getRequestWorkspace(javax.servlet.http.HttpServletRequest request)
          Get the workspace stored in the request
 WKRole getRole(String wfRoleId)
          Get the WKRole linked to a WFRole for a given Workflow
 WKRole getRole(WFRole wfRole)
          Get the WKRole linked to a WFRole for a given Workflow
 HashMap<String,WKRole> getRoleMap()
          Getter of RoleMap
static Workspace getSessionWorkspace(javax.servlet.http.HttpSession session)
          Get the workspace stored in the session
 String getTitle()
          Get the value of title.
 String getTitle(String lang)
          Get the value of title bound to the given language.
 String getTitle(String lang, boolean useDefault)
          Get the value of title bound to the given language.
 HashMap<String,String> getTitleML()
          Retrieve the HashMap containing the titles of this Workspace in language other than the main site language.
 String getTypeDescription(Class clazz, String lang)
          Returns the description for the given type (class) in the given language.
 String getTypeLabel(Class clazz, String lang)
          Returns the label for the given type (class) in the given language.
 HashMap<Class<?>,Object> getTypeMap()
          Getter of TypeMap
 Set<Class<?>> getTypeSet()
          Returns a Set of all visible types
 WFRole getWFRole(WKRole wkRole)
          Returns the WFRole bound to the given WKRole.
 Set<String> getWFRoleIdSet()
          Return a set of all WFRoleId
 Set<WFRole> getWFRoleSet()
          Return a set of all WFRole
 Set<WKRole> getWKRoleSet()
          Return a set of all WKRole
 Set<WKRole> getWKRoleSet(Class clazz)
          Return all the WKRole for a given Class
 Set<WKRole> getWKRoleSet(Workflow wf)
          Return all the WKRole for a given Workflow
 Workflow getWorkflow(Class clazz)
          Find the Worflow associated to the given class.
 Workflow getWorkflow(Class<?> clazz, boolean checkSuperclass)
          Find the Worflow associated to the given class or one of it's super class.
 Set<Workflow> getWorkflowSet()
          Returns a Set of all workflow used by calling getWorkflow(clazz,false) on all clazz.
 WSTypeEntry getWSTypeEntry(Class clazz)
          Returns a WSTypeEntry describing custom properties for a given type in a given workspace.
 WSTypeEntry getWSTypeEntry(String className)
          Returns a WSTypeEntry describing custom properties for a given type in a given workspace.
static Set<String> getWysiwygCSSFileSet()
          Returns the list of CSS files for the WYSIWYG.
 boolean hasWKRole(String wfRoleId)
          Check if a WKRole exists in this workspace for the specified WFRole id
 boolean hasWKRole(WFRole wfRole)
          Check if a WKRole exists in this workspace for the specified WFRole
 boolean hasWorkflow(Class clazz)
          Check if the type is linked to a workflow for this workspace
protected static void initWYSIWYGStyleMap()
          Parse all css wysiwyg file to build cssGlobalMap if it is null
 boolean isAdmin(Member member)
          Check if the member is an administrator of the workspace or of the channel
 boolean isClosed()
          Getter for isClosed.
 boolean isModel()
          Getter for model
 boolean isWorkspaceCat(Category cat)
          Checks if the given category is a workspace category or a descendent of worspace categories.
 void linkRole(WFRole wfRole, WKRole wkRole)
          Link into the workspace a WFRole to a WKRole
 void performDelete(Member mbr, Map context)
          Performs data deletion
 void performUpdate(Member mbr, Map context)
          Performs data update
 void setAdministrators(ArrayList<Member> administrators)
           
 void setCatSet(HashSet<Category> catSet)
           
 void setClosed(boolean closed)
          Setter for isClosed
 void setEmail(String email)
           
 void setGlobalCSS(String[] globalCSS)
          Setter for globcalCSS
 void setLanguage(String language)
           
 void setModel(boolean model)
          Setter for model
 void setOrder(int order)
           
static void setRequestWorkspace(javax.servlet.http.HttpServletRequest request, Workspace workspace)
          Set the given workspace to the request.
 void setRole(WFRole wfRole, WKRole wkRole)
          Binds a WKRole to a WFRole
 void setRoleMap(HashMap<String,WKRole> roleMap)
          Setter of RoleMap
static void setSessionWorkspace(javax.servlet.http.HttpSession session, Workspace workspace)
          Set the given workspace to the session.
 void setTitle(String v)
          Set the value of title.
 void setTitleML(HashMap<String,String> v)
          Set the HashMap containing the titles of this Workspace in language other than the main site language.
 void setTypeMap(HashMap<Class<?>,Object> typeMap)
          Setter of TypeMap
 void setTypeWorkflow(Class<?> clazz, Workflow wf)
          Link a Workflow to a given Class.
 boolean setWSTypeEntry(Class<?> clazz, WSTypeEntry wste)
          Link a WSTypeEntry to a given Class.
 String toCSV(String lang)
          Returns a CSV view of this object
 String toString()
           
 void updateGroupSet(Group grp, boolean add)
          Update the groupSet index
 void updatePubSet(Publication pub, boolean add)
          Update pubSet index
 
Methods inherited from class com.jalios.jcms.Data
checkCreate, checkDelete, checkLock, checkUpdate, checkWrite, exportXml, exportXml, exportXml, exportXmlFiles, fillExportXmlFieldAttributes, getAllReferrerSet, getAllReferrerSet, getAllTypeFieldEntry, getAuthor, getAuthorComparator, getAuthorId, getAuthorSelector, getBooleanFieldValue, getCaddyComparator, getCategoryFieldValue, getCdateComparator, getCdateSelector, getDataImage, getDataImage, getDataImage, getDataNameComparator, getDate, getDate, getDateSelector, getDeletableSelector, getDisplayUrl, getDoubleFieldValue, getExportXmlDataValue, getExtension, getExtraData, getExtraDataMap, getExtraDBData, getExtraDBDataMap, getExtraInfo, getExtraInfoMap, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getIdComparator, getImportAuthor, getImportBatch, getImportDate, getImportDisplayUrl, getImportId, getImportMap, getImportMdate, getImportSelector, getImportSignature, getImportSource, getImportSourceUrl, getImportUrl, getIntFieldValue, getIntFieldValue, getLinkCount, getLinkIndexedDataSet, getLinkIndexedDataSet, getLockDate, getLockMember, getLongFieldValue, getMdateComparator, getMdateSelector, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getOpAuthor, getOpAuthorComparator, getOpDelegate, getRowId, getTypeEntry, getTypeFieldsEntries, getUpdateInstance, hashCode, importXml, importXmlFieldsWithReferences, importXmlFiles, importXmlReferences, isImported, isImportUpdated, isInDatabase, isLocked, isPersisted, lock, markNewImport, performAfterWrite, performBeforeWrite, performCreate, performCreate, performDelete, performUpdate, removeExtraData, removeExtraDBData, removeExtraInfo, setAuthor, setAuthorId, setExtension, setExtraData, setExtraDataMap, setExtraDBData, setExtraDBDataMap, setExtraInfo, setImportAuthor, setImportBatch, setImportDate, setImportDisplayUrl, setImportId, setImportMap, setImportMdate, setImportSignature, setImportSource, setImportSourceUrl, setImportUpdated, setMdate, setOpAuthor, setOpDelegate, setRowId, toFullString, unlock, unlock, unmarkNewImport, updateExtraDataMap, updateExtraDBDataMap, updateIndexTreeSet
 
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
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values

title

protected String title

titleML

protected HashMap<String,String> titleML

order

protected int order

administrators

protected ArrayList<Member> administrators

typeMap

protected HashMap<Class<?>,Object> typeMap

roleMap

protected HashMap<String,WKRole> roleMap

catSet

protected HashSet<Category> catSet

email

protected String email

isModel

protected boolean isModel

isClosed

protected boolean isClosed

globalCSS

protected String[] globalCSS

language

protected String language

groupSet

protected transient TreeSet<Group> groupSet

pubSet

protected transient TreeSet<Publication> pubSet

classPubSetMap

protected transient HashMap<Class<?>,Set<Publication>> classPubSetMap

WORKSPACE_ICON

public static final String WORKSPACE_ICON
See Also:
Constant Field Values

WORKSPACE_MODEL_ICON

public static final String WORKSPACE_MODEL_ICON
See Also:
Constant Field Values

WORKSPACE_CLOSED_ICON

public static final String WORKSPACE_CLOSED_ICON
See Also:
Constant Field Values

WORKSPACE_MODEL_CLOSED_ICON

public static final String WORKSPACE_MODEL_CLOSED_ICON
See Also:
Constant Field Values

ALL_WORKSPACE_ICON

public static final String ALL_WORKSPACE_ICON
See Also:
Constant Field Values

cachedHomeCat

protected transient Category cachedHomeCat

cssGlobalMap

protected static transient Map<String,Set<String>> cssGlobalMap
Constructor Detail

Workspace

public Workspace()

Workspace

public Workspace(Workspace other)
Method Detail

toString

public String toString()
Overrides:
toString in class Data

exportXmlField

public void exportXmlField(StringBuffer sb,
                           int indentLevel)
Description copied from class: Data
Fills the given StringBuffer with Xml export of fields of this data.

Overrides:
exportXmlField in class Data
Parameters:
sb - the StringBuffer
indentLevel - the indent level

toCSV

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

Overrides:
toCSV in class Data
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

getIcon

public String getIcon()
Returns the image path icon for the given workspace

Returns:
String image relative path
Since:
jcms-5.5.0

flushHomeUrl

public void flushHomeUrl()
Reset the cache of the home category. Should only be called by category, publication and workspace listeners


getHomeUrl

public String getHomeUrl(Locale userLocal)
Returns the home url for the given workspace calculated from portal categories that belongs to workspace

Parameters:
userLocal - the user local
Returns:
String

getHomeUrlVisitor

protected Category getHomeUrlVisitor(Collection<Category> collect,
                                     Set<Publication> portalSet)
Internal methods to check home url

Parameters:
collect - a collection of category to check
portalSet - the portal set
Returns:
Category the hoem category

isWorkspaceCat

public boolean isWorkspaceCat(Category cat)
Checks if the given category is a workspace category or a descendent of worspace categories.

Parameters:
cat - the child category
Returns:
true if the given category is a workspace category or a descendent of worspace categories.
Since:
jcms 4.1

getFirstWorkspaceCat

public Category getFirstWorkspaceCat(Category cat)
Returns first workspace category mathching (or parent) given category.

Parameters:
cat - the child category
Returns:
category the workspace category.
Since:
jcms 5.7.4

getGlobalWYSIWYGStyle

public Set<String> getGlobalWYSIWYGStyle()
Returns a Set of global style for the current workspace.

Returns:
Set of global style

getLocalWYSIWYGStyle

public Set<String> getLocalWYSIWYGStyle(String global)
Returns a Set of local style for a given global style

Parameters:
global - the selected global style
Returns:
Set of local style

getGlobalWYSIWYGStyleMap

public static Map<String,Set<String>> getGlobalWYSIWYGStyleMap()

getWysiwygCSSFileSet

public static Set<String> getWysiwygCSSFileSet()
Returns the list of CSS files for the WYSIWYG.

Returns:
Set of wysiwyg css files
See Also:
PolicyManager.checkWysiwygCSSFile(Set)

initWYSIWYGStyleMap

protected static void initWYSIWYGStyleMap()
Parse all css wysiwyg file to build cssGlobalMap if it is null


getAllWorkspaceSet

public static Set<Workspace> getAllWorkspaceSet()
Returns a Set with all workspace, model or not. CAUTION: DO NOT alter the returned set, clone prior modification.

Returns:
Set of Workspace
Since:
jcms-5.5.0

getAllWorkspaceSet

public static Set<Workspace> getAllWorkspaceSet(Member member)
Returns a Set of workspace, for the given member. If the Member is an Admin return all workspace (model or not) If member is not null return workspace's member otherwise return empty TreeSet.

Parameters:
member - the working member
Returns:
Set of Workspace
Since:
jcms-5.5.0

getAllWorkspaceSetWithoutModel

public static Set<Workspace> getAllWorkspaceSetWithoutModel()
Returns a Set with all workspace without workspace model.

Returns:
Set of Workspace
Since:
jcms-5.5.0

getAllWorkspaceSetModel

public static Set<Workspace> getAllWorkspaceSetModel()
Returns a Set with all workspace model.

Returns:
Set of Workspace
Since:
jcms-5.5.0

getWorkflow

public Workflow getWorkflow(Class clazz)
Find the Worflow associated to the given class. This method also check for super class.

Parameters:
clazz -
Returns:
the workflow linked to the given class.
Since:
jcms-4.1
See Also:
getWorkflow(Class, boolean)

getWorkflow

public Workflow getWorkflow(Class<?> clazz,
                            boolean checkSuperclass)
Find the Worflow associated to the given class or one of it's super class. Since jcms-5.5.0, the workflow stored in the typeMap may be a String or a WSTypeEntry

Parameters:
clazz - the target class
checkSuperclass - should check super class
Returns:
the workflow linked to the given class.
Since:
jcms-4.1
See Also:
getWorkflow(Class)

getWSTypeEntry

public WSTypeEntry getWSTypeEntry(Class clazz)
Returns a WSTypeEntry describing custom properties for a given type in a given workspace. WARNING: If Workspace doesn't handle a WSTypeEntry for this class it will return a fake WSTypeEntry.

Parameters:
clazz - the target class
Returns:
WSTypeEntry the type description or null if it doesn't exists
Since:
jcms-5.5.0

getWSTypeEntry

public WSTypeEntry getWSTypeEntry(String className)
Returns a WSTypeEntry describing custom properties for a given type in a given workspace. WARNING: If Workspace doesn't handle a WSTypeEntry for this class it will return a fake WSTypeEntry.

Parameters:
className - the target class name
Returns:
WSTypeEntry the type description or null if it doesn't exists
Since:
jcms-5.5.0

getTypeLabel

public String getTypeLabel(Class clazz,
                           String lang)
Returns the label for the given type (class) in the given language.

Parameters:
clazz - the class
lang - the language
Returns:
the label for the given type in the given language.

getTypeDescription

public String getTypeDescription(Class clazz,
                                 String lang)
Returns the description for the given type (class) in the given language.

Parameters:
clazz - the class
lang - the language
Returns:
the description for the given type (class) in the given language.

hasWorkflow

public boolean hasWorkflow(Class clazz)
Check if the type is linked to a workflow for this workspace

Parameters:
clazz - the class to check
Returns:
true if the type is linked to a workflow
Since:
jcms-4.1

getTypeSet

public Set<Class<?>> getTypeSet()
Returns a Set of all visible types

Returns:
a Set of all visible types (String)
Since:
jcms-4.1

canPublish

public boolean canPublish(Class clazz)
Checks if the given class can be published in this workspace.

Returns:
true if the given class can be published in this workspace
Since:
jcms-4.1

getWorkflowSet

public Set<Workflow> getWorkflowSet()
Returns a Set of all workflow used by calling getWorkflow(clazz,false) on all clazz.

Returns:
a Set of all workflow used
Since:
jcms-4.1

setTypeWorkflow

public void setTypeWorkflow(Class<?> clazz,
                            Workflow wf)
Link a Workflow to a given Class. Warning since jcms-5.5.0 Workspace may use a WSTypeEntry. You may also use setWSTypeEntry(Class,WSTypeEntry) If the given class is linked to a WSTypeEntry then this method will throw a RuntimeException.

Parameters:
clazz - the clazz to link
wf - the workflow to link
Since:
jcms-5.5.0
See Also:
setWSTypeEntry(Class, WSTypeEntry)

setWSTypeEntry

public boolean setWSTypeEntry(Class<?> clazz,
                              WSTypeEntry wste)
Link a WSTypeEntry to a given Class. If WSTypeEntry.isSameProperties() than channel properties then do not store the WSTypeEntry. Warning: Caller must create, update or delete the WSTypeEntry this method is only a convenient setter

Parameters:
clazz - the clazz to link
wste - the WSTypeEntry to link with
Returns:
boolean true if the WSTypeEntry is used or false if it is same
Since:
jcms-5.5.0

getPublicationSet

public Set<Publication> getPublicationSet(Workflow workflow)
Return all publication for a given Workflow

Parameters:
workflow -
Returns:
a Set of publication
Since:
jcms-4.1

getPublicationSet

public Set<Publication> getPublicationSet(Workflow workflow,
                                          boolean specialState)
Return all the publication in/not a special state for the given Workflow

Parameters:
workflow -
specialState -
Returns:
a Set of publication
Since:
jcms-4.1

getPubSet

public TreeSet<Publication> getPubSet()
Returns:
Returns the pubSet.
Since:
jcms-4.1

updatePubSet

public void updatePubSet(Publication pub,
                         boolean add)
Update pubSet index

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

getClassPubSetMap

public HashMap<Class<?>,Set<Publication>> getClassPubSetMap()
Returns:
map(class, pubSet)
Since:
jcms-4.1

getPublicationSet

public <T extends Publication> Set<T> getPublicationSet(Class<?> clazz,
                                                        boolean specialState)
Return all the publication in/not a special state for the given class

Parameters:
clazz -
specialState -
Returns:
a Set of publication
Since:
jcms-4.1

getPublicationSet

public <T extends Publication> Set<T> getPublicationSet(Class<?> clazz)
Return all publication for a given Clazz

Parameters:
clazz -
Returns:
a Set of publication
Since:
jcms-4.1

getWFRole

public WFRole getWFRole(WKRole wkRole)
Returns the WFRole bound to the given WKRole.

Parameters:
wkRole - the WKRole to look for.
Returns:
the WFRole bound to the given WKRole.
Since:
jcms-5.0.5

getRole

public WKRole getRole(WFRole wfRole)
Get the WKRole linked to a WFRole for a given Workflow

Parameters:
wfRole - the role
Returns:
WKRole associated to the given WFRole
Since:
jcms-4.1

setRole

public void setRole(WFRole wfRole,
                    WKRole wkRole)
Binds a WKRole to a WFRole

Parameters:
wfRole - the WFRole
wkRole - the WKRole
Since:
jcms-5.5.0

getRole

public WKRole getRole(String wfRoleId)
Get the WKRole linked to a WFRole for a given Workflow

Parameters:
wfRoleId - the role id
Returns:
WKRole associated to the given WFRole
Since:
jcms-4.1

hasWKRole

public boolean hasWKRole(String wfRoleId)
Check if a WKRole exists in this workspace for the specified WFRole id

Parameters:
wfRoleId - the id of the WFRole to check
Returns:
true if the wfRoleID have associated WKRole
Since:
jcms-4.1

hasWKRole

public boolean hasWKRole(WFRole wfRole)
Check if a WKRole exists in this workspace for the specified WFRole

Parameters:
wfRole - the WFRole to check
Returns:
true if the wfRole have associated WKRole
Since:
jcms-4.1

getWFRoleIdSet

public Set<String> getWFRoleIdSet()
Return a set of all WFRoleId

Returns:
a set of WFRoleId
Since:
jcms-4.1

getWFRoleSet

public Set<WFRole> getWFRoleSet()
Return a set of all WFRole

Returns:
a set of WFRole
Since:
jcms-4.1

getWKRoleSet

public Set<WKRole> getWKRoleSet()
Return a set of all WKRole

Returns:
a set of WKRole
Since:
jcms-4.1

getWKRoleSet

public Set<WKRole> getWKRoleSet(Workflow wf)
Return all the WKRole for a given Workflow

Parameters:
wf -
Returns:
a Set of WKRole
Since:
jcms-4.1

getWKRoleSet

public Set<WKRole> getWKRoleSet(Class clazz)
Return all the WKRole for a given Class

Parameters:
clazz - the class
Returns:
a Set of WKRole
Since:
jcms-4.1

linkRole

public void linkRole(WFRole wfRole,
                     WKRole wkRole)
Link into the workspace a WFRole to a WKRole

Parameters:
wfRole -
wkRole -
Since:
jcms-4.1

isAdmin

public boolean isAdmin(Member member)
Check if the member is an administrator of the workspace or of the channel

Parameters:
member -
Returns:
true if the member is an administrator
Since:
jcms-4.1

getComparator

public static Comparator<Workspace> getComparator(String str,
                                                  boolean reverse)
Since:
jcms-5.0.0

getNameComparator

public static Comparator<Workspace> getNameComparator(String lang)
Returns a new Comparator instance to compare workspace based on their title.

Parameters:
lang - the language in which to compare workspace
Since:
jcms-5.6.1

getOrderComparator

public static Comparator<Workspace> getOrderComparator(String lang)
Returns a new Comparator instance to compare workspace based on their order.

Parameters:
lang - the language in which to compare workspaces'title when order is the same.
Since:
jcms-5.6.1

getGroupSizeComparator

public static Comparator<Workspace> getGroupSizeComparator(String lang)
Returns a new Comparator instance to compare workspace based on the number of groups in each workspace.

Parameters:
lang - the language in which to compare workspaces'title when number of groups is the same.
Since:
jcms-5.6.1

getMemberSizeComparator

public static Comparator<Workspace> getMemberSizeComparator(String lang)
Returns a new Comparator instance to compare workspace based on the number of members in each workspace.

Parameters:
lang - the language in which to compare workspaces'title when number of members is the same.
Since:
jcms-5.6.1

getMemberSet

public Set<Member> getMemberSet()
Convenient method that return a set of members representing members that belongs to groups of this workspace or administrators of this workspace

Returns:
a new Set containing all members of this Workspace

setSessionWorkspace

public static void setSessionWorkspace(javax.servlet.http.HttpSession session,
                                       Workspace workspace)
Set the given workspace to the session.

Parameters:
session - the session
workspace - the workspace
Since:
jcms-4.1

getSessionWorkspace

public static Workspace getSessionWorkspace(javax.servlet.http.HttpSession session)
Get the workspace stored in the session

Parameters:
session - the session
Returns:
the workspace in the session
Since:
jcms-4.1

setRequestWorkspace

public static void setRequestWorkspace(javax.servlet.http.HttpServletRequest request,
                                       Workspace workspace)
Set the given workspace to the request.

Parameters:
request - the request
workspace - the workspace
Since:
jcms-5.0

getRequestWorkspace

public static Workspace getRequestWorkspace(javax.servlet.http.HttpServletRequest request)
Get the workspace stored in the request

Parameters:
request - the request
Returns:
the workspace in the request
Since:
jcms-5.0

getDataName

public String getDataName(String language)
Description copied from class: Data
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.

Overrides:
getDataName in class Data
Parameters:
language - the language in which to return the name if multilang available for the data.
Returns:
title of Workspace in given language or empty String if not specified.
Since:
jcms-5.1
See Also:
getTitle(String), Data.getDataName(String)

getTitle

public String getTitle(String lang)
Get the value of title bound to the given language.

Parameters:
lang - the language to get the title
Returns:
title in the given language.
Since:
jcms-4.1

getTitle

public String getTitle(String lang,
                       boolean useDefault)
Get the value of title bound to the given language.

Parameters:
lang - the language to get the title
useDefault - should main language used as default language if title does not exist in the given language
Returns:
title in the given language.
Since:
jcms-4.1

getTitle

public String getTitle()
Get the value of title.

Returns:
Value of title.
Since:
jcms-4.1

setTitle

public void setTitle(String v)
Set the value of title.

Parameters:
v - Value to assign to title.
Since:
jcms-4.1

getTitleML

public HashMap<String,String> getTitleML()
Retrieve the HashMap containing the titles of this Workspace in language other than the main site language.

Returns:
an HashMap of String.
Since:
jcms-4.1

setTitleML

public void setTitleML(HashMap<String,String> v)
Set the HashMap containing the titles of this Workspace in language other than the main site language.

Parameters:
v - Value to assign to titleML.
Since:
jcms-4.1

setGlobalCSS

public void setGlobalCSS(String[] globalCSS)
Setter for globcalCSS

Parameters:
globalCSS - Set of css name

getGlobalCSS

public String[] getGlobalCSS()
Getter for globalCSS

Returns:
Set of css name

isModel

public boolean isModel()
Getter for model

Returns:
model is workspace is a model

setModel

public void setModel(boolean model)
Setter for model

Parameters:
model - is workspace is a model

isClosed

public boolean isClosed()
Getter for isClosed. Is a workspace is closed, no contribution, no modification on groups are allowed.

Returns:
isClosed is workspace is Closed For Contribution

setClosed

public void setClosed(boolean closed)
Setter for isClosed

Parameters:
closed - to close this workspace for contribution

getRoleMap

public HashMap<String,WKRole> getRoleMap()
Getter of RoleMap

Returns:
the association: Workflow / WfRoleSet
Since:
jcms-4.1

setRoleMap

public void setRoleMap(HashMap<String,WKRole> roleMap)
Setter of RoleMap

Parameters:
roleMap -
Since:
jcms-4.1

getTypeMap

public HashMap<Class<?>,Object> getTypeMap()
Getter of TypeMap

Returns:
a Map Class / Workflow Id
Since:
jcms-4.1

setTypeMap

public void setTypeMap(HashMap<Class<?>,Object> typeMap)
Setter of TypeMap

Parameters:
typeMap -
Since:
jcms-4.1

getOrder

public int getOrder()
Returns:
Returns the order.
Since:
jcms-4.1

setOrder

public void setOrder(int order)
Parameters:
order - The order to set.
Since:
jcms-4.1

getGroupSet

public TreeSet<Group> getGroupSet()
Returns:
Returns the groupSet.
Since:
jcms-4.1

updateGroupSet

public void updateGroupSet(Group grp,
                           boolean add)
Update the groupSet index

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

getAdministrators

public ArrayList<Member> getAdministrators()
Returns:
Returns the administrators.
Since:
jcms-4.1

setAdministrators

public void setAdministrators(ArrayList<Member> administrators)
Parameters:
administrators - The administrators to set.
Since:
jcms-4.1

getCatSet

public HashSet<Category> getCatSet()
Returns:
Returns the catSet.
Since:
jcms-4.1

setCatSet

public void setCatSet(HashSet<Category> catSet)
Parameters:
catSet - The catSet to set.
Since:
jcms-4.1

getEmail

public String getEmail()
Returns:
Returns the email.
Since:
jcms-4.1

getLanguage

public String getLanguage()
Returns:
Returns the main Language of the workspace if it is specified. null otherwise.
Since:
jcms-5.7.3

setLanguage

public void setLanguage(String language)
Parameters:
language - The language to set.
Since:
jcms-5.7.3

getFullEmail

public String getFullEmail()
Returns the full email in the form "WorkspaceTitle ".

Returns:
an email
Since:
jcms-5.0.0

getFullEmail

public String getFullEmail(String lang)
Returns the full email in the form "WorkspaceTitle ".

Parameters:
lang - the language used to retrive Workspace title
Returns:
an email
Since:
jcms-5.0.0

setEmail

public void setEmail(String email)
Parameters:
email - The email to set.
Since:
jcms-4.1

checkIntegrity

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

Overrides:
checkIntegrity in class Data
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.

Overrides:
checkMember in class Data
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,
                                    Map context)
Checks if the creation can be performed

Overrides:
checkCreate in class Data
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,
                                    Map context)
Checks if the update can be performed

Overrides:
checkUpdate in class Data
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,
                                    Map context)
Checks if the deletion can be performed

Overrides:
checkDelete in class Data
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

performUpdate

public void performUpdate(Member mbr,
                          Map context)
Description copied from class: Data
Performs data update

Overrides:
performUpdate in class Data
Parameters:
mbr - the member which requests the write operation
context - a map which contains context parameters (may be null)
Since:
jcms-5.5.0
See Also:
Data.performUpdate(com.jalios.jcms.Member, java.util.Map)

performDelete

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

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


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