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

com.adobe.aem.formsndocuments.service.FMCRUDService Maven / Gradle / Ivy

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * __________________
 *
 *  Copyright 2014 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.aem.formsndocuments.service;

import java.io.IOException;

import javax.jcr.Session;

import org.apache.sling.api.request.RequestParameterMap;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.commons.json.JSONArray;
import org.apache.sling.commons.json.JSONObject;

import com.adobe.granite.asset.api.Asset;
import com.adobe.aemforms.fm.exception.FormsMgrException;
import com.adobe.forms.foundation.transfer.CopiedAssetInfo;

/**
 * Exposes FM CRUD related operations. Operation other than Delete will be added later.
 *
 */
public interface FMCRUDService {

    /**
     * Deletes a resource from CRX side, be it a folder, form, guide or resource. 
     * For forms, guides and resources deletePreprocessors are invoked.
     * @param session
     * @param resourcePath - The path of the resource to be deleted.
     * @throws FormsMgrException
     */
    public void deleteCRXResource(Session session, String resourcePath)throws FormsMgrException;
    
    /**
     * Create the formset
     * @param resolver
     * @param assetJSON
     * @throws FormsMgrException
     * @throws IOException
     */
    public void createFormset(ResourceResolver resolver, JSONObject assetJSON)throws FormsMgrException, IOException;

    /**
     * Create the Dam Asset
     * @param resolver
     * @param assetJSON
     * @return Dam Asset will be returned.
     * @throws FormsMgrException
     */
    public Asset createAsset(ResourceResolver resolver, JSONObject assetJSON) throws FormsMgrException;
    
    /**
     * Update the formset
     * @param resolver
     * @param assetJSON
     * @throws FormsMgrException
     */
    public void updateFormset(ResourceResolver resolver, JSONObject assetJSON)throws FormsMgrException;
    
    /**
     * Generate Thumbnail for Formset
     * @param resolver
     * @param formsetPath
     * @throws FormsMgrException
     * @throws IOException 
     */
    public void generateFormsetThumbnail(ResourceResolver resolver, String formsetPath)throws FormsMgrException, IOException;
    
    /**
     * This API is used to create Adaptive Form Fragment from exiting panel of an Adaptive Form. The fragment created is made up of the panel taken as input in params. 
     * @param resolver
     * @param params
     * @throws FormsMgrException
     */

    public String createFragmentFromPanel(ResourceResolver resolver, JSONObject params)  throws FormsMgrException;

    /**
     * This API is used to clean up the unwanted info related to review, analytics, abtest and replication from provided Form
     * To be used in import of packages and copy/paste functionality
     * @param session representing JCR session
     * @param formPath representing repository path to Form
     * @throws FormsMgrException 
     */
    public void cleanUpForm(Session session, String formPath) throws FormsMgrException;
    
    /**
     * This API is used to clean up unwanted review information of form.
     * To be used in import of packages and copy/paste functionality
     * @param session representing JCR session
     * @param formPath representing repository path to Form
     * @throws FormsMgrException 
     */
    public void cleanUpReviewInfo(Session session,String formPath)  throws FormsMgrException;

    /**
     * This API is used to clean up the unwanted A/B testing details present on the form and its
     * corresponding cq:Page
     * To be used in import of packages and copy/paste functionality
     * @param session
     * @param formPath
     */
    public void cleanUpABTestingInfo(Session session, String formPath)  throws FormsMgrException;

    /**
     * This API is used to clean up the unwanted A/B testing details present on the form dam:Asset
     * To be used in copy/paste functionality
     * @param session
     * @param formPath path of form dam:asset node
     */
    public void cleanUpFormABTestingInfo(Session session, String formPath)  throws FormsMgrException;

    /**
     * This API is used to clean up the unwanted A/B testing details present on the form cq:Page
     * To be used in copy/paste functionality
     * @param session
     * @param pagePath path of the cq:Page corresponding Form asset
     */
    public void cleanUpFormPageABTestingInfo(Session session, String pagePath)  throws FormsMgrException;

    /**
     * This API is used to clean up the unwanted Analytics information present with the form
     * To be used in import of packages and copy/paste functionality
     * @param session
     * @param formPath
     */
    public void cleanUpAnalyticsInfo(Session session, String formPath)  throws FormsMgrException;

    /**
     * This API is used to create Theme Asset.
     * @param resolver
     * @param themeJson
     * @param themeContentJson
     * @throws FormsMgrException
     */
	public void createTheme(ResourceResolver resolver, JSONObject themeJson, JSONObject themeContentJson) throws FormsMgrException;

	/**
	 * This API is used to check whether a node exists or not
	 * @param resourceResolver
	 * @param nodePath
	 * @return
	 * @throws FormsMgrException
	 */
	public boolean checkNodeExist(ResourceResolver resourceResolver, String nodePath) throws FormsMgrException;

	/**
	 * This API is used to copy the asset at destinationPath.
	 * It also performs clean up task.
	 * @param copiedAssetInfo
	 * @param sourcePath
	 * @param destinationPath
	 * @param resourceResolver
	 * @throws FormsMgrException
	 */
	public void copyAsset(CopiedAssetInfo copiedAssetInfo, String sourcePath, String destinationPath, ResourceResolver resourceResolver) throws FormsMgrException;

	/**
	 * This API is used to create FDM asset.
	 * @param resolver
	 * @param assetJson
	 * @throws FormsMgrException
	 */
	public void createFDM(ResourceResolver resolver, JSONObject assetJson) throws FormsMgrException;

	/**
	 * This API is used to schedule a replication job.
	 * @param assetPath
	 * @param updatedAttribute
	 * @param updatedTime
	 * @throws FormsMgrException
	 */
	public void scheduleFormReplication(String assetPath, String updatedAttribute, long updatedTime) throws FormsMgrException;

    /**
     * This API is used to update FDM sources
     * @param resolver
     * @param path
     * @param assetJson
     * @throws FormsMgrException
     */
	public void updateFDMSources(ResourceResolver resolver, String path, String cqConf, JSONArray assetJson) throws FormsMgrException;

	/**
	 * Updates theme clientlib.
	 * @param resolver
	 * @param paramMap
	 * @throws FormsMgrException
	 */
	public void updateThemeClientlib (ResourceResolver resolver, RequestParameterMap paramMap) throws FormsMgrException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy