|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.content.beans.manager.ObjectBeanManagerImpl
org.hippoecm.hst.content.beans.manager.workflow.WorkflowPersistenceManagerImpl
public class WorkflowPersistenceManagerImpl
An implementation for WorkflowPersistenceManager
interface with Hippo Repository Workflow API.
This implementation does not provide automatic bindings from content object to JCR node(s).
So, client codes should provide custom binders for their own node types. These custom binders map can be
given by a constructor argument, or a custom binder can be given by an argument of update(Object, ContentNodeBinder)
method.
Another useful option is to make a content POJO object implement ContentNodeBinder
interface.
When client codes invoke update(Object)
method, this implementation will look up the custom binder
from the internal map at first. If there's nothing found, then this implementation will check if the content POJO
object is an instance of ContentNodeBinder
. If it is, this implementation will use the content POJO object itself
as a ContentNodeBinder
.
If this implementation cannot find any ContentNodeBinder
, it will do updating the content without any bindings.
Field Summary | |
---|---|
protected Map<String,ContentNodeBinder> |
contentNodeBinders
Custom content node binders map, which is used to look up a custom binder for a node type. |
protected String |
defaultWorkflowCategory
The workflow category name to localize the new document |
protected String |
documentAdditionWorkflowCategory
The workflow category name to add a new document. |
protected String |
documentNodeWorkflowCategory
The workflow category name to get a document workflow. |
protected String |
folderAdditionWorkflowCategory
The workflow category name to add a new folder. |
protected String |
folderNodeTypeName
Hippo Repository specific predefined folder node type name |
protected String |
folderNodeWorkflowCategory
The workflow category name to get a folder workflow. |
protected org.hippoecm.repository.api.StringCodec |
uriEncoding
The codec which is used for the node names |
protected WorkflowCallbackHandler |
workflowCallbackHandler
Workflow callback handler |
Fields inherited from class org.hippoecm.hst.content.beans.manager.ObjectBeanManagerImpl |
---|
objectConverter, session |
Constructor Summary | |
---|---|
WorkflowPersistenceManagerImpl(javax.jcr.Session session,
ObjectConverter objectConverter)
Constructor |
|
WorkflowPersistenceManagerImpl(javax.jcr.Session session,
ObjectConverter objectConverter,
Map<String,ContentNodeBinder> contentNodeBinders)
Constructor |
Method Summary | |
---|---|
void |
create(String absPath,
String nodeTypeName,
String name)
Deprecated. the name of the created node can differ from the passed name. Use createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)
to get the absolute path of the created node. |
void |
create(String absPath,
String nodeTypeName,
String name,
boolean autoCreateFolders)
Deprecated. the name of the created node can differ from the passed name. Use createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)
to get the absolute path of the created node. |
String |
createAndReturn(String absPath,
String nodeTypeName,
String name,
boolean autoCreateFolders)
Creates content node(s) with the specified node type at the specified absolute path. |
protected javax.jcr.Node |
createMissingFolders(String absPath)
|
protected String |
createNodeByWorkflow(javax.jcr.Node folderNode,
String nodeTypeName,
String name)
|
String |
getDocumentAdditionWorkflowCategory()
Gets the workflow category name used to add a document. |
String |
getDocumentNodeWorkflowCategory()
Gets the workflow category name used to get a document workflow. |
String |
getFolderAdditionWorkflowCategory()
Gets the workflow category name used to add a folder. |
String |
getFolderNodeTypeName()
Gets the folder node type name which is used to create folders. |
String |
getFolderNodeWorkflowCategory()
Gets the workflow category name used to get a folder workflow. |
org.hippoecm.repository.api.Workflow |
getWorkflow(String category,
org.hippoecm.repository.api.Document document)
|
org.hippoecm.repository.api.Workflow |
getWorkflow(String category,
javax.jcr.Node node)
|
void |
refresh()
Invokes Session.refresh(boolean) with false parameter. |
void |
refresh(boolean keepChanges)
Invokes Session.refresh(boolean) . |
void |
remove(Object content)
Removes the content node which is mapped to the object. |
void |
save()
Saves all pending changes. |
void |
setDocumentAdditionWorkflowCategory(String documentAdditionWorkflowCategory)
Sets the workflow category name used to add a document. |
void |
setDocumentNodeWorkflowCategory(String documentNodeWorkflowCategory)
Sets the workflow category name used to get a document workflow. |
void |
setFolderAdditionWorkflowCategory(String folderAdditionWorkflowCategory)
Sets the workflow category name used to add a folder. |
void |
setFolderNodeTypeName(String folderNodeTypeName)
Sets the folder node type name which is used to create folders. |
void |
setFolderNodeWorkflowCategory(String folderNodeWorkflowCategory)
Sets the workflow category name used to get a folder workflow. |
void |
setWorkflowCallbackHandler(WorkflowCallbackHandler<? extends org.hippoecm.repository.api.Workflow> workflowCallbackHandler)
|
void |
update(Object content)
Updates the content node which is mapped to the object. |
void |
update(Object content,
ContentNodeBinder customContentNodeBinder)
Updates the content node which is mapped to the object by the customContentNodeBinder
provided by client. |
Methods inherited from class org.hippoecm.hst.content.beans.manager.ObjectBeanManagerImpl |
---|
getObject, getObjectByUuid, getSession |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.hippoecm.hst.content.beans.manager.ObjectBeanManager |
---|
getObject, getObjectByUuid, getSession |
Field Detail |
---|
protected Map<String,ContentNodeBinder> contentNodeBinders
protected String folderNodeTypeName
protected String folderNodeWorkflowCategory
protected String documentNodeWorkflowCategory
protected String documentAdditionWorkflowCategory
protected String folderAdditionWorkflowCategory
protected WorkflowCallbackHandler workflowCallbackHandler
protected org.hippoecm.repository.api.StringCodec uriEncoding
protected String defaultWorkflowCategory
Constructor Detail |
---|
public WorkflowPersistenceManagerImpl(javax.jcr.Session session, ObjectConverter objectConverter)
session
- the session for this manager contextobjectConverter
- the object converter to do mapping from JCR nodes to content POJO objectspublic WorkflowPersistenceManagerImpl(javax.jcr.Session session, ObjectConverter objectConverter, Map<String,ContentNodeBinder> contentNodeBinders)
session
- the session for this manager contextobjectConverter
- the object converter to do mapping from JCR nodes to content POJO objectscontentNodeBinders
- the predefined content node binders map which item is node type name key and custom binder object value.Method Detail |
---|
@Deprecated public void create(String absPath, String nodeTypeName, String name) throws ObjectBeanPersistenceException
createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)
to get the absolute path of the created node.
The absolute path could be regarded differently according to physical implementations. For example, an implementation can regard the path as a simple one to create a simple JCR node. On the other hand, a sophisticated implementation can regard the path as an input for a workflow-enabled document/folder path.
create
in interface ObjectBeanPersistenceManager
absPath
- the absolute node pathnodeTypeName
- the node type name of the content objectname
- the content node name
ObjectBeanPersistenceException
@Deprecated public void create(String absPath, String nodeTypeName, String name, boolean autoCreateFolders) throws ObjectBeanPersistenceException
createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)
to get the absolute path of the created node.
The absolute path could be regarded differently according to physical implementations. For example, an implementation can regard the path as a simple one to create a simple JCR node. On the other hand, a sophisticated implementation can regard the path as an input for a workflow-enabled document/folder path.
If autoCreateFolders
is true, then folders will be automatically created.
create
in interface ObjectBeanPersistenceManager
absPath
- the absolute node pathnodeTypeName
- the node type name of the content objectname
- the content node nameautoCreateFolders
- the flag to create folders
ObjectBeanPersistenceException
public String createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders) throws ObjectBeanPersistenceException
The absolute path could be regarded differently according to physical implementations. For example, an implementation can regard the path as a simple one to create a simple JCR node. On the other hand, a sophisticated implementation can regard the path as an input for a workflow-enabled document/folder path.
If autoCreateFolders
is true, then folders will be automatically created.
createAndReturn
in interface ObjectBeanPersistenceManager
absPath
- the absolute node pathnodeTypeName
- the node type name of the content objectname
- the content node nameautoCreateFolders
- the flag to create folders
ObjectBeanPersistenceException
protected javax.jcr.Node createMissingFolders(String absPath) throws ObjectBeanPersistenceException
ObjectBeanPersistenceException
protected String createNodeByWorkflow(javax.jcr.Node folderNode, String nodeTypeName, String name) throws ObjectBeanPersistenceException
ObjectBeanPersistenceException
public void update(Object content) throws ObjectBeanPersistenceException
This will look up a propery custom content node binder from the internal map. (contentNodeBinders
).
If it is not found there, this implementation will check if the content object is an instance of ContentNodeBinder
interface.
If so, the content object will be used as a custom binder.
If there's no content node binder found, then this implementation will do updating only without any bindings.
update
in interface ObjectBeanPersistenceManager
content
-
ObjectBeanPersistenceException
public void update(Object content, ContentNodeBinder customContentNodeBinder) throws ObjectBeanPersistenceException
customContentNodeBinder
provided by client.
Unlike update(Object)
, the implementation should not try to do automatic or predefined bindings.
Instead, it should invoke customContentNodeBinder
to do bindings.
Therefore, if a developer wants to customize the bindings, the developer should provide a customContentNodeBinder
.
update
in interface ObjectBeanPersistenceManager
content
- customContentNodeBinder
-
ObjectBeanPersistenceException
public void remove(Object content) throws ObjectBeanPersistenceException
remove
in interface ObjectBeanPersistenceManager
content
-
ObjectBeanPersistenceException
public void save() throws ObjectBeanPersistenceException
save
in interface ObjectBeanPersistenceManager
ObjectBeanPersistenceException
public void refresh() throws ObjectBeanPersistenceException
Session.refresh(boolean)
with false
parameter.
refresh
in interface ObjectBeanPersistenceManager
ObjectBeanPersistenceException
public void refresh(boolean keepChanges) throws ObjectBeanPersistenceException
Session.refresh(boolean)
.
refresh
in interface ObjectBeanPersistenceManager
keepChanges
-
ObjectBeanPersistenceException
public void setFolderNodeTypeName(String folderNodeTypeName)
folderNodeTypeName
- public String getFolderNodeTypeName()
public String getFolderNodeWorkflowCategory()
public void setFolderNodeWorkflowCategory(String folderNodeWorkflowCategory)
folderNodeWorkflowCategory
- public String getDocumentNodeWorkflowCategory()
public void setDocumentNodeWorkflowCategory(String documentNodeWorkflowCategory)
documentNodeWorkflowCategory
- public String getFolderAdditionWorkflowCategory()
public void setFolderAdditionWorkflowCategory(String folderAdditionWorkflowCategory)
folderAdditionWorkflowCategory
- public String getDocumentAdditionWorkflowCategory()
public void setDocumentAdditionWorkflowCategory(String documentAdditionWorkflowCategory)
documentAdditionWorkflowCategory
- public void setWorkflowCallbackHandler(WorkflowCallbackHandler<? extends org.hippoecm.repository.api.Workflow> workflowCallbackHandler)
setWorkflowCallbackHandler
in interface WorkflowPersistenceManager
public org.hippoecm.repository.api.Workflow getWorkflow(String category, javax.jcr.Node node) throws javax.jcr.RepositoryException
getWorkflow
in interface WorkflowPersistenceManager
javax.jcr.RepositoryException
public org.hippoecm.repository.api.Workflow getWorkflow(String category, org.hippoecm.repository.api.Document document) throws javax.jcr.RepositoryException
getWorkflow
in interface WorkflowPersistenceManager
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |