|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.content.controls.extensible.CmxControlImpl
public class CmxControlImpl
Copyright (c) 2005-2006 by BEA Systems, Inc. All Rights Reserved.
The implementation class for the content management system controller.CmxControl
defines an extensibility model that allows extended operations
to be declared using a @ControlExtension
The interface provides the invoke
method, that is called whenever an
extended operation is called by the client at run time.
The protected methods can be overridden to add general sorts of functionality like
logging, security, etc.
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:
AppScopedControlsFactory
to obtain the CCC
ControlFilter
in web.xml
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.bea.content.controls.extensible.CmxControl |
---|
CmxControl.Create, CmxControl.Delete, CmxControl.DynamicProperties, CmxControl.FindBy, CmxControl.FindById, CmxControl.Id, CmxControl.Move, CmxControl.ParentId, CmxControl.Property, CmxControl.PropertyPair, CmxControl.RepositoryInfo, CmxControl.SearchPaths, CmxControl.SortOrder, CmxControl.Update |
Field Summary | |
---|---|
protected static String |
CMX_CONTROL_CREATE_SEQUENCER_ID
|
protected static Class[] |
constructorArgClasses
Resource context, for onAcquire(), is NOT avaiable to us on ApplicationLifecycleListener callbacks, so we can't use it. |
protected ContentContext |
contentContext
|
protected static int |
DEFAULT_LIST_SIZE
|
protected static ID |
IGNORED_ID
|
protected static int |
MAX_NAME_LENGTH
|
protected INodeManager |
nodeManager
|
protected CmxControl.RepositoryInfo |
repositoryInfo
|
protected ISearchManager |
searchManager
|
protected ID |
topLevelID
|
protected ITypeManager |
typeManager
|
Constructor Summary | |
---|---|
CmxControlImpl()
no-op default empty Constructor...perform initialization in onCreate |
Method Summary | |
---|---|
protected Node |
addNode(ContentContext cc,
CmxControl.Create methodCreate,
ObjectClass objectClass,
Property[] nodeProps,
ID parentId)
|
protected Node |
addNodeSecure(ContentContext cc,
int nodeHierarchyContentType,
ID parentId,
String nodeName,
String ocName,
Property[] nodeProps)
Actually add the node, going thru security in derived classes if necessay. |
protected void |
checkAccess(String capability,
ID idOfAffectedNode)
Default no-op method for checking security access |
protected void |
checkAccess(String capability,
String workingPath)
Default no-op method for checking security access |
protected Object |
constructReturnValueFromNode(Node tmpNode,
Constructor returnTypeNodeConstructor,
com.bea.content.nodemappers.NodeMapper nodeMapper,
boolean isNodeReturnType)
|
protected Object |
create(CmxControl.Create methodCreate,
Method method,
Type[] types,
Object[] args,
Class returnType)
|
protected ObjectClass |
createObjectClass(String nodeType,
List propertyDefs,
String parentTypeName,
Boolean isSearchable)
Create the ObjectClass |
protected static Value |
createValue(Object object)
Value factory... |
protected static Value[] |
createValues(Object object)
Values factory... |
protected Object |
delete(Method method,
Object[] args)
|
protected Object |
findBy(Method method,
CmxControl.FindBy methodFindBy,
Type[] argTypes,
String[] argNames,
Object[] args,
Class returnTypeClass,
Type returnType)
|
protected Object |
findById(Method method,
CmxControl.FindBy methodFindBy,
Type[] argTypes,
String[] argNames,
Object[] args,
Class returnTypeClass,
Type returnType)
|
protected ID |
findIdInArgs(Object[] args,
Method method)
|
protected ID |
findParentIdInArgs(Object[] args,
Method method)
Get the parentId |
protected ObjectClass |
getObjectClass(ContentContext cc,
String nodeType)
Search for ObjectClass before creating it |
protected List |
getPropertyDefinitions(Object[] args,
Method method,
ArrayList<String> keyFieldsReturned,
String parentTypeName)
Get Property definitions in case we need to create a new ObjectClass This methods in addition to returned the Property Definitions for the ObjectClass updated an ArrayList which contains primary key fields the ObjectClass. |
Object |
invoke(Method method,
Object[] args)
Called by the Controls runtime to handle calls to methods of an extensible control. |
protected Object |
move(Method method,
Object[] args)
|
void |
onCreate()
Invoked by the controls runtime when a new instance of this class is instantiated by the runtime |
protected Object |
update(Method method,
Object[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Class[] constructorArgClasses
protected static final ID IGNORED_ID
protected static final String CMX_CONTROL_CREATE_SEQUENCER_ID
protected static final int MAX_NAME_LENGTH
protected static final int DEFAULT_LIST_SIZE
protected ID topLevelID
protected transient INodeManager nodeManager
protected transient ISearchManager searchManager
protected transient ITypeManager typeManager
protected transient CmxControl.RepositoryInfo repositoryInfo
protected transient ContentContext contentContext
Constructor Detail |
---|
public CmxControlImpl()
Method Detail |
---|
public void onCreate() throws org.apache.beehive.controls.api.ControlException
org.apache.beehive.controls.api.ControlException
public Object invoke(Method method, Object[] args) throws Throwable
invoke
in interface org.apache.beehive.controls.api.bean.Extensible
method
- The extended operation that was called.args
- Parameters of the operation.
Throwable
- any exception declared on the extended operation may be
thrown. If a checked exception is thrown from the implementation that is not declared
on the original interface, it will be wrapped in a ControlException.protected Object create(CmxControl.Create methodCreate, Method method, Type[] types, Object[] args, Class returnType) throws AuthenticationException, AuthorizationException, NodeExistsException, NoSuchObjectClassException, RepositoryException, InstantiationException, IllegalAccessException, InvocationTargetException, SQLException, GSNonUniqueContentException
methodCreate
- method
- types
- args
- returnType
-
AuthenticationException
AuthorizationException
NodeExistsException
NoSuchObjectClassException
RepositoryException
InstantiationException
IllegalAccessException
InvocationTargetException
SQLException
GSNonUniqueContentException
protected Object findBy(Method method, CmxControl.FindBy methodFindBy, Type[] argTypes, String[] argNames, Object[] args, Class returnTypeClass, Type returnType) throws InstantiationException, IllegalAccessException, InvocationTargetException, com.bea.content.nodemappers.NodeMapper.NodeMapperException, AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
method
- methodFindBy
- argTypes
- argNames
- args
- returnTypeClass
- returnType
-
InstantiationException
IllegalAccessException
InvocationTargetException
NodeMapper.NodeMapperException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
protected Object findById(Method method, CmxControl.FindBy methodFindBy, Type[] argTypes, String[] argNames, Object[] args, Class returnTypeClass, Type returnType) throws InstantiationException, IllegalAccessException, InvocationTargetException, com.bea.content.nodemappers.NodeMapper.NodeMapperException, AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
InstantiationException
IllegalAccessException
InvocationTargetException
com.bea.content.nodemappers.NodeMapper.NodeMapperException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
protected Object constructReturnValueFromNode(Node tmpNode, Constructor returnTypeNodeConstructor, com.bea.content.nodemappers.NodeMapper nodeMapper, boolean isNodeReturnType) throws RepositoryException, InstantiationException, IllegalAccessException, InvocationTargetException, com.bea.content.nodemappers.NodeMapper.NodeMapperException
RepositoryException
InstantiationException
IllegalAccessException
InvocationTargetException
com.bea.content.nodemappers.NodeMapper.NodeMapperException
protected Object update(Method method, Object[] args) throws AuthenticationException, AuthorizationException, NoSuchNodeException, NoSuchPropertyException, RepositoryException, IOException, GSNonUniqueContentException
AuthenticationException
AuthorizationException
NoSuchNodeException
NoSuchPropertyException
RepositoryException
IOException
GSNonUniqueContentException
protected Object delete(Method method, Object[] args) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
protected Object move(Method method, Object[] args) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException, GSNonUniqueContentException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
GSNonUniqueContentException
protected ObjectClass getObjectClass(ContentContext cc, String nodeType) throws AuthorizationException, RepositoryException
AuthorizationException
RepositoryException
protected void checkAccess(String capability, String workingPath) throws AuthorizationException
AuthorizationException
protected void checkAccess(String capability, ID idOfAffectedNode) throws AuthorizationException, NoSuchNodeException, RepositoryException
AuthorizationException
NoSuchNodeException
RepositoryException
protected ObjectClass createObjectClass(String nodeType, List propertyDefs, String parentTypeName, Boolean isSearchable)
protected List getPropertyDefinitions(Object[] args, Method method, ArrayList<String> keyFieldsReturned, String parentTypeName) throws AuthorizationException, RepositoryException
AuthorizationException
RepositoryException
protected Node addNode(ContentContext cc, CmxControl.Create methodCreate, ObjectClass objectClass, Property[] nodeProps, ID parentId) throws AuthorizationException, NoSuchObjectClassException, RepositoryException
methodCreate
- objectClass
- nodeProps
- parentId
-
AuthorizationException
NoSuchObjectClassException
RepositoryException
protected Node addNodeSecure(ContentContext cc, int nodeHierarchyContentType, ID parentId, String nodeName, String ocName, Property[] nodeProps) throws AuthorizationException, NoSuchObjectClassException, RepositoryException
AuthorizationException
NoSuchObjectClassException
RepositoryException
protected ID findIdInArgs(Object[] args, Method method)
protected ID findParentIdInArgs(Object[] args, Method method)
protected static Value createValue(Object object)
protected static Value[] createValues(Object object)
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |