com.jalios.jcms.archive
Class ArchivedPublication

java.lang.Object
  extended by com.jalios.jcms.archive.ArchivedPublication
All Implemented Interfaces:
DBData, JcmsConstants, JaliosConstants, Serializable

public class ArchivedPublication
extends Object
implements 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
Version:
$Revision: 27753 $
Author:
Olivier Jaquemet
See Also:
Serialized Form

Field Summary
protected  Member author
           
protected  TreeSet<Group> authorizedGroupSet
           
protected  TreeSet<Member> authorizedMemberSet
           
protected  Date cdate
           
protected  String description
           
protected  HashMap<String,String> descriptionML
           
protected  String mainLanguage
           
protected  String originalId
           
protected  short originalType
           
protected  String originalTypeLabel
           
static String REVISION
           
protected  Long rowId
           
protected  String title
           
protected  HashMap<String,String> titleML
           
static short TYPE_CONTENT
           
static short TYPE_FORM
           
protected  Workspace workspace
           
 
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, 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
 
Constructor Summary
ArchivedPublication()
           
ArchivedPublication(Publication pub)
          Create a new ArchivedPublication from a publication.
 
Method Summary
 boolean canBeDeletedBy(Member member)
          Check if this archive can be deleted by specified member.
 boolean canBeReadBy(Member member)
          Check if this archive can be ready by specified member.
 boolean canBeUpdatedBy(Member member)
          Check if this archive can be updated by specified member.
 void delete()
          Delete this archive (from the DB and all associated files on disk).
 HashMap<String,String> getAssociatedFilesMap()
          Retrieve files associated with the given archive.
 Member getAuthor()
          Get the author of this Archive.
 String getAuthorId()
          Returns the JStore ID of the author
 String getAuthorizedGroupIds()
           
 Set<Group> getAuthorizedGroupSet()
          Get the set of Group authorized to read this archive.
 String getAuthorizedMemberIds()
           
 Set<Member> getAuthorizedMemberSet()
          Get the set of Member authorized to read this archive.
 Date getCdate()
          Get the archive creation date.
 String getDescription()
           
 String getDescription(String lang)
           
 String getDescription(String lang, boolean useDefault)
           
 HashMap<String,String> getDescriptionML()
           
 String getDescriptionXml()
          Retrieves an xml serialization of the descriptions of this Publication in all the languages.
 String getMainLanguage()
          Get the value of main language.
 String getOriginalId()
           
 short getOriginalType()
           
 String getOriginalTypeLabel()
           
 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, ...")
 Long getRowId()
           
 String getSavedHtmlPath(String userLang)
          Return the path (webapp relative, for jsp inclusion) of the file in which the original publication was saved
 String getSavedXmlPath()
          Return the path (webapp relative) of the XML file in which the original publication's data was saved
 String getTitle()
          Retrieve the title of this publication in the main site language.
 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 publication in language other than the main site language.
 String getTitleXml()
          Retrieves an xml serialization of the titles of this Publication in all the languages.
 Workspace getWorkspace()
           
 String getWorkspaceId()
           
 boolean hasAnyReadRights()
          Tests if this archive has member or group read rights.
 void save()
          Creates or updates this archive in the DB.
 void setAuthor(Member mbr)
          Set the author of this Archive.
 void setAuthorId(String authordId)
          Sets the JStore ID of the author
 void setAuthorizedGroupIds(String authorizedGroupIds)
           
 void setAuthorizedGroupSet(TreeSet<Group> groupSet)
          Set the set of Group authorized to read this archive.
 void setAuthorizedMemberIds(String authorizedMemberIds)
           
 void setAuthorizedMemberSet(TreeSet<Member> memberSet)
          Set the set of Member authorized to read this archive.
 void setCdate(Date cdate)
          Set the creation date of this ArchivedPublication.
 void setDescription(String value)
           
 void setDescriptionML(HashMap<String,String> map)
           
 void setDescriptionXml(String xml)
          Set the descriptions of this Publication in all the languages using the specified XML string.
 void setMainLanguage(String v)
          Set the value of main language.
 void setOriginalId(String originalId)
           
 void setOriginalType(short originalType)
           
 void setOriginalTypeLabel(String originalTypeLabel)
           
 void setRowId(Long rowId)
           
 void setTitle(String v)
          Set the title of this publication in the main site language.
 void setTitleML(HashMap<String,String> v)
          Set the HashMap containing the titles of this publication in language other than the main site language.
 void setTitleXml(String xml)
          Set the titles of this Publication in all the languages using the specified XML string.
 void setWorkspace(Workspace workspace)
           
 void setWorkspaceId(String workspaceId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

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 Long rowId

cdate

protected Date cdate

workspace

protected Workspace workspace

author

protected Member author

mainLanguage

protected String mainLanguage

title

protected String title

titleML

protected HashMap<String,String> titleML

description

protected String description

descriptionML

protected HashMap<String,String> descriptionML

originalId

protected String originalId

originalType

protected short originalType

originalTypeLabel

protected String originalTypeLabel

authorizedMemberSet

protected TreeSet<Member> authorizedMemberSet

authorizedGroupSet

protected 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 String getSavedHtmlPath(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 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 HashMap<String,String> getAssociatedFilesMap()
Retrieve files associated with the given archive.

Returns:
an hashmap, filename ==> filepath (webapp relative)

setRowId

public void setRowId(Long rowId)
Specified by:
setRowId in interface DBData

getRowId

public Long getRowId()
Specified by:
getRowId in interface DBData

getCdate

public Date getCdate()
Get the archive creation date.

Returns:
a date.

setCdate

public void setCdate(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 String getWorkspaceId()

setWorkspaceId

public void setWorkspaceId(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 String getAuthorId()
Returns the JStore ID of the author

Returns:
the JStore ID of the author
Since:
jcms-6.0

setAuthorId

public void setAuthorId(String authordId)
Sets the JStore ID of the author

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

getMainLanguage

public String getMainLanguage()
Get the value of main language.

Returns:
Value of main language.

setMainLanguage

public void setMainLanguage(String v)
Set the value of main language.

Parameters:
v - Value to assign to main language.

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-6.0

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-6.0

getTitle

public 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(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 HashMap<String,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(HashMap<String,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 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(String xml)
Set the titles of this Publication in all the languages using the specified XML string.

Parameters:
xml - an xml string as returned by getTitleXml()
Since:
jcms-6.0

getDescription

public String getDescription()

setDescription

public void setDescription(String value)

getDescription

public String getDescription(String lang)

getDescription

public String getDescription(String lang,
                             boolean useDefault)

getDescriptionML

public HashMap<String,String> getDescriptionML()

setDescriptionML

public void setDescriptionML(HashMap<String,String> map)

getDescriptionXml

public 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(String xml)
Set the descriptions of this Publication in all the languages using the specified XML string.

Parameters:
xml - an xml string as returned by getDescriptionXml()
Since:
jcms-6.0

getAuthorizedMemberSet

public 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(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 String getAuthorizedMemberIds()

setAuthorizedMemberIds

public void setAuthorizedMemberIds(String authorizedMemberIds)

getAuthorizedGroupSet

public 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(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 String getAuthorizedGroupIds()

setAuthorizedGroupIds

public void setAuthorizedGroupIds(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 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 String getOriginalId()

setOriginalId

public void setOriginalId(String originalId)

getOriginalType

public short getOriginalType()

setOriginalType

public void setOriginalType(short originalType)

getOriginalTypeLabel

public String getOriginalTypeLabel()

setOriginalTypeLabel

public void setOriginalTypeLabel(String originalTypeLabel)


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