Class AmetysObjectDao
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.repository.workspace.AmetysObjectDao
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
DAO providing methods to manage
AmetysObject
s.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAmetysObject
(String parentId, String name, String type) Add an AmetysObject to the repository.Get information on anAmetysObject
from its identifier.getAmetysObjectByPath
(String path) Get information on anAmetysObject
, found by its path.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.Execute a query to find AmetysObjects.void
Remove an AmetysObject.void
removeMetadata
(String id, String compositePath, String metadataName) Remove a metadata of a Ametys objectvoid
service
(ServiceManager serviceManager) void
Unlock an AmetysObject.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_resolver
The AmetysObject resolver.
-
-
Constructor Details
-
AmetysObjectDao
public AmetysObjectDao()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getAmetysObject
Get information on anAmetysObject
from its identifier.- Parameters:
id
- the AmetysObject identifier.- Returns:
- information on the AmetysObject as a Map.
-
getAmetysObjectByPath
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
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
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
Remove an AmetysObject.- Parameters:
id
- the identifier of the AmetysObject to remove.
-
removeMetadata
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
Unlock an AmetysObject.- Parameters:
id
- the identifier of the AmetysObject to remove.
-
query
Execute a query to find AmetysObjects.- Parameters:
query
- the query to execute.- Returns:
- a List of AmetysObject info (as Maps).
-
putAmetysObjectInfo
Fill the given Map with information on an AmetysObject.- Parameters:
info
- the Map to fill.obj
- the AmetysObject.
-