com.stratelia.webactiv.kmelia.model
Class KmeliaPublication

java.lang.Object
  extended by com.stratelia.webactiv.kmelia.model.KmeliaPublication
All Implemented Interfaces:
com.silverpeas.SilverpeasContent, Serializable

public class KmeliaPublication
extends Object
implements com.silverpeas.SilverpeasContent

A publication as defined in a Kmelia component. A publication in Kmelia can be positionned in the PDC, it can have attachments and it can be commented.

See Also:
Serialized Form

Field Summary
 boolean read
           
 
Method Summary
static KmeliaPublication aKmeliaPublicationFromCompleteDetail(com.stratelia.webactiv.util.publication.model.CompletePublication detail)
          Gets the Kmelia publication from the specified complete publication detail.
static KmeliaPublication aKmeliaPublicationFromDetail(com.stratelia.webactiv.util.publication.model.PublicationDetail detail)
          Gets the Kmelia publication from the specified publication detail.
static KmeliaPublication aKmeliaPublicationFromDetail(com.stratelia.webactiv.util.publication.model.PublicationDetail detail, int rank)
           
static KmeliaPublication aKmeliaPublicationWithPk(com.stratelia.webactiv.util.publication.model.PublicationPK pk)
          Gets the Kmelia publication with the specified primary key identifying it uniquely.
 KmeliaPublication asAlias()
          Sets this Kmelia publication as an alias one.
 boolean canBeAccessedBy(com.stratelia.webactiv.beans.admin.UserDetail user)
          Is the specified user can access this publication?
 boolean equals(Object obj)
           
 List<com.silverpeas.comment.model.Comment> getComments()
          Gets the comments on this publication.
 com.stratelia.webactiv.util.publication.model.CompletePublication getCompleteDetail()
          Gets the complete detail about this publication.
 String getComponentInstanceId()
           
 String getContributionType()
           
 Date getCreationDate()
           
 com.stratelia.webactiv.beans.admin.UserDetail getCreator()
          Gets the creator of this publication (the initial author).
 String getDescription()
           
 com.stratelia.webactiv.util.publication.model.PublicationDetail getDetail()
          Gets the details about this publication.
 String getId()
          Gets the unique identifier of this publication.
 com.stratelia.webactiv.beans.admin.UserDetail getLastModifier()
          Gets the user that has lastly modified this publication.
 int getNbAccess()
           
 int getNumberOfComments()
          Get the number of comments on this publication
 List<com.stratelia.silverpeas.pdc.model.ClassifyPosition> getPDCPositions()
          Gets the positions in the PDC of this publication.
 com.stratelia.webactiv.util.publication.model.PublicationPK getPk()
          Gets the primary key of this publication.
 int getRank()
           
 String getSilverpeasContentId()
           
 String getTitle()
           
 String getURL()
          Gets the complete URL at which this publication is located.
 int hashCode()
           
 boolean isAlias()
          Is this publication an alias of an existing Kmelia publication?
 void setRank(int rank)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

read

public boolean read
Method Detail

aKmeliaPublicationWithPk

public static KmeliaPublication aKmeliaPublicationWithPk(com.stratelia.webactiv.util.publication.model.PublicationPK pk)
Gets the Kmelia publication with the specified primary key identifying it uniquely. If no such publication exists with the specified key, then the runtime exception SilverpeasRuntimeException is thrown.

Parameters:
pk - the primary key of the publication to get.
Returns:
the Kmelia publication matching the primary key.

aKmeliaPublicationFromDetail

public static KmeliaPublication aKmeliaPublicationFromDetail(com.stratelia.webactiv.util.publication.model.PublicationDetail detail)
Gets the Kmelia publication from the specified publication detail.

Parameters:
detail - the detail about the publication to get.
Returns:
the Kmelia publication matching the specified publication detail.

aKmeliaPublicationFromDetail

public static KmeliaPublication aKmeliaPublicationFromDetail(com.stratelia.webactiv.util.publication.model.PublicationDetail detail,
                                                             int rank)

aKmeliaPublicationFromCompleteDetail

public static KmeliaPublication aKmeliaPublicationFromCompleteDetail(com.stratelia.webactiv.util.publication.model.CompletePublication detail)
Gets the Kmelia publication from the specified complete publication detail.

Parameters:
detail - the complete detail about the publication to get.
Returns:
the Kmelia publication matching the specified complete publication detail.

asAlias

public KmeliaPublication asAlias()
Sets this Kmelia publication as an alias one.

Returns:
itself.

isAlias

public boolean isAlias()
Is this publication an alias of an existing Kmelia publication?

Returns:
true if this publication is an alias, false otherwise.

getPk

public com.stratelia.webactiv.util.publication.model.PublicationPK getPk()
Gets the primary key of this publication.

Returns:
the publication primary key.

getId

public String getId()
Gets the unique identifier of this publication.

Specified by:
getId in interface com.silverpeas.SilverpeasContent
Returns:
the unique identifier of this publication.

getURL

public String getURL()
Gets the complete URL at which this publication is located.

Returns:
the publication URL.

getDetail

public com.stratelia.webactiv.util.publication.model.PublicationDetail getDetail()
Gets the details about this publication.

Returns:
the publication details.

getCompleteDetail

public com.stratelia.webactiv.util.publication.model.CompletePublication getCompleteDetail()
Gets the complete detail about this publication.

Returns:
the publication complete details.

getCreator

public com.stratelia.webactiv.beans.admin.UserDetail getCreator()
Gets the creator of this publication (the initial author).

Specified by:
getCreator in interface com.silverpeas.SilverpeasContent
Returns:
the detail about the creator of this publication.

getLastModifier

public com.stratelia.webactiv.beans.admin.UserDetail getLastModifier()
Gets the user that has lastly modified this publication. He's the last one that has worked on this publication. If this publication was not modified since its creation, the creator is returned as he's the last user that has worked on this publication.

Returns:
the detail about the last modifier of this publication.

getComments

public List<com.silverpeas.comment.model.Comment> getComments()
Gets the comments on this publication.

Returns:
an unmodifiable list with the comments on this publication.

getPDCPositions

public List<com.stratelia.silverpeas.pdc.model.ClassifyPosition> getPDCPositions()
Gets the positions in the PDC of this publication.

Returns:
an unmodifiable list with the PDC positions of this publication.

getNbAccess

public int getNbAccess()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getComponentInstanceId

public String getComponentInstanceId()
Specified by:
getComponentInstanceId in interface com.silverpeas.SilverpeasContent

getSilverpeasContentId

public String getSilverpeasContentId()
Specified by:
getSilverpeasContentId in interface com.silverpeas.SilverpeasContent

getCreationDate

public Date getCreationDate()
Specified by:
getCreationDate in interface com.silverpeas.SilverpeasContent

getTitle

public String getTitle()
Specified by:
getTitle in interface com.silverpeas.SilverpeasContent

getDescription

public String getDescription()
Specified by:
getDescription in interface com.silverpeas.SilverpeasContent

getContributionType

public String getContributionType()
Specified by:
getContributionType in interface com.silverpeas.SilverpeasContent

canBeAccessedBy

public boolean canBeAccessedBy(com.stratelia.webactiv.beans.admin.UserDetail user)
Is the specified user can access this publication?

A user can access a publication if he has enough rights to access both the Kmelia instance in which is managed this publication and the topics to which this publication belongs to.

Specified by:
canBeAccessedBy in interface com.silverpeas.SilverpeasContent
Parameters:
user - a user in Silverpeas.
Returns:
true if the user can access this publication, false otherwise.

setRank

public void setRank(int rank)

getRank

public int getRank()

getNumberOfComments

public int getNumberOfComments()
Get the number of comments on this publication

Returns:
the number.


Copyright © 2016 Silverpeas. All Rights Reserved.