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

com.day.cq.wcm.command.api.DeleteCommandBuilder Maven / Gradle / Ivy

There is a newer version: 6.5.21
Show newest version
/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2017 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 * **************************************************************************/

package com.day.cq.wcm.command.api;

import com.day.cq.i18n.I18n;
import org.osgi.annotation.versioning.ProviderType;
import org.apache.sling.api.resource.ResourceResolver;
import com.day.cq.wcm.api.PageManager;
import com.day.cq.dam.api.AssetReferenceResolver;
import com.day.cq.replication.Replicator;
import com.day.cq.commons.predicate.PredicateProvider;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * builder interface for the delete command
 */
@ProviderType
public interface DeleteCommandBuilder extends CommandBuilder {

    /**
     * initializes the {@code ResourceResolver} for the command builder
     *
     * @param resourceResolver the resource resolver for the command builder
     * @return this {@code DeleteCommandBuilder}
     */
    @Nonnull
    DeleteCommandBuilder withResourceResolver(@Nonnull ResourceResolver resourceResolver);

    /**
     * initializes the  {@code PageManager} which provides methods for page level operations
     *
     * @return this {@code DeleteCommandBuilder}
     */
    @Nonnull
    DeleteCommandBuilder withPageManager(@Nonnull PageManager pageManager);

    /**
     * initializes the {@code I18n} object for the command builder
     *
     * @param i18n the internationalization object for the command builder
     * @return this {@code DeleteCommandBuilder}
     */
    @Nonnull
    DeleteCommandBuilder withI18N(@Nonnull I18n i18n);

    /**
     * initializes the {@code Replicator} for the command builder
     *
     * @param replicator the replicator for the command builder
     * @return this {@code DeleteCommandBuilder}
     */
    @Nonnull
    DeleteCommandBuilder withReplicator(@Nonnull Replicator replicator);

    /**
     * sets the reference resolver to access references
     *
     * @param assetRefResolver the {@code AssetReferenceResolver} to get references
     * @return this {@code DeleteCommandBuilder}
     */
    @Nonnull
    DeleteCommandBuilder withAssetReferenceResolver(@Nonnull AssetReferenceResolver assetRefResolver);

    /**
     * initializes the {@code PredicateProvider} for the command builder
     *
     * @param predicateProvider the predicate provider for the command builder
     * @return this {@code DeleteCommandBuilder}
     */
    @Nonnull
    DeleteCommandBuilder withPredicateProvider(@Nonnull PredicateProvider predicateProvider);

    /**
     * set whitelist of root paths where deletion is allowed
     *
     * @param deleteWhitelistRootPaths list of root paths under which deletion is allowed
     * @return this {@code DeleteCommandBuilder}
     */
    @Nonnull
    DeleteCommandBuilder withDeleteWhitelistRootPaths(@Nonnull String[] deleteWhitelistRootPaths);

    /**
     * sets whether to perform a shallow operation
     *
     * @param shallow if {@code true} only the content of the resource is deleted
     *        but not its child resources. only supported for pages. default is false
     * @return this {@code DeleteCommandBuilder}
     */
    @Nonnull
    DeleteCommandBuilder withShallow(boolean shallow);

    /**
     * sets whether to do to force delete
     *
     * @param force if {@code false} deletion is executed only if selected item(s)
     * 
    *
  • are not referenced by any pages
  • *
  • don't have any child pages (if {@code checkChildren} below is true)
  • *
  • don't contain any activated assets
  • *
* default is false * @return this {@code DeleteCommandBuilder} */ @Nonnull DeleteCommandBuilder withForce(boolean force); /** * sets whether to check for child pages of selected items while deletion * * @param checkChildren if {@code true}, and if {@code force} above is false, deletion * isn't performed if selected items have child pages. default is false * @return this {@code DeleteCommandBuilder} */ @Nonnull DeleteCommandBuilder withCheckChildren(boolean checkChildren); /** * @return a new path argument builder */ @Nonnull DeleteCommandPathArgumentBuilder createPathArgumentBuilder(); /** * append a path argument * * @param pathArgument the path argument instance * @return this {@code DeleteCommandBuilder} */ @Nonnull DeleteCommandBuilder withPathArgument(@Nonnull DeleteCommandPathArgument pathArgument); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy