All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.day.cq.wcm.undo.BinaryValueManager Maven / Gradle / Ivy

package com.day.cq.wcm.undo;

import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;

/*
AdobePatentID="2789US01"
*/

/**
 * Provides means to manage binary values for the CQ5 undo.
 */
public interface BinaryValueManager {

    /**
     * 

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.

* * @param par The paragraph * @param subPath The sub-path of the binary data * @param originalRef The reference to the original binary data (as returned by a * previous call to {@link #save}) * @return true if the binary data has changed * @throws BinaryHandlingException if the check could not be executed */ boolean isChanged(Resource par, String subPath, String originalRef) throws BinaryHandlingException; /** *

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

* * @param par The paragraph * @param subPath The sub-path of the binary data * @return The path of the binary value * @throws BinaryHandlingException if the binary resource could not be saved for undo * purposes */ String save(Resource par, String subPath) throws BinaryHandlingException; /** *

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

* * @param undoData The binary value used for restoring ("source") * @param par The paragraph to restore to * @param subPath The sub-path the binary value will be restored to * @throws BinaryHandlingException if the binary value could not be restored */ void restore(Resource undoData, Resource par, String subPath) throws BinaryHandlingException; /** *

Deletes a binary value from the specified target path.

* * @param par The paragraph * @param subPath The sub-path of the binary * @param deletePar true to delete the entire paragraph; false * to delete the BLOB node only * @throws BinaryHandlingException if the binary value could not be removed */ void delete(Resource par, String subPath, boolean deletePar) throws BinaryHandlingException; /** *

Deletes a binary value from the specified target path.

* * @param resolver The resource resolver to be used for accessing the repository * @param undoPath The path to delete from (as, for example returned by {@link #save}) * @throws BinaryHandlingException if the binary value could not be removed */ void delete(ResourceResolver resolver, String undoPath) throws BinaryHandlingException; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy