Interface DamManager


@Deprecated public interface DamManager
Deprecated.
Use DamUtil instead.
The DamManager provides utility methods for DAM.

The DAM manager can be adapted (retrieved) via resource resolver:

    ...
    DamManager damManager = resourceResolver.adaptTo(DamManager.class);
    ...
 
  • Method Details

    • createTempFile

      @Deprecated File createTempFile(String prefix, String suffix) throws IOException
      Deprecated.
      This method works almost the same way as File.createTempFile(String, String) . The only difference is that one can specify on the DamManager the temp dir location.
      Parameters:
      prefix - The prefix string to be used in generating the file's name; must be at least three characters long
      suffix - The suffix string to be used in generating the file's name; may be null, in which case the suffix ".tmp" will be used
      Returns:
      temp file
      Throws:
      IOException - Thrown upon an error occurring during file handling.
    • createMetadataPath

      @Deprecated String createMetadataPath(String binaryNodePath)
      Deprecated.
      Creates the asset data path resp. replaces the /var/dam prefix with the /content/dam prefix
      Parameters:
      binaryNodePath - the binary file path (e.g. /var/dam/test.jpeg)
      Returns:
      the path under /content/dam
    • createBinaryUploadLocationPath

      @Deprecated String createBinaryUploadLocationPath(String assetNodePath)
      Deprecated.
      Creates the binary data path resp. replaces the /content/dam prefix with the /var/dam prefix
      Parameters:
      assetNodePath - the asset file path (e.g. /content/dam/test.jpeg)
      Returns:
      the path under /var/dam
    • getSession

      Deprecated.
      Will be removed without replacement.
      Creates a new administrative Session on the workspace used by the DamManager.
      Returns:
      The administrative JCR session.
      Throws:
      RepositoryException - Thrown upon encountering an error creating the session.
    • getAssetNode

      @Deprecated Node getAssetNode(String assetNodePath, Session session)
      Deprecated.
      Use
      invalid reference
      com.day.cq.dam.commons.util.DamUtil#getAssetNodeForBinary(String, Session)
      instead.
      Retrieves the node given by the assetNodePath parameter or null if it doesn't exist.
      Parameters:
      assetNodePath - The node to retrieve.
      session - The JCR session to work with.
      Returns:
      The node.
    • removeAssetNode

      @Deprecated void removeAssetNode(String assetNodePath, Session session)
      Deprecated.
      Use
      invalid reference
      com.day.cq.dam.commons.util.DamUtil#removeAssetForBinary(String, Session)
      instead.
      Removes the node of an asset.
      Parameters:
      assetNodePath - The path of the asset to remove.
      session - The JCR session to work with.
    • createAssetStructure

      @Deprecated Asset createAssetStructure(String binaryPath, Session session, boolean doSave)
      Deprecated.
      Use
      invalid reference
      com.day.cq.dam.commons.util.DamUtil#createAssetForBinary(String, ResourceResolver, Boolean)
      instead.
      This method creates the complete asset structure in the asset content 'store'. (in our case /content/dam'). following structure is created: <xmp> + file.jpg (dam:Asset) + jcr:content )(dam:AssetContent) + renditions (sling:Folder) + metadata (nt:unstructured)

      <xmp>

      The binary path points to the upload location (in our case /var/dam). the /var/dam prefix will be replaced by /content/dam

      Parameters:
      binaryPath - path where the binary is put for upload (/var/dam/...)
      session - jcr session used
      doSave - true for immediate saves
      Returns:
      Returns the Asset