Interface BinaryValueManager


  • public interface BinaryValueManager
    Provides means to manage binary values for the CQ5 undo.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete​(ResourceResolver resolver, java.lang.String undoPath)
      Deletes a binary value from the specified target path.
      void delete​(Resource par, java.lang.String subPath, boolean deletePar)
      Deletes a binary value from the specified target path.
      boolean isChanged​(Resource par, java.lang.String subPath, java.lang.String originalRef)
      Checks if the binary value (located at the specified sub-path of the specified paragraph) has changed in relation to the specified original undo data.
      void restore​(Resource undoData, Resource par, java.lang.String subPath)
      Restores a binary value from the undo area to a specific content path.
      java.lang.String save​(Resource par, java.lang.String subPath)
      Saves the binary value at the specified repository path to the undo area.
    • Method Detail

      • isChanged

        boolean isChanged​(Resource par,
                          java.lang.String subPath,
                          java.lang.String originalRef)
                   throws BinaryHandlingException

        Checks if the binary value (located at the specified sub-path of the specified paragraph) has changed in relation to the specified original undo data.

        Parameters:
        par - The paragraph
        subPath - The sub-path of the binary data
        originalRef - The reference to the original binary data (as returned by a previous call to save(org.apache.sling.api.resource.Resource, java.lang.String))
        Returns:
        true if the binary data has changed
        Throws:
        BinaryHandlingException - if the check could not be executed
      • save

        java.lang.String save​(Resource par,
                              java.lang.String subPath)
                       throws BinaryHandlingException

        Saves the binary value at the specified repository path to the undo area.

        Parameters:
        par - The paragraph
        subPath - The sub-path of the binary data
        Returns:
        The path of the binary value
        Throws:
        BinaryHandlingException - if the binary resource could not be saved for undo purposes
      • restore

        void restore​(Resource undoData,
                     Resource par,
                     java.lang.String subPath)
              throws BinaryHandlingException

        Restores a binary value from the undo area to a specific content path.

        Parameters:
        undoData - The binary value used for restoring ("source")
        par - The paragraph to restore to
        subPath - The sub-path the binary value will be restored to
        Throws:
        BinaryHandlingException - if the binary value could not be restored
      • delete

        void delete​(Resource par,
                    java.lang.String subPath,
                    boolean deletePar)
             throws BinaryHandlingException

        Deletes a binary value from the specified target path.

        Parameters:
        par - The paragraph
        subPath - The sub-path of the binary
        deletePar - true to delete the entire paragraph; false to delete the BLOB node only
        Throws:
        BinaryHandlingException - if the binary value could not be removed