public class RepositoryDao extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
protected NodeStateTracker |
_nodeStateTracker
The node state tracker.
|
protected NodeTypeHierarchyComponent |
_nodeTypeHierarchy
The node type hierarchy component.
|
protected RepositoryProvider |
_repositoryProvider
The repository provider.
|
private ServiceManager |
_serviceManager |
Constructor and Description |
---|
RepositoryDao() |
Modifier and Type | Method and Description |
---|---|
static String |
addLeadingSlash(String path)
Add a leading slash to the path.
|
Map<String,Object> |
addNode(String parentPath,
String childName,
String childType,
String workspaceName)
Add a node.
|
void |
checkoutNode(String path,
String workspaceName)
Check-out a node.
|
protected void |
fillNodeInfo(Node node,
Map<String,Object> nodeInfo)
Fill the node info.
|
Set<String> |
getChildrenTypes(String nodePath,
String workspaceName)
Get the possible children types of a node.
|
Map<String,Object> |
getNodeByIdentifier(String identifier,
String workspaceName)
Get node information by its identifier.
|
Map<String,Object> |
getNodeByPath(String path,
String workspaceName)
Get node information by path.
|
Map<String,Object> |
getNodesByPath(Collection<String> paths,
String workspaceName)
Get node information by path.
|
Map<String,Object> |
getRepositoryInfo()
Get information on the repository.
|
List<String> |
getWorkspaces()
Get the list of available workspaces in the repository.
|
static String |
removeLeadingSlash(String path)
Remove the leading slash from the path if needed.
|
String |
removeNode(String path,
String workspaceName)
Remove a node from the repository.
|
void |
removeProperty(String path,
String workspaceName,
String propertyName)
Remove a property from a node.
|
void |
rollbackSession(String workspaceName)
Rollback a session.
|
void |
saveSession(String workspaceName)
Save a session.
|
void |
service(ServiceManager serviceManager) |
void |
unlockNode(String path,
String workspaceName)
Unlock a node.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected RepositoryProvider _repositoryProvider
protected NodeStateTracker _nodeStateTracker
protected NodeTypeHierarchyComponent _nodeTypeHierarchy
private ServiceManager _serviceManager
public RepositoryDao()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getRepositoryInfo()
public List<String> getWorkspaces() throws RepositoryException
RepositoryException
- if an error occurs getting or setting data from/in the repository.public Map<String,Object> getNodesByPath(Collection<String> paths, String workspaceName) throws RepositoryException
paths
- the node paths, relative to the root node (without leading slash).workspaceName
- the workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public Map<String,Object> getNodeByPath(String path, String workspaceName) throws RepositoryException
path
- the node path, relative to the root node (without leading slash).workspaceName
- the workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public Map<String,Object> getNodeByIdentifier(String identifier, String workspaceName) throws RepositoryException
identifier
- the node identifier.workspaceName
- the workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public Set<String> getChildrenTypes(String nodePath, String workspaceName) throws RepositoryException
nodePath
- The node path.workspaceName
- The workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public Map<String,Object> addNode(String parentPath, String childName, String childType, String workspaceName) throws RepositoryException
parentPath
- the parent node path.childName
- the name of the node to create.childType
- the type of the node to create.workspaceName
- the workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public String removeNode(String path, String workspaceName) throws RepositoryException
path
- The absolute node path, can start with a slash or not.workspaceName
- The workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public void removeProperty(String path, String workspaceName, String propertyName) throws RepositoryException
path
- The absolute node path, can start with a slash or not.workspaceName
- The workspace name.propertyName
- The name of the property to remove.RepositoryException
- if an error occurs getting or setting data from/in the repository.public void unlockNode(String path, String workspaceName) throws RepositoryException
path
- The absolute node path.workspaceName
- The workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public void checkoutNode(String path, String workspaceName) throws RepositoryException
path
- The absolute node path, must start with a slash.workspaceName
- The workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public void saveSession(String workspaceName) throws RepositoryException
workspaceName
- The workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.public void rollbackSession(String workspaceName) throws RepositoryException
workspaceName
- The workspace name.RepositoryException
- if an error occurs getting or setting data from/in the repository.protected void fillNodeInfo(Node node, Map<String,Object> nodeInfo) throws RepositoryException
node
- The node to convertnodeInfo
- The map to fillRepositoryException
- if an error occurs getting or setting data from/in the repository.public static String addLeadingSlash(String path)
path
- the path.public static String removeLeadingSlash(String path)
path
- the path.