ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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
 

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

Reimplemented from ilXmlExporter.

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

116 {
117 return array (
118 "4.3.0" => array(
119 "namespace" => "http://www.ilias.de/Modules/Category/cat/4_3",
120 "xsd_file" => "ilias_cat_4_3.xsd",
121 "uses_dataset" => false,
122 "min" => "4.3.0",
123 "max" => "")
124 );
125 }

◆ 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"

Reimplemented from ilXmlExporter.

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

23 {
24 include_once './Services/Export/classes/class.ilExportOptions.php';
26
27 $obj_id = end($a_ids);
28
29
30 $GLOBALS['ilLog']->write(__METHOD__.': '.$obj_id);
31 if($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id)
32 {
33 return array();
34 }
35
36 if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
37 {
38 return array(
39 array(
40 'component' => 'Services/Container',
41 'entity' => 'struct',
42 'ids' => $a_ids
43 )
44 );
45 }
46 return array();
47 }
static getInstance()
Get singelton instance.
$GLOBALS['ct_recipient']

References $GLOBALS, ilExportOptions\getInstance(), and ilExportOptions\KEY_ROOT.

+ Here is the call graph for this function:

◆ 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"

Reimplemented from ilXmlExporter.

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

58 {
59 if ($a_entity == "cat")
60 {
61 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
62 $tax_ids = array();
63 foreach ($a_ids as $id)
64 {
66 if (count($t_ids) > 0)
67 {
68 $tax_ids[$t_ids[0]] = $t_ids[0];
69 }
70 }
71
72 return array (
73 array(
74 "component" => "Services/Taxonomy",
75 "entity" => "tax",
76 "ids" => $tax_ids)
77 );
78 }
79 return array();
80 }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.

References ilObjTaxonomy\getUsageOfObject().

+ 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

Reimplemented from ilXmlExporter.

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

90 {
91 $cat_ref_id = end(ilObject::_getAllReferences($a_id));
92 $category = ilObjectFactory::getInstanceByRefId($cat_ref_id,false);
93
94 if(!$category instanceof ilObjCategory)
95 {
96 $GLOBALS['ilLog']->write(__METHOD__. $a_id . ' is not instance of type category!');
97 return '';
98 }
99
100 include_once './Modules/Category/classes/class.ilCategoryXmlWriter.php';
101
102 $writer = new ilCategoryXmlWriter($category);
103 $writer->setMode(ilCategoryXmlWriter::MODE_EXPORT);
104 $writer->export(false);
105 return $writer->getXml();
106 }
Class for category export.
Class ilObjCategory.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _getAllReferences($a_id)
get all reference ids of object

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

+ Here is the call graph for this function:

◆ init()

ilCategoryExporter::init ( )

Init method.

Reimplemented from ilXmlExporter.

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

130 {
131
132 }

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