Package com.jalios.jcms.archive
Class ArchivedPublication
- java.lang.Object
-
- com.jalios.jcms.archive.ArchivedPublication
-
- All Implemented Interfaces:
DBData,JcmsConstants,JaliosConstants,java.io.Serializable,java.lang.Comparable<ArchivedPublication>
public class ArchivedPublication extends java.lang.Object implements java.lang.Comparable<ArchivedPublication>, DBData, JcmsConstants
This class represents an archived Publication in memory, used to keep track of authors, rights, category, workspace of archived publication- Since:
- jcms-4.1.1
- Author:
- Olivier Jaquemet
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Memberauthorprotected java.util.TreeSet<Group>authorizedGroupSetprotected java.util.TreeSet<Member>authorizedMemberSetprotected java.util.Datecdateprotected java.lang.Stringdescriptionprotected java.util.HashMap<java.lang.String,java.lang.String>descriptionMLprotected java.lang.StringmainLanguageprotected java.lang.StringoriginalIdprotected shortoriginalTypeprotected java.lang.StringoriginalTypeLabelprotected java.lang.LongrowIdprotected java.lang.Stringtitleprotected java.util.HashMap<java.lang.String,java.lang.String>titleMLstatic shortTYPE_CONTENTstatic shortTYPE_FORMprotected Workspaceworkspace-
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.JcmsConstants
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DATA_DIRECTORY, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, IS_IN_FRONT_OFFICE, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_DIR, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
-
-
Constructor Summary
Constructors Constructor Description ArchivedPublication()ArchivedPublication(Publication pub)Create a new ArchivedPublication from a publication.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeDeletedBy(Member member)Check if this archive can be deleted by specified member.booleancanBeReadBy(Member member)Check if this archive can be ready by specified member.booleancanBeUpdatedBy(Member member)Check if this archive can be updated by specified member.intcompareTo(ArchivedPublication other)voiddelete()Delete this archive (from the DB and all associated files on disk).java.util.HashMap<java.lang.String,java.lang.String>getAssociatedFilesMap()Retrieve files associated with the given archive.MembergetAuthor()Get the author of this Archive.java.lang.StringgetAuthorId()Returns the JStore ID of the authorjava.lang.StringgetAuthorizedGroupIds()java.util.Set<Group>getAuthorizedGroupSet()Get the set of Group authorized to read this archive.java.lang.StringgetAuthorizedMemberIds()java.util.Set<Member>getAuthorizedMemberSet()Get the set of Member authorized to read this archive.java.util.DategetCdate()Get the archive creation date.java.lang.StringgetDescription()java.lang.StringgetDescription(java.lang.String lang)java.lang.StringgetDescription(java.lang.String lang, boolean useDefault)java.util.HashMap<java.lang.String,java.lang.String>getDescriptionML()java.lang.StringgetDescriptionXml()Retrieves an xml serialization of the descriptions of this Publication in all the languages.java.lang.StringgetMainLanguage()Get the value of main language.java.lang.StringgetOriginalId()shortgetOriginalType()java.lang.StringgetOriginalTypeLabel()java.lang.StringgetReadRightsString(int max)This convenient method returns a String displaying group/member read rights (eg if this publication is restricted to g1, g2, m1, m2 and m3, getReadRightsString(3) will return "g1, g2, m1, ...")java.lang.LonggetRowId()java.lang.StringgetSavedHtmlPath(java.lang.String userLang)Return the path (webapp relative, for jsp inclusion) of the file in which the original publication was savedjava.lang.StringgetSavedXmlPath()Return the path (webapp relative) of the XML file in which the original publication's data was savedjava.lang.StringgetTitle()Retrieve the title of this publication in the main site language.java.lang.StringgetTitle(java.lang.String lang)Get the value of title bound to the given language.java.lang.StringgetTitle(java.lang.String lang, boolean useDefault)Get the value of title bound to the given language.java.util.HashMap<java.lang.String,java.lang.String>getTitleML()Retrieve the HashMap containing the titles of this publication in language other than the main site language.java.lang.StringgetTitleXml()Retrieves an xml serialization of the titles of this Publication in all the languages.WorkspacegetWorkspace()java.lang.StringgetWorkspaceId()booleanhasAnyReadRights()Tests if this archive has member or group read rights.voidsave()Creates or updates this archive in the DB.voidsetAuthor(Member mbr)Set the author of this Archive.voidsetAuthorId(java.lang.String authordId)Sets the JStore ID of the authorvoidsetAuthorizedGroupIds(java.lang.String authorizedGroupIds)voidsetAuthorizedGroupSet(java.util.TreeSet<Group> groupSet)Set the set of Group authorized to read this archive.voidsetAuthorizedMemberIds(java.lang.String authorizedMemberIds)voidsetAuthorizedMemberSet(java.util.TreeSet<Member> memberSet)Set the set of Member authorized to read this archive.voidsetCdate(java.util.Date cdate)Set the creation date of this ArchivedPublication.voidsetDescription(java.lang.String value)voidsetDescriptionML(java.util.HashMap<java.lang.String,java.lang.String> map)voidsetDescriptionXml(java.lang.String xml)Set the descriptions of this Publication in all the languages using the specified XML string.voidsetMainLanguage(java.lang.String v)Set the value of main language.voidsetOriginalId(java.lang.String originalId)voidsetOriginalType(short originalType)voidsetOriginalTypeLabel(java.lang.String originalTypeLabel)voidsetRowId(java.lang.Long rowId)voidsetTitle(java.lang.String v)Set the title of this publication in the main site language.voidsetTitleML(java.util.HashMap<java.lang.String,java.lang.String> v)Set the HashMap containing the titles of this publication in language other than the main site language.voidsetTitleXml(java.lang.String xml)Set the titles of this Publication in all the languages using the specified XML string.voidsetWorkspace(Workspace workspace)voidsetWorkspaceId(java.lang.String workspaceId)
-
-
-
Field Detail
-
TYPE_CONTENT
public static final short TYPE_CONTENT
- See Also:
- Constant Field Values
-
TYPE_FORM
public static final short TYPE_FORM
- See Also:
- Constant Field Values
-
rowId
protected java.lang.Long rowId
-
cdate
protected java.util.Date cdate
-
workspace
protected Workspace workspace
-
author
protected Member author
-
mainLanguage
protected java.lang.String mainLanguage
-
title
protected java.lang.String title
-
titleML
protected java.util.HashMap<java.lang.String,java.lang.String> titleML
-
description
protected java.lang.String description
-
descriptionML
protected java.util.HashMap<java.lang.String,java.lang.String> descriptionML
-
originalId
protected java.lang.String originalId
-
originalType
protected short originalType
-
originalTypeLabel
protected java.lang.String originalTypeLabel
-
authorizedMemberSet
protected java.util.TreeSet<Member> authorizedMemberSet
-
authorizedGroupSet
protected java.util.TreeSet<Group> authorizedGroupSet
-
-
Constructor Detail
-
ArchivedPublication
public ArchivedPublication()
-
ArchivedPublication
public ArchivedPublication(Publication pub)
Create a new ArchivedPublication from a publication.Should only be called by the ArchiveManager which performs the whole archiving process.
- Parameters:
pub- the Publication from which we create this Archive- Since:
- jcms-4.1.1
-
-
Method Detail
-
save
public void save()
Creates or updates this archive in the DB.
-
delete
public void delete()
Delete this archive (from the DB and all associated files on disk).
-
canBeReadBy
public boolean canBeReadBy(Member member)
Check if this archive can be ready by specified member.- Parameters:
member- the member to check (can be null)- Returns:
- true is Member can read archive, false otherwise
-
canBeUpdatedBy
public boolean canBeUpdatedBy(Member member)
Check if this archive can be updated by specified member.- Parameters:
member- the member to check (can be null)- Returns:
- true is Member can delete archive, false otherwise
-
canBeDeletedBy
public boolean canBeDeletedBy(Member member)
Check if this archive can be deleted by specified member.- Parameters:
member- the member to check (can be null)- Returns:
- true is Member can delete archive, false otherwise
-
getSavedHtmlPath
public java.lang.String getSavedHtmlPath(java.lang.String userLang)
Return the path (webapp relative, for jsp inclusion) of the file in which the original publication was saved- Parameters:
userLang- the lang in which the Publication is wanted, if available- Returns:
- the path of the html file were the Publication was saved, or null if no file was found
- Since:
- jcms-4.1.1
-
getSavedXmlPath
public java.lang.String getSavedXmlPath()
Return the path (webapp relative) of the XML file in which the original publication's data was saved- Returns:
- the path of the XML file were the Publication was saved
- Since:
- jcms-4.1.1
-
getAssociatedFilesMap
public java.util.HashMap<java.lang.String,java.lang.String> getAssociatedFilesMap()
Retrieve files associated with the given archive.- Returns:
- an hashmap, filename ==> filepath (webapp relative)
-
getCdate
public java.util.Date getCdate()
Get the archive creation date.- Returns:
- a date.
-
setCdate
public void setCdate(java.util.Date cdate)
Set the creation date of this ArchivedPublication.- Parameters:
cdate- Value to assign to cdate.
-
getWorkspace
public Workspace getWorkspace()
-
setWorkspace
public void setWorkspace(Workspace workspace)
-
getWorkspaceId
public java.lang.String getWorkspaceId()
-
setWorkspaceId
public void setWorkspaceId(java.lang.String workspaceId)
-
getAuthor
public Member getAuthor()
Get the author of this Archive.- Returns:
- the Member author of this archive.
- Since:
- jcms-6.0
-
setAuthor
public void setAuthor(Member mbr)
Set the author of this Archive.- Parameters:
mbr- Value to assign to author.- Since:
- jcms-6.0
-
getAuthorId
public java.lang.String getAuthorId()
Returns the JStore ID of the author- Returns:
- the JStore ID of the author
- Since:
- jcms-6.0
-
setAuthorId
public void setAuthorId(java.lang.String authordId)
Sets the JStore ID of the author- Parameters:
authordId- the JStore author id- Since:
- jcms-6.0
-
getMainLanguage
public java.lang.String getMainLanguage()
Get the value of main language.- Returns:
- Value of main language.
-
setMainLanguage
public void setMainLanguage(java.lang.String v)
Set the value of main language.- Parameters:
v- Value to assign to main language.
-
getTitle
public java.lang.String getTitle(java.lang.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-6.0
-
getTitle
public java.lang.String getTitle(java.lang.String lang, boolean useDefault)Get the value of title bound to the given language.- Parameters:
lang- the language to get the titleuseDefault- should main language used as default language if title does not exist in the given language- Returns:
- title in the given language.
- Since:
- jcms-6.0
-
getTitle
public java.lang.String getTitle()
Retrieve the title of this publication in the main site language.- Returns:
- Value of title.
- Since:
- jcms-6.0
-
setTitle
public void setTitle(java.lang.String v)
Set the title of this publication in the main site language.- Parameters:
v- value to assign to title.- Since:
- jcms-6.0
-
getTitleML
public java.util.HashMap<java.lang.String,java.lang.String> getTitleML()
Retrieve the HashMap containing the titles of this publication in language other than the main site language.- Returns:
- an HashMap of String.
- Since:
- jcms-6.0
-
setTitleML
public void setTitleML(java.util.HashMap<java.lang.String,java.lang.String> v)
Set the HashMap containing the titles of this publication in language other than the main site language.- Parameters:
v- an HashMap of String.- Since:
- jcms-6.0
-
getTitleXml
public java.lang.String getTitleXml()
Retrieves an xml serialization of the titles of this Publication in all the languages.- Returns:
- a valid XML document, as returned by
JcmsUtil.convertMultilingualFieldToXml(String, Map) - Since:
- jcms-6.0
-
setTitleXml
public void setTitleXml(java.lang.String xml)
Set the titles of this Publication in all the languages using the specified XML string.- Parameters:
xml- an xml string as returned bygetTitleXml()- Since:
- jcms-6.0
-
getDescription
public java.lang.String getDescription()
-
setDescription
public void setDescription(java.lang.String value)
-
getDescription
public java.lang.String getDescription(java.lang.String lang)
-
getDescription
public java.lang.String getDescription(java.lang.String lang, boolean useDefault)
-
getDescriptionML
public java.util.HashMap<java.lang.String,java.lang.String> getDescriptionML()
-
setDescriptionML
public void setDescriptionML(java.util.HashMap<java.lang.String,java.lang.String> map)
-
getDescriptionXml
public java.lang.String getDescriptionXml()
Retrieves an xml serialization of the descriptions of this Publication in all the languages.- Returns:
- a valid XML document, as returned by
JcmsUtil.convertMultilingualFieldToXml(String, Map) - Since:
- jcms-6.0
-
setDescriptionXml
public void setDescriptionXml(java.lang.String xml)
Set the descriptions of this Publication in all the languages using the specified XML string.- Parameters:
xml- an xml string as returned bygetDescriptionXml()- Since:
- jcms-6.0
-
getAuthorizedMemberSet
public java.util.Set<Member> getAuthorizedMemberSet()
Get the set of Member authorized to read this archive.- Returns:
- a set of Member.
- Since:
- jcms-6.0
-
setAuthorizedMemberSet
public void setAuthorizedMemberSet(java.util.TreeSet<Member> memberSet)
Set the set of Member authorized to read this archive.- Parameters:
memberSet- a set of Member.- Since:
- jcms-6.0
-
getAuthorizedMemberIds
public java.lang.String getAuthorizedMemberIds()
-
setAuthorizedMemberIds
public void setAuthorizedMemberIds(java.lang.String authorizedMemberIds)
-
getAuthorizedGroupSet
public java.util.Set<Group> getAuthorizedGroupSet()
Get the set of Group authorized to read this archive.- Returns:
- a set of Group.
- Since:
- jcms-6.0
-
setAuthorizedGroupSet
public void setAuthorizedGroupSet(java.util.TreeSet<Group> groupSet)
Set the set of Group authorized to read this archive.- Parameters:
groupSet- a set of Group.- Since:
- jcms-6.0
-
getAuthorizedGroupIds
public java.lang.String getAuthorizedGroupIds()
-
setAuthorizedGroupIds
public void setAuthorizedGroupIds(java.lang.String authorizedGroupIds)
-
hasAnyReadRights
public boolean hasAnyReadRights()
Tests if this archive has member or group read rights.- Returns:
- true if there are member or group read rights.
- Since:
- jcms-6.0
-
getReadRightsString
public java.lang.String getReadRightsString(int max)
This convenient method returns a String displaying group/member read rights (eg if this publication is restricted to g1, g2, m1, m2 and m3, getReadRightsString(3) will return "g1, g2, m1, ...")- Parameters:
max- how many group/member to display- Returns:
- a String
- Since:
- jcms-6.0
-
getOriginalId
public java.lang.String getOriginalId()
-
setOriginalId
public void setOriginalId(java.lang.String originalId)
-
getOriginalType
public short getOriginalType()
-
setOriginalType
public void setOriginalType(short originalType)
-
getOriginalTypeLabel
public java.lang.String getOriginalTypeLabel()
-
setOriginalTypeLabel
public void setOriginalTypeLabel(java.lang.String originalTypeLabel)
-
compareTo
public int compareTo(ArchivedPublication other)
- Specified by:
compareToin interfacejava.lang.Comparable<ArchivedPublication>
-
-