JSMA portal
Overview
The JSMA portal provides functionality for handling portals
What can JSMA portal do for me?
You could easily use the JSMA portal to edit a portal
Index
- 1 Overview
- 2 Index
- 3 Usage
- 3.1 writing data
- 3.2 reading data
- 4 Methods
- 4.1 string[] portal.activeDeliveryMethods
- 4.2 string[] portal.activePaymentMethods
- 4.3 string portal.backendPassword
- 4.4 string portal.backendType
- 4.5 string portal.backendUrl
- 4.6 string portal.backendUser
- 4.7 bool portal.ibsActive
- 4.8 string portal.ibsBaseURL
- 4.9 string portal.ibsUser
- 4.10 string portal.ibsPassword
- 4.11 portal portal.clone(name)
- 4.12 string portal.cacheKey
- 4.13 portal.flexAttributes
- 4.14 string portal.get(key)
- 4.15 boolean portal.has(key)
- 4.16 string portal.host
- 4.17 int portal.id
- 4.18 portal.increment(key)
- 4.19 string portal.name
- 4.20 string portal.path
- 4.21 object portal.regions
- 4.22 portal.remove(key)
- 4.23 portal.set(key, value, [options])
- 4.24 float portal.vat
Usage
writing data
Here is an example on how to write data to a JSMA portal:
...
portal.set(key, value, [options]);
...reading data
Here is an example on how to read data from a JSMA portal:
...
var activePaymentMethods = portal.activePaymentMethods;
...Methods
The JSMA portal provides the following methods:
string[] portal.activeDeliveryMethods
Returns a string-array with all the delivery methods, that are currently active
Example
...
var activeDeliveryMethods = portal.activeDeliveryMethods;
...string[] portal.activePaymentMethods
Returns a string-array with all the payment methods, that are currently active
Example
...
var activePaymentMethods = portal.activePaymentMethods;
...string portal.backendPassword
Returns the backend password of the portal
Example
...
var backendPW = portal.backendPassword;
...string portal.backendType
Returns the backend type of the portal
Example
...
var backendType = portal.backendType;
...string portal.backendUrl
Returns the backend url of the portal
Example
...
var backendUrl = portal.backendUrl;
...string portal.backendUser
Returns the backend user of the portal
Example
...
var backendUser= portal.backendUser;
...bool portal.ibsActive
Returns whether IBS is enabled for the portal
Example
...
portal.ibsActive # => true / false
...string portal.ibsBaseURL
Returns the IBS base URL setting of the portal.
Example
...
var url = portal.ibsBaseURL; # => 'https://...'
...string portal.ibsUser
Returns the IBS user setting of the portal.
Example
...
var userName = portal.ibsUser; # => 'IBS-Username'
...string portal.ibsPassword
Returns the IBS password setting of the portal.
Example
...
var password = portal.ibsPassword; # => 'IBS-password'
...portal portal.clone(name)
Clones the portal and returns the copy as a JSMA portal.
Slice aware
This entity is slice aware, which means that to use this facility:
there must be a logged in user in the context of the execution
this user must be currently within a slice
this user must have the necessary privileges to edit the entity (IFE → System → Benutzer → Roles → Content-Management)
Example
...
var clonedPortal = portal.clone() // => portal
...Parameter name: (optional)
string portal.cacheKey
Returns a string that you can use in the fragment cache. This string will change whenever the portal or one of its product associations is changed.
Example
...
portal.cacheKey # => "12589387317632578294"
...portal.flexAttributes
Returns the flex attributes of the portal
Example
...
var portalFlexAttributes = portal.flexAttributes;
...string portal.get(key)
Returns the value of key as string or null if no value is set under the key.
Example
...
portal.get(key)
...Parameter key:string (required)
The key to be looked up in the flexAttributes of the order.
boolean portal.has(key)
Returns a boolean value depending on whether key is present for a given portal
Example
...
if (portal.has("description") === true)
{
...
}
...Parameter key:string (required)
The key to be checked in the flexAttributes of the order.
string portal.host
Returns the host for a given portal
Example
...
var host = portal.host;
...int portal.id
Returns the id of a given portal
Example
...
var portalId = portal.id;
...portal.increment(key)
Increments the vale of a given key by one.
Example
...
portal.increment(key)
...Parameter key:string (required)
The key to be incremented in the flexAttributes of the portal.
string portal.name
Returns the name of the portal
Example
...
var portalName = portal.name;
...string portal.path
Returns the path of the portal
Example
...
var portalName = portal.path;
...object portal.regions
Returns the regions of the portal
Example
...
var portalRegions = portal.regions;
...portal.remove(key)
Removes the key from the flexAttributes of the portal
Example
...
portal.remove(key);
...Parameter key:string (required)
The key to be removed from the flexAttributes of the portal
portal.set(key, value, [options])
Sets the value of a specified key for a given portal
Example
...
portal.set(key, value, [options]);
...Parameter key:string (required)
The key to be set in the flexAttributes of the portal.
Parameter value:string (required)
The value to be set for the key
Parameter options:object (optional)
May have a key 'broadcastEvent':bool which determines whether the log message shows up in the websocket log view.
float portal.vat
Returns the vat
Example
...
var vat = portal.vat;
...