pt.digitalis.dif.utils.extensions.cms
Class ContentItem

java.lang.Object
  extended by pt.digitalis.dif.utils.extensions.cms.ContentItem

public class ContentItem
extends Object

Content Item definition class

Author:
Pedro Viegas pviegas@digitalis.pt
Created on:
2010/10/06

Constructor Summary
ContentItem(IDIFUser user)
          Default constructor for DocumentRepositoryEntry.
ContentItem(Long parentNodeId, String name, String creatorID, IDIFUser user)
           
 
Method Summary
 boolean delete()
          ContentItem is deleted in DB.
 List<ACLEntry> getACL()
          Get ACL.
 String getContent()
          Inspector for the 'content' attribute.
 Date getCreationDate()
          Inspector for the 'creationDate' attribute.
 String getCreatorID()
          Inspector for the 'creatorID' attribute.
 String getDescription()
          Inspector for the 'description' attribute.
 String getId()
          Inspector for the 'id' attribute.
 String getName()
          Inspector for the 'name' attribute.
 Node getParentNode()
           
 Long getParentNodeId()
          Inspector for the 'parentNodeId' attribute.
 IDIFUser getUser()
          Inspector for the 'userId' attribute.
 boolean grantAccessGroup(String groupId)
          Grants ContentItem access to group.
 boolean grantAccessUser(IDIFUser user)
          Grants ContentItem access to user.
 boolean isDeleted()
          Inspector for the 'isDeleted' attribute.
 boolean revokeAccessGroup(String groupId)
          Revokes ContentItem access to group. revoke access is done immediately
 boolean revokeAccessUser(IDIFUser user)
          Revokes ContentItem access to group. revoke access is done immediately
 void setContent(String content)
          Modifier for the 'content' attribute.
 void setCreationDate(Date creationDate)
          Modifier for the 'creationDate' attribute.
 void setCreatorID(String creatorID)
          Modifier for the 'creatorID' attribute.
 void setDescription(String description)
          Modifier for the 'description' attribute.
 void setId(String id)
          Modifier for the 'id' attribute.
 void setName(String name)
          Modifier for the 'name' attribute.
 void setUserId(IDIFUser user)
          Sets the 'userId' attribute.
 boolean update()
          Updates the ContentItem with current object values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentItem

public ContentItem(IDIFUser user)
Default constructor for DocumentRepositoryEntry.

Parameters:
user - The current user

ContentItem

public ContentItem(Long parentNodeId,
                   String name,
                   String creatorID,
                   IDIFUser user)
Parameters:
parentNodeId - the parent node ID
name - the content name
creatorID - the creator ID
user - The current user
Method Detail

delete

public boolean delete()
               throws IdentityManagerException,
                      ContentManagerException
ContentItem is deleted in DB. Object ID property is set to null

Returns:
T if update was succeeded
Throws:
IdentityManagerException
ContentManagerException

getACL

public List<ACLEntry> getACL()
                      throws ContentManagerException
Get ACL.

Returns:
the accessList value
Throws:
ContentManagerException

getContent

public String getContent()
Inspector for the 'content' attribute.

Returns:
the content value

getCreationDate

public Date getCreationDate()
Inspector for the 'creationDate' attribute.

Returns:
the creationDate value

getCreatorID

public String getCreatorID()
Inspector for the 'creatorID' attribute.

Returns:
the creatorID value

getDescription

public String getDescription()
Inspector for the 'description' attribute.

Returns:
the description value

getId

public String getId()
Inspector for the 'id' attribute.

Returns:
the id value

getName

public String getName()
Inspector for the 'name' attribute.

Returns:
the name value

getParentNode

public Node getParentNode()
                   throws IdentityManagerException,
                          ContentManagerException
Returns:
the parent Node
Throws:
IdentityManagerException
ContentManagerException

getParentNodeId

public Long getParentNodeId()
Inspector for the 'parentNodeId' attribute.

Returns:
the parentNodeId value

getUser

public IDIFUser getUser()
Inspector for the 'userId' attribute.

Returns:
the userId value

grantAccessGroup

public boolean grantAccessGroup(String groupId)
                         throws ContentManagerException
Grants ContentItem access to group. Grant access is done immediately

Parameters:
groupId - the group to grant access
Returns:
T if grant was succeeded
Throws:
ContentManagerException

grantAccessUser

public boolean grantAccessUser(IDIFUser user)
                        throws ContentManagerException
Grants ContentItem access to user. Grant access is done immediately

Parameters:
user - the user to grant access
Returns:
T if grant was succeeded
Throws:
ContentManagerException

isDeleted

public boolean isDeleted()
Inspector for the 'isDeleted' attribute.

Returns:
the isDeleted value

revokeAccessGroup

public boolean revokeAccessGroup(String groupId)
                          throws ContentManagerException
Revokes ContentItem access to group. revoke access is done immediately

Parameters:
groupId - the group to revoke access
Returns:
T if revoke was succeeded
Throws:
ContentManagerException

revokeAccessUser

public boolean revokeAccessUser(IDIFUser user)
                         throws ContentManagerException
Revokes ContentItem access to group. revoke access is done immediately

Parameters:
user - the user to revoke access
Returns:
T if revoke was succeeded
Throws:
ContentManagerException

setContent

public void setContent(String content)
Modifier for the 'content' attribute.

Parameters:
content - the new content value to set

setCreationDate

public void setCreationDate(Date creationDate)
Modifier for the 'creationDate' attribute.

Parameters:
creationDate - the new creationDate value to set

setCreatorID

public void setCreatorID(String creatorID)
Modifier for the 'creatorID' attribute.

Parameters:
creatorID - the new creatorID value to set

setDescription

public void setDescription(String description)
Modifier for the 'description' attribute.

Parameters:
description - the new description value to set

setId

public void setId(String id)
Modifier for the 'id' attribute.

Parameters:
id - the new id value to set

setName

public void setName(String name)
Modifier for the 'name' attribute.

Parameters:
name - the new name value to set

setUserId

public void setUserId(IDIFUser user)
Sets the 'userId' attribute.

Parameters:
user - the user currently using the object

update

public boolean update()
               throws IdentityManagerException,
                      ContentManagerException
Updates the ContentItem with current object values. If the ContentItem doesn't exist than it is inserted

Returns:
T if update was succeeded
Throws:
IdentityManagerException
ContentManagerException


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.