com.bea.apps.groupspace.links.controls
Class LinksControlImpl

java.lang.Object
  extended by com.bea.apps.groupspace.controls.generic.ContentControlBaseImpl<T,Folder>
      extended by com.bea.apps.groupspace.controls.generic.GroupSpaceContentControlImpl<T>
          extended by com.bea.apps.groupspace.controls.generic.CM_ControlImpl<Link>
              extended by com.bea.apps.groupspace.links.controls.LinksControlImpl
All Implemented Interfaces
CM_Control<Link>, ContentControlBase<Link,Folder>, GroupSpaceContentControl<Link>, LinksControl, Serializable

public class LinksControlImpl
extends CM_ControlImpl<Link>
implements LinksControl, Serializable

This control uses a cache for the link groups. They are keyed off Visibility, Owner, and the Link Group name. If the visibility is COMMUNITY, the owner is assumed to be 'GroupSpace' for generating the key. todo: is this a good idea?

See Also
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.bea.apps.groupspace.links.controls.LinksControl
LinksControl.Params
 
Nested classes/interfaces inherited from interface com.bea.apps.groupspace.controls.generic.ContentControlBase
ContentControlBase.NodeSearchType
 
Field Summary
protected  com.bea.apps.groupspace.controls.generic.CachedFoldersControl cachedFolderControl
           
protected  HttpServletRequest request
           
 
Fields inherited from class com.bea.apps.groupspace.controls.generic.CM_ControlImpl
ccCmxControl, folderControl, topNode, topNodeName
 
Fields inherited from class com.bea.apps.groupspace.controls.generic.GroupSpaceContentControlImpl
ALL_TYPES, contentContext
 
Fields inherited from class com.bea.apps.groupspace.controls.generic.ContentControlBaseImpl
beanClass, contentFactory, DEFAULT_SEARCH_LOAD_SIZE, nodeManager, objectClassType, repoID, repoName, searchManager, typeManager
 
Constructor Summary
LinksControlImpl()
           
 
Method Summary
 Link create(String title, String url, String description, CommunityContent.Visibility visibility)
          Create a new Link that will be put in default group folder.
 Link create(String title, String url, String description, CommunityContent.Visibility visibility, ID[] relatedNodes, Set<CmxControl.PropertyPair> dynamicProps)
          Create a new Link that has related Community Content.
 Link create(String linkGroup, String title, String url, String description, CommunityContent.Visibility visibility)
          Use this ctor for placing node in a particular place in the hierarchy
 Link create(String linkGroup, String title, String url, String description, CommunityContent.Visibility visibility, ID[] relatedNodes)
          Create a new Link that has related Community Content.
 Link create(String linkGroup, String title, String url, String description, CommunityContent.Visibility visibility, ID[] relatedNodes, Set<CmxControl.PropertyPair> dynamicProps)
          Create a new Link that has related Community Content.
 Link create(String linkGroup, String title, String url, String urlType, String description, CommunityContent.Visibility visibility)
          Create a new Link, putting it in the named group folder, unless the visibility is personal, in which case it will be ignored.
 Link create(String linkGroup, String title, String url, String urlType, String description, CommunityContent.Visibility visibility, ID[] relatedNodes)
          Create a new Link that has related Community Content.
 Link create(String linkGroup, String title, String url, String urlType, String description, CommunityContent.Visibility visibility, ID[] relatedNodes, Set<CmxControl.PropertyPair> dynamicProps)
           
 Folder createFolder(String name, ID parentID)
          This gives the default visiblity of "COMMUNITY" and owner as the current principal username.
protected  Link createObject(Node node)
          We're creating Links from a Node
 ObjectClass createType()
           
 void forceRemoveGroup(String groupName)
          Remove this link folder and all links beneath it, regardless of ownership.
protected  Folder getDefaultFolder(CommunityContent.Visibility visibility)
          Determines whether the default folder is the user's personal folder or the top content folder
 Node getLinkGroup(String groupName)
          Get the Node associated with this link group.
 Set<String> getLinkGroupNames()
          Get all link group names, or null if there are none.
 Set<Link> getLinksInGroup(String groupName, SortCriteria[] sortCriteria)
          Get all the links beneath this group node.
 boolean isNameOfExistingGroup(String groupName)
          Validate that the group with groupName exists.
 Link moveLinkToGroup(Link link, String groupName)
          Move this link to another group
 void onCreate()
          Put any other init params here.
 void removeGroup(String groupName)
          Remove this link folder and all links beneath it.
 
Methods inherited from class com.bea.apps.groupspace.controls.generic.CM_ControlImpl
getCommunityFolderNode, getFolderByExpression, getPersonalContentFolder, getTopNode, getUserFolder
 
Methods inherited from class com.bea.apps.groupspace.controls.generic.GroupSpaceContentControlImpl
asSet, createFolder, findByDescription, findById, findByTitle, findContentById, findMany, getAll, getAllNodes, getCommunity, getCommunityAndPrivate, getCommunityFolder, getFolder, getImmediateChildrenAsPagedResult, getPersonal, getPrivate, getReferencingContent, getReferencingContent, getRelatedContent, move, promoteToCommunity, remove, removeAll, removeCommunityAndPrivate, removePersonal, removePrivate, update
 
Methods inherited from class com.bea.apps.groupspace.controls.generic.ContentControlBaseImpl
createObjectClass, createObjects, createObjects, findMany, findManyChildren, getAllChildren, getAllPropertyDefinitions, getDefaultStringValue, getImmediateChildren, getImmediateChildren, getObjectClass, getTopFolder, move, recurseRepository, remove, remove, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bea.apps.groupspace.controls.generic.CM_Control
getPersonalContentFolder
 
Methods inherited from interface com.bea.apps.groupspace.controls.generic.GroupSpaceContentControl
asSet, createFolder, findByDescription, findByTitle, getCommunity, getCommunityAndPrivate, getCommunityFolder, getPersonal, getPrivate, getReferencingContent, getReferencingContent, getRelatedContent, promoteToCommunity, removeCommunityAndPrivate, removePersonal, removePrivate
 
Methods inherited from interface com.bea.apps.groupspace.controls.generic.ContentControlBase
createObjectClass, createObjects, createObjects, findById, findContentById, findMany, findMany, findManyChildren, getAllPropertyDefinitions, getDefaultStringValue, getFolder, getImmediateChildren, getImmediateChildren, getImmediateChildrenAsPagedResult, getObjectClass, getTopFolder, getTopNode, move, move, remove, remove, remove, removeAll, update, update
 

Field Detail

cachedFolderControl

protected com.bea.apps.groupspace.controls.generic.CachedFoldersControl cachedFolderControl

request

protected HttpServletRequest request
Constructor Detail

LinksControlImpl

public LinksControlImpl()
Method Detail

create

public Link create(String title,
                   String url,
                   String description,
                   CommunityContent.Visibility visibility)
            throws NoSuchNodeException,
                   RepositoryException,
                   AuthorizationException,
                   CharacterCodingException
Create a new Link that will be put in default group folder.

Specified by:
create in interface LinksControl
Parameters
title -
url -
description -
Returns
Link
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
CharacterCodingException

create

public Link create(String linkGroup,
                   String title,
                   String url,
                   String description,
                   CommunityContent.Visibility visibility)
            throws NoSuchNodeException,
                   RepositoryException,
                   AuthorizationException,
                   CharacterCodingException
Use this ctor for placing node in a particular place in the hierarchy

Specified by:
create in interface LinksControl
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
CharacterCodingException

create

public Link create(String linkGroup,
                   String title,
                   String url,
                   String urlType,
                   String description,
                   CommunityContent.Visibility visibility)
            throws NoSuchNodeException,
                   RepositoryException,
                   AuthorizationException,
                   CharacterCodingException
Description copied from interface: LinksControl
Create a new Link, putting it in the named group folder, unless the visibility is personal, in which case it will be ignored. Otherwise, if the group folder does not exist, it will be created.

Specified by:
create in interface LinksControl
Returns
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
CharacterCodingException

create

public Link create(String linkGroup,
                   String title,
                   String url,
                   String description,
                   CommunityContent.Visibility visibility,
                   ID[] relatedNodes)
            throws NoSuchNodeException,
                   RepositoryException,
                   AuthorizationException,
                   CharacterCodingException
Description copied from interface: LinksControl
Create a new Link that has related Community Content. Put the link in the default group folder. This link will be created with the default url type.

Specified by:
create in interface LinksControl
Returns
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
CharacterCodingException

create

public Link create(String linkGroup,
                   String title,
                   String url,
                   String urlType,
                   String description,
                   CommunityContent.Visibility visibility,
                   ID[] relatedNodes)
            throws NoSuchNodeException,
                   RepositoryException,
                   AuthorizationException,
                   CharacterCodingException
Description copied from interface: LinksControl
Create a new Link that has related Community Content. Put the link in the named group folder, unless the visibility is personal, in which case it will be ignored. Otherwise, if the group folder does not exist, it will be created. This link will be created with the default url type.

Specified by:
create in interface LinksControl
Returns
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
CharacterCodingException

create

public Link create(String linkGroup,
                   String title,
                   String url,
                   String description,
                   CommunityContent.Visibility visibility,
                   ID[] relatedNodes,
                   Set<CmxControl.PropertyPair> dynamicProps)
            throws NoSuchNodeException,
                   RepositoryException,
                   AuthorizationException,
                   CharacterCodingException
Description copied from interface: LinksControl
Create a new Link that has related Community Content. Put the link in the named group folder, unless the visibility is personal, in which case it will be ignored. Otherwise, if the group folder does not exist, it will be created. This link will be created with the default url type and may have these dynamic properties.

Specified by:
create in interface LinksControl
Returns
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
CharacterCodingException

create

public Link create(String title,
                   String url,
                   String description,
                   CommunityContent.Visibility visibility,
                   ID[] relatedNodes,
                   Set<CmxControl.PropertyPair> dynamicProps)
            throws NoSuchNodeException,
                   RepositoryException,
                   AuthorizationException,
                   CharacterCodingException
Description copied from interface: LinksControl
Create a new Link that has related Community Content. Put the link in the default group folder. This link will be created with the default url type and may have these dynamic properties.

Specified by:
create in interface LinksControl
Returns
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
CharacterCodingException

create

public Link create(String linkGroup,
                   String title,
                   String url,
                   String urlType,
                   String description,
                   CommunityContent.Visibility visibility,
                   ID[] relatedNodes,
                   Set<CmxControl.PropertyPair> dynamicProps)
            throws NoSuchNodeException,
                   RepositoryException,
                   AuthorizationException,
                   CharacterCodingException
Parameters
linkGroup -
title -
url -
urlType -
description -
visibility -
relatedNodes -
dynamicProps -
Returns
Link
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
CharacterCodingException

createType

public ObjectClass createType()
                       throws NoSuchNodeException,
                              RepositoryException,
                              AuthorizationException
Specified by:
createType in class ContentControlBaseImpl<Link,Folder>
Returns
Throws
NoSuchNodeException
RepositoryException
AuthorizationException

removeGroup

public void removeGroup(String groupName)
                 throws NoSuchNodeException,
                        RepositoryException,
                        AuthorizationException
Remove this link folder and all links beneath it. If there are links with Private visibility beneath this group, those links may not be removed unless the caller of this method owns those links. Any other private links may not be removed, and an AuthorizationException will be thrown.

Specified by:
removeGroup in interface LinksControl
Throws
NoSuchNodeException
RepositoryException
AuthorizationException - if private links exist in this group that are not owned by this user

forceRemoveGroup

public void forceRemoveGroup(String groupName)
                      throws NoSuchNodeException,
                             RepositoryException,
                             AuthorizationException
Remove this link folder and all links beneath it, regardless of ownership.

Specified by:
forceRemoveGroup in interface LinksControl
Throws
NoSuchNodeException
RepositoryException - if private links exist in this group
AuthorizationException

isNameOfExistingGroup

public boolean isNameOfExistingGroup(String groupName)
                              throws RepositoryException,
                                     AuthorizationException
Validate that the group with groupName exists.

Specified by:
isNameOfExistingGroup in interface LinksControl
Throws
RepositoryException
AuthorizationException

getLinkGroupNames

public Set<String> getLinkGroupNames()
                              throws NoSuchNodeException,
                                     RepositoryException,
                                     AuthorizationException
Get all link group names, or null if there are none.

Specified by:
getLinkGroupNames in interface LinksControl
Throws
NoSuchNodeException
RepositoryException
AuthorizationException

getLinkGroup

public Node getLinkGroup(String groupName)
                  throws NoSuchNodeException,
                         RepositoryException,
                         AuthorizationException
Get the Node associated with this link group.

Specified by:
getLinkGroup in interface LinksControl
Throws
NoSuchNodeException
RepositoryException
AuthorizationException

getLinksInGroup

public Set<Link> getLinksInGroup(String groupName,
                                 SortCriteria[] sortCriteria)
                          throws NoSuchNodeException,
                                 RepositoryException,
                                 AuthorizationException
Get all the links beneath this group node. Returns null if there are none. This method returns all the links with COMMUNITY visibility

Specified by:
getLinksInGroup in interface LinksControl
Throws
NoSuchNodeException
RepositoryException
AuthorizationException

moveLinkToGroup

public Link moveLinkToGroup(Link link,
                            String groupName)
                     throws NoSuchNodeException,
                            RepositoryException,
                            AuthorizationException
Move this link to another group

Specified by:
moveLinkToGroup in interface LinksControl
Returns
Throws
NoSuchNodeException
RepositoryException
AuthorizationException

createFolder

public Folder createFolder(String name,
                           ID parentID)
                    throws AuthorizationException,
                           NodeExistsException,
                           RepositoryException
This gives the default visiblity of "COMMUNITY" and owner as the current principal username. As the description is also a required field (imposed by the control), we let the folder name equal its title.

Specified by:
createFolder in interface GroupSpaceContentControl<Link>
Overrides:
createFolder in class CM_ControlImpl<Link>
Throws
AuthorizationException
NodeExistsException - throws ControlException - unchecked exception that wraps AuthenticationException, NoSuchObjectClassException, InstantiationException, IllegalAccessException, InvocationTargetException
RepositoryException

createObject

protected Link createObject(Node node)
We're creating Links from a Node

Specified by:
createObject in class ContentControlBaseImpl<Link,Folder>

getDefaultFolder

protected Folder getDefaultFolder(CommunityContent.Visibility visibility)
                           throws NoSuchNodeException,
                                  RepositoryException,
                                  AuthorizationException
Description copied from class: CM_ControlImpl
Determines whether the default folder is the user's personal folder or the top content folder

Overrides:
getDefaultFolder in class CM_ControlImpl<Link>
Parameters
visibility -
Returns
Throws
NoSuchNodeException
RepositoryException
AuthorizationException
AuthenticationException

onCreate

public void onCreate()
              throws org.apache.beehive.controls.api.ControlException
Put any other init params here. Note they can go on the control interface annotations. See the CM_Control.java file for an example of declaring parameters, and the CM_ControlImpl.jcs file for accessing those parameters

Overrides:
onCreate in class CM_ControlImpl<Link>
Throws
org.apache.beehive.controls.api.ControlException


Copyright © 2006 BEA Systems, Inc. All Rights Reserved