| 
|   | __construct () | 
|   | 
|   | getSupportedVersions () | 
|   | Get supported versions.  More...
  | 
|   | 
|   | getXmlNamespace (string $a_entity, string $a_schema_version) | 
|   | Get xml namespace.  More...
  | 
|   | 
|   | getXmlRecord (string $a_entity, string $a_version, array $a_set) | 
|   | Get xml record.  More...
  | 
|   | 
|   | readData (string $a_entity, string $a_version, array $a_ids) | 
|   | Read data.  More...
  | 
|   | 
|   | getContainerExportConfig (array $record, string $entity, string $schema_version, string $field, string $value) | 
|   | 
|   | importRecord (string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version) | 
|   | Import record.  More...
  | 
|   | 
|   | __construct () | 
|   | 
|   | init (string $a_entity, string $a_schema_version) | 
|   | Init.  More...
  | 
|   | 
|   | getSupportedVersions () | 
|   | 
|   | readData (string $a_entity, string $a_version, array $a_ids) | 
|   | Read data from DB.  More...
  | 
|   | 
|   | initByExporter (ilXmlExporter $xml_exporter) | 
|   | 
|   | setImportDirectory (string $a_val) | 
|   | 
|   | getImportDirectory () | 
|   | 
|   | setDSPrefix (string $a_val) | 
|   | 
|   | getDSPrefix () | 
|   | 
|   | getDSPrefixString () | 
|   | 
|   | getDirectDataFromQuery (string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true) | 
|   | Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields.  More...
  | 
|   | 
|   | convertToLeadingUpper (string $a_str) | 
|   | Make xyz_abc a XyzAbc string.  More...
  | 
|   | 
|   | getXmlRepresentation (string $a_entity, string $a_schema_version, ?array $a_ids, string $a_field="", bool $a_omit_header=false, bool $a_omit_types=false) | 
|   | Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text"> <ftype name="field_2" type="date"> <ftype name="field_3" type="integer"> </types> <types ...> ...  More...
  | 
|   | 
|   | addRecordsXml (ilXmlWriter $a_writer, array $a_prefixes, string $a_entity, string $a_schema_version, array $a_ids, ?string $a_field="") | 
|   | 
|   | afterXmlRecordWriting (string $a_entity, string $a_version, array $a_set) | 
|   | 
|   | getNamespaces (array &$namespaces, string $a_entity, string $a_schema_version) | 
|   | 
|   | getXmlRecord (string $a_entity, string $a_version, array $a_set) | 
|   | Get xml record for version.  More...
  | 
|   | 
|   | getXmlTypes (string $a_entity, string $a_version) | 
|   | Get xml types.  More...
  | 
|   | 
|   | getXMLEntityName (string $a_entity, string $a_version) | 
|   | Get entity name for xml (may be overwritten)  More...
  | 
|   | 
|   | getXMLEntityTag (string $a_entity, string $a_schema_version) | 
|   | Get entity tag.  More...
  | 
|   | 
|   | setImport (ilSurveyImporter $a_val) | 
|   | 
|   | getImport () | 
|   | 
|   | setCurrentInstallationId (string $a_val) | 
|   | 
|   | getCurrentInstallationId () | 
|   | 
|   | importRecord (string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version) | 
|   | Needs to be overwritten for import use case.  More...
  | 
|   | 
|   | getCollection (array $record, string $entity, string $schema_version, string $field, string $value) | 
|   | 
|   | getContainerExportConfig (array $record, string $entity, string $schema_version, string $field, string $value) | 
|   | 
 | 
|   | getTypes (string $a_entity, string $a_version) | 
|   | Get field types for entity.  More...
  | 
|   | 
|   | getDependencies (string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null) | 
|   | Determine the dependent sets of data.  More...
  | 
|   | 
|   | getTypes (string $a_entity, string $a_version) | 
|   | Get (abstract) types for (abstract) field names.  More...
  | 
|   | 
|   | getXmlNamespace (string $a_entity, string $a_schema_version) | 
|   | 
|   | getExportDirInContainer (string $exp_dir) | 
|   | 
|   | getIRSSContainerExportConfig (StorableResource $source_container, string $source_path, string $target_path="") | 
|   | 
|   | getDependencies (string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null) | 
|   | 
|   | createObjectExportId (string $a_type, string $a_id) | 
|   | Build ilias export id.  More...
  | 
|   | 
|   | parseObjectExportId (string $a_id, ?string $a_fallback_id=null) | 
|   | Parse export id.  More...
  | 
|   | 
|   | stripTags (array $rec, array $omit_keys=[]) | 
|   | 
Style Data set class. 
This class implements the following entities:
- sty: table object_data
 
- sty_setting: table style_setting
 
- sty_char: table style classes
 
- sty_char_title: table style class titles
 
- sty_parameter: table style_parameter
 
- sty_color: table style colors
 
- sty_template: table style_template
 
- sty_template_class: table style_template_class
 
- sty_media_query: table sty_media_query
 
- sty_usage: table style_usage
 
- object_style: this is a special entity which allows to export using the ID of the consuming object (e.g. wiki) the "sty" entity will be detemined and exported afterwards (if a non global style has been assigned)
 
- Author
 - Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e 
 
Definition at line 44 of file class.ilStyleDataSet.php.
 
      
        
          | ilStyleDataSet::importRecord  | 
          ( | 
          string  | 
          $a_entity,  | 
        
        
           | 
           | 
          array  | 
          $a_types,  | 
        
        
           | 
           | 
          array  | 
          $a_rec,  | 
        
        
           | 
           | 
          ilImportMapping  | 
          $a_mapping,  | 
        
        
           | 
           | 
          string  | 
          $a_schema_version  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Import record. 
- Parameters
 - 
  
  
 
Definition at line 509 of file class.ilStyleDataSet.php.
References $DIC, $service, ilImportMapping\addMapping(), ilDataSet\getImportDirectory(), ilObjectFactory\getInstanceByObjId(), ilImportMapping\getMapping(), ILIAS\Repository\int(), ilDataSet\stripTags(), ILIAS\Repository\user(), ilObjStyleSheet\writeOwner(), and ilObjStyleSheet\writeStyleUsage().
  512         $service = $DIC->contentStyle()->internal();
   513         $access_manager = 
$service->domain()->access(
   517         $access_manager->enableWrite(
true);
   519         $style_id = (isset($this->current_obj))
   520             ? $this->current_obj->getId()
   522         $characteristic_manager = 
$service->domain()->characteristic(
   527         $color_manager = 
$service->domain()->color(
   535                 $this->log->debug(
"Entity: " . $a_entity);
   536                 if ($new_id = $a_mapping->
getMapping(
'components/ILIAS/Container', 
'objs', $a_rec[
'Id'])) {
   540                     $newObj->create(0, 
true);
   543                 $newObj->setTitle($a_rec[
"Title"]);
   544                 $newObj->setDescription($a_rec[
"Description"]);
   545                 $newObj->update(
true);
   547                 $this->current_obj = $newObj;
   548                 $a_mapping->
addMapping(
"components/ILIAS/Style", 
"sty", $a_rec[
"Id"], $newObj->getId());
   549                 $a_mapping->
addMapping(
"components/ILIAS/ILIASObject", 
"obj", $a_rec[
"Id"], $newObj->getId());
   550                 $this->log->debug(
"Added mapping Services/Style sty  " . $a_rec[
"Id"] . 
" > " . $newObj->getId());
   553                 $dir = str_replace(
"..", 
"", $a_rec[
"ImagesDir"] ?? 
"");
   556                     $sm = $this->style_domain->style($newObj->getId());
   557                     $sm->createContainerFromLocalDir($source_dir, 
"images", 
false);
   560                 $dir = str_replace(
"..", 
"", ($a_rec[
"StyleContainer"] ?? 
""));
   563                     if (is_dir($source_dir)) {
   564                         $sm = $this->style_domain->style($newObj->getId());
   565                         $sm->createContainerFromLocalDir($source_dir, 
"images", 
false);
   571                 $this->current_obj->writeStyleSetting($a_rec[
"Name"], $a_rec[
"Value"]);
   575                 $this->current_obj->addCharacteristic($a_rec[
"Type"], $a_rec[
"Characteristic"], $a_rec[
"Hide"], (
int) ($a_rec[
"OrderNr"] ?? 0), (
bool) ($a_rec[
"Outdated"] ?? 
false));
   578             case "sty_char_title":
   579                 $char_repo = $this->repo->characteristic();
   580                 $char_repo->addTitle(
   581                     $this->current_obj->getId(),
   583                     $a_rec[
"Characteristic"],
   589             case "sty_parameter":
   590                 $mq_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Style", 
"media_query", $a_rec[
"MqId"]);
   591                 $characteristic_manager->replaceParameter($a_rec[
"Tag"], $a_rec[
"Class"], $a_rec[
"Parameter"], $a_rec[
"Value"], $a_rec[
"Type"], $mq_id, $a_rec[
"Custom"]);
   595                 $color_manager->addColor($a_rec[
"ColorName"], $a_rec[
"ColorCode"]);
   598             case "sty_media_query":
   599                 $mq_id = $this->current_obj->addMediaQuery($a_rec[
"MQuery"], $a_rec[
"OrderNr"]);
   600                 $a_mapping->
addMapping(
"components/ILIAS/Style", 
"media_query", $a_rec[
"Id"], $mq_id);
   604                 $tid = $this->current_obj->addTemplate($a_rec[
"TempType"], $a_rec[
"Name"], array());
   605                 $a_mapping->
addMapping(
"components/ILIAS/Style", 
"template", $a_rec[
"Id"], $tid);
   608             case "sty_template_class":
   609                 $tid = (
int) $a_mapping->
getMapping(
"components/ILIAS/Style", 
"template", $a_rec[
"TemplateId"]);
   610                 $this->current_obj->addTemplateClass($tid, $a_rec[
"ClassType"], $a_rec[
"Class"]);
   614                 $obj_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/ILIASObject", 
"obj", $a_rec[
"ObjId"]);
   615                 $style_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Style", 
"sty", $a_rec[
"StyleId"]);
   616                 if ($obj_id > 0 && $style_id > 0) {
 
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
 
static writeOwner($obj_id, $style_id)
 
getMapping(string $a_comp, string $a_entity, string $a_old_id)
 
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id 
 
static writeStyleUsage(int $a_obj_id, int $a_style_id)
Write style usage. 
 
stripTags(array $rec, array $omit_keys=[])