ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCategoryExporter Class Reference

Class for category export. More...

+ Inheritance diagram for ilCategoryExporter:
+ Collaboration diagram for ilCategoryExporter:

Public Member Functions

 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 init ()
 Init method. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 Constructor. More...
 
 setExport (ilExport $a_exp)
 Set export object. More...
 
 getExport ()
 Get export. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 init ()
 
 setExportDirectories ($a_dir_relative, $a_dir_absolute)
 Export directories. More...
 
 getRelativeExportDirectory ()
 Get relative export directory. More...
 
 getAbsoluteExportDirectory ()
 Get absolute export directory. More...
 
 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion ($a_entity, $a_target_release)
 Determine schema version. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 export directory lookup More...
 
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 
 $exp
 

Detailed Description

Class for category export.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e $Id$

Definition at line 12 of file class.ilCategoryExporter.php.

Member Function Documentation

◆ getValidSchemaVersions()

ilCategoryExporter::getValidSchemaVersions (   $a_entity)

Returns schema versions that the component can export to.

ILIAS chooses the first one, that has min/max constraints which fit to the target release. Please put the newest on top.

Returns

Definition at line 122 of file class.ilCategoryExporter.php.

References array.

123  {
124  return array(
125  "4.3.0" => array(
126  "namespace" => "http://www.ilias.de/Modules/Category/cat/4_3",
127  "xsd_file" => "ilias_cat_4_3.xsd",
128  "uses_dataset" => false,
129  "min" => "4.3.0",
130  "max" => "")
131  );
132  }
Create styles array
The data for the language used.

◆ getXmlExportHeadDependencies()

ilCategoryExporter::getXmlExportHeadDependencies (   $a_entity,
  $a_target_release,
  $a_ids 
)

Get head dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Definition at line 22 of file class.ilCategoryExporter.php.

References array.

23  {
24  // always trigger container because of co-page(s)
25  return array(
26  array(
27  'component' => 'Services/Container',
28  'entity' => 'struct',
29  'ids' => $a_ids
30  )
31  );
32 
33  /*
34  include_once './Services/Export/classes/class.ilExportOptions.php';
35  $eo = ilExportOptions::getInstance();
36 
37  $obj_id = end($a_ids);
38 
39 
40  $GLOBALS['ilLog']->write(__METHOD__.': '.$obj_id);
41  if($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id)
42  {
43  return array();
44  }
45 
46  if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
47  {
48  return array(
49  array(
50  'component' => 'Services/Container',
51  'entity' => 'struct',
52  'ids' => $a_ids
53  )
54  );
55  }
56  return array();
57  */
58  }
Create styles array
The data for the language used.

◆ getXmlExportTailDependencies()

ilCategoryExporter::getXmlExportTailDependencies (   $a_entity,
  $a_target_release,
  $a_ids 
)

Get tail dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Definition at line 68 of file class.ilCategoryExporter.php.

References $id, array, and ilObjTaxonomy\getUsageOfObject().

69  {
70  if ($a_entity == "cat") {
71  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
72  $tax_ids = array();
73  foreach ($a_ids as $id) {
74  $t_ids = ilObjTaxonomy::getUsageOfObject($id);
75  if (count($t_ids) > 0) {
76  $tax_ids[$t_ids[0]] = $t_ids[0];
77  }
78  }
79 
80  return array(
81  array(
82  "component" => "Services/Taxonomy",
83  "entity" => "tax",
84  "ids" => $tax_ids)
85  );
86  }
87  return array();
88  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
if(!array_key_exists('StateId', $_REQUEST)) $id
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getXmlRepresentation()

ilCategoryExporter::getXmlRepresentation (   $a_entity,
  $a_schema_version,
  $a_id 
)

Get xml.

Parameters
object$a_entity
object$a_schema_version
object$a_id
Returns

Definition at line 97 of file class.ilCategoryExporter.php.

References $GLOBALS, ilObject\_getAllReferences(), ilObjectFactory\getInstanceByRefId(), and ilCategoryXmlWriter\MODE_EXPORT.

98  {
99  $cat_ref_id = end(ilObject::_getAllReferences($a_id));
100  $category = ilObjectFactory::getInstanceByRefId($cat_ref_id, false);
101 
102  if (!$category instanceof ilObjCategory) {
103  $GLOBALS['ilLog']->write(__METHOD__ . $a_id . ' is not instance of type category!');
104  return '';
105  }
106 
107  include_once './Modules/Category/classes/class.ilCategoryXmlWriter.php';
108 
109  $writer = new ilCategoryXmlWriter($category);
110  $writer->setMode(ilCategoryXmlWriter::MODE_EXPORT);
111  $writer->export(false);
112  return $writer->getXml();
113  }
Class for category export.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getAllReferences($a_id)
get all reference ids of object
Class ilObjCategory.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:

◆ init()

ilCategoryExporter::init ( )

Init method.

Definition at line 137 of file class.ilCategoryExporter.php.

138  {
139  }

The documentation for this class was generated from the following file: