com.bea.apps.groupspace.controls.generic
Class ContentControlBaseImpl<T extends ContentBase,V extends FolderBase>

java.lang.Object
  extended by com.bea.apps.groupspace.controls.generic.ContentControlBaseImpl<T,V>
All Implemented Interfaces
ContentControlBase<T,V>, Serializable
Direct Known Subclasses:
CmBrowserControlImpl, FoldersControlBaseImpl, GroupSpaceContentControlImpl

public abstract class ContentControlBaseImpl<T extends ContentBase,V extends FolderBase>
extends Object
implements ContentControlBase<T,V>, Serializable

Copyright (c) 2005-2006 by BEA Systems, Inc. All Rights Reserved.

Defines general operations for dealing with CM content.

This class is meant to be used OUTSIDE of a GroupSpace community, since it will bypass GroupSpace security/role mappings

Declarative instantiation (@Control fooControl;) from a PageFlow or from another control is the preferred method of instantiating controls (as this will supply the control a proper Control Container Context (CCC)). Should the control be instantiated programmatically, from a different context or with an application scope (rather than webapp), extra measures should be taken:

See Also
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.bea.apps.groupspace.controls.generic.ContentControlBase
ContentControlBase.NodeSearchType, ContentControlBase.Params
 
Field Summary
static int ALL_TYPES
           
protected  Class<T> beanClass
           
protected static ContentFactory contentFactory
           
static int DEFAULT_SEARCH_LOAD_SIZE
           
protected static INodeManager nodeManager
           
protected  String objectClassType
           
protected  ID repoID
           
protected  String repoName
           
protected static ISearchManager searchManager
           
protected static ITypeManager typeManager
           
 
Constructor Summary
ContentControlBaseImpl()
           
 
Method Summary
protected  ContentContext cc()
          Update the ContentContext object on each method invocation to keep it in sync with the current Request.
protected abstract  V createFolderObject(Node node)
           
protected abstract  T createObject(Node node)
          Creates an object of type T that wraps the node supplied as an argument
 ObjectClass createObjectClass()
          Creates an ObjectClass for the given control
 Set<T> createObjects(Node[] nodes)
          Create a collection of things from an array of Nodes
 Set<T> createObjects(Set<Node> nodes)
          Create a collection of things from a set of Nodes
protected abstract  ObjectClass createType()
           
 T findById(String nodeIdString)
          Find an item based on its Node ID
 SortableFilterablePagedResult<T> findMany(String expression, String[] searchPaths)
          Retrieve a set of things based on properties in an expression.
 SortableFilterablePagedResult<T> findMany(String expression, String[] searchPaths, SortCriteria[] sortCriteria)
          Retrieve a set of things based on properties in an expression.
 SortableFilterablePagedResult<T> findManyChildren(String expression)
           
 Set<T> getAll()
          Get all Community Scoped Content items of a specific type
static Set<Node> getAllChildren(ContentContext context, ID topLevelNode, int type)
          Get all the children of this node, specifying whether to include content only, folders only, or both Node types.
 List<PropertyDefinition> getAllPropertyDefinitions()
           
protected  String[] getAsSearchPaths(String path)
           
protected abstract  String getContentType()
           
 String getDefaultStringValue(String propertyName)
           
 V getFolder(ID folderId)
          Get the Folder of the Node with the supplied ID.
protected abstract  V getFolderByExpression(String topNodeName, String expression, Node communityNode)
           
protected abstract  String getFolderContentType()
           
 Set<ContentBase> getImmediateChildren(V parentFolder, ContentControlBase.NodeSearchType type)
          Get the immediate children of this item.
 Set<ContentBase> getImmediateChildren(V parentFolder, SortCriteria[] sortCriteria, ContentControlBase.NodeSearchType type)
          Get the immediate children of this item.
abstract  SortableFilterablePagedResult<ContentBase> getImmediateChildrenAsPagedResult(Node node, SortCriteria[] sortCriteria, ContentControlBase.NodeSearchType hierarchySearchType)
          Get the immediate children of this item.
 ObjectClass getObjectClass()
          Return the object class associated with the thing T TODO move this function to CmxControl?
protected abstract  String[] getSearchPaths()
           
 V getTopFolder()
          Get the top-level Folder of each data type (eg, top Links folder)
abstract  Node getTopNode()
          Get the top-level node of each data type (eg, top Links folder)
 T move(ID source, ID newParent)
          Move Node from one place to another
 T move(String source, String newParent)
          Move Node from one place to another
protected static void recurseRepository(ContentContext context, ID id, Set nodes, int searchType)
          Recurse the repository and store id/node in a (sorted) TreeMap
 void remove(Node node)
          Remove the node
 void remove(Set<T> things)
          Remove the Set of things T
 void remove(T thing)
          Remove the thing T
 void removeAll()
          Remove all
 void update(Set<T> things)
          Update a Set of existing things
 void update(T updatedThing)
          Update an existing thing and flush binary/search caches
 
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.ContentControlBase
findContentById
 

Field Detail

ALL_TYPES

public static final int ALL_TYPES
See Also
Constants Summary

DEFAULT_SEARCH_LOAD_SIZE

public static final int DEFAULT_SEARCH_LOAD_SIZE
See Also
Constants Summary

nodeManager

protected static INodeManager nodeManager

typeManager

protected static ITypeManager typeManager

searchManager

protected static ISearchManager searchManager

contentFactory

protected static ContentFactory contentFactory

objectClassType

protected String objectClassType

repoName

protected String repoName

repoID

protected ID repoID

beanClass

protected Class<T extends ContentBase> beanClass
Constructor Detail

ContentControlBaseImpl

public ContentControlBaseImpl()
Method Detail

getTopNode

public abstract Node getTopNode()
                         throws AuthenticationException,
                                AuthorizationException,
                                NoSuchNodeException,
                                RepositoryException
Description copied from interface: ContentControlBase
Get the top-level node of each data type (eg, top Links folder)

Specified by:
getTopNode in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps InstantiationException, IllegalAccessException, InvocationTargetException, NodeMapper.NodeMapperException, AuthenticationException, NoSuchNodeException
RepositoryException
AuthenticationException
NoSuchNodeException

getImmediateChildrenAsPagedResult

public abstract SortableFilterablePagedResult<ContentBase> getImmediateChildrenAsPagedResult(Node node,
                                                                                             SortCriteria[] sortCriteria,
                                                                                             ContentControlBase.NodeSearchType hierarchySearchType)
                                                                                      throws AuthorizationException,
                                                                                             NoSuchNodeException,
                                                                                             RepositoryException
Get the immediate children of this item. Returns null if none are found.

Specified by:
getImmediateChildrenAsPagedResult in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

createObject

protected abstract T createObject(Node node)
Creates an object of type T that wraps the node supplied as an argument


createType

protected abstract ObjectClass createType()
                                   throws NoSuchNodeException,
                                          RepositoryException,
                                          AuthorizationException
Throws
NoSuchNodeException
RepositoryException
AuthorizationException

createFolderObject

protected abstract V createFolderObject(Node node)

getContentType

protected abstract String getContentType()

getFolderContentType

protected abstract String getFolderContentType()

getSearchPaths

protected abstract String[] getSearchPaths()
                                    throws RepositoryException,
                                           InstantiationException
Throws
RepositoryException
InstantiationException

getFolderByExpression

protected abstract V getFolderByExpression(String topNodeName,
                                           String expression,
                                           Node communityNode)
                                                       throws AuthorizationException,
                                                              NoSuchNodeException,
                                                              RepositoryException
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

createObjectClass

public ObjectClass createObjectClass()
                              throws NoSuchNodeException,
                                     RepositoryException,
                                     AuthorizationException
Description copied from interface: ContentControlBase
Creates an ObjectClass for the given control

Specified by:
createObjectClass in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
NoSuchNodeException
RepositoryException
AuthorizationException - throws ControlException - unchecked exception that wraps InstantiationException, IllegalAccessException, InvocationTargetException, NodeMapper.NodeMapperException, AuthenticationException, NoSuchNodeException

getObjectClass

public ObjectClass getObjectClass()
                           throws AuthorizationException,
                                  NoSuchObjectClassException,
                                  RepositoryException
Return the object class associated with the thing T TODO move this function to CmxControl?

Specified by:
getObjectClass in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchObjectClassException
RepositoryException

findManyChildren

public SortableFilterablePagedResult<T> findManyChildren(String expression)
                                                                      throws AuthorizationException,
                                                                             NoSuchNodeException,
                                                                             RepositoryException
Specified by:
findManyChildren in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

findMany

public SortableFilterablePagedResult<T> findMany(String expression,
                                                 String[] searchPaths)
                                                              throws AuthorizationException,
                                                                     NoSuchNodeException,
                                                                     RepositoryException
Retrieve a set of things based on properties in an expression. Returns null if none are found.

Specified by:
findMany in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

findMany

public SortableFilterablePagedResult<T> findMany(String expression,
                                                 String[] searchPaths,
                                                 SortCriteria[] sortCriteria)
                                                              throws AuthorizationException,
                                                                     NoSuchNodeException,
                                                                     RepositoryException
Retrieve a set of things based on properties in an expression. Returns null if none are found.

Specified by:
findMany in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps InstantiationException, IllegalAccessException, InvocationTargetException, NodeMapper.NodeMapperException, AuthenticationException, NoSuchNodeException
RepositoryException
NoSuchNodeException

getFolder

public V getFolder(ID folderId)
                               throws AuthorizationException,
                                      NoSuchNodeException,
                                      RepositoryException
Get the Folder of the Node with the supplied ID.

Specified by:
getFolder in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

getTopFolder

public V getTopFolder()
                                  throws AuthorizationException,
                                         NoSuchNodeException,
                                         RepositoryException
Get the top-level Folder of each data type (eg, top Links folder)

Specified by:
getTopFolder in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps InstantiationException, IllegalAccessException, InvocationTargetException, NodeMapper.NodeMapperException, AuthenticationException, NoSuchNodeException
RepositoryException
NoSuchNodeException

update

public void update(T updatedThing)
            throws AuthorizationException,
                   NoSuchNodeException,
                   NoSuchPropertyException,
                   RepositoryException
Update an existing thing and flush binary/search caches

Specified by:
update in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps AuthenticationException, NoSuchPropertyException, InstantiationException, IllegalAccessException, InvocationTargetException, NodeMapper.NodeMapperException, IOException
RepositoryException
NoSuchNodeException
NoSuchPropertyException

update

public void update(Set<T> things)
            throws AuthorizationException,
                   NoSuchNodeException,
                   NoSuchPropertyException,
                   RepositoryException
Update a Set of existing things

Specified by:
update in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps AuthenticationException, NoSuchPropertyException, InstantiationException, IllegalAccessException, InvocationTargetException, NodeMapper.NodeMapperException, IOException
RepositoryException
NoSuchNodeException
NoSuchPropertyException

getAll

public Set<T> getAll()
                                  throws AuthorizationException,
                                         NoSuchNodeException,
                                         RepositoryException
Get all Community Scoped Content items of a specific type

Throws
AuthorizationException
NoSuchNodeException
RepositoryException

getImmediateChildren

public Set<ContentBase> getImmediateChildren(V parentFolder,
                                             ContentControlBase.NodeSearchType type)
                                      throws AuthorizationException,
                                             NoSuchNodeException,
                                             RepositoryException
Get the immediate children of this item. Returns null if none are found.

Specified by:
getImmediateChildren in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

getImmediateChildren

public Set<ContentBase> getImmediateChildren(V parentFolder,
                                             SortCriteria[] sortCriteria,
                                             ContentControlBase.NodeSearchType type)
                                      throws AuthorizationException,
                                             NoSuchNodeException,
                                             RepositoryException
Get the immediate children of this item. Returns null if none are found.

Specified by:
getImmediateChildren in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

remove

public void remove(T thing)
            throws AuthorizationException,
                   RepositoryException
Description copied from interface: ContentControlBase
Remove the thing T

Specified by:
remove in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps AuthenticationException
RepositoryException

remove

public void remove(Node node)
            throws AuthorizationException,
                   RepositoryException
Description copied from interface: ContentControlBase
Remove the node

Specified by:
remove in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps AuthenticationException
RepositoryException

remove

public void remove(Set<T> things)
            throws AuthorizationException,
                   RepositoryException
Description copied from interface: ContentControlBase
Remove the Set of things T

Specified by:
remove in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps AuthenticationException
RepositoryException

removeAll

public void removeAll()
               throws AuthorizationException,
                      RepositoryException
Description copied from interface: ContentControlBase
Remove all

Specified by:
removeAll in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps InstantiationException, IllegalAccessException, InvocationTargetException, NodeMapper.NodeMapperException, AuthenticationException, NoSuchNodeException
RepositoryException

move

public T move(ID source,
              ID newParent)
                           throws AuthorizationException,
                                  NoSuchNodeException,
                                  RepositoryException
Move Node from one place to another

Specified by:
move in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchNodeException - throws ControlException - unchecked exception that wraps AuthenticationException
RepositoryException

move

public T move(String source,
              String newParent)
                           throws AuthorizationException,
                                  NoSuchNodeException,
                                  RepositoryException
Move Node from one place to another

Specified by:
move in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchNodeException - throws ControlException - unchecked exception that wraps AuthenticationException
RepositoryException

findById

public T findById(String nodeIdString)
                               throws AuthorizationException,
                                      NoSuchNodeException,
                                      RepositoryException
Find an item based on its Node ID

Specified by:
findById in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException - throws ControlException - unchecked exception that wraps InstantiationException, IllegalAccessException, InvocationTargetException, NodeMapper.NodeMapperException, AuthenticationException, NoSuchNodeException
RepositoryException
NoSuchNodeException

createObjects

public Set<T> createObjects(Set<Node> nodes)
                                         throws AuthorizationException
Create a collection of things from a set of Nodes

Specified by:
createObjects in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException

createObjects

public Set<T> createObjects(Node[] nodes)
                                         throws AuthorizationException
Create a collection of things from an array of Nodes

Specified by:
createObjects in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException

getAllChildren

public static Set<Node> getAllChildren(ContentContext context,
                                       ID topLevelNode,
                                       int type)
                                throws AuthorizationException,
                                       NoSuchNodeException,
                                       RepositoryException
Get all the children of this node, specifying whether to include content only, folders only, or both Node types. Types are: Node.CONTENT, Node.HIERARCHY, or -1 (all)

Throws
AuthorizationException
NoSuchNodeException
RepositoryException

recurseRepository

protected static void recurseRepository(ContentContext context,
                                        ID id,
                                        Set nodes,
                                        int searchType)
                                 throws AuthorizationException,
                                        NoSuchNodeException,
                                        RepositoryException
Recurse the repository and store id/node in a (sorted) TreeMap

Parameters
context - The content context object
id - Starting point ID for looking in repository
nodes - Set for storing nodes
searchType - Node.CONTENT, Node.HIERARCHY, or -1 for all
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

getAsSearchPaths

protected String[] getAsSearchPaths(String path)

cc

protected ContentContext cc()
Update the ContentContext object on each method invocation to keep it in sync with the current Request.


getAllPropertyDefinitions

public List<PropertyDefinition> getAllPropertyDefinitions()
                                                   throws AuthorizationException,
                                                          NoSuchObjectClassException,
                                                          RepositoryException
Specified by:
getAllPropertyDefinitions in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
AuthorizationException
NoSuchObjectClassException
RepositoryException

getDefaultStringValue

public String getDefaultStringValue(String propertyName)
                             throws RepositoryException
Specified by:
getDefaultStringValue in interface ContentControlBase<T extends ContentBase,V extends FolderBase>
Throws
RepositoryException


Copyright © 2006 BEA Systems, Inc. All Rights Reserved