Class AmetysObjectDao
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.repository.workspace.AmetysObjectDao
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
public class AmetysObjectDao extends AbstractLogEnabled implements Component, Serviceable
DAO providing methods to manageAmetysObject
s.
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver
_resolver
The AmetysObject resolver.
-
Constructor Summary
Constructors Constructor Description AmetysObjectDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
addAmetysObject(String parentId, String name, String type)
Add an AmetysObject to the repository.Map<String,Object>
getAmetysObject(String id)
Get information on anAmetysObject
from its identifier.Map<String,Object>
getAmetysObjectByPath(String path)
Get information on anAmetysObject
, found by its path.Map<String,Object>
getAmetysObjects(Collection<String> ids)
Get information on aAmetysObject
s from their identifier.protected void
putAmetysObjectInfo(Map<String,Object> info, AmetysObject obj)
Fill the given Map with information on an AmetysObject.List<Map<String,Object>>
query(String query)
Execute a query to find AmetysObjects.void
removeAmetysObject(String id)
Remove an AmetysObject.void
removeMetadata(String id, String compositePath, String metadataName)
Remove a metadata of a Ametys objectvoid
service(ServiceManager serviceManager)
void
unlockAmetysObject(String id)
Unlock an AmetysObject.-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
The AmetysObject resolver.
-
-
Constructor Detail
-
AmetysObjectDao
public AmetysObjectDao()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getAmetysObject
public Map<String,Object> getAmetysObject(String id)
Get information on anAmetysObject
from its identifier.- Parameters:
id
- the AmetysObject identifier.- Returns:
- information on the AmetysObject as a Map.
-
getAmetysObjectByPath
public Map<String,Object> getAmetysObjectByPath(String path)
Get information on anAmetysObject
, found by its path.- Parameters:
path
- the absolute AmetysObject path (starting with /ametys:root).- Returns:
- information on the AmetysObject as a Map.
-
getAmetysObjects
public Map<String,Object> getAmetysObjects(Collection<String> ids)
Get information on aAmetysObject
s from their identifier.- Parameters:
ids
- a Collection of AmetysObject identifiers.- Returns:
- a Map containing the list of AmetysObject info ('objects' key) and the list of unknown identifiers ('notFound' key).
-
addAmetysObject
public Map<String,Object> addAmetysObject(String parentId, String name, String type)
Add an AmetysObject to the repository.- Parameters:
parentId
- the parent AmetysObject ID, must be ModifiableTraversable.name
- the name of the AmetysObject to create.type
- the AmetysObject type.- Returns:
- a Map of information on the created AmetysObject.
-
removeAmetysObject
public void removeAmetysObject(String id)
Remove an AmetysObject.- Parameters:
id
- the identifier of the AmetysObject to remove.
-
removeMetadata
public void removeMetadata(String id, String compositePath, String metadataName)
Remove a metadata of a Ametys object- Parameters:
id
- the identifier of the AmetysObjectcompositePath
- the path of the parent metadata. Can be null or empty.metadataName
- The name of metadata to remove
-
unlockAmetysObject
public void unlockAmetysObject(String id)
Unlock an AmetysObject.- Parameters:
id
- the identifier of the AmetysObject to remove.
-
query
public List<Map<String,Object>> query(String query)
Execute a query to find AmetysObjects.- Parameters:
query
- the query to execute.- Returns:
- a List of AmetysObject info (as Maps).
-
putAmetysObjectInfo
protected void putAmetysObjectInfo(Map<String,Object> info, AmetysObject obj)
Fill the given Map with information on an AmetysObject.- Parameters:
info
- the Map to fill.obj
- the AmetysObject.
-
-