org.hippoecm.hst.content.beans.manager
Interface ObjectBeanPersistenceManager

All Superinterfaces:
ObjectBeanManager
All Known Subinterfaces:
WorkflowPersistenceManager
All Known Implementing Classes:
MockObjectBeanPersistenceManager, WorkflowPersistenceManagerImpl

public interface ObjectBeanPersistenceManager
extends ObjectBeanManager

ObjectBeanPersistenceManager is the primary interface for HST-2-Persistence-aware application components.

An implementation of this interface should be able to convert content nodes to objects, and vice versa. Also it should have knowledges on how to create, update or remove a content node with node type and absolute path.

If the content models are not complex and so just simple node structures are enough for the requirements, then an implementation for this interface can probably provide an automatic bi-directional mappings.

However, in most real cases, the content models are very sophisticated, so they need careful workflow management to fulfill real requirements such as faceted selection, virtual nodes, approval or publishing management. Therefore, this sophisticated management should be implemented properly in separated classes.

Some sophisticated JCR repository engine already have their own workflow knowledges on how to create, update and remove content nodes based on node types. Or, some domain specific content-based application should know the knowledges on their own content models. In these cases, they can provide an implementation for this interface.


Method Summary
 void create(String absPath, String nodeTypeName, String name)
          Deprecated. use createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)
 void create(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)
          Deprecated. use createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)
 String createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)
          Creates content node(s) with the specified node type at the specified absolute path.
 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 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 interface org.hippoecm.hst.content.beans.manager.ObjectBeanManager
getObject, getObjectByUuid, getSession
 

Method Detail

create

@Deprecated
void create(String absPath,
                       String nodeTypeName,
                       String name)
            throws ObjectBeanPersistenceException
Deprecated. use createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)

Creates content node(s) with the specified node type at the specified absolute path.

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.

Parameters:
absPath - the absolute node path
nodeTypeName - the node type name of the content object
name - the content node name
Throws:
ObjectBeanPersistenceException

create

@Deprecated
void create(String absPath,
                       String nodeTypeName,
                       String name,
                       boolean autoCreateFolders)
            throws ObjectBeanPersistenceException
Deprecated. use createAndReturn(String absPath, String nodeTypeName, String name, boolean autoCreateFolders)

Creates content node(s) with the specified node type at the specified absolute path.

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.

Parameters:
absPath - the absolute node path
nodeTypeName - the node type name of the content object
name - the content node name
autoCreateFolders - the flag to create folders
Throws:
ObjectBeanPersistenceException

createAndReturn

String createAndReturn(String absPath,
                       String nodeTypeName,
                       String name,
                       boolean autoCreateFolders)
                       throws ObjectBeanPersistenceException
Creates content node(s) with the specified node type at the specified absolute path.

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.

Parameters:
absPath - the absolute node path
nodeTypeName - the node type name of the content object
name - the content node name
autoCreateFolders - the flag to create folders
Returns:
the absolute path of the created node
Throws:
ObjectBeanPersistenceException

update

void update(Object content)
            throws ObjectBeanPersistenceException
Updates the content node which is mapped to the object.

An implementation can provide binding the content object to the physical JCR node(s) and updates. An implementation can provide automatic content binding, or another requires pre-registered ContentNodeBinder map to do real bindings. It probably depends on the functionalities of underlying repository.

Parameters:
content -
Throws:
ObjectBeanPersistenceException

update

void update(Object content,
            ContentNodeBinder customContentNodeBinder)
            throws ObjectBeanPersistenceException
Updates the content node which is mapped to the object by the 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.

Parameters:
content -
customContentNodeBinder -
Throws:
ObjectBeanPersistenceException

remove

void remove(Object content)
            throws ObjectBeanPersistenceException
Removes the content node which is mapped to the object.

Parameters:
content -
Throws:
ObjectBeanPersistenceException

save

void save()
          throws ObjectBeanPersistenceException
Saves all pending changes.

Throws:
ObjectBeanPersistenceException

refresh

void refresh()
             throws ObjectBeanPersistenceException
Invokes Session.refresh(boolean) with false parameter.

Throws:
ObjectBeanPersistenceException

refresh

void refresh(boolean keepChanges)
             throws ObjectBeanPersistenceException
Invokes Session.refresh(boolean).

Parameters:
keepChanges -
Throws:
ObjectBeanPersistenceException


Copyright © 2008-2012 Hippo. All Rights Reserved.