Class PublicationDetail
- java.lang.Object
-
- org.silverpeas.core.i18n.AbstractI18NBean<PublicationI18N>
-
- org.silverpeas.core.contribution.publication.model.PublicationDetail
-
- All Implemented Interfaces:
Serializable
,SilverContentInterface
,ContributionWithVisibility
,Contribution
,I18nContribution
,SilverpeasContent
,WithAttachment
,WithPermanentLink
,WithThumbnail
,Rateable
,I18NBean<PublicationI18N>
,LocalizedResource
,Translatable
,Identifiable
,Instance<Contribution>
,Nameable
,WithReminder
,Securable
,SilverpeasResource
@ModificationTracked public class PublicationDetail extends AbstractI18NBean<PublicationI18N> implements I18nContribution, ContributionWithVisibility, SilverContentInterface, Rateable, Serializable, WithAttachment, WithThumbnail, WithReminder, WithPermanentLink
This object contains the description of a publication- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PublicationDetail.Builder
A builder of aPublicationDetail
instance by setting some of its properties.
-
Field Summary
Fields Modifier and Type Field Description static String
CLONE_STATUS
static String
DELAYED_VISIBILITY_AT_MODEL_PROPERTY
static String
DRAFT_STATUS
static String
REFUSED_STATUS
static String
TO_VALIDATE_STATUS
static String
TYPE
static String
VALID_STATUS
-
Constructor Summary
Constructors Modifier Constructor Description protected
PublicationDetail()
Default contructor, required for JAXB mapping in importExport.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PublicationDetail.Builder
builder()
Gets a builder ofPublicationDetail
instances for the default language as defined inI18n.getDefaultLanguage()
.static PublicationDetail.Builder
builder(String language)
Gets a builder ofPublicationDetail
instances for the specified language.boolean
canBeAccessedBy(User user)
Is the specified user can access this publication?boolean
canBeFiledInBy(User user)
Is the specified user can file in this publication attachments?boolean
canBeModifiedBy(User user)
Is the specified user can modify this publication?PublicationDetail
copy()
boolean
equals(Object o)
String
getAuthor()
Date
getBeginDate()
Date
getBeginDateAndHour()
String
getBeginHour()
String
getCloneId()
PublicationPK
getClonePK()
String
getCloneStatus()
WysiwygContent
getContent()
String
getContentPagePath()
ContributionStatus
getContributionStatus()
String
getContributionType()
Gets the type of this contribution.Date
getCreationDate()
Gets the date at which the resource has been created.String
getCreatorId()
String
getCreatorName()
String
getDate()
String
getDefaultUrl(String componentName)
Date
getEndDate()
Date
getEndDateAndHour()
String
getEndHour()
int
getExplicitRank()
String
getFieldValue(String fieldNameAndLanguage)
Map<String,String>
getFormValues(String language)
String
getIconUrl()
String
getId()
Gets the identifier of this content in the Silverpeas component providing it.ContributionIdentifier
getIdentifier()
Gets the unique identifier of this contribution.String
getImage()
String
getImageMimeType()
int
getImportance()
int
getIndexOperation()
String
getInfoId()
String
getInstanceId()
String
getKeywords()
String
getKeywords(String lang)
Date
getLastUpdateDate()
Gets the date at which the resource has been lastly updated.User
getLastUpdater()
Gets the user that has lastly updated the resource.ContributionModel
getModel()
Gets a model to this contribution.String
getMostRecentUpdater()
int
getNbAccess()
String
getPermalink()
PublicationPK
getPK()
ContributionRating
getRating()
Gets the rating informations linked with the current publication.Optional<PublicationPath>
getResourcePath()
static String
getResourceType()
The type of this resourceString
getSilverCreationDate()
String
getSilverObjectId()
String
getSilverpeasContentId()
Gets the unique identifier of this content among all the contents managed in the Silverpeas collaborative portal.String
getStatus()
String
getTargetValidatorId()
String[]
getTargetValidatorIds()
String
getTargetValidatorNames()
Thumbnail
getThumbnail()
Gets the thumbnail linked to the publication.String
getTitle()
Gets the title of this contribution if any.protected Class<PublicationI18N>
getTranslationType()
String
getUpdaterId()
String
getURL()
Date
getValidateDate()
String
getValidatorId()
String
getVersion()
Visibility
getVisibility()
Gets the visibility details about the contribution.List<XMLField>
getXmlFields()
List<XMLField>
getXmlFields(String language)
int
hashCode()
boolean
haveGotClone()
boolean
isAlias()
boolean
isClone()
boolean
isDraft()
boolean
isIndexable()
Is this contribution indexable?boolean
isNew()
Is this publication a new one?boolean
isNoMoreVisible()
boolean
isNotYetVisible()
boolean
isPublicationEditor(String userId)
boolean
isRefused()
boolean
isSharingAllowedForRolesFrom(UserDetail user)
boolean
isStatusMustBeChecked()
boolean
isUpdateDataMustBeSet()
Indicates if the update data MUST be set.boolean
isValid()
boolean
isValidationRequired()
boolean
isVisible()
void
setAlias(boolean alias)
void
setAuthor(String author)
void
setAuthorizedLocation(Location location)
Sets an authorized location to the current instance.void
setBeginDate(Date beginDate)
void
setBeginHour(String hour)
void
setCloneId(String tempPubId)
void
setCloneStatus(String cloneStatus)
void
setContentPagePath(String content)
void
setCreationDate(Date creationDate)
void
setCreatorId(String creatorId)
void
setCreatorName(String creatorName)
void
setEndDate(Date endDate)
void
setEndHour(String hour)
void
setExplicitRank(int explicitRank)
void
setIconUrl(String iconUrl)
void
setImportance(int importance)
void
setIndexOperation(int i)
void
setInfoId(String infoId)
void
setKeywords(String keywords)
void
setNbAccess(int nbAccess)
void
setPk(PublicationPK pk)
void
setSilverObjectId(int silverObjectId)
void
setSilverObjectId(String silverObjectId)
void
setStatus(String status)
void
setStatusMustBeChecked(boolean statusMustBeChecked)
void
setTargetValidatorId(String targetValidatorId)
void
setThumbnail(ThumbnailDetail thumbnail)
void
setUpdateDataMustBeSet(boolean updateDataMustBeSet)
void
setUpdateDate(Date updateDate)
void
setUpdaterId(String updaterId)
void
setValidateDate(Date validateDate)
void
setValidatorId(String validatorId)
void
setVersion(String version)
void
setVisibilityPeriod(Period period)
String
toString()
-
Methods inherited from class org.silverpeas.core.i18n.AbstractI18NBean
addTranslation, getClonedTranslations, getDescription, getDescription, getLanguage, getLanguages, getLanguageToDisplay, getName, getName, getNextTranslation, getTranslation, getTranslationId, getTranslations, isRemoveTranslation, setDescription, setLanguage, setName, setRemoveTranslation, setTranslationId, setTranslations, setTranslations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.contribution.model.Contribution
getDescription
-
Methods inherited from interface org.silverpeas.core.contribution.model.I18nContribution
getLocalizationIn
-
Methods inherited from interface org.silverpeas.core.i18n.LocalizedResource
getTranslation
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy
-
Methods inherited from interface org.silverpeas.core.contribution.contentcontainer.content.SilverContentInterface
getComponentInstanceId, getCreator, getDescription, getLanguages, getName, getName
-
-
-
-
Field Detail
-
DELAYED_VISIBILITY_AT_MODEL_PROPERTY
public static final String DELAYED_VISIBILITY_AT_MODEL_PROPERTY
- See Also:
- Constant Field Values
-
DRAFT_STATUS
public static final String DRAFT_STATUS
- See Also:
- Constant Field Values
-
VALID_STATUS
public static final String VALID_STATUS
- See Also:
- Constant Field Values
-
TO_VALIDATE_STATUS
public static final String TO_VALIDATE_STATUS
- See Also:
- Constant Field Values
-
REFUSED_STATUS
public static final String REFUSED_STATUS
- See Also:
- Constant Field Values
-
CLONE_STATUS
public static final String CLONE_STATUS
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static PublicationDetail.Builder builder()
Gets a builder ofPublicationDetail
instances for the default language as defined inI18n.getDefaultLanguage()
. All the textual properties (name, description and keywords) will be related to this language.- Returns:
- a
PublicationDetail.Builder
instance
-
builder
public static PublicationDetail.Builder builder(String language)
Gets a builder ofPublicationDetail
instances for the specified language. All the textual properties (name, description and keywords) will be related to this language.- Parameters:
language
- a ISO 639-1 code of a supported language.- Returns:
- a
PublicationDetail.Builder
instance
-
getTranslationType
protected Class<PublicationI18N> getTranslationType()
- Specified by:
getTranslationType
in classAbstractI18NBean<PublicationI18N>
-
getPK
public PublicationPK getPK()
-
setPk
public void setPk(PublicationPK pk)
-
getInfoId
public String getInfoId()
-
setInfoId
public void setInfoId(String infoId)
-
setCreationDate
public void setCreationDate(Date creationDate)
-
setBeginDate
public void setBeginDate(Date beginDate)
-
setEndDate
public void setEndDate(Date endDate)
-
setVisibilityPeriod
public void setVisibilityPeriod(Period period)
-
setCreatorId
public void setCreatorId(String creatorId)
-
setContentPagePath
public void setContentPagePath(String content)
-
setStatus
public void setStatus(String status)
-
setUpdateDate
public void setUpdateDate(Date updateDate)
-
setUpdaterId
public void setUpdaterId(String updaterId)
-
setAuthor
public void setAuthor(String author)
-
getCreationDate
public Date getCreationDate()
Description copied from interface:SilverpeasResource
Gets the date at which the resource has been created.- Specified by:
getCreationDate
in interfaceSilverContentInterface
- Specified by:
getCreationDate
in interfaceSilverpeasResource
- Returns:
- the date of creation of the resource.
-
getBeginDate
public Date getBeginDate()
-
getEndDate
public Date getEndDate()
-
getCreatorId
public String getCreatorId()
- Specified by:
getCreatorId
in interfaceSilverContentInterface
-
getIdentifier
public ContributionIdentifier getIdentifier()
Description copied from interface:I18nContribution
Gets the unique identifier of this contribution.- Specified by:
getIdentifier
in interfaceContribution
- Specified by:
getIdentifier
in interfaceI18nContribution
- Specified by:
getIdentifier
in interfaceSilverpeasContent
- Specified by:
getIdentifier
in interfaceSilverpeasResource
- Returns:
- the unique identifier of the contribution.
-
getImportance
public int getImportance()
-
getVersion
public String getVersion()
-
getKeywords
public String getKeywords()
-
getContentPagePath
public String getContentPagePath()
-
getStatus
public String getStatus()
-
getContributionStatus
public ContributionStatus getContributionStatus()
-
getImage
public String getImage()
-
getImageMimeType
public String getImageMimeType()
-
getThumbnail
public Thumbnail getThumbnail()
Gets the thumbnail linked to the publication.The corresponding
ThumbnailDetail
is loaded once and cached into publication instance.- Specified by:
getThumbnail
in interfaceWithThumbnail
- Returns:
- the
ThumbnailDetail
instance if any.
-
getResourcePath
public Optional<PublicationPath> getResourcePath()
Description copied from interface:Contribution
Gets the
of the contribution represented by the given identifier.Returns empty by default if not implemented.
- Specified by:
getResourcePath
in interfaceContribution
- Returns:
- the optional
ResourcePath
instance.
-
setThumbnail
public void setThumbnail(ThumbnailDetail thumbnail)
-
getLastUpdateDate
public Date getLastUpdateDate()
Description copied from interface:SilverpeasResource
Gets the date at which the resource has been lastly updated. If the resource doesn't have such an information, then this method should return the date of the resource creation.- Specified by:
getLastUpdateDate
in interfaceSilverContentInterface
- Specified by:
getLastUpdateDate
in interfaceSilverpeasResource
- Returns:
- the date of the last update of the resource.
-
getUpdaterId
public String getUpdaterId()
-
getLastUpdater
public User getLastUpdater()
Description copied from interface:SilverpeasResource
Gets the user that has lastly updated the resource. If the resource doesn't have such an information, then this method should return the user that has created the resource.- Specified by:
getLastUpdater
in interfaceSilverContentInterface
- Specified by:
getLastUpdater
in interfaceSilverpeasResource
- Returns:
- a
User
in Silverpeas.
-
getAuthor
public String getAuthor()
-
getValidateDate
public Date getValidateDate()
-
getValidatorId
public String getValidatorId()
-
setValidateDate
public void setValidateDate(Date validateDate)
-
setValidatorId
public void setValidatorId(String validatorId)
-
setBeginHour
public void setBeginHour(String hour)
-
getBeginHour
public String getBeginHour()
-
setEndHour
public void setEndHour(String hour)
-
getEndHour
public String getEndHour()
-
setSilverObjectId
public void setSilverObjectId(String silverObjectId)
-
setSilverObjectId
public void setSilverObjectId(int silverObjectId)
-
getSilverObjectId
public String getSilverObjectId()
-
getURL
public String getURL()
- Specified by:
getURL
in interfaceSilverContentInterface
-
getId
public String getId()
Description copied from interface:SilverpeasContent
Gets the identifier of this content in the Silverpeas component providing it. This identifier is only unique among all the contents managed by the same component (whatever its different instances). As each type of contents in Silverpeas is provided by a single Silverpeas component, the identifier of a content is then specific to the component it belongs to. It is a way for an instance of a such component to identify uniquely the different contents it manages. So, each component can have their own policy to identify their content, whatever the way they are identified in Silverpeas.- Specified by:
getId
in interfaceIdentifiable
- Specified by:
getId
in interfaceSilverpeasContent
- Returns:
- the identifier of this content.
-
getInstanceId
public String getInstanceId()
- Specified by:
getInstanceId
in interfaceSilverContentInterface
-
getDate
public String getDate()
- Specified by:
getDate
in interfaceSilverContentInterface
-
getSilverCreationDate
public String getSilverCreationDate()
- Specified by:
getSilverCreationDate
in interfaceSilverContentInterface
-
getTitle
public String getTitle()
Description copied from interface:Contribution
Gets the title of this contribution if any. By default returns an empty String.- Specified by:
getTitle
in interfaceContribution
- Returns:
- the contribution's title in the specified language. Can be empty if no title was set or no title is defined for a such contribution.
-
setIconUrl
public void setIconUrl(String iconUrl)
-
getIconUrl
public String getIconUrl()
- Specified by:
getIconUrl
in interfaceSilverContentInterface
-
getContent
public WysiwygContent getContent()
-
setImportance
public void setImportance(int importance)
-
setKeywords
public void setKeywords(String keywords)
-
setVersion
public void setVersion(String version)
-
getCreatorName
public String getCreatorName()
-
setCreatorName
public void setCreatorName(String creatorName)
-
getIndexOperation
public int getIndexOperation()
-
setIndexOperation
public void setIndexOperation(int i)
-
isStatusMustBeChecked
public boolean isStatusMustBeChecked()
-
setStatusMustBeChecked
public void setStatusMustBeChecked(boolean statusMustBeChecked)
-
getTargetValidatorId
public String getTargetValidatorId()
-
setTargetValidatorId
public void setTargetValidatorId(String targetValidatorId)
-
getTargetValidatorNames
public String getTargetValidatorNames()
-
getTargetValidatorIds
public String[] getTargetValidatorIds()
-
getCloneId
public String getCloneId()
-
setCloneId
public void setCloneId(String tempPubId)
-
haveGotClone
public boolean haveGotClone()
-
isClone
public boolean isClone()
-
isValid
public boolean isValid()
-
isValidationRequired
public boolean isValidationRequired()
-
isRefused
public boolean isRefused()
-
isDraft
public boolean isDraft()
-
getClonePK
public PublicationPK getClonePK()
-
copy
public PublicationDetail copy()
-
getCloneStatus
public String getCloneStatus()
-
setCloneStatus
public void setCloneStatus(String cloneStatus)
-
isUpdateDataMustBeSet
public boolean isUpdateDataMustBeSet()
Indicates if the update data MUST be set.The update data are:
- the last update date
- the last updater
- Returns:
- true if update data MUST be set, false otherwise.
-
setUpdateDataMustBeSet
public void setUpdateDataMustBeSet(boolean updateDataMustBeSet)
-
getNbAccess
public int getNbAccess()
-
setNbAccess
public void setNbAccess(int nbAccess)
-
isVisible
public boolean isVisible()
-
isNoMoreVisible
public boolean isNoMoreVisible()
-
isNotYetVisible
public boolean isNotYetVisible()
-
getBeginDateAndHour
public Date getBeginDateAndHour()
-
getEndDateAndHour
public Date getEndDateAndHour()
-
getVisibility
public Visibility getVisibility()
Description copied from interface:ContributionWithVisibility
Gets the visibility details about the contribution.- Specified by:
getVisibility
in interfaceContributionWithVisibility
- Returns:
- a
ContributionVisibility
instance.
-
isIndexable
public boolean isIndexable()
Description copied from interface:Contribution
Is this contribution indexable? By default true.- Specified by:
isIndexable
in interfaceContribution
- Returns:
- a boolean indicating if this contribution can be taken in charge by the Indexation Engine. By default, any contribution in Silverpeas are indexable unless specified otherwise.
-
isPublicationEditor
public boolean isPublicationEditor(String userId)
-
getContributionType
public String getContributionType()
Description copied from interface:Contribution
Gets the type of this contribution. The type is a label that identifies uniquely a kind of contribution handled by a Silverpeas application. By default, this method returns the simple name of the class implementing this interface.- Specified by:
getContributionType
in interfaceContribution
- Returns:
- the label of the type of this contribution.
-
canBeAccessedBy
public boolean canBeAccessedBy(User user)
Is the specified user can access this publication?A user can access a publication if he has enough rights to access both the application instance in which is managed this publication and one of the nodes to which this publication belongs to.
- Specified by:
canBeAccessedBy
in interfaceContribution
- Specified by:
canBeAccessedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can access this publication, false otherwise.
-
canBeModifiedBy
public boolean canBeModifiedBy(User user)
Is the specified user can modify this publication?A user can access a publication on persist context if he has enough rights to access both the application instance in which is managed this publication and one of the nodes to which this publication belongs to.
- Specified by:
canBeModifiedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can access this publication, false otherwise.
-
canBeFiledInBy
public boolean canBeFiledInBy(User user)
Is the specified user can file in this publication attachments?- Specified by:
canBeFiledInBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user has modification rights on this publication. In this case, he can attach documents to this publication. False otherwise.
-
getResourceType
public static String getResourceType()
The type of this resource- Returns:
- the same value returned by getContributionType()
-
getSilverpeasContentId
public String getSilverpeasContentId()
Description copied from interface:SilverpeasContent
Gets the unique identifier of this content among all the contents managed in the Silverpeas collaborative portal. It is the alone unique identifier of a content in the whole Silverpeas portal; it is referred as the Silverpeas content identifier or the silver content identifier. For each content put into the Silverpeas collaborative portal, an entry is uniquely created in the whole system so that is can be referred by transversal services and by component instances others the one that manages it. For compatibility reason, the Silverpeas content identifier of contents that are no yet taken into account in the whole system isn't defined, so an empty string is then returned.- Specified by:
getSilverpeasContentId
in interfaceSilverpeasContent
- Returns:
- the unique identifier of this content in the whole Silverpeas collaborative portal. Can be empty if no such identifier is defined for the type of this content (default).
-
setExplicitRank
public void setExplicitRank(int explicitRank)
-
getExplicitRank
public int getExplicitRank()
-
getRating
public ContributionRating getRating()
Gets the rating informations linked with the current publication.- Specified by:
getRating
in interfaceRateable
- Returns:
- the rating of the publication.
- See Also:
ContributionRating
-
setAuthorizedLocation
public void setAuthorizedLocation(Location location)
Sets an authorized location to the current instance.A publication is linked or not to a node, depending the application functional context. This method should be used into the case of a publication linked to a node, located at a location in other words. Sometimes, a publication can be located at several locations (so linked to several nodes), in that case there is a main location and the others which are called "aliases". The caller of this method has verified which locations of a publication is authorized according to a context, that the publication detail instance does not know about, and set one of these authorized ones to the current instance. If the authorized location set defines an alias then some methods will take into account this information, like
getPermalink()
for example.Giving a null location means that alias data MUST be cleared.
- Parameters:
location
- aLocation
instance.
-
setAlias
public void setAlias(boolean alias)
-
isAlias
public boolean isAlias()
-
getPermalink
public String getPermalink()
- Specified by:
getPermalink
in interfaceWithPermanentLink
-
isSharingAllowedForRolesFrom
public boolean isSharingAllowedForRolesFrom(UserDetail user)
-
getModel
public ContributionModel getModel()
Description copied from interface:Contribution
Gets a model to this contribution. A model is a business abstract representation of the concrete type of this contribution. If not overridden, it returns by default aDefaultContributionModel
instance that access the business properties of the contribution by reflection.- Specified by:
getModel
in interfaceContribution
- Returns:
- a
ContributionModel
object. By default, if this method isn't overridden, aDefaultContributionModel
instance is returned.
-
getMostRecentUpdater
public String getMostRecentUpdater()
-
isNew
public boolean isNew()
Is this publication a new one? A publication is considered as a new one when it was created or updated before a given amount of day. This amount is a parameter that is set in thepublicationSettings.properties
properties file.- Returns:
- true of this publication was created or updated recently. False otherwise
-
-