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

com.adobe.cq.mobile.dps.ui.PublishDataSource Maven / Gradle / Ivy

package com.adobe.cq.mobile.dps.ui;


import com.adobe.cq.mobile.dps.DPSCollection;
import com.adobe.cq.mobile.dps.DPSException;
import org.apache.sling.commons.json.JSONArray;
import org.apache.sling.commons.json.JSONObject;

import java.util.Map;

public interface PublishDataSource {
    /**
     * Get articles from AEM and DPS.
     * @param searchCriteria Name/Value pairs used to filter the results.  Acceptable values are:
     *           - text: will search through string properties and see if the string contains the specified value
     *           - source: AEM or DPS will only extract entries from that source
     *        'searchCriteria' can be null.
     *
     *        Hint:  To get articles in a collection, get that collection and check its contentDetails property
     * @return
     * @throws DPSException
     */
    JSONObject getArticles(Map searchCriteria) throws DPSException;

    JSONObject getBanners(Map searchCriteria) throws DPSException;

    JSONObject getCollection(DPSCollection dpsCollection) throws DPSException;

    /**
     * Get collections from AEM and DPS.
     * @param searchCriteria
     *           - source:  'AEM' or 'DPS' will only extract entries from that source
     *           - flatten: true or false.  If false, only return collections that are not contained in other collections.
     *        'searchCriteria' can be null.
     * @return
     * @throws DPSException
     */
    JSONObject getCollections(Map searchCriteria) throws DPSException;

    JSONObject getLayouts(Map searchCriteria) throws DPSException;

    /**
     * Retrieve which collections reference the one indicated by the 'page' parameter.  Optionally, give the reference
     * path down to the root (i.e. to a collection that has no references).
     * @param searchCriteria
     *           - page: the DPS entity as represented by a com.day.cq.wcm.api.Page
     *           - includeAncestors: false by default
     *                               If false: only those entities that directly reference the 'entityId'
     *                               will be returned.
     *                               If true: a number of json arrays containing the reference path, down to
     *                               the root, will be returned.  As entities can be referenced by more then one collection
     *                               there may be more than 1 path returned.
     * @return
     * @throws DPSException
     */
    JSONObject getReferences(Map searchCriteria) throws DPSException;

    Map convertJSONtoMap(JSONArray json) throws DPSException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy