ePages 6.10 - DE_EPAGES/Shop/API/WebService/BaseShopService.pm

Package DE_EPAGES::Shop::API::WebService::BaseShopService

Base class for shop web services (with shop as object).

Base
DE_EPAGES::WebService::API::WebService::BaseService

Functions

CheckPermission
checkFeature
featureAlias
featureCount
loadShopObject
object

CheckPermission

Checks if the user is allowed to execute a web service method on the user's shop. Checks if the shop has the feature 'WebServices' or if the web service method is called by an authorized client application.

Syntax
$IsAllowed = $self->CheckPermission( $WebService, $Method, $Login, $Password );
Input
$WebService (object)
web service object
$Method (object)
web service method object
$Login (string)
login
$Password (string)
password
Return
$IsAllowed (boolean)
true if the method call is allowed

checkFeature

check if feature activated and enougth WS calls allowed produce an error if not enogth WS calls allowd

Syntax
$self->checkFeature;

featureAlias

simply returns the Alias of the current Webservie feature

Syntax
my $FeatureAlias = $self->featureAlias;
Return
$FeatureAlias (string)
alias of WS

featureCount

returns the number of available allowed WebService calls today

Syntax
my $FeatureCount = $self->featureCount($Feature);
Input
$Feature (object)
feature object
Return
$FeatureCount (integer)
number of available WS calls

loadShopObject

loads the object specified by object path and verifies that is exists, belongs to the current shop and is an instance of a certain class. Raises an error if any condition is not fulfilled. Returns the object if all tests passed.

Syntax
$Object = $self->loadShopObject( $Path, $ClassAlias )
Input
$Path (string)
object path to load
$ClassAlias (string)
alias of a class (optional)
Return
$Object (object)
object

object

Override method object from BaseShopService. Returns the base object on which the WebService will act. The 'Site' attribute (Shop) of the web service user will be used as base object.

Syntax
$base_object = $service->object;
Return
$Object (Shop object)
base WebService object