/**
  * Write webresource xml
  * @param ilXmlWriter $writer
  * @return 
  */
 public function toXML(ilXmlWriter $writer)
 {
     $attribs = array("obj_id" => "il_" . IL_INST_ID . "_webr_" . $this->getId());
     $writer->xmlStartTag('WebLinks', $attribs);
     // LOM MetaData
     include_once 'Services/MetaData/classes/class.ilMD2XML.php';
     $md2xml = new ilMD2XML($this->getId(), $this->getId(), 'webr');
     $md2xml->startExport();
     $writer->appendXML($md2xml->getXML());
     // Sorting
     include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
     switch (ilContainerSortingSettings::_lookupSortMode($this->getId())) {
         case ilContainer::SORT_MANUAL:
             $writer->xmlElement('Sorting', array('type' => 'Manual'));
             break;
         case ilContainer::SORT_TITLE:
         default:
             $writer->xmlElement('Sorting', array('type' => 'Title'));
             break;
     }
     // All links
     include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
     $links = new ilLinkResourceItems($this->getId());
     $links->toXML($writer);
     $writer->xmlEndTag('WebLinks');
     return true;
 }
 /**
  * Write xml of template action
  * @param ilXmlWriter $writer
  */
 public function toXml(ilXmlWriter $writer)
 {
     $writer->xmlStartTag('localRoleAction');
     $il_id = 'il_' . IL_INST_ID . '_' . ilObject::_lookupType($this->getRoleTemplateId()) . '_' . $this->getRoleTemplateId();
     $writer->xmlStartTag('roleTemplate', array('id' => $il_id));
     include_once './Services/AccessControl/classes/class.ilRoleXmlExport.php';
     $exp = new ilRoleXmlExport();
     $exp->setMode(ilRoleXmlExport::MODE_DTPL);
     $exp->addRole($this->getRoleTemplateId(), ROLE_FOLDER_ID);
     $exp->write();
     $writer->appendXML($exp->xmlDumpMem(FALSE));
     $writer->xmlEndTag('roleTemplate');
     $writer->xmlEndTag('localRoleAction');
 }