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 manage AmetysObjects.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager serviceManager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getAmetysObject

      Get information on an AmetysObject from its identifier.
      Parameters:
      id - the AmetysObject identifier.
      Returns:
      information on the AmetysObject as a Map.
    • getAmetysObjectByPath

      Get information on an AmetysObject, 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 a AmetysObjects 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 AmetysObject
      compositePath - 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.