ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\OrgUnit\Webservices\SOAP\Base Class Reference

Class Base. More...

+ Inheritance diagram for ILIAS\OrgUnit\Webservices\SOAP\Base:
+ Collaboration diagram for ILIAS\OrgUnit\Webservices\SOAP\Base:

Public Member Functions

 __construct ()
 
 getServiceStyle ()
 Get the service style, e.g. More...
 
 getServiceUse ()
 Get the service use, e.g. More...
 
 getServiceNamespace ()
 Get the namespace of the service where this method belongs to. More...
 
 getInputParams ()
 Get the input parameters. More...
 
 execute (array $params)
 Execute the business logic for this SOAP method (when a SOAP request hits the endpoint defined by the name). More...
 
 addError (string $message)
 
- Public Member Functions inherited from ilSoapAdministration
 __construct (bool $use_nusoap=true)
 
 getMessage ()
 
 appendMessage (string $a_str)
 
 setMessageCode (string $a_code)
 
 getMessageCode ()
 
 reInitUser ()
 
 isFault ($object)
 
 getInstallationInfoXML ()
 
 getClientInfoXML (string $clientid)
 
- Public Member Functions inherited from ilSoapMethod
 getName ()
 Get the name of the method. More...
 
 getOutputParams ()
 Get the output parameters in the same format as the input parameters. More...
 
 getDocumentation ()
 Get the documentation of this method. More...
 

Data Fields

const TYPE_INT_ARRAY = 'tns:intArray'
 
const TYPE_STRING = 'xsd:string'
 
const TYPE_INT = 'xsd:int'
 
const TYPE_DOUBLE_ARRAY = 'tns:doubleArray'
 
const SID = 'sid'
 
const ORGU_REF_ID = 'orgu_ref_id'
 
const POSITION_ID = 'position_id'
 
const USR_IDS = 'usr_ids'
 
const USR_ID = 'usr_id'
 
- Data Fields inherited from ilSoapAdministration
const NUSOAP = 1
 
const PHP5 = 2
 
int $error_method
 Defines type of error handling (PHP5 || NUSOAP) More...
 

Protected Member Functions

 initIliasAndCheckSession (string $session_id)
 Use this method at the beginning of your execute() method to check if the provided session ID is valid. More...
 
 checkParameters (array $params)
 Check that all input parameters are present when executing the soap method. More...
 
 getAdditionalInputParams ()
 
 run (array $params)
 
- Protected Member Functions inherited from ilSoapAdministration
 checkSession (string $sid)
 
 explodeSid (string $sid)
 
 setMessage (string $a_str)
 
 initAuth (string $sid)
 
 initIlias ()
 
 initAuthenticationObject ()
 
 raiseError (string $a_message, $a_code)
 
 checkObjectAccess (int $ref_id, array $expected_type, string $permission, bool $returnObject=false)
 check access for ref id: expected type, permission, return object instance if returnobject is true More...
 

Protected Attributes

ilOrgUnitPositionDBRepository $positionRepo
 
ilOrgUnitUserAssignmentDBRepository $assignmentRepo
 
- Protected Attributes inherited from ilSoapAdministration
bool $soap_check = true
 
string $message = ''
 
string $message_code = ''
 

Private Member Functions

 init (string $session_id)
 

Detailed Description

Class Base.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 30 of file Base.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\OrgUnit\Webservices\SOAP\Base::__construct ( )

Definition at line 47 of file Base.php.

References $_GET, $dic, ILIAS\GlobalScreen\Provider\__construct(), and ilOrgUnitLocalDIC\dic().

48  {
49  if (! isset($_GET["wsdl"])) {
51  $this->positionRepo = $dic["repo.Positions"];
52  $this->assignmentRepo = $dic["repo.UserAssignments"];
53  }
54 
56  }
$_GET["client_id"]
Definition: webdav.php:30
__construct(Container $dic, ilPlugin $plugin)
$dic
Definition: result.php:31
+ Here is the call graph for this function:

Member Function Documentation

◆ addError()

ILIAS\OrgUnit\Webservices\SOAP\Base::addError ( string  $message)
Exceptions

Definition at line 143 of file Base.php.

References ilSoapAdministration\raiseError().

Referenced by ILIAS\OrgUnit\Webservices\SOAP\Base\execute(), ILIAS\OrgUnit\Webservices\SOAP\AddUserIdToPositionInOrgUnit\run(), ILIAS\OrgUnit\Webservices\SOAP\PositionTitle\run(), and ILIAS\OrgUnit\Webservices\SOAP\RemoveUserIdFromPositionInOrgUnit\run().

144  {
145  throw $this->raiseError($message, 'ERROR');
146  }
raiseError(string $a_message, $a_code)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkParameters()

ILIAS\OrgUnit\Webservices\SOAP\Base::checkParameters ( array  $params)
protected

Check that all input parameters are present when executing the soap method.

Parameters
array$params
Exceptions
ilSoapPluginException

Definition at line 89 of file Base.php.

References ILIAS\OrgUnit\Webservices\SOAP\Base\getInputParams().

Referenced by ILIAS\OrgUnit\Webservices\SOAP\Base\execute().

89  : void
90  {
91  for ($i = 0, $iMax = count($this->getInputParams()); $i < $iMax; $i++) {
92  if (!isset($params[$i])) {
93  $names = implode(', ', array_keys($this->getInputParams()));
94  throw new ilSoapPluginException("Request is missing at least one of the following parameters: $names");
95  }
96  }
97  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
getInputParams()
Get the input parameters.
Definition: Base.php:106
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ execute()

ILIAS\OrgUnit\Webservices\SOAP\Base::execute ( array  $params)

Execute the business logic for this SOAP method (when a SOAP request hits the endpoint defined by the name).

Note: This Method must return the data in the format specified by getOutputParams().

Parameters
array$paramsKey/Value pair of parameters defined by getInputParams()
Returns
mixed

Implements ilSoapMethod.

Definition at line 118 of file Base.php.

References $DIC, ILIAS\OrgUnit\Webservices\SOAP\Base\addError(), ILIAS\OrgUnit\Webservices\SOAP\Base\checkParameters(), ILIAS\OrgUnit\Webservices\SOAP\Base\getAdditionalInputParams(), ilObjOrgUnit\getRootOrgRefId(), ILIAS\OrgUnit\Webservices\SOAP\Base\init(), and ILIAS\OrgUnit\Webservices\SOAP\Base\run().

119  {
120  $this->checkParameters($params);
121  $session_id = (isset($params[0])) ? $params[0] : '';
122  $this->init($session_id);
123 
124  // Check Permissions
125  global $DIC;
126  if (!$DIC->access()->checkAccess('write', '', \ilObjOrgUnit::getRootOrgRefId())) {
127  $this->addError('Permission denied');
128  }
129 
130  $clean_params = array();
131  $i = 1;
132  foreach ($this->getAdditionalInputParams() as $key => $type) {
133  $clean_params[$key] = $params[$i];
134  $i++;
135  }
136 
137  return $this->run($clean_params);
138  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
init(string $session_id)
Definition: Base.php:151
global $DIC
Definition: shib_login.php:22
static getRootOrgRefId()
checkParameters(array $params)
Check that all input parameters are present when executing the soap method.
Definition: Base.php:89
+ Here is the call graph for this function:

◆ getAdditionalInputParams()

ILIAS\OrgUnit\Webservices\SOAP\Base::getAdditionalInputParams ( )
abstractprotected

◆ getInputParams()

ILIAS\OrgUnit\Webservices\SOAP\Base::getInputParams ( )

Get the input parameters.

Array keys must correspond to parameter names and values must correspond to a valid SOAP data-type

Returns
array
See also
ilNusoapUserAdministrationAdapter::registerMethods() for examples

Implements ilSoapMethod.

Definition at line 106 of file Base.php.

References $params, ILIAS\OrgUnit\Webservices\SOAP\Base\getAdditionalInputParams(), and ILIAS\OrgUnit\Webservices\SOAP\Base\run().

Referenced by ILIAS\OrgUnit\Webservices\SOAP\Base\checkParameters().

106  : array
107  {
108  return array_merge(
109  array(
110  self::SID => self::TYPE_STRING,
111  ),
112  $this->getAdditionalInputParams()
113  );
114  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getServiceNamespace()

ILIAS\OrgUnit\Webservices\SOAP\Base::getServiceNamespace ( )

Get the namespace of the service where this method belongs to.

Returns
string

Implements ilSoapMethod.

Definition at line 99 of file Base.php.

References ILIAS\OrgUnit\Webservices\SOAP\Base\getAdditionalInputParams().

99  : string
100  {
101  return 'urn:' . ilOrgUnitSOAPServicesPlugin::PLUGIN_NAME;
102  }
+ Here is the call graph for this function:

◆ getServiceStyle()

ILIAS\OrgUnit\Webservices\SOAP\Base::getServiceStyle ( )

Get the service style, e.g.

'rpc'

Returns
string

Implements ilSoapMethod.

Definition at line 58 of file Base.php.

58  : string
59  {
60  return 'rpc';
61  }

◆ getServiceUse()

ILIAS\OrgUnit\Webservices\SOAP\Base::getServiceUse ( )

Get the service use, e.g.

'encoded'

Returns
string

Implements ilSoapMethod.

Definition at line 63 of file Base.php.

63  : string
64  {
65  return 'encoded';
66  }

◆ init()

ILIAS\OrgUnit\Webservices\SOAP\Base::init ( string  $session_id)
private
Exceptions
ilSoapPluginException

Definition at line 151 of file Base.php.

References ILIAS\OrgUnit\Webservices\SOAP\Base\initIliasAndCheckSession().

Referenced by ILIAS\OrgUnit\Webservices\SOAP\Base\execute().

151  : void
152  {
153  $this->initIliasAndCheckSession($session_id); // Throws exception if session is not valid
154  }
initIliasAndCheckSession(string $session_id)
Use this method at the beginning of your execute() method to check if the provided session ID is vali...
Definition: Base.php:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initIliasAndCheckSession()

ILIAS\OrgUnit\Webservices\SOAP\Base::initIliasAndCheckSession ( string  $session_id)
protected

Use this method at the beginning of your execute() method to check if the provided session ID is valid.

This method wraps around ilSoapAdministration::initAuth() and ilSoapAdministration::initILIAS() which are both required in order to handle the request.

Parameters
string$session_id
Exceptions
ilSoapPluginException

Definition at line 75 of file Base.php.

References ilSoapAdministration\checkSession(), ilSoapAdministration\getMessage(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().

Referenced by ILIAS\OrgUnit\Webservices\SOAP\Base\init().

75  : void
76  {
77  $this->initAuth($session_id);
78  $this->initIlias();
79  if (!$this->checkSession($session_id)) {
80  throw new ilSoapPluginException($this->getMessage());
81  }
82  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

ILIAS\OrgUnit\Webservices\SOAP\Base::run ( array  $params)
abstractprotected

Referenced by ILIAS\OrgUnit\Webservices\SOAP\Base\execute(), and ILIAS\OrgUnit\Webservices\SOAP\Base\getInputParams().

+ Here is the caller graph for this function:

Field Documentation

◆ $assignmentRepo

ilOrgUnitUserAssignmentDBRepository ILIAS\OrgUnit\Webservices\SOAP\Base::$assignmentRepo
protected

Definition at line 45 of file Base.php.

◆ $positionRepo

ilOrgUnitPositionDBRepository ILIAS\OrgUnit\Webservices\SOAP\Base::$positionRepo
protected

Definition at line 44 of file Base.php.

◆ ORGU_REF_ID

const ILIAS\OrgUnit\Webservices\SOAP\Base::ORGU_REF_ID = 'orgu_ref_id'

Definition at line 40 of file Base.php.

◆ POSITION_ID

const ILIAS\OrgUnit\Webservices\SOAP\Base::POSITION_ID = 'position_id'

Definition at line 41 of file Base.php.

◆ SID

const ILIAS\OrgUnit\Webservices\SOAP\Base::SID = 'sid'

Definition at line 39 of file Base.php.

◆ TYPE_DOUBLE_ARRAY

const ILIAS\OrgUnit\Webservices\SOAP\Base::TYPE_DOUBLE_ARRAY = 'tns:doubleArray'

Definition at line 38 of file Base.php.

◆ TYPE_INT

◆ TYPE_INT_ARRAY

◆ TYPE_STRING

◆ USR_ID

const ILIAS\OrgUnit\Webservices\SOAP\Base::USR_ID = 'usr_id'

Definition at line 43 of file Base.php.

◆ USR_IDS

const ILIAS\OrgUnit\Webservices\SOAP\Base::USR_IDS = 'usr_ids'

Definition at line 42 of file Base.php.


The documentation for this class was generated from the following file: