Class AbstractSilverpeasContentManager.ContributionWrapper
- java.lang.Object
-
- org.silverpeas.core.contribution.contentcontainer.content.AbstractSilverpeasContentManager.ContributionWrapper
-
- All Implemented Interfaces:
Serializable
,SilverContentInterface
,Contribution
,SilverpeasContent
,Identifiable
,Instance<Contribution>
,Nameable
,Securable
,SilverpeasResource
- Enclosing class:
- AbstractSilverpeasContentManager
public static class AbstractSilverpeasContentManager.ContributionWrapper extends Object implements SilverContentInterface
Wrapper which permits to handle as aSilverContentInterface
each implementation of aContribution
.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeAccessedBy(User user)
Is the specified user can access this contribution?boolean
canBeDeletedBy(User user)
Checks the given user can delete this resource.boolean
canBeModifiedBy(User user)
Checks the given user can modify this resource.String
getComponentInstanceId()
SilverpeasContent
default implementations.String
getContributionType()
Gets the type of this contribution.Date
getCreationDate()
Gets the date at which the resource has been created.User
getCreator()
Gets the user that has created the resource.String
getCreatorId()
String
getDate()
String
getDescription()
Gets a description about this contribution if any.String
getDescription(String language)
String
getIconUrl()
String
getId()
Gets the identifier of this content in the Silverpeas component providing it.ContributionIdentifier
getIdentifier()
Contribution
default implementations.String
getInstanceId()
Collection<String>
getLanguages()
Date
getLastUpdateDate()
Gets the date at which the resource has been lastly updated.User
getLastUpdater()
Gets the user that has lastly updated the resource.String
getName()
Gets the name of this contribution.String
getName(String language)
String
getSilverCreationDate()
String
getSilverpeasContentId()
Gets the unique identifier of this content among all the contents managed in the Silverpeas collaborative portal.String
getTitle()
Gets the title of this contribution if any.String
getURL()
Contribution
getWrappedInstance()
boolean
isIndexable()
Is this contribution indexable?-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.contribution.model.Contribution
getModel, getResourcePath
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeFiledInBy
-
-
-
-
Method Detail
-
getWrappedInstance
public Contribution getWrappedInstance()
-
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.
-
getName
public String getName()
Description copied from interface:Contribution
Gets the name of this contribution. The name is in a contribution its title.- Specified by:
getName
in interfaceContribution
- Specified by:
getName
in interfaceNameable
- Specified by:
getName
in interfaceSilverContentInterface
- Returns:
- the contribution title.
-
getName
public String getName(String language)
- Specified by:
getName
in interfaceSilverContentInterface
-
getDescription
public String getDescription(String language)
- Specified by:
getDescription
in interfaceSilverContentInterface
-
getURL
public String getURL()
- Specified by:
getURL
in interfaceSilverContentInterface
-
getInstanceId
public String getInstanceId()
- Specified by:
getInstanceId
in interfaceSilverContentInterface
-
getComponentInstanceId
public String getComponentInstanceId()
Description copied from interface:SilverContentInterface
SilverpeasContent
default implementations.- Specified by:
getComponentInstanceId
in interfaceSilverContentInterface
- Specified by:
getComponentInstanceId
in interfaceSilverpeasContent
- Returns:
- the unique identifier of the component instance in the Silverpeas collaborative portal.
-
getDate
public String getDate()
- Specified by:
getDate
in interfaceSilverContentInterface
-
getSilverCreationDate
public String getSilverCreationDate()
- Specified by:
getSilverCreationDate
in interfaceSilverContentInterface
-
getIconUrl
public String getIconUrl()
- Specified by:
getIconUrl
in interfaceSilverContentInterface
-
getCreatorId
public String getCreatorId()
- Specified by:
getCreatorId
in interfaceSilverContentInterface
-
getCreator
public User getCreator()
Description copied from interface:SilverpeasResource
Gets the user that has created the resource.- Specified by:
getCreator
in interfaceSilverContentInterface
- Specified by:
getCreator
in interfaceSilverpeasResource
- Returns:
- a
User
in Silverpeas.
-
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.
-
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.
-
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.
-
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).
-
getIdentifier
public ContributionIdentifier getIdentifier()
Description copied from interface:SilverpeasContent
Contribution
default implementations.- Specified by:
getIdentifier
in interfaceContribution
- Specified by:
getIdentifier
in interfaceSilverpeasContent
- Specified by:
getIdentifier
in interfaceSilverpeasResource
- Returns:
- the unique identifier of the contribution.
-
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.
-
getDescription
public String getDescription()
Description copied from interface:Contribution
Gets a description about this contribution if any. By default returns an empty String.- Specified by:
getDescription
in interfaceContribution
- Specified by:
getDescription
in interfaceNameable
- Returns:
- the description on this contribution. Can be empty if no description was set or no description is defined for a such contribution.
-
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.
-
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.
-
canBeAccessedBy
public boolean canBeAccessedBy(User user)
Description copied from interface:Contribution
Is the specified user can access this contribution?By default
Securable.canBeAccessedBy(User)
is implemented so that a user can access a contribution if it has enough rights to access the application instance in which is managed this contribution.
Indeed, this behavior is mostly the common one.
But In the case the application instance distributes its contribution along of a categorization tree and the nodes of this tree support access rights, then the user must have also the rights to access the node to which belongs the content.
Of course it could exist other access rules...- Specified by:
canBeAccessedBy
in interfaceContribution
- Specified by:
canBeAccessedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can access this content, false otherwise.
-
canBeModifiedBy
public boolean canBeModifiedBy(User user)
Description copied from interface:Securable
Checks the given user can modify this resource. By default, if the user can access this securable resource, then it can also modify it.- Specified by:
canBeModifiedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can modify the data managed by this instance, false otherwise.
-
canBeDeletedBy
public boolean canBeDeletedBy(User user)
Description copied from interface:Securable
Checks the given user can delete this resource. By default, if the user can modify this securable resource, then it can also delete it.- Specified by:
canBeDeletedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can delete the data managed by this instance, false otherwise.
-
getLanguages
public Collection<String> getLanguages()
- Specified by:
getLanguages
in interfaceSilverContentInterface
-
-