|
| addFile ($sid, $target_id, $file_xml) |
| add an File with id. More...
|
|
| updateFile ($sid, $ref_id, $file_xml) |
| update a File with id. More...
|
|
| getFileXML ($sid, $ref_id, $attachFileContentsMode) |
| get File xml More...
|
|
| __construct ($use_nusoap=true) |
| Constructor. More...
|
|
| initErrorWriter () |
| Overwrite error handler. More...
|
|
| __explodeSid ($sid) |
|
| __setMessage ($a_str) |
|
| __getMessage () |
|
| __appendMessage ($a_str) |
|
| __setMessageCode ($a_code) |
|
| __getMessageCode () |
|
| initAuth ($sid) |
| Init authentication. More...
|
|
| initIlias () |
|
| __initAuthenticationObject ($a_auth_mode=AUTH_LOCAL) |
|
| __raiseError ($a_message, $a_code) |
|
| getNIC ($sid) |
| get client information from current as xml result set More...
|
|
| isFault ($object) |
|
| checkObjectAccess ($ref_id, $expected_type, $permission, $returnObject=false) |
| check access for ref id: expected type, permission, return object instance if returnobject is true More...
|
|
| getInstallationInfoXML () |
|
| getClientInfoXML ($clientid) |
|
◆ addFile()
ilSoapFileAdministration::addFile |
( |
|
$sid, |
|
|
|
$target_id, |
|
|
|
$file_xml |
|
) |
| |
add an File with id.
- Parameters
-
string | $session_id | current session |
int | $target_id | refid of parent in repository |
string | $file_xml | qti xml description of test |
- Returns
- int reference id in the tree, 0 if not successful
Definition at line 47 of file class.ilSoapFileAdministration.php.
References $DIC, ilFileException\$ID_MISMATCH, $ilLog, $target_id, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_isInTrash(), ilObjectFactory\getInstanceByRefId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
52 if (!$this->__checkSession($sid)) {
57 $ilAccess = $DIC[
'ilAccess'];
60 return $this->
__raiseError(
'No valid target given.',
'Client');
64 return $this->
__raiseError(
"Parent with ID $target_id has been deleted.",
'CLIENT_TARGET_DELETED');
68 $allowed_types = array(
'cat',
'grp',
'crs',
'fold',
'root');
69 if (!in_array($target_obj->getType(), $allowed_types)) {
70 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
73 if (!$ilAccess->checkAccess(
'create',
'',
$target_id,
"file")) {
78 include_once
'./Modules/File/classes/class.ilFileXMLParser.php';
79 include_once
'./Modules/File/classes/class.ilFileException.php';
80 include_once
'./Modules/File/classes/class.ilObjFile.php';
86 if ($fileXMLParser->start()) {
91 $ilLog->write(__METHOD__ .
': File type: ' . $file->getFileType());
94 $file->createReference();
99 $fileXMLParser->setFileContents();
102 return $file->getRefId();
104 return $this->
__raiseError(
"Could not add file",
"Server");
static _isInTrash($a_ref_id)
checks wether object is in trash
__raiseError($a_message, $a_code)
Class to report exception.
initAuth($sid)
Init authentication.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
◆ getFileXML()
ilSoapFileAdministration::getFileXML |
( |
|
$sid, |
|
|
|
$ref_id, |
|
|
|
$attachFileContentsMode |
|
) |
| |
get File xml
- Parameters
-
string | $sid | |
int | $ref_id | |
boolean | $attachFileContentsMode | |
- Returns
- xml following ilias_file_x.dtd
Definition at line 202 of file class.ilSoapFileAdministration.php.
References $DIC, $ilLog, $tree, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
207 if (!$this->__checkSession($sid)) {
210 if (!strlen($ref_id)) {
212 'No ref id given. Aborting!',
218 $rbacsystem = $DIC[
'rbacsystem'];
219 $tree = $DIC[
'tree'];
221 $ilAccess = $DIC[
'ilAccess'];
227 'No File found for id: ' . $ref_id,
233 return $this->
__raiseError(
"Object with ID $ref_id has been deleted.",
'Client');
237 $permission_ok =
false;
239 if ($ilAccess->checkAccess(
'read',
'', $ref_id)) {
240 $permission_ok =
true;
245 if (!$permission_ok) {
247 'No permission to edit the object with id: ' . $ref_id,
254 if (!is_object($file) || $file->getType()!=
"file") {
256 'Wrong obj id or type for File with id ' . $ref_id,
261 include_once
'./Modules/File/classes/class.ilFileXMLWriter.php';
265 $xmlWriter->setFile($file);
266 $xmlWriter->setAttachFileContents($attachFileContentsMode);
269 return $xmlWriter->getXML();
static _isInTrash($a_ref_id)
checks wether object is in trash
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
__raiseError($a_message, $a_code)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
initAuth($sid)
Init authentication.
◆ updateFile()
ilSoapFileAdministration::updateFile |
( |
|
$sid, |
|
|
|
$ref_id, |
|
|
|
$file_xml |
|
) |
| |
update a File with id.
- Parameters
-
string | $session_id | current session |
int | $ref_id | refid id of File in repository |
string | $file_xml | qti xml description of test |
- Returns
- boolean true, if update successful, false otherwise
Definition at line 121 of file class.ilSoapFileAdministration.php.
References $DIC, ilFileException\$ID_MISMATCH, $ilLog, $tree, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
126 if (!$this->__checkSession($sid)) {
131 $rbacsystem = $DIC[
'rbacsystem'];
132 $tree = $DIC[
'tree'];
134 $ilAccess = $DIC[
'ilAccess'];
137 return $this->
__raiseError(
'Cannot perform update since file has been deleted.',
'CLIENT_OBJECT_DELETED');
142 'No File found for id: ' . $ref_id,
148 $permission_ok =
false;
150 if ($ilAccess->checkAccess(
'write',
'', $ref_id)) {
151 $permission_ok =
true;
156 if (!$permission_ok) {
158 'No permission to edit the File with id: ' . $ref_id,
166 if (!is_object($file) || $file->getType()!=
"file") {
168 'Wrong obj id or type for File with id ' . $ref_id,
173 include_once
'./Modules/File/classes/class.ilFileXMLParser.php';
174 include_once
'./Modules/File/classes/class.ilFileException.php';
178 if ($fileXMLParser->start()) {
179 $fileXMLParser->updateFileContents();
181 return $file->update();
185 $exception->getMessage(),
static _isInTrash($a_ref_id)
checks wether object is in trash
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
__raiseError($a_message, $a_code)
Class to report exception.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
initAuth($sid)
Init authentication.
The documentation for this class was generated from the following file: