This section describes how a custom provisioning provider can be created.
What does this section cover?
Create a custom payment gateway
In order to create a custom payment gateway, you need to:
- Define the custom payment gateway in payment gateways metadata file.
- Create a custom enum to define authentication setting parameters. (optional)
- Create a custom business object class extending com.crm.businessobject.paymentgateway.CRMBOPaymentGatewaySettingBean.
- Create a user interface class extending com.crm.process.paymentgateway.CRMUIPaymentGatewaySettingBean
- Create a custom process class extending com.crm.process.paymentgateway.CRMProcessPaymentGatewayBean
- Create a custom search page.
- Create a custom summary page for payment gateway requests.
- Create a custom data entry page for the payment gateway.
- Define the new menu options in menu options metadata file.
- Define a custom module in modules metadata file.
Note that all data object, business object, user interface and process class names should start with the custom project directory name:
For this example we assume that <custom_project> = payeezy
The new custom payment gateway must be defined in paymentgateways.xml file which is located under <custom_project>/src/main/resources/metadata/ directory.
2. Provisioning Parameters Enum
This enum will be used to define the authentication setting parameters. Note that 'order' property will be used to define the parameter's order on the screen.
package payeezy.dataobject.paymentgateway.payeezy;
import com.crm.dataobject.ICRMLookupEnum;
public enum PayeezyParameter implements ICRMLookupEnum{
MODE("key_mode", "String",1),
TEST_URL("key_url", "String",2),
TEST_MERCHANT_TOKEN("key_merchant_token", "String",3),
TEST_TA_TOKEN("key_transarmor_token", "String",4),
TEST_API_KEY("key_api_key", "String",5),
TEST_API_SECRET("key_api_secret", "String",6),
TEST_JS_SECURITY_KEY("key_js_security_key", "String",7),
LIVE_URL("key_url", "String",2),
LIVE_MERCHANT_TOKEN("key_merchant_token", "String",3),
LIVE_TA_TOKEN("key_transarmor_token", "String",4),
LIVE_API_KEY("key_api_key", "String",5),
LIVE_API_SECRET("key_api_secret", "String",6),
LIVE_JS_SECURITY_KEY("key_js_security_key", "String",7);
private String label;
private String type;
private Integer order;
private PayeezyParameter(String label, String type, Integer order) {
this.label = label;
this.type = type;
this.order = order;
}
@Override
public String getLabel() {
return label;
}
public String getType() {
return type;
}
public Integer getOrder() {
return order;
}
}
To achieve that, when you create a new provisioning provider object (CRMDOProvProvider) you have to create new object of your provisioning parameters data object class and set it to the 'parameters' property of the CRMDOProvProvider object:
/**
* Constructs a TUCANO provisioning provider.
*
* @param mainDTO - the main data object
* @return a TUCANO provisioning provider
* @throws Exception
*/
@Override
protected CRMDO constructDO(CRMDO mainDTO) throws Exception {
CRMDOProvProvider provProvider = (CRMDOProvProvider)super.constructDO(mainDTO);
MYCOMPANYTucanoParameters tucanoParameters = new MYCOMPANYTucanoParameters();
provProvider.setProvisioningParameters(tucanoParameters);
...
return provProvider;
}
More details on creating a provisioning provider business object class can be found in the next section.
3. Payment Gateway Business Object Class
The new custom business object class must extend com.crm.businessobject.paymentgateway.CRMBOPaymentGatewaySettingBean
and implement com.crm.businessobject.ICRMBOProvisioningProvider interface and its five methods:
- getServiceCAID(CRMDOProvProvider provProvider,CRMDOProduct product) which should return a unique identification string (conditional access id) used by the provisioning provider to identify the given service.
- getSmartcardCAID(CRMDOProvProvider provProvider,CRMDOInstalledItem installedItem) which should return a unique identification string (conditional access id) used by the provisioning provider to identify the given smartcard.
- getSTBCAID(CRMDOProvProvider provProvider,CRMDOInstalledItem installedItem) which should return a unique identification string (conditional access id) used by the provisioning provider to identify the given set top box.
- setXMLFromObjects(CRMDOProvProvider provProvider) which should construct a string XML that will keep all information about the provider's connection parameters and set it to CRMDOProvProvider object's 'parameters' String property.
- setObjectsFromXML(CRMDOProvProvider provProvider) which should set CRMDOProvProvider object's connection parameter values using its 'parameters' String property value.
Other useful methods that you are recommended to implement are:
- public CRMDOProvProvider loadEffective()
- public CRMDOProvProvider loadEffective(Boolean applicationServerFiltering)
- public CRMDOProvProvider load()
Methods you are recommended to override to add functionality:
- protected CRMDO constructDO(CRMDO mainDTO)
- protected LinkedHashMap<String, String> getMandatoryFields(CRMDO dto)
- protected void validateOnSaveProvisioningProviderServices(CRMDOProvProvider provProvider)
- protected void validateOnSaveProvisioningDistributors(CRMDOProvProvider provProvider)
- protected void validateOnSaveProvisioningProviderPhysicalGood(CRMDOProvProvider provProvider)
package payeezy.businessobject.paymentgateway.payeezy;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Set;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import com.crm.businessobject.CRMValidatorBean;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewayParameterBean;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewayParameterValueBean;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewaySettingBean;
import com.crm.businessobject.platform.CRMBOCurrencyBean;
import com.crm.dataobject.CRMDO;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewayParameter;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewayParameterValue;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewaySetting;
import com.crm.dataobject.paymentgateway.PaymentGatewayCardBrand;
import com.crm.dataobject.paymentgateway.PaymentGatewayLifeCycleState;
import com.crm.dataobject.platform.CRMDOCurrency;
import com.crm.exception.DAOException;
import com.crm.exception.MandatoryFieldException;
import com.crm.framework.service.ServiceUtil;
import payeezy.dataobject.paymentgateway.payeezy.PayeezyParameter;
import payeezy.dataobject.paymentgateway.payeezy.PayeezyMode;
/**
* Session Bean implementation class PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean
*/
@Stateless
@LocalBean
public class PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean extends CRMBOPaymentGatewaySettingBean {
/**
*
*/
private static final long serialVersionUID = 1L;
@EJB private CRMValidatorBean validatorBean;
@EJB private CRMBOCurrencyBean currencyBean;
@EJB private CRMBOPaymentGatewayParameterBean paymentGatewayParameterBean;
@EJB private CRMBOPaymentGatewayParameterValueBean paymentGatewayParameterValueBean;
public final static String GENERAL_PARAMETERS = "GENERAL_PARAMETERS";
public final static String PROTOCOL = "PAYEEZY";
/**
* @see CRMBOPaymentGatewaySettingBean#CRMBOPaymentGatewaySettingBean()
*/
public PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean() {
super();
}
/**
* Constructs a payment gateway setting.
*
* @param mainDTO - the main data object
* @return a payment gateway setting
* @throws Exception
*/
@Override
protected CRMDO constructDO(CRMDO mainDTO) throws Exception {
CRMDOPaymentGatewaySetting paymentGatewaySetting = (CRMDOPaymentGatewaySetting)super.constructDO(mainDTO);
paymentGatewaySetting.setPaymentGatewayProtocol(PROTOCOL);
paymentGatewaySetting.setLifeCycleState(PaymentGatewayLifeCycleState.NOT_EFFECTIVE);
return paymentGatewaySetting;
}
/**
* Validates a payeezy payment gateway setting on save.
*
* @param dto - the payment gateway setting to validate
* @throws Exception
*/
@Override
protected void validateDOonSave(CRMDO dto) throws Exception {
super.validateDOonSave(dto);
CRMDOPaymentGatewaySetting paymentGatewaySetting = (CRMDOPaymentGatewaySetting)dto;
validateAuthenticationSettings(paymentGatewaySetting);
}
/**
* Validates the authentication settings of the payment gateway setting
*
* @param paymentGatewaySetting - the payment gateway setting to validate
* @throws Exception
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private void validateAuthenticationSettings(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
if(paymentGatewaySetting.getPaymentGatewayParameters()==null || !ServiceUtil.isInitialized(paymentGatewaySetting.getPaymentGatewayParameters()))
{
paymentGatewaySetting.setPaymentGatewayParameters(new HashSet(paymentGatewayParameterBean.load(paymentGatewaySetting)));
}
PayeezyMode mode = getMode(paymentGatewaySetting.getPaymentGatewayParameters());
if(mode==null)
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.MODE.getLabel());
}
if(mode.equals(PayeezyMode.TEST))
{
if(!exists(PayeezyParameter.TEST_MERCHANT_TOKEN, paymentGatewaySetting.getPaymentGatewayParameters()))
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.TEST_MERCHANT_TOKEN.getLabel());
}
if(!exists(PayeezyParameter.TEST_API_KEY, paymentGatewaySetting.getPaymentGatewayParameters()))
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.TEST_API_KEY.getLabel());
}
if(!exists(PayeezyParameter.TEST_API_SECRET, paymentGatewaySetting.getPaymentGatewayParameters()))
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.TEST_API_SECRET.getLabel());
}
if(!exists(PayeezyParameter.TEST_URL, paymentGatewaySetting.getPaymentGatewayParameters()))
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.TEST_URL.getLabel());
}
}
else if(mode.equals(PayeezyMode.LIVE))
{
if(!exists(PayeezyParameter.LIVE_MERCHANT_TOKEN, paymentGatewaySetting.getPaymentGatewayParameters()))
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.LIVE_MERCHANT_TOKEN.getLabel());
}
if(!exists(PayeezyParameter.LIVE_API_KEY, paymentGatewaySetting.getPaymentGatewayParameters()))
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.LIVE_API_KEY.getLabel());
}
if(!exists(PayeezyParameter.LIVE_API_SECRET, paymentGatewaySetting.getPaymentGatewayParameters()))
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.LIVE_API_SECRET.getLabel());
}
if(!exists(PayeezyParameter.LIVE_URL, paymentGatewaySetting.getPaymentGatewayParameters()))
{
throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.LIVE_URL.getLabel());
}
}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
private PayeezyMode getMode(Set<CRMDOPaymentGatewayParameter> parameters) throws DAOException, Exception{
PayeezyMode mode = null;
if(parameters!=null)
{
Iterator<CRMDOPaymentGatewayParameter> iter = parameters.iterator();
while(iter.hasNext())
{
CRMDOPaymentGatewayParameter parameter = iter.next();
if(parameter!=null &&
parameter.getName()!=null &&
parameter.getName().equals(PayeezyParameter.MODE.toString()))
{
Set<CRMDOPaymentGatewayParameterValue> values = parameter.getParameterValues();
if(values==null || !ServiceUtil.isInitialized(values))
{
values = new HashSet(paymentGatewayParameterValueBean.load(parameter));
}
if(values!=null)
{
Iterator<CRMDOPaymentGatewayParameterValue> valueIter = values.iterator();
while(valueIter.hasNext())
{
CRMDOPaymentGatewayParameterValue value = valueIter.next();
if(value!=null)
{
mode = PayeezyMode.valueOf(PayeezyMode.class,value.getStringValue());
break;
}
}
}
}
if(mode!=null)
{
break;
}
}
}
return mode;
}
private boolean exists(PayeezyParameter PayeezyParameter, Set<CRMDOPaymentGatewayParameter> parameters){
boolean exists = false;
if(parameters!=null)
{
for(CRMDOPaymentGatewayParameter parameter:parameters)
{
if(parameter!=null &&
parameter.getName()!=null &&
parameter.getName().equals(PayeezyParameter.toString()) &&
parameter.getParameterValues()!=null &&
parameter.getParameterValues().size()>0)
{
Iterator<CRMDOPaymentGatewayParameterValue> iter = parameter.getParameterValues().iterator();
while(iter.hasNext())
{
CRMDOPaymentGatewayParameterValue value = iter.next();
if(value.getStringValue()!=null)
{
exists = true;
break;
}
}
if(exists)
{
break;
}
}
}
}
return exists;
}
/**
* Constructs an XML file from a payment gateway setting.
*
* @param paymentGatewaySetting - the payment gateway setting to get the values from
* @return the payment gateway setting
* @throws Exception
*/
@Override
public CRMDOPaymentGatewaySetting setXMLFromObjects(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
return paymentGatewaySetting;
}
/**
* Sets the values of a payment gateway setting from an XML file.
*
* @param paymentGatewaySetting - the payment gateway setting to set the values for
* @return the updated payment gateway setting
* @throws Exception
*/
@Override
public CRMDOPaymentGatewaySetting setObjectsFromXML(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
return paymentGatewaySetting;
}
/**
* Loads the payeezy payment gateway setting.
*
* @return a payeezy payment gateway setting
* @throws Exception
*/
public CRMDOPaymentGatewaySetting load() throws Exception {
return loadByProtocol(PROTOCOL);
}
/**
* Loads the effective payeezy payment gateway setting.
*
* @return the effective payeezy payment gateway setting
* @throws Exception
*/
public CRMDOPaymentGatewaySetting loadEffective() throws Exception {
return loadEffective(PROTOCOL);
}
/**
* Loads the effective payeezy payment gateway setting.
*
* @param applicationServerFiltering - if true, result will be filtered based on allowed application servers
* @return the effective payeezy payment gateway setting
* @throws Exception
*/
public CRMDOPaymentGatewaySetting loadEffective(Boolean applicationServerFiltering) throws Exception {
return loadEffective(PROTOCOL, applicationServerFiltering);
}
/**
* Returns the mandatory fields of a payeezy payment gateway setting.
*
* @param dto - the payeezy payment gateway setting to return the mandatory fields for
* @return the mandatory fields of the payeezy payment gateway setting
* @throws Exception
*/
@Override
protected LinkedHashMap<String, String> getMandatoryFields(CRMDO dto) throws Exception {
LinkedHashMap<String, String> mandatoryFields = new LinkedHashMap<String,String>();
mandatoryFields.put("key_name", "name");
mandatoryFields.put("key_alternative_code", "altCode");
mandatoryFields.put("key_life_cycle_state", "lifeCycleState");
mandatoryFields.put("key_payment_gateway", "paymentGatewayProtocol");
return mandatoryFields;
}
/**
* Validates the uniqueness of a payment gateway setting.
*
* @param paymentGatewaySetting - the payment gateway setting to validate
* @throws Exception
*/
@Override
protected void validateUniqueness(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
String[] fieldNames = new String[] {"name", "altCode", "paymentGatewayProtocol"};
String[] msgKeys = new String[] {"Name", "Alternative Code", "Protocol"};
validatorBean.validateUniqueRecordAgainstDb(
paymentGatewaySetting,
fieldNames,
msgKeys,
"Payeezy Payment Gateway Setting",
true,
null);
}
@Override
public CRMDOPaymentGatewaySetting initializeParameters(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception
{
return paymentGatewaySetting;
}
/**
* Get the currencies which are supported by payeezy
*
* @return a list of all the currencies which are supported by payeezy
* @throws Exception
*/
public ArrayList<CRMDO> getSupportedCurrencies(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
ArrayList<CRMDO> supportedCurrencies = currencyBean.loadAltenativeCurrencies();
CRMDOCurrency defaultCurrency = getCRMSession().getGeneralSettings().getDefaultCurrency();
if (supportedCurrencies!=null && supportedCurrencies.size()>0)
{
Boolean defaultFound=false;
for (int i=0; i<supportedCurrencies.size(); i++)
{
CRMDOCurrency currency = (CRMDOCurrency) supportedCurrencies.get(i);
if(currency.equals(defaultCurrency))
{
defaultFound=true;
break;
}
}
if(!defaultFound)
{
supportedCurrencies.add(defaultCurrency);
}
}
return supportedCurrencies;
}
/**
* Returns the card brand based on the payeezy card type
* @param cardType - the given payeezy card type
* @return the card brand
*/
public String getCardBrand(String cardType){
String brand = null;
if(cardType!=null)
{
if(cardType.equalsIgnoreCase("American Express"))
{
brand = PaymentGatewayCardBrand.AMERICAN_EXPRESS.toString();
}
else if(cardType.equalsIgnoreCase("Discover"))
{
brand = PaymentGatewayCardBrand.DISCOVER.toString();
}
else if(cardType.equalsIgnoreCase("MasterCard"))
{
brand = PaymentGatewayCardBrand.MASTER_CARD.toString();
}
else if(cardType.equalsIgnoreCase("Visa"))
{
brand = PaymentGatewayCardBrand.VISA.toString();
}
else
{
brand = PaymentGatewayCardBrand.UNKNOWN.toString();
}
}
return brand;
}
/**
* Returns the card type based on the card brand
* @param cardType - the given card brand
* @return the card brand
*/
public String getCardType(String brand){
String cardType = null;
if(brand!=null)
{
if(brand.equals(PaymentGatewayCardBrand.AMERICAN_EXPRESS.toString()))
{
cardType ="American Express";
}
else if(brand.equals(PaymentGatewayCardBrand.DISCOVER.toString()))
{
cardType = "Discover";
}
else if(brand.equals(PaymentGatewayCardBrand.MASTER_CARD.toString()))
{
cardType = "MasterCard";
}
else if(brand.equals(PaymentGatewayCardBrand.VISA.toString()))
{
cardType = "Visa";
}
}
return cardType;
}
}
4. User Interface Classes
a. Provisioning Provider User Interface Class
The first user interface class that should be created is the provisioning provider's user interface class and should extend com.crm.process.provisioning.CRMUIProvProviderBean.
This class's methods will by called by the provisioning provider data entry page.
public class MYCOMPANYCRMUITucanoServiceProviderBean extends CRMUIProvProviderBean {
@EJB private CRMBOProvProviderServiceBean provProviderServiceBean;
@EJB private CRMBOProvisioningDistributorBean provisioningDistributorBean;
@EJB private MYCOMPANYCRMBOTucanoProviderBean tucanoProviderBean;
@EJB private CRMBOSubscriptionTypeBean subscriptionTypeBean;
@EJB private MYCOMPANYTucanoProviderXMLUtilBean tucanoProviderXMLUtilBean;
@EJB private CRMBOProductBean productBean;
@EJB private CRMBOProductTypeBean productTypeBean;
@EJB private CRMBOProvProviderPhysicalGoodBean provProviderPhysicalGoodBean;
/**
* Default constructor.
*/
public MYCOMPANYCRMUITucanoServiceProviderBean() {
// do nothing
}
/**
* Loads the effective TUCANO provisioning provider
* @return the effective TUCANO provisioning provider
* @throws Exception
*/
public CRMDOProvProvider loadForm() throws Exception {
CRMDOProvProvider provProvider = (CRMDOProvProvider)tucanoProviderBean.loadEffective(false);
if (provProvider==null)
{
provProvider = (MYCOMPANYCRMDOProvProvider)tucanoProviderBean.load();
if (provProvider==null)
{
provProvider = (CRMDOProvProvider)createButton();
Set<CRMDOProvisioningDistributor> provisioningDistributors = new HashSet<CRMDOProvisioningDistributor>();
CRMDOProvisioningDistributor provisioningDistributor = (CRMDOProvisioningDistributor) provisioningDistributorBean.construct(provProvider);
provisioningDistributors.add(provisioningDistributor);
provProvider.setProvisioningDistributors(provisioningDistributors);
}
else
{
provProvider = tucanoProviderXMLUtilBean.loadConnectionParametersFromXml(provProvider);
}
}
else
{
provProvider = tucanoProviderXMLUtilBean.loadConnectionParametersFromXml(provProvider);
}
return provProvider;
}
/**
* Loads a provisioning provider given its id
* @param provProviderID - the provisioning provider id
* @return the provisioning provider
* @throws Exception
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public CRMDOProvProvider loadForm(String provProviderID) throws Exception {
CRMDOProvProvider provProvider = (CRMDOProvProvider)tucanoProviderBean.load(provProviderID);
provProvider.setPhysicalGoods(new HashSet(loadPhysicalGoodsTab(provProvider)));
provProvider.setProvisioningDistributors(new HashSet(loadDistributorsTab(provProvider)));
if(provProvider.getProvisioningDistributors().size()==0)
{
Set<CRMDOProvisioningDistributor> provisioningDistributors = new HashSet<CRMDOProvisioningDistributor>();
CRMDOProvisioningDistributor provisioningDistributor= (CRMDOProvisioningDistributor) provisioningDistributorBean.construct(provProvider);
provisioningDistributors.add(provisioningDistributor);
provProvider.setProvisioningDistributors(provisioningDistributors);
}
provProvider = tucanoProviderXMLUtilBean.loadConnectionParametersFromXml(provProvider);
return provProvider;
}
public CRMDOProvProvider createButton() throws Exception {
return createButton(CRMProcessTucanoProviderBean.PROVIDER_PROTOCOL);
}
/**
* Creates a new provisioning provider with the given protocol
* @param protocol - the protocol to create the provisioning provider for
* @return the new provisioning provider
* @throws Exception
*/
public CRMDOProvProvider createButton(String protocol) throws Exception {
CRMDOProvProviderprovProvider = null;
if (protocol!=null)
{
if (protocol.equals(MYCOMPANYCRMProcessTucanoProviderBean.PROVIDER_PROTOCOL))
{
provProvider = (CRMDOProvProvider)tucanoProviderBean.construct();
}
}
return provProvider;
}
/**
* Saves the given provisioning provider
* @param provProvider - the provisioning provider to save
* @return the saved provisioning provider
* @throws Exception
*/
public CRMDOProvProvider saveButton(CRMDOProvProvider provProvider) throws Exception {
String provProviderProtocol = provProvider.getProtocol();
if (provProviderProtocol.equals(MYCOMPANYCRMProcessTucanoProviderBean.PROVIDER_PROTOCOL))
{
tucanoProviderBean.validateConnectionParameters(provProvider);
return (CRMDOProvProvider)tucanoProviderBean.validateAndSave(provProvider);
}
return provProvider;
}
/**
* Loads the given provisioning provider
* @param provProvider - the provisioning provider to load
* @return the provisioning provider
* @throws Exception
*/
public CRMDOProvProvider editButton(CRMDOProvProvider provProvider) throws Exception {
return (provProvider!=null && !provProvider.isNew()) ? loadForm(provProvider.getId()) : loadForm();
}
/**
* Deletes the given provisioning provider
* @param provProvider - the provisioning provider to delete
* @return the deleted provisioning provider
* @throws Exception
*/
public CRMDOProvProvider deleteButton(CRMDOProvProvider provProvider) throws Exception {
String provProviderProtocol = provProvider.getProtocol();
if (provProviderProtocol.equals(MYCOMPANYCRMProcessTucanoProviderBean.PROVIDER_PROTOCOL))
{
return (CRMDOProvProvider)tucanoProviderBean.validateAndDelete(provProvider);
}
return provProvider;
}
/**
* Adds a list of set-top-boxes to the provisioning provider.
*
* @param provProvider the provisioning provider related with the physical goods
* @param productTypeIds a list of product IDs
* @return a list of the provisioning provider physical goods added
* @throws Exception
*/
public ArrayList<CRMDO> addSetTopBoxButton (CRMDOProvProvider provProvider, ArrayList<String> productTypeIds) throws Exception {
String className = productTypeBean.getDOName();
String primaryId = "id";
String propertyName = "productType";
ArrayList<CRMDO> smartcards = provProviderPhysicalGoodBean.construct(provProvider, null, className, primaryId,propertyName, productTypeIds, null);
for(int i = 0; i < smartcards.size(); i++)
{
CRMDOProvProviderPhysicalGood smartcard = (CRMDOProvProviderPhysicalGood)smartcards.get(i);
smartcard.setValue(ProvProviderPhysicalGood.DECODER);
}
return smartcards;
}
}
b. Provisioning Request User Interface Class
The second user interface class that should be created is the provisioning provider's user interface class and should extend com.crm.process.provisioning.CRMUIProvisioningRequestBean.
This class's methods will by called by the provisioning provider requests summary pages.
public class MYCOMPANYCRMUITucanoServiceProvisioningRequestBean extends CRMUIProvisioningRequestBean {
public MYCOMPANYCRMUITucanoServiceProvisioningRequestBean() {
// do nothing
}
/**
* Loads the provisioning request type options.
*
* @return the provisioning request type options
* @throws Exception
*/
public LookupBuilder getTypeOptions() throws Exception {
return getTypeOptions(null);
}
/**
* Loads the provisioning request type options.
*
* @param emptyValue - an empty value for type
* @return the provisioning request type options
* @throws Exception
*/
public LookupBuilder getTypeOptions(String emptyValue) throws Exception {
LookupBuilder builder = new LookupBuilder();
if (emptyValue!=null)
{
builder.build("", emptyValue);
}
MYCOMPANYProvisioningRequestTypeCode[] requestTypes = MYCOMPANYProvisioningRequestTypeCode.values();
for (int i=0; i<requestTypes.length; i++)
{
MYCOMPANYProvisioningRequestTypeCode requestType = requestTypes[i];
builder.build(requestType.toString(), requestType.getLabel());
}
return builder;
}
}
5. Provisioning Provider Process Class
a. Create Class and Implement a Method for Each Action
Use @Stateless(mappedName = "ejb/MYCOMPANYCRMProcessTucanoProvider") to define the mapped name of the provisioning provider EJB. The mapped name should match the one defined in provisioningproviders.xml metadata file.
The new process class must extend com.crm.process.provisioning.CRMProcessProviderBean and implement the following methods (which are defined as abstract in CRMProcessProviderBean parent class):
Note that the value of PORVIDER_PROTOCOL must be the same as <provproviderprotocol> tag's value as defined in provisioningproviders.xml
public String getProtocol()
@Stateless(mappedName = "ejb/MYCOMPANYCRMProcessTucanoProvider")
@LocalBean
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
public static String PROVIDER_PROTOCOL = "TUCANO";
/**
* Default constructor.
*/
public MYCOMPANYCRMProcessTucanoProviderBean() {
super();
}
public String getProtocol() throws Exception {
return PROVIDER_PROTOCOL;
}
...
}
public CRMDOProvProvider setObjectsFromXML(CRMDOProvProvider provProvider)
This method is called whenever loadProvider(), loadEffectiveProvider(String protocol) and loadEffectiveProvider(String protocol , Boolean applicationServerFiltering) methods of CRMProcessProviderBean are called.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
@EJB private MYCOMPANYCRMBOTucanoProviderBean tucanoProviderBean;
...
public CRMDOProvProvider setObjectsFromXML(CRMDOProvProvider provProvider) throws Exception {
provProvider = tucanoProviderBean.setObjectsFromXML(provProvider);
return provProvider;
}
...
}
public void processAddServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices, ArrayList<ProviderInstalledItem> providerInstalledItems)
This method is called whenever an 'Add Service' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processAddServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> providerServices, ArrayList<ProviderInstalledItem> providerInstalledItems)throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processAmendBundleServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)
This method is called whenever an 'Amend Bundled' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processAmendBundleServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)
throws Exception {
...
}
...
}
public void processRemoveServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)
This method is called whenever a 'Remove Service' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processRemoveServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
//addedProviderServices in case of regret the swap
//The "Activating an AlphaNetworks Tucano Services Process" is performed for the services that will be restored (i.e. the services that the subscriber had before the service swap)
activateTucanoServices(subscriptionAction, provProvider, subscription, addedProviderServices);
ArrayList<ProviderService> authorisedServices = getAuthorisedServices(removedProviderServices);
deactivateTucanoServices(subscriptionAction, provProvider, subscription, authorisedServices);
}
...
}
public void processSwapServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)
This method is called whenever a 'Swap Service' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processSwapServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
ArrayList<ProviderService> effectiveServices = getEffectiveServices(addedProviderServices);
activateTucanoServices(subscriptionAction, provProvider, subscription, effectiveServices);
ArrayList<ProviderService> authorisedServices = getAuthorisedServices(removedProviderServices);
deactivateTucanoServices(subscriptionAction, provProvider, subscription, authorisedServices);
}
...
}
public void processStartServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever a 'Start Service' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processStartServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processStopServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever a 'Stop Service' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processStopServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processAddInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> providerInstalledItems)
This method is called whenever an 'Add Installed Item' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processAddInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> providerInstalledItems) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
addTucanoSTBs(subscriptionAction, provProvider, subscription, providerInstalledItems);
}
...
}
public void processRemoveInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> providerInstalledItems)
This method is called whenever a 'Remove Installed Item' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processRemoveInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> providerInstalledItems) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
removeTucanoSTBs(subscriptionAction, provProvider, subscription, providerInstalledItems);
if(subscription.getLifeCycleState()==null)
{
subscription.setLifeCycleState(subscriptionBean.getLifeCycleState(subscription, getCurrentDate()));
}
if(subscription.getLifeCycleState()!=null
&& (subscription.getLifeCycleState().equals(SubscriptionLifeCycleState.CANCELLED)
|| subscription.getLifeCycleState().equals(SubscriptionLifeCycleState.REGRETTED) )
&& !installedItemExists(subscription, provProvider))
{
updateSubscriptionProvisioningParameter(PROVIDER_PROTOCOL, subscription, USERNAME, null, subscription.getNumber(), SubProvProviderLifeCycleState.CANCELLED);
}
}
...
}
public void processSwapInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> removedProviderInstalledItems, ArrayList<ProviderInstalledItem> addedProviderInstalledItems)
This method is called whenever a 'Swap Installed Item' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processSwapInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> removedProviderInstalledItems,ArrayList<ProviderInstalledItem> addedProviderInstalledItems) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
addTucanoSTBs(subscriptionAction, provProvider, subscription, addedProviderInstalledItems);
removeTucanoSTBs(subscriptionAction, provProvider, subscription, removedProviderInstalledItems);
}
...
}
public void processChangeSubscriptionDistributionSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderInstalledItem> removedProviderInstalledItems, ArrayList<ProviderService> addedProviderServices, ArrayList<ProviderInstalledItem> addedProviderInstalledItems)
This method is called whenever a 'Change Subscription Distribution' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processChangeSubscriptionDistributionSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,
ArrayList<ProviderService> removedProviderServices,
ArrayList<ProviderInstalledItem> removedProviderInstalledItems,
ArrayList<ProviderService> addedProviderServices,
ArrayList<ProviderInstalledItem> addedProviderInstalledItems) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
activateTucanoServices(subscriptionAction, provProvider, subscription, addedProviderServices);
deactivateTucanoServices(subscriptionAction, provProvider, subscription, removedProviderServices);
addTucanoSTBs(subscriptionAction, provProvider, subscription, addedProviderInstalledItems);
removeTucanoSTBs(subscriptionAction, provProvider, subscription, removedProviderInstalledItems);
}
...
}
public void processBecomeSubscriberSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices, ArrayList<ProviderInstalledItem> providerInstalledItems)
This method is called whenever a 'Become Subscriber' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processBecomeSubscriberSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,
ArrayList<ProviderService> providerServices,
ArrayList<ProviderInstalledItem> providerInstalledItems) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
createNewTucanoAccount(subscriptionAction, provProvider, subscription, providerServices, providerInstalledItems);
}
...
}
public void processActivateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever an 'Activate Subscription' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processActivateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processDeactivateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever a 'Deactivate Subscription' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processDeactivateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processTerminateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever a 'Terminate Subscription' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
public static String PROVIDER_PROTOCOL = "TUCANO";
public static String USERNAME = "USERNAME";
...
@Override
public void processTerminateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
if(!installedItemExists(subscription, provProvider))
{
updateSubscriptionProvisioningParameter(PROVIDER_PROTOCOL, subscription, USERNAME, null, subscription.getNumber(), SubProvProviderLifeCycleState.CANCELLED);
}
}
...
}
public void processRestSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever a 'Rest Subscription' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processRestSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processEndSubscriptionRestingSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever an 'End Subscription Resting' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processEndSubscriptionRestingSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processShortTermActivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever a 'Short Term Activation' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processShortTermActivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processEndShortTermActivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever an 'End Short Term Activation' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processEndShortTermActivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processShortTermDeactivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever a 'Short Term Deactivation' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processShortTermDeactivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processEndShortTermDeactivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)
This method is called whenever an 'End Short Term Deactivation' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processEndShortTermDeactivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
CRMDOProvProvider provProvider = loadProvider();
CRMDOSubscription subscription = subscriptionAction.getSubscription();
activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
}
...
}
public void processAddServiceUsageSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderUsageDataRecord> protocolProviderUdrs)
This method is called whenever an 'Add Service Usage' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processAddServiceUsageSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderUsageDataRecord> protocolProviderUdrs) throws Exception {
...
}
...
}
public void processCancelledUDRs(ArrayList<ProviderUsageDataRecord> providerUsageDataRecords)
This method is called whenever a 'Cancel UDR' action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processCancelledUDRs(ArrayList<ProviderUsageDataRecord> providerUsageDataRecords) throws Exception {
...
}
...
}
public void processResetSubscription(CRMDOProvProvider provProvider, CRMDOSubscription subscription)
This method is callled whenever a 'Reset Subscription' subscription action is executed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
@Override
public void processResetSubscription(CRMDOProvProvider provProvider, CRMDOSubscription subscription) throws Exception {
String processName = ProvisioningRequestProcessName.RESET.toString();
if(!isSubscriptionProvisioned(subscription.getId()) && ifSubscriptionServiceProvisionedExists(subscription.getId(), provProvider.getId()))
{
createNewTucanoAccount(provProvider, subscription, null, null, processName, null);
}
ArrayList<ProviderService> providerServicesForDeactivation = getProviderServicesForDeactivation(subscription, provProvider);
if(providerServicesForDeactivation != null && providerServicesForDeactivation.size() > 0)
{
deactivateTucanoServices(provProvider, subscription, providerServicesForDeactivation, processName, null);
}
ArrayList<ProviderService> providerServicesForActivation = getProviderServicesForActivation(subscription, provProvider);
if(providerServicesForActivation != null && providerServicesForActivation.size() > 0)
{
activateTucanoServices(provProvider, subscription, providerServicesForActivation, processName, null);
}
ArrayList<ProviderInstalledItem> providerInstalledItemsForActivation = getProviderInstalledItemsForActivation(subscription, provProvider);
if(providerInstalledItemsForActivation != null && providerInstalledItemsForActivation.size() > 0)
{
addTucanoSTBs(provProvider, subscription, providerInstalledItemsForActivation, processName, null);
}
ArrayList<ProviderInstalledItem> providerInstalledItemsForDeactivation = getProviderInstalledItemsForDeactivation(subscription, provProvider);
if(providerInstalledItemsForDeactivation != null && providerInstalledItemsForDeactivation.size() > 0)
{
removeTucanoSTBs(provProvider, subscription, providerInstalledItemsForDeactivation, processName, null);
}
}
...
}
b. Create and Process Provisioning Requests
In the following example, you can see how a provisioning request for adding services, can be created and processed.
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
...
private CRMDOProvisioningRequest processActivateOptionsProvisioningRequest( CRMDOProvProvider provProvider,
CRMDOSubscription subscription,
CRMDOSubProvProviderParameter subProvProviderParameter,
ArrayList<ProviderService> providerServices,
String processName,
String processID,
TucanoAuthenticationToken tucanoAuthenticationToken) throws Exception {
//The provisioning request parameters to be created
HashMap<String,Object> parameterValues = new HashMap<String,Object>();
//The subscription provisioning parameter
parameterValues.put(ProvisioningRequestParameterType.SUB_PROVISIONING_PARAMETER_ID.toString(), subProvProviderParameter);
//A list of service CA IDs
ArrayList<Integer> optionIds = new ArrayList<Integer>();
ArrayList<CRMDOSubProvisioningDistribution> subProvDistributions = new ArrayList<CRMDOSubProvisioningDistribution>();
for(int i=0; i<providerServices.size(); i++)
{
optionIds.add(new Integer(tucanoProviderBean.getServiceCAID(provProvider,providerServices.get(i).getProduct())));
subProvDistributions.add(providerServices.get(i).getSubProvisioningDistribution());
}
//The subscription provisioning distributor linked with the service
parameterValues.put(ProvisioningRequestParameterType.SERVICE_CA_ID.toString(),optionIds);
//The subscription service CA ID
parameterValues.put(ProvisioningRequestParameterType.SERVICE_SUB_PROVISIONING_DISTRIBUTION_ID.toString(),subProvDistributions);
//Create and save the porvisioning request and provisioning request parameters
CRMDOProvisioningRequest provisioningRequest = createProvisioningRequest( provProvider,
ProvisioningRequestTypeCode.ACTIVATE_OPTIONS.toString(),
getCurrentDate(),
parameterValues,
"addOptions",
null,
processName,
processID,
subscription);
Boolean success = false;
String request = null;
String result = null;
//Send request to TUCANO and set values of request, success and result
{...}
//
if(success)
{
provisioningRequest.setRequest(request+" / "result);
completeProvisioningRequest(request+" / "result, getCurrentDate(),subProvDistributions,null,null,null,null);
}
else
{
rejectProvisioningRequest(provisioningRequest, result, subProvDistributions,null,null,null,null);
}
return provisioningRequest;
}
...
}
6. Summary Pages
You will need to create one main summary page for provisioning requests, and two that will be used by the main as drill-downs: one for provisioning request parameters and one for provisioning request process information.
For more information on creating custom summary pages go to Customize Summary Pages.
a. Provisioning Requests
b. Provisioning Request Parameters
7. Data Entry Page
You will need to create one data entry page for the provisioning provider. For more information on creating custom data entry pages go to Customize Data Entry Pages.
A new custom module should be defined in modules.xml file. For more information on customising modules metadata file, go to Customize Menu Options Metadata.
The new menu options should be defined in menuoptions.xml file. For more information on customising menu options metadata file, go to Customize Modules Metadata.