ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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

 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.

Member Function Documentation

◆ addError()

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

Definition at line 132 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().

133  {
134  throw $this->raiseError($message, 'ERROR');
135  }
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 78 of file Base.php.

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

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

78  : void
79  {
80  for ($i = 0, $iMax = count($this->getInputParams()); $i < $iMax; $i++) {
81  if (!isset($params[$i])) {
82  $names = implode(', ', array_keys($this->getInputParams()));
83  throw new ilSoapPluginException("Request is missing at least one of the following parameters: $names");
84  }
85  }
86  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
getInputParams()
Get the input parameters.
Definition: Base.php:95
+ 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 107 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().

108  {
109  $this->checkParameters($params);
110  $session_id = (isset($params[0])) ? $params[0] : '';
111  $this->init($session_id);
112 
113  // Check Permissions
114  global $DIC;
115  if (!$DIC->access()->checkAccess('write', '', \ilObjOrgUnit::getRootOrgRefId())) {
116  $this->addError('Permission denied');
117  }
118 
119  $clean_params = array();
120  $i = 1;
121  foreach ($this->getAdditionalInputParams() as $key => $type) {
122  $clean_params[$key] = $params[$i];
123  $i++;
124  }
125 
126  return $this->run($clean_params);
127  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
init(string $session_id)
Definition: Base.php:140
global $DIC
Definition: shib_login.php:26
static getRootOrgRefId()
checkParameters(array $params)
Check that all input parameters are present when executing the soap method.
Definition: Base.php:78
+ 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 95 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().

95  : array
96  {
97  return array_merge(
98  array(
99  self::SID => self::TYPE_STRING,
100  ),
101  $this->getAdditionalInputParams()
102  );
103  }
+ 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 88 of file Base.php.

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

88  : string
89  {
90  return 'urn:' . ilOrgUnitSOAPServicesPlugin::PLUGIN_NAME;
91  }
+ 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 47 of file Base.php.

47  : string
48  {
49  return 'rpc';
50  }

◆ getServiceUse()

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

Get the service use, e.g.

'encoded'

Returns
string

Implements ilSoapMethod.

Definition at line 52 of file Base.php.

52  : string
53  {
54  return 'encoded';
55  }

◆ init()

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

Definition at line 140 of file Base.php.

References $_GET, $dic, ilOrgUnitLocalDIC\dic(), and ILIAS\OrgUnit\Webservices\SOAP\Base\initIliasAndCheckSession().

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

140  : void
141  {
142  $this->initIliasAndCheckSession($session_id); // Throws exception if session is not valid
143 
144  if (!isset($_GET["wsdl"])) {
146  $this->positionRepo = $dic["repo.Positions"];
147  $this->assignmentRepo = $dic["repo.UserAssignments"];
148  }
149  }
$_GET["client_id"]
Definition: webdav.php:30
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:64
$dic
Definition: result.php:31
+ 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 64 of file Base.php.

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

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

64  : void
65  {
66  $this->initAuth($session_id);
67  $this->initIlias();
68  if (!$this->checkSession($session_id)) {
69  throw new ilSoapPluginException($this->getMessage());
70  }
71  }
+ 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: