4 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
20 parent::__construct();
34 if (!$this->__checkSession($sid)) {
37 if (!strlen($ref_id)) {
39 'No ref id given. Aborting!',
45 $rbacsystem = $DIC[
'rbacsystem'];
52 'No weblink found for id: ' . $ref_id,
58 return $this->
__raiseError(
"Parent with ID $ref_id has been deleted.",
'Client');
62 $permission_ok =
false;
63 $write_permission_ok =
false;
65 if ($rbacsystem->checkAccess(
'edit', $ref_id)) {
66 $write_permission_ok =
true;
69 if ($rbacsystem->checkAccess(
'read', $ref_id)) {
70 $permission_ok =
true;
75 if (!$permission_ok && !$write_permission_ok) {
77 'No permission to edit the object with id: ' . $ref_id,
83 include_once
'./Modules/WebResource/classes/class.ilWebLinkXmlWriter.php';
85 $writer->setObjId($obj_id);
88 return $writer->xmlDumpMem(
true);
108 if (!$this->__checkSession($sid)) {
113 $rbacsystem = $DIC[
'rbacsystem'];
114 $tree = $DIC[
'tree'];
118 return $this->
__raiseError(
'No valid target given.',
'Client');
122 return $this->
__raiseError(
"Parent with ID $target_id has been deleted.",
'CLIENT_OBJECT_DELETED');
127 $allowed_types = array(
'cat',
'grp',
'crs',
'fold',
'root');
128 if (!in_array($target_obj->getType(), $allowed_types)) {
129 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, root, category or folder"',
'Client');
132 if (!$rbacsystem->checkAccess(
'create',
$target_id,
"webr")) {
138 include_once
'./Modules/WebResource/classes/class.ilObjLinkResource.php';
139 include_once
'./Modules/WebResource/classes/class.ilWebLinkXmlParser.php';
142 $webl->setTitle(
'XML Import');
144 $webl->createReference();
154 }
catch (ilWebLinkXMLParserException $e) {
159 return $webl->getRefId();
176 if (!$this->__checkSession($sid)) {
181 $rbacsystem = $DIC[
'rbacsystem'];
182 $tree = $DIC[
'tree'];
186 return $this->
__raiseError(
'Cannot perform update since weblink has been deleted.',
'CLIENT_OBJECT_DELETED');
191 'No weblink found for id: ' . $ref_id,
192 'CLIENT_OBJECT_NOT_FOUND' 197 $permission_ok =
false;
199 if ($rbacsystem->checkAccess(
'edit', $ref_id)) {
200 $permission_ok =
true;
205 if (!$permission_ok) {
207 'No permission to edit the weblink with id: ' . $ref_id,
213 if (!is_object($webl)
or $webl->getType()!=
"webr") {
215 'Wrong obj id or type for weblink with id ' . $ref_id,
221 include_once
'./Modules/WebResource/classes/class.ilWebLinkXmlParser.php';
227 }
catch (ilWebLinkXMLParserException $e) {
XML parser for weblink xml.
__construct()
Constructor.
updateWebLink($sid, $ref_id, $weblink_xml)
update a weblink with id.
static _isInTrash($a_ref_id)
checks wether object is in trash
SaxParserException thrown by ilSaxParser if property throwException is set.
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
Soap methods for adminstrating web links.
__raiseError($a_message, $a_code)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
createWebLink($sid, $target_id, $weblink_xml)
add an exercise with id.
initAuth($sid)
Init authentication.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
readWebLink($sid, $ref_id)
Get Weblink xml.