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

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

public class Node
extends Object

Content node definition class

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

Constructor Summary
Node(Long parentNodeId, String name, String creatorID, IDIFUser user)
          Constructor
 
Method Summary
 boolean delete()
          Node is deleted in DB.
 boolean deleteCascade()
          Node is deleted in DB, as well has its child nodes.
 List<ACLEntry> getACL()
          Get ACL.
 Date getCreationDate()
          Inspector for the 'creationDate' attribute.
 String getCreatorID()
          Inspector for the 'creatorID' attribute.
 String getDescription()
          Inspector for the 'description' attribute.
 String getFullPathName()
          Inspector for the 'fullPathName' attribute.
 Long getId()
          Inspector for the 'id' attribute.
 List<Node> getInnerNodes()
           
 List<ContentItem> getItems()
           
 String getName()
          Inspector for the 'name' attribute.
 Node getParentNode()
           
 Long getParentNodeId()
          Inspector for the 'parentNodeId' attribute.
 IDIFUser getUser()
          Inspector for the 'user' attribute.
 boolean grantAccessGroup(String groupId)
          Grants Node access to group.
 boolean grantAccessUser(IDIFUser user)
          Grants Node access to user.
 boolean isDeleted()
          Inspector for the 'isDeleted' attribute.
 boolean isPublic()
          Inspector for the 'isPublic' attribute.
 boolean revokeAccessGroup(String groupId)
          Revokes Node access to group. revoke access is done immediately
 boolean revokeAccessUser(IDIFUser user)
          Revokes Node access to group. revoke access is done immediately
 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 setFullPathName(String fullPathName)
          Modifier for the 'fullPathName' attribute.
 void setId(Long id)
          Modifier for the 'id' attribute.
 void setName(String name)
          Modifier for the 'name' attribute.
 void setParentNodeId(long parentNodeId)
          Modifier for the 'parentNodeId' attribute.
 void setPublic(boolean isPublic)
          Modifier for the 'isPublic' attribute.
 void setUser(IDIFUser user)
          Sets the 'user' attribute.
 boolean update()
          Updates the Node with current object values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(Long parentNodeId,
            String name,
            String creatorID,
            IDIFUser user)
Constructor

Parameters:
parentNodeId - the parent node ID
name - the node Name
creatorID - the creator ID
user - the user instantiating the Node
Method Detail

delete

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

Returns:
T if update was succeeded
Throws:
IdentityManagerException
ContentManagerException

deleteCascade

public boolean deleteCascade()
                      throws IdentityManagerException,
                             ContentManagerException
Node is deleted in DB, as well has its child nodes. 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

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

getFullPathName

public String getFullPathName()
Inspector for the 'fullPathName' attribute.

Returns:
the fullPathName value

getId

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

Returns:
the id value

getInnerNodes

public List<Node> getInnerNodes()
                         throws IdentityManagerException,
                                ContentManagerException
Returns:
the node inner nodes
Throws:
IdentityManagerException
ContentManagerException

getItems

public List<ContentItem> getItems()
                           throws IdentityManagerException,
                                  ContentManagerException
Returns:
the node content elements
Throws:
IdentityManagerException
ContentManagerException

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 'user' attribute.

Returns:
the user value

grantAccessGroup

public boolean grantAccessGroup(String groupId)
                         throws ContentManagerException
Grants Node 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 Node 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

isPublic

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

Returns:
the isPublic value

revokeAccessGroup

public boolean revokeAccessGroup(String groupId)
                          throws ContentManagerException
Revokes Node 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 Node access to group. revoke access is done immediately

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

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

setFullPathName

public void setFullPathName(String fullPathName)
Modifier for the 'fullPathName' attribute.

Parameters:
fullPathName - the new fullPathName value to set

setId

public void setId(Long 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

setParentNodeId

public void setParentNodeId(long parentNodeId)
Modifier for the 'parentNodeId' attribute.

Parameters:
parentNodeId - the new parentNodeId value to set

setPublic

public void setPublic(boolean isPublic)
Modifier for the 'isPublic' attribute.

Parameters:
isPublic - the new isPublic value to set

setUser

public void setUser(IDIFUser user)
Sets the 'user' attribute.

Parameters:
user - the user currently using the object

update

public boolean update()
               throws IdentityManagerException,
                      ContentManagerException
Updates the Node with current object values. If the Node 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.