In this document
In services
section of the APP-META.xml
file, add a service
section with the new service declaration:
<service id="resellers">
<code engine="php" path="scripts/resellers.php"/>
<presentation>
<name>Reseller profile</name>
<summary>Product customization for resellers</summary>
</presentation>
</service>
In accordance with this declaration, the scripts/resellers.php
script must define the new APS type and service.
You will create that file later in this project.
In the scripts/wizard_data.json
file, insert the following resellerProfile
section between the
apsResources
and resourceTypes
sections:
"resellerProfile": {
"id": "idcced499b78e4d8",
"apsType": "http://aps-standard.org/samples/reseller-config/reseller/1.0",
"type": "http://aps-standard.org/types/core/profile/reseller/1.0",
"relations": {
"cloud": "idglobals"
}
},
This will make the APS controller create an APS resource based on the specified reseller profile APS type.
In the resourceTypes
section, add a resource type for the created reseller profile:
{
"name": "Offer Management and Reseller Configuration - Value added reseller",
"id": -500006,
"resClass": "rc.saas.service.link",
"required": false,
"rtfor": "http://aps-standard.org/types/core/profile/reseller/1.0",
"actParams": {
"resource_uid": "idcced499b78e4d8"
}
}
In the serviceTemplate
section, add the new resource type:
{
"limit": 1,
"unlimited": false,
"rtID": -500006
}
The application must define a new APS type and a respective service to be used for creating reseller profiles.
For this aim, add a PHP file, for example, scripts/resellers.php
that declares the APS type and defines the service
with its properties and methods. The following are key points in the file:
ResellerProfile
APS type.The content of the file must look as follows:
<?php
require "aps/2/runtime.php";
/**
* Settings, customizable by resellers, for example
* @type("http://aps-standard.org/samples/reseller-config/reseller-profile/1.0")
* @implements("http://aps-standard.org/types/core/profile/reseller/1.0")
*/
class ResellerCloud extends APS\ResourceBase {
/**
* @link("http://aps-standard.org/samples/reseller-config/cloud/1.0")
* @required
*/
public $cloud;
/**
* @link("http://aps-standard.org/samples/reseller-config/context/1.0[]")
*/
public $contexts;
## White label customizable per reseller
/**
* @type(string)
* @title(Parameter 1)
* @description("White label #1")
*/
public $param1;
## White label customizable per reseller
/**
* @type(string)
* @title(Parameter 2)
* @description("White label #2")
*/
public param2;
}
?>