|
| 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 $file, ilFileException\$ID_MISMATCH, $ilLog, $target_id, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_isInTrash(), array, ilObjectFactory\getInstanceByRefId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
52 if (!$this->__checkSession($sid)) {
55 global $rbacsystem, $tree,
$ilLog, $ilAccess;
58 return $this->
__raiseError(
'No valid target given.',
'Client');
63 return $this->
__raiseError(
"Parent with ID $target_id has been deleted.",
'CLIENT_TARGET_DELETED');
67 $allowed_types =
array(
'cat',
'grp',
'crs',
'fold',
'root');
68 if (!in_array($target_obj->getType(), $allowed_types)) {
69 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
72 if (!$ilAccess->checkAccess(
'create',
'',
$target_id,
"file")) {
77 include_once
'./Modules/File/classes/class.ilFileXMLParser.php';
78 include_once
'./Modules/File/classes/class.ilFileException.php';
79 include_once
'./Modules/File/classes/class.ilObjFile.php';
85 if ($fileXMLParser->start()) {
88 $ilLog->write(__METHOD__ .
': File type: ' .
$file->getFileType());
91 $file->createReference();
96 $fileXMLParser->setFileContents();
99 return $file->getRefId();
101 return $this->
__raiseError(
"Could not add file",
"Server");
static _isInTrash($a_ref_id)
checks wether object is in trash
Exercise XML Parser which completes/updates a given file by an xml string.
__raiseError($a_message, $a_code)
Class to report exception.
Create styles array
The data for the language used.
initAuth($sid)
Init authentication.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ 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 194 of file class.ilSoapFileAdministration.php.
References $file, $ilLog, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
199 if (!$this->__checkSession($sid)) {
202 if (!strlen($ref_id)) {
204 'No ref id given. Aborting!',
208 global $rbacsystem, $tree,
$ilLog, $ilAccess;
214 'No File found for id: ' . $ref_id,
220 return $this->
__raiseError(
"Object with ID $ref_id has been deleted.",
'Client');
224 $permission_ok =
false;
226 if ($ilAccess->checkAccess(
'read',
'', $ref_id)) {
227 $permission_ok =
true;
232 if (!$permission_ok) {
234 'No permission to edit the object with id: ' . $ref_id,
241 if (!is_object(
$file) ||
$file->getType()!=
"file") {
243 'Wrong obj id or type for File with id ' . $ref_id,
248 include_once
'./Modules/File/classes/class.ilFileXMLWriter.php';
252 $xmlWriter->setFile(
$file);
253 $xmlWriter->setAttachFileContents($attachFileContentsMode);
256 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.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ 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 118 of file class.ilSoapFileAdministration.php.
References $file, ilFileException\$ID_MISMATCH, $ilLog, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
123 if (!$this->__checkSession($sid)) {
126 global $rbacsystem, $tree,
$ilLog, $ilAccess;
129 return $this->
__raiseError(
'Cannot perform update since file has been deleted.',
'CLIENT_OBJECT_DELETED');
134 'No File found for id: ' . $ref_id,
140 $permission_ok =
false;
142 if ($ilAccess->checkAccess(
'write',
'', $ref_id)) {
143 $permission_ok =
true;
148 if (!$permission_ok) {
150 'No permission to edit the File with id: ' . $ref_id,
158 if (!is_object(
$file) ||
$file->getType()!=
"file") {
160 'Wrong obj id or type for File with id ' . $ref_id,
165 include_once
'./Modules/File/classes/class.ilFileXMLParser.php';
166 include_once
'./Modules/File/classes/class.ilFileException.php';
170 if ($fileXMLParser->start()) {
171 $fileXMLParser->updateFileContents();
173 return $file->update();
177 $exception->getMessage(),
static _isInTrash($a_ref_id)
checks wether object is in trash
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.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
initAuth($sid)
Init authentication.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
The documentation for this class was generated from the following file: