ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAdvancedMetaDataExporter Class Reference

Export class for adv md. More...

+ Inheritance diagram for ilAdvancedMetaDataExporter:
+ Collaboration diagram for ilAdvancedMetaDataExporter:

Public Member Functions

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

Private Attributes

 $ds

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
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 $dir_absolute

Detailed Description

Export class for adv md.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:

Definition at line 13 of file class.ilAdvancedMetaDataExporter.php.

Member Function Documentation

ilAdvancedMetaDataExporter::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 118 of file class.ilAdvancedMetaDataExporter.php.

{
return array (
"4.4.0" => array(
"namespace" => "http://www.ilias.de/Services/AdvancedMetaData/advmd/4_4",
"xsd_file" => "ilias_advmd_4_4.xsd",
"uses_dataset" => true,
"min" => "4.4.0",
"max" => "")
);
}
ilAdvancedMetaDataExporter::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 33 of file class.ilAdvancedMetaDataExporter.php.

{
return array();
}
ilAdvancedMetaDataExporter::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 47 of file class.ilAdvancedMetaDataExporter.php.

{
return array();
}
ilAdvancedMetaDataExporter::getXmlRepresentation (   $a_entity,
  $a_schema_version,
  $a_id 
)

Get xml representation.

Parameters
stringentity
stringschema version
stringid
Returns
string xml string

Reimplemented from ilXmlExporter.

Definition at line 60 of file class.ilAdvancedMetaDataExporter.php.

References $query, $row, ilAdvancedMDFieldDefinition\_getDefinitionsByRecordId(), ilAdvancedMDFieldDefinition\_lookupImportId(), and ilXmlWriter\xmlStartTag().

{
global $ilDB;
$parts = explode(":", $a_id);
if(sizeof($parts) != 2)
{
return;
}
$obj_id = $parts[0];
$rec_id = $parts[1];
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
$field_ids = array();
{
$field_ids[] = $def->getFieldId();
}
if(!sizeof($field_ids))
{
return;
}
$xml = new ilXmlWriter;
$xml->xmlStartTag('AdvancedMetaData');
$query = "SELECT field_id,value,sub_id,sub_type".
" FROM adv_md_values ".
" WHERE obj_id = ".$ilDB->quote($a_id, "integer").
" AND ".$ilDB->in("field_id", $field_ids, "", "integer");
$set = $ilDB->query($query);
while($row = $ilDB->fetchAssoc($set))
{
if(trim($row['value']) != "")
{
$xml->xmlElement('Value',
array(
'sub_id' => $row['sub_id'],
'sub_type' => $row['sub_type'],
),
$row['value']);
}
}
$xml->xmlEndTag('AdvancedMetaData');
return $xml->xmlDumpMem(false);
}

+ Here is the call graph for this function:

ilAdvancedMetaDataExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

Definition at line 20 of file class.ilAdvancedMetaDataExporter.php.

{
}

Field Documentation

ilAdvancedMetaDataExporter::$ds
private

Definition at line 15 of file class.ilAdvancedMetaDataExporter.php.


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