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

com.adobe.cq.screens.display.DisplayService Maven / Gradle / Ivy

/*************************************************************************
 *
 * 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.adobe.cq.screens.display;

import aQute.bnd.annotation.ProviderType;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.jcr.RepositoryException;
import java.util.Iterator;

/**
 * Manages the displays in the repository.
 */
@ProviderType
public interface DisplayService {

    /**
     * Gets the display for the specified assignment
     * @param  assignment   The assignment
     * @return  The display that contains the assignment
     */
    @Nullable
    Resource getDisplay(@Nonnull Resource assignment);

    /**
     * The assignments for the specified Display.
     * @param  resolver The resource resolver
     * @param  display  The display in which to look for the assignment
     * @return  All assignments
     */
    Iterator getAssignments(@Nonnull ResourceResolver resolver, @Nonnull Resource display);

    /**
     * The assignments for a schedule in the context of a display
     * assigned to the schedule.
     * @param  resolver The resource resolver
     * @param  display  The display in which context the dynamic channels are referenced
     * @param  schedule  The schedule in which to look for the assignment
     * @return  All assignments for a schedule
     */
    @Deprecated
    Iterator getAssignmentsForSchedule(@Nonnull ResourceResolver resolver, @Nonnull Resource display, @Nonnull Resource schedule);

    /**
     * Resolves the channel resource for the specified channel assignment.
     * @param  resolver The resource resolver
     * @param  display  The display in which to look for the assignment
     * @param  role     The role of the assignment
     * @return  The resolved channel resource, or null
     */
    Resource resolveChannel(@Nonnull ResourceResolver resolver, @Nonnull Resource display, @Nonnull String role);

    /**
     * Resolves the channel resource for the specified channel assignment.
     * @param  resolver The resource resolver
     * @param  display  The display in which to look for the assignment
     * @param  assignment   The assignment resource
     * @return  The resolved channel resource, or null
     */
    @Deprecated
    Resource resolveChannel(@Nonnull ResourceResolver resolver, @Nonnull Resource display, @Nonnull Resource assignment);

    /**
     * Resolves the schedule resource for the specified schedule assignment.
     * @param  resolver     The resource resolver
     * @param  display      The display in which to look for the assignment
     * @param  assignment   The assignment resource
     * @return  The resolved channel resource, or null
     */
    @Deprecated
    Resource resolveSchedule(@Nonnull ResourceResolver resolver, @Nonnull Resource display, @Nonnull Resource assignment);

    /**
     * Remove the assignment for the specified channel on this display
     * @param  resolver The resource resolver
     * @param  display  The display to remove the assignment from
     * @param  channel  The channel for which we want to remove the assignment
     * @throws PersistenceException if the deletion fails
     */
    void unassign(@Nonnull ResourceResolver resolver, @Nonnull Resource display, @Nonnull Resource channel) throws PersistenceException, RepositoryException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy