00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00033 include_once './webservice/soap/classes/class.ilSoapAdministration.php';
00034
00035 class ilSoapObjectAdministration extends ilSoapAdministration
00036 {
00037 function ilSoapObjectAdministration()
00038 {
00039 parent::ilSoapAdministration();
00040 }
00041
00042 function getObjIdByImportId($sid,$import_id)
00043 {
00044 if(!$this->__checkSession($sid))
00045 {
00046 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00047 }
00048 if(!$import_id)
00049 {
00050 return $this->__raiseError('No import id given.',
00051 'Client');
00052 }
00053
00054
00055 include_once './include/inc.header.php';
00056 global $ilLog;
00057
00058 $obj_id = ilObject::_lookupObjIdByImportId($import_id);
00059 $ilLog->write("SOAP getObjIdByImportId(): import_id = ".$import_id.' obj_id = '.$obj_id);
00060
00061 return $obj_id ? $obj_id : "0";
00062 }
00063
00064 function getRefIdsByImportId($sid,$import_id)
00065 {
00066 global $tree;
00067
00068 if(!$this->__checkSession($sid))
00069 {
00070 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00071 }
00072 if(!$import_id)
00073 {
00074 return $this->__raiseError('No import id given.',
00075 'Client');
00076 }
00077
00078
00079 include_once './include/inc.header.php';
00080 global $tree;
00081
00082 $obj_id = ilObject::_lookupObjIdByImportId($import_id);
00083
00084
00085 $ref_ids = ilObject::_getAllReferences($obj_id);
00086
00087 foreach($ref_ids as $ref_id)
00088 {
00089
00090 if ($tree->isInTree($ref_id))
00091 {
00092 $new_refs[] = $ref_id;
00093 }
00094 }
00095 return $new_refs ? $new_refs : array();
00096 }
00097
00098 function getRefIdsByObjId($sid,$obj_id)
00099 {
00100 if(!$this->__checkSession($sid))
00101 {
00102 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00103 }
00104 if(!$obj_id)
00105 {
00106 return $this->__raiseError('No object id given.',
00107 'Client');
00108 }
00109
00110
00111 include_once './include/inc.header.php';
00112
00113 $ref_ids = ilObject::_getAllReferences($obj_id);
00114 foreach($ref_ids as $ref_id)
00115 {
00116 $new_refs[] = $ref_id;
00117 }
00118 return $new_refs ? $new_refs : array();
00119 }
00120
00121
00122 function getObjectByReference($sid,$a_ref_id,$user_id)
00123 {
00124 if(!$this->__checkSession($sid))
00125 {
00126 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00127 }
00128 if(!is_numeric($a_ref_id))
00129 {
00130 return $this->__raiseError('No valid reference id given. Please choose an existing reference id of an ILIAS object',
00131 'Client');
00132 }
00133
00134
00135 include_once './include/inc.header.php';
00136
00137 if(!$tmp_obj = ilObjectFactory::getInstanceByRefId($a_ref_id,false))
00138 {
00139 return $this->__raiseError('Cannot create object instance!','Server');
00140 }
00141
00142
00143 if(ilObject::_isInTrash($a_ref_id))
00144 {
00145 return $this->__raiseError("Object with ID $a_ref_id has been deleted.", 'Client');
00146 }
00147
00148 include_once './webservice/soap/classes/class.ilObjectXMLWriter.php';
00149
00150 $xml_writer = new ilObjectXMLWriter();
00151 if($user_id)
00152 {
00153 $xml_writer->setUserId($user_id);
00154 $xml_writer->enableOperations(true);
00155 }
00156 $xml_writer->setObjects(array($tmp_obj));
00157 if($xml_writer->start())
00158 {
00159 return $xml_writer->getXML();
00160 }
00161
00162 return $this->__raiseError('Cannot create object xml !','Server');
00163 }
00164
00165 function getObjectsByTitle($sid,$a_title,$user_id)
00166 {
00167 if(!$this->__checkSession($sid))
00168 {
00169 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00170 }
00171 if(!strlen($a_title))
00172 {
00173 return $this->__raiseError('No valid query string given.',
00174 'Client');
00175 }
00176
00177
00178 include_once './include/inc.header.php';
00179
00180 include_once './Services/Search/classes/class.ilQueryParser.php';
00181
00182 $query_parser =& new ilQueryParser($a_title);
00183 $query_parser->setMinWordLength(0);
00184 $query_parser->setCombination(QP_COMBINATION_AND);
00185 $query_parser->parse();
00186 if(!$query_parser->validate())
00187 {
00188 return $this->__raiseError($query_parser->getMessage(),
00189 'Client');
00190 }
00191
00192 include_once './Services/Search/classes/class.ilObjectSearchFactory.php';
00193
00194 $object_search =& ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
00195 $object_search->setFields(array('title'));
00196 $object_search->appendToFilter('role');
00197 $object_search->appendToFilter('rolt');
00198 $res =& $object_search->performSearch();
00199 if($user_id)
00200 {
00201 $res->setUserId($user_id);
00202 }
00203
00204 $res->filter(ROOT_FOLDER_ID,true);
00205
00206 $objs = array();
00207 foreach($res->getUniqueResults() as $entry)
00208 {
00209 $objs[] = ilObjectFactory::getInstanceByObjId($entry['obj_id'],false);
00210 }
00211 if(!count($objs))
00212 {
00213 return '';
00214 }
00215
00216 include_once './webservice/soap/classes/class.ilObjectXMLWriter.php';
00217
00218 $xml_writer = new ilObjectXMLWriter();
00219 if($user_id)
00220 {
00221 $xml_writer->setUserId($user_id);
00222 $xml_writer->enableOperations(true);
00223 }
00224 $xml_writer->setObjects($objs);
00225 if($xml_writer->start())
00226 {
00227 return $xml_writer->getXML();
00228 }
00229
00230 return $this->__raiseError('Cannot create object xml !','Server');
00231 }
00232
00233 function searchObjects($sid,$types,$key,$combination,$user_id)
00234 {
00235 if(!$this->__checkSession($sid))
00236 {
00237 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00238 }
00239 if(!is_array($types))
00240 {
00241 return $this->__raiseError('Types must be an array of object types.',
00242 'Client');
00243 }
00244 if($combination != 'and' and $combination != 'or')
00245 {
00246 return $this->__raiseError('No valid combination given. Must be "and" or "or".',
00247 'Client');
00248 }
00249
00250
00251
00252 include_once './include/inc.header.php';
00253
00254 include_once './Services/Search/classes/class.ilQueryParser.php';
00255
00256 $query_parser =& new ilQueryParser($key);
00257 $query_parser->setMinWordLength(3);
00258 $query_parser->setCombination($combination == 'and' ? QP_COMBINATION_AND : QP_COMBINATION_OR);
00259 $query_parser->parse();
00260 if(!$query_parser->validate())
00261 {
00262 return $this->__raiseError($query_parser->getMessage(),
00263 'Client');
00264 }
00265
00266 include_once './Services/Search/classes/class.ilObjectSearchFactory.php';
00267
00268 $object_search =& ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
00269 $object_search->setFilter($types);
00270
00271 $res =& $object_search->performSearch();
00272 if($user_id)
00273 {
00274 $res->setUserId($user_id);
00275 }
00276 $res->filter(ROOT_FOLDER_ID,$combination == 'and' ? true : false);
00277
00278
00279
00280 $counter = 0;
00281 $objs = array();
00282 foreach($res->getUniqueResults() as $entry)
00283 {
00284 if(++$counter == 30)
00285 {
00286 break;
00287 }
00288 $objs[] = ilObjectFactory::getInstanceByObjId($entry['obj_id'],false);
00289 }
00290 if(!count($objs))
00291 {
00292 return '';
00293 }
00294
00295 include_once './webservice/soap/classes/class.ilObjectXMLWriter.php';
00296
00297 $xml_writer = new ilObjectXMLWriter();
00298
00299 if($user_id)
00300 {
00301 $xml_writer->setUserId($user_id);
00302 $xml_writer->enableOperations(true);
00303 }
00304 $xml_writer->setObjects($objs);
00305 if($xml_writer->start())
00306 {
00307 return $xml_writer->getXML();
00308 }
00309
00310 return $this->__raiseError('Cannot create object xml !','Server');
00311 }
00312
00313 function getTreeChilds($sid,$ref_id,$types,$user_id)
00314 {
00315 $all = false;
00316
00317 if(!$this->__checkSession($sid))
00318 {
00319 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00320 }
00321
00322
00323 include_once './include/inc.header.php';
00324 global $tree;
00325
00326 if(!$target_obj =& ilObjectFactory::getInstanceByRefId($ref_id,false))
00327 {
00328 return $this->__raiseError('No valid reference id given.',
00329 'Client');
00330 }
00331 if (intval($ref_id) == SYSTEM_FOLDER_ID) {
00332 return $this->__raiseError('No valid reference id given.',
00333 'Client');
00334 }
00335
00336 if(!$types)
00337 {
00338 $all = true;
00339 }
00340 $filter = is_array($types) ? $types : array();
00341
00342 foreach($tree->getChilds($ref_id,'title') as $child)
00343 {
00344 if($all or in_array($child['type'],$types))
00345 {
00346 if($tmp = ilObjectFactory::getInstanceByRefId($child['ref_id'],false))
00347 {
00348 $objs[] = $tmp;
00349 }
00350 }
00351 }
00352
00353 if(!$objs)
00354 {
00355 return '';
00356 }
00357
00358 include_once './webservice/soap/classes/class.ilObjectXMLWriter.php';
00359
00360 $xml_writer = new ilObjectXMLWriter();
00361 $xml_writer->setObjects($objs);
00362 $xml_writer->enableOperations(true);
00363 if($user_id)
00364 {
00365 $xml_writer->setUserId($user_id);
00366 }
00367
00368 if($xml_writer->start())
00369 {
00370 return $xml_writer->getXML();
00371 }
00372
00373 return $this->__raiseError('Cannot create object xml !','Server');
00374 }
00375
00376 function getXMLTree($sid,$ref_id,$types,$user_id) {
00377
00378 if(!$this->__checkSession($sid))
00379 {
00380 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00381 }
00382
00383 include_once './include/inc.header.php';
00384
00385 global $tree;
00386
00387 $nodedata = $tree->getNodeData($ref_id);
00388
00389 $nodearray = $tree->getSubTree($nodedata);
00390
00391 $filter = is_array($types) ? $types : array("0" => "root","adm","lngf","mail",
00392 "usrf","rolf","taxf","trac","pays",
00393 "auth","chac","objf","recf","assf",
00394 "stys","seas","extt");
00395
00396 foreach($nodearray as $node) {
00397 if (!in_array($node['type'], $filter)) {
00398 if ($tmp = ilObjectFactory::getInstanceByRefId($node['ref_id'],false)) {
00399 $nodes[] = $tmp;
00400 }
00401 }
00402 }
00403
00404
00405 include_once './webservice/soap/classes/class.ilObjectXMLWriter.php';
00406
00407 $xml_writer = new ilObjectXMLWriter();
00408 $xml_writer->setObjects($nodes);
00409 $xml_writer->enableOperations(false);
00410
00411 if($user_id)
00412 {
00413 $xml_writer->setUserId($user_id);
00414 }
00415
00416 if($xml_writer->start())
00417 {
00418 return $xml_writer->getXML();
00419 }
00420
00421 return $this->__raiseError('Cannot create object xml !','Server');
00422 }
00423
00424
00425 function addObject($sid,$a_target_id,$a_xml)
00426 {
00427 if(!$this->__checkSession($sid))
00428 {
00429 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00430 }
00431 if(!strlen($a_xml))
00432 {
00433 return $this->__raiseError('No valid xml string given.',
00434 'Client');
00435 }
00436
00437
00438 include_once './include/inc.header.php';
00439 global $rbacsystem, $objDefinition,$ilUser;
00440
00441 if(!$target_obj =& ilObjectFactory::getInstanceByRefId($a_target_id,false))
00442 {
00443 return $this->__raiseError('No valid target given.',
00444 'Client');
00445 }
00446
00447 if(ilObject::_isInTrash($a_target_id))
00448 {
00449 return $this->__raiseError("Parent with ID $a_target_id has been deleted.", 'Client');
00450 }
00451
00452 $allowed_types = array('root','cat','grp','crs','fold');
00453 if(!in_array($target_obj->getType(),$allowed_types))
00454 {
00455 return $this->__raiseError('No valid target type. Target must be reference id of "course, group, category or folder"',
00456 'Client');
00457 }
00458
00459 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
00460
00461 foreach($allowed_subtypes as $row)
00462 {
00463 if($row['name'] != 'rolf')
00464 {
00465 $allowed[] = $row['name'];
00466 }
00467 }
00468
00469 include_once './webservice/soap/classes/class.ilObjectXMLParser.php';
00470
00471 $xml_parser =& new ilObjectXMLParser($a_xml);
00472 $xml_parser->startParsing();
00473
00474 foreach($xml_parser->getObjectData() as $object_data)
00475 {
00476
00477 if(!in_array($object_data['type'],$allowed))
00478 {
00479 return $this->__raiseError('Objects of type: '.$object_data['type'].' are not allowed to be subobjects of type '.
00480 $target_obj->getType().'!',
00481 'Client');
00482 }
00483 if(!$rbacsystem->checkAccess('create',$a_target_id,$object_data['type']))
00484 {
00485 return $this->__raiseError('No permission to create objects of type '.$object_data['type'].'!',
00486 'Client');
00487 }
00488 if($object_data['type'] == 'crs')
00489 {
00490 return $this->__raiseError('Cannot create course objects. Use method addCourse() ',
00491 'Client');
00492 }
00493
00494
00495 if(strlen($object_data['import_id']) and ilObject::_lookupObjIdByImportId($object_data['import_id']))
00496 {
00497 return $this->__raiseError('An object with import id '.$object_data['import_id'].' already exists!',
00498 'Server');
00499 }
00500
00501
00502
00503
00504 switch($object_data['type'])
00505 {
00506 case 'grp':
00507 if(ilUtil::groupNameExists($object_data['title']))
00508 {
00509 return $this->__raiseError('A group with name '.$object_data['title'].' already exists!',
00510 'Client');
00511 }
00512 break;
00513 }
00514
00515
00516
00517 $class_name = $objDefinition->getClassName($object_data['type']);
00518 $module = $objDefinition->getModule($object_data['type']);
00519 $module_dir = ($module == "")
00520 ? ""
00521 : $module."/";
00522
00523 $class_constr = "ilObj".$class_name;
00524 require_once("./".$module_dir."classes/class.ilObj".$class_name.".php");
00525
00526 $newObj = new $class_constr();
00527
00528 $newObj->setType($object_data['type']);
00529 if(strlen($object_data['import_id']))
00530 {
00531 $newObj->setImportId($object_data['import_id']);
00532 }
00533 $newObj->setTitle($object_data['title']);
00534 $newObj->setDescription($object_data['description']);
00535 $newObj->create();
00536 $newObj->createReference();
00537 $newObj->putInTree($a_target_id);
00538 $newObj->setPermissions($a_target_id);
00539 $newObj->initDefaultRoles();
00540
00541 switch($object_data['type'])
00542 {
00543 case 'grp':
00544
00545 $newObj->addMember($object_data['owner'] ? $object_data['owner'] : $ilUser->getId(),
00546 $newObj->getDefaultAdminRole());
00547 break;
00548
00549 case 'lm':
00550 case 'dbk':
00551 $newObj->createLMTree();
00552 break;
00553
00554 }
00555
00556 }
00557 $ref_id = $newObj->getRefId();
00558 return $ref_id ? $ref_id : "0";
00559 }
00560
00561 function addReference($sid,$a_source_id,$a_target_id)
00562 {
00563 if(!$this->__checkSession($sid))
00564 {
00565 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00566 }
00567 if(!is_numeric($a_source_id))
00568 {
00569 return $this->__raiseError('No source id given.',
00570 'Client');
00571 }
00572 if(!is_numeric($a_target_id))
00573 {
00574 return $this->__raiseError('No target id given.',
00575 'Client');
00576 }
00577
00578 include_once './include/inc.header.php';
00579 global $objDefinition, $rbacsystem, $tree;
00580
00581 if(!$source_obj =& ilObjectFactory::getInstanceByRefId($a_source_id,false))
00582 {
00583 return $this->__raiseError('No valid source id given.',
00584 'Client');
00585 }
00586 if(!$target_obj =& ilObjectFactory::getInstanceByRefId($a_target_id,false))
00587 {
00588 return $this->__raiseError('No valid target id given.',
00589 'Client');
00590 }
00591
00592 if(!$objDefinition->allowLink($source_obj->getType()))
00593 {
00594 return $this->__raiseError('Linking of object type: '.$source_obj->getType().' is not allowed',
00595 'Client');
00596 }
00597
00598 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
00599 foreach($allowed_subtypes as $row)
00600 {
00601 if($row['name'] != 'rolf')
00602 {
00603 $allowed[] = $row['name'];
00604 }
00605 }
00606 if(!in_array($source_obj->getType(),$allowed))
00607 {
00608 return $this->__raiseError('Objects of type: '.$source_obj->getType().' are not allowed to be subobjects of type '.
00609 $target_obj->getType().'!',
00610 'Client');
00611 }
00612
00613
00614 if(!$rbacsystem->checkAccess('create',$target_obj->getRefId(),$source_obj->getType()))
00615 {
00616 return $this->__raiseError('No permission to create objects of type '.$source_obj->getType().'!',
00617 'Client');
00618 }
00619 if(!$rbacsystem->checkAccess('delete',$source_obj->getRefId()))
00620 {
00621 return $this->__raiseError('No permission to link object with id: '.$source_obj->getRefId().'!',
00622 'Client');
00623 }
00624
00625 $possibleChilds = $tree->getChildsByType($target_obj->getRefId(), $source_obj->getType());
00626 foreach ($possibleChilds as $child)
00627 {
00628 if ($child["obj_id"] == $source_obj->getId())
00629 return $this->__raiseError("Object already linked to target.","Client");
00630 }
00631
00632
00633
00634 $new_ref_id = $source_obj->createReference();
00635 $source_obj->putInTree($target_obj->getRefId());
00636 $source_obj->setPermissions($target_obj->getRefId());
00637 $source_obj->initDefaultRoles();
00638
00639 return $new_ref_id ? $new_ref_id : "0";
00640 }
00641
00642 function deleteObject($sid,$reference_id)
00643 {
00644 global $tree;
00645
00646 if(!$this->__checkSession($sid))
00647 {
00648 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00649 }
00650 if(!is_numeric($reference_id))
00651 {
00652 return $this->__raiseError('No reference id given.',
00653 'Client');
00654 }
00655 include_once './include/inc.header.php';
00656 global $tree, $rbacsystem, $rbacadmin;
00657
00658 if(!$del_obj =& ilObjectFactory::getInstanceByRefId($reference_id,false))
00659 {
00660 return $this->__raiseError('No valid reference id given.',
00661 'Client');
00662 }
00663 if(!$rbacsystem->checkAccess('delete',$del_obj->getRefId()))
00664 {
00665 return $this->__raiseError('No permission to delete object with id: '.$del_obj->getRefId().'!',
00666 'Client');
00667 }
00668
00669
00670 $subnodes = $tree->getSubtree($tree->getNodeData($reference_id));
00671
00672 foreach($subnodes as $subnode)
00673 {
00674 $rbacadmin->revokePermission($subnode["child"]);
00675
00676 $affected_users = ilUtil::removeItemFromDesktops($subnode["child"]);
00677 }
00678
00679 $tree->saveSubTree($reference_id);
00680 $tree->deleteTree($tree->getNodeData($reference_id));
00681
00682 return true;
00683 }
00684
00685 function removeFromSystemByImportId($sid,$import_id)
00686 {
00687 if(!$this->__checkSession($sid))
00688 {
00689 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00690 }
00691 if(!strlen($import_id))
00692 {
00693 return $this->__raiseError('No import id given. Aborting!',
00694 'Client');
00695 }
00696 include_once './include/inc.header.php';
00697 global $rbacsystem, $tree, $ilLog;
00698
00699
00700 if(!$obj_id = ilObject::_lookupObjIdByImportId($import_id))
00701 {
00702 return $this->__raiseError('No object found with import id: '.$import_id,
00703 'Client');
00704 }
00705
00706
00707 $permission_ok = false;
00708 foreach($ref_ids = ilObject::_getAllReferences($obj_id) as $ref_id)
00709 {
00710 if($rbacsystem->checkAccess('delete',$ref_id))
00711 {
00712 $permission_ok = true;
00713 break;
00714 }
00715 }
00716 if(!$permission_ok)
00717 {
00718 return $this->__raiseError('No permission to delete the object with import id: '.$import_id,
00719 'Server');
00720 }
00721
00722
00723 foreach($ref_ids as $ref_id)
00724 {
00725
00726 $node_data = $tree->getNodeData($ref_id);
00727 $subtree_nodes = $tree->getSubtree($node_data);
00728
00729 foreach($subtree_nodes as $node)
00730 {
00731 $ilLog->write('Soap: removeFromSystemByImportId(). Deleting object with title id: '.$node['title']);
00732 $tmp_obj = ilObjectFactory::getInstanceByRefId($node['ref_id']);
00733 if(!is_object($tmp_obj))
00734 {
00735 return $this->__raiseError('Cannot create instance of reference id: '.$node['ref_id'],
00736 'Server');
00737 }
00738 $tmp_obj->delete();
00739 }
00740
00741 $tree->deleteTree($node_data);
00742
00743 }
00744
00745 return true;
00746 }
00747
00748
00749 function updateObjects($sid,$a_xml)
00750 {
00751 if(!$this->__checkSession($sid))
00752 {
00753 return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
00754 }
00755 if(!strlen($a_xml))
00756 {
00757 return $this->__raiseError('No valid xml string given.',
00758 'Client');
00759 }
00760
00761
00762 include_once './include/inc.header.php';
00763 global $rbacreview, $rbacsystem;
00764
00765 include_once './webservice/soap/classes/class.ilObjectXMLParser.php';
00766
00767 $xml_parser =& new ilObjectXMLParser($a_xml);
00768 $xml_parser->startParsing();
00769
00770
00771 foreach($xml_parser->getObjectData() as $object_data)
00772 {
00773 if(!$object_data["obj_id"])
00774 {
00775 return $this->__raiseError('No obj_id in xml found.', 'Client');
00776 }
00777
00778 if($object_data['type'] == 'role')
00779 {
00780 $rolf_ids = $rbacreview->getFoldersAssignedToRole($object_data['obj_id'],true);
00781 $rolf_id = $rolf_ids[0];
00782
00783 if(!$rbacsystem->checkAccess('write',$rolf_id))
00784 {
00785 return $this->__raiseError('No write permission for object with id '.$object_data['obj_id'].'!',
00786 'Client');
00787 }
00788 }
00789 else
00790 {
00791 $permission_ok = false;
00792 foreach(ilObject::_getAllReferences($object_data['obj_id']) as $ref_id)
00793 {
00794 if($rbacsystem->checkAccess('write',$object_data['obj_id']))
00795 {
00796 $permission_ok = true;
00797 break;
00798 }
00799 }
00800 if(!$permission_ok)
00801 {
00802 return $this->__raiseError('No write permission for object with id '.$object_data['obj_id'].'!',
00803 'Client');
00804 }
00805 }
00806
00807
00808
00809 switch($object_data['type'])
00810 {
00811 case 'grp':
00812 if(ilUtil::groupNameExists($object_data['title']))
00813 {
00814 return $this->__raiseError('A group with name '.$object_data['title'].' already exists!',
00815 'Client');
00816 }
00817 break;
00818 }
00819 }
00820
00821
00822 foreach($xml_parser->getObjectData() as $object_data)
00823 {
00824 $tmp_obj = ilObjectFactory::getInstanceByObjId($object_data['obj_id'],false);
00825 $tmp_obj->setTitle($object_data['title']);
00826 $tmp_obj->setDescription($object_data['description']);
00827 if(strlen($object_data['owner']))
00828 {
00829 $tmp_obj->setOwner($object_data['owner']);
00830 }
00831 $tmp_obj->update();
00832 }
00833 return true;
00834
00835 }
00836
00837
00838 }
00839 ?>