|
| ilSoapFileAdministration () |
|
| 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...
|
|
| ilSoapAdministration ($use_nusoap=true) |
|
| initErrorWriter () |
| Overwrite error handler. More...
|
|
| __explodeSid ($sid) |
|
| __setMessage ($a_str) |
|
| __getMessage () |
|
| __appendMessage ($a_str) |
|
| __setMessageCode ($a_code) |
|
| __getMessageCode () |
|
| initAuth ($sid) |
|
| 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 51 of file class.ilSoapFileAdministration.php.
References $file, ilFileException\$ID_MISMATCH, $ilLog, $target_id, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_isInTrash(), ilObjectFactory\getInstanceByRefId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
56 if(!$this->__checkSession($sid))
60 global $rbacsystem, $tree,
$ilLog, $ilAccess;
64 return $this->
__raiseError(
'No valid target given.',
'Client');
70 return $this->
__raiseError(
"Parent with ID $target_id has been deleted.",
'CLIENT_TARGET_DELETED');
74 $allowed_types = array(
'cat',
'grp',
'crs',
'fold',
'root');
75 if(!in_array($target_obj->getType(), $allowed_types))
77 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
80 if(!$ilAccess->checkAccess(
'create',
'',
$target_id,
"file"))
86 include_once
'./Modules/File/classes/class.ilFileXMLParser.php';
87 include_once
'./Modules/File/classes/class.ilFileException.php';
88 include_once
'./Modules/File/classes/class.ilObjFile.php';
96 if ($fileXMLParser->start())
100 $ilLog->write(__METHOD__.
': File type: '.
$file->getFileType());
103 $file->createReference();
108 $fileXMLParser->setFileContents();
111 return $file->getRefId();
115 return $this->
__raiseError(
"Could not add file",
"Server");
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Exercise XML Parser which completes/updates a given file by an xml string.
__raiseError($a_message, $a_code)
Class to report exception.
_isInTrash($a_ref_id)
checks wether object is in trash
◆ 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 213 of file class.ilSoapFileAdministration.php.
References $file, $ilLog, $ref_id, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
218 if(!$this->__checkSession($sid))
224 return $this->
__raiseError(
'No ref id given. Aborting!',
227 global $rbacsystem, $tree,
$ilLog, $ilAccess;
239 return $this->
__raiseError(
"Object with ID $ref_id has been deleted.",
'Client');
243 $permission_ok =
false;
246 if($ilAccess->checkAccess(
'read',
'',$ref_id))
248 $permission_ok =
true;
255 return $this->
__raiseError(
'No permission to edit the object with id: '.$ref_id,
261 if (!is_object(
$file) ||
$file->getType()!=
"file")
263 return $this->
__raiseError(
'Wrong obj id or type for File with id '.$ref_id,
267 include_once
'./Modules/File/classes/class.ilFileXMLWriter.php';
271 $xmlWriter->setFile(
$file);
272 $xmlWriter->setAttachFileContents($attachFileContentsMode);
275 return $xmlWriter->getXML();
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
__raiseError($a_message, $a_code)
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
_isInTrash($a_ref_id)
checks wether object is in trash
◆ ilSoapFileAdministration()
ilSoapFileAdministration::ilSoapFileAdministration |
( |
| ) |
|
◆ 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 133 of file class.ilSoapFileAdministration.php.
References $file, ilFileException\$ID_MISMATCH, $ilLog, $ref_id, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
138 if(!$this->__checkSession($sid))
142 global $rbacsystem, $tree,
$ilLog, $ilAccess;
146 return $this->
__raiseError(
'Cannot perform update since file has been deleted.',
'CLIENT_OBJECT_DELETED');
156 $permission_ok =
false;
159 if($ilAccess->checkAccess(
'write',
'',$ref_id))
161 $permission_ok =
true;
168 return $this->
__raiseError(
'No permission to edit the File with id: '.$ref_id,
175 if (!is_object(
$file) ||
$file->getType()!=
"file")
177 return $this->
__raiseError(
'Wrong obj id or type for File with id '.$ref_id,
181 include_once
'./Modules/File/classes/class.ilFileXMLParser.php';
182 include_once
'./Modules/File/classes/class.ilFileException.php';
188 if ($fileXMLParser->start())
190 $fileXMLParser->updateFileContents();
192 return $file->update();
Exercise XML Parser which completes/updates a given file by an xml string.
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.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
_isInTrash($a_ref_id)
checks wether object is in trash
The documentation for this class was generated from the following file: