
com.adobe.forms.common.service.DataXMLOptions Maven / Gradle / Ivy
/*
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2016 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 all applicable intellectual property
* laws, including trade secret and copyright laws.
* 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.forms.common.service;
import org.apache.sling.api.resource.Resource;
import java.util.Map;
/**
* The DataXMLOptions captures the set of parameters to be passed to the DataXMLProvider for getting the data xml
* for a form. The following options are supported currently
* dataRef : path of the XML
* formResource : resource of the Form for which the data is required
* pagePath : path of the page which renders the form
* aemFormContainer : If the Form is being embedded inside an AEM Form Container than the path of the AEM Form Container
* resource. It can be null if the form is not being embedded inside a Container.
*/
public class DataXMLOptions {
private String dataRef;
private Resource formResource;
private String pagePath;
private Resource aemFormContainer;
private String serviceName;
private Map paramMap;
//Default constructor for scala build.
public DataXMLOptions() {
}
public DataXMLOptions(DataOptions dataOptions) {
dataRef = dataOptions.getDataRef();
formResource = dataOptions.getFormResource();
pagePath = dataOptions.getPagePath();
aemFormContainer = dataOptions.getAemFormContainer();
serviceName = dataOptions.getServiceName();
paramMap = dataOptions.getExtras();
}
/**
* path of the XML being passed as the sling request parameter or request attribute.
* @return path of the XML being passed as the sling request parameter or request attribute or null if nothing passed
*/
public String getDataRef() {
return dataRef;
}
/**
* set the path of the XML from where the data has to be obtained
* @param dataRef path of the XML from where the data has to be obtained
* @return the same object on which this API is called. This has been done mainly for chaining multiple API calls.
*/
public DataXMLOptions setDataRef(String dataRef) {
this.dataRef = dataRef;
return this;
}
/**
* Form resource present inside DAM for which the data is required.
* @return resource of the form that is being ren
*/
public Resource getFormResource() {
return formResource;
}
/**
* Form resource present inside DAM for which the data is required.
* @param formResource Form resource present inside DAM for which the data is required.
* @return the same object on which this API is called. This has been done mainly for chaining multiple API calls.
*/
public DataXMLOptions setFormResource(Resource formResource) {
this.formResource = formResource;
return this;
}
/**
* Path of the page where the form resides. For adaptive form it will be the path of the page and for mobile form
* it will be the path of the profile which is rendering the Form.
* @return Path of the page where the form resides
*/
public String getPagePath() {
return pagePath;
}
/**
* Path of the page/profile (for MF) where the form resides.
* @param pagePath Path of the page/profile (for MF) where the form resides.
* @return the same object on which this API is called. This has been done mainly for chaining multiple API calls.
*/
public DataXMLOptions setPagePath(String pagePath) {
this.pagePath = pagePath;
return this;
}
/**
* Container (if any) resource in which the form is being embedded.
* @return container if the form is being embedded otherwise null
*/
public Resource getAemFormContainer() {
return aemFormContainer;
}
/**
* Container (if any) resource in which the form is being embedded.
* @param aemFormContainer Container (if any) resource in which the form is being embedded.
* @return the same object on which this API is called. This has been done mainly for chaining multiple API calls.
*/
public DataXMLOptions setAemFormContainer(Resource aemFormContainer) {
this.aemFormContainer = aemFormContainer;
return this;
}
/**
* returns the name of the service to be used for getting the data xml.
* @return name of the service or null if nothing is set
*/
public String getServiceName() {
return serviceName;
}
/**
* set the name of the service to be used for getting the data xml. If none provided, all the available service
* will be queried for the data
* @param serviceName name of the service to be used for getting the data xml
* @return the same object on which this API is called. This has been done mainly for chaining multiple API calls.
*/
public DataXMLOptions setServiceName(String serviceName) {
this.serviceName = serviceName;
return this;
}
/**
* Returns the parameter map
* @return map containing the parameters
*/
public Map getParams(){
return paramMap;
}
/**
* Sets the parameter map. This parameter map is any custom payload which has to be made
* available to the prefill service
* A sample example could be to fetch a map from a request attribute and set it to this params.
* @param paramMap map of parameters
* @return the same object on which this API is called. This has been done mainly for chaining multiple API calls.
*/
public DataXMLOptions setParams(Map paramMap){
this.paramMap = paramMap;
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy