3 declare(strict_types=1);
30 protected array
$path = array();
36 $this->manifest_dom = $a_manifest_dom;
37 $path =
new DOMXpath($a_manifest_dom);
38 $path->registerNamespace(
"ims",
"http://www.imsproject.org/xsd/imscp_rootv1p1p2");
39 $items = $path->query(
"//ims:manifest/ims:metadata");
40 if ($items->length == 1) {
41 foreach ($items as
$i) {
44 $this->metadata_found =
true;
69 public function import():
void 71 if ($this->metadata_found) {
83 public function handlerBeginTag($a_xml_parser,
string $a_name, array $a_attribs): void
85 $this->path[] = $a_name;
93 $this->md_in_md =
true;
94 $this->in_meta_data =
true;
99 $this->md_gen = $this->md->addGeneral();
100 $this->md_gen->save();
105 if ($this->
in(
"general")) {
107 $this->md_ide = $par->addIdentifier();
108 $this->md_ide->save();
118 if ($this->
in(
"general")) {
120 $this->md_lan = $par->addLanguage();
121 $this->md_lan->save();
129 if (strtolower(get_class($par)) ===
'ilmdrights' or
130 strtolower(get_class($par)) ===
'ilmdannotation' or
131 strtolower(get_class($par)) ===
'ilmdclassification') {
134 } elseif ($this->
in(
"general")) {
135 $this->md_des = $par->addDescription();
136 $this->md_des->save();
142 if ($this->
in(
"general")) {
144 $this->md_key = $par->addKeyword();
145 $this->md_key->save();
158 $this->md_lif = $par->addLifecycle();
160 $this->md_lif->save();
366 if ($this->
in(
"general")) {
367 if ($this->
in(
"title")) {
370 } elseif ($this->
in(
"description")) {
371 $this->md_des->setDescriptionLanguage(
new ilMDLanguageItem($a_attribs[
'language']));
372 $this->md_des->update();
373 } elseif ($this->
in(
"keyword")) {
374 $this->md_key->setKeywordLanguage(
new ilMDLanguageItem($a_attribs[
'language']));
375 $this->md_key->update();
378 if ($this->
in(
"lifeCycle")) {
379 if ($this->
in(
"version")) {
396 unset($this->path[count($this->path) - 1]);
403 $this->md_parent = array();
404 $this->md_in_md =
false;
405 $this->in_meta_data =
false;
415 if ($this->
in(
"general")) {
427 if ($this->
in(
"general")) {
437 if (strtolower(get_class($par)) ===
'ilmddescription') {
447 if ($this->
in(
"general")) {
634 if ($this->
in(
"general")) {
635 if ($this->
in(
"title")) {
646 if ($this->
in(
"description")) {
653 $this->md_des->update();
655 if ($this->
in(
"keyword")) {
660 if ($this->
in(
"lifeCycle")) {
661 if ($this->
in(
"version")) {
669 if ($this->
in(
"general")) {
670 if ($this->
in(
"structure")) {
672 "atomic" =>
"Atomic",
673 "collection" =>
"Collection",
674 "networked" =>
"Networked",
675 "linear" =>
"Linear",
676 "hierarchical" =>
"Hierarchical" 685 if ($this->
in(
"lifeCycle")) {
686 if ($this->
in(
"status")) {
689 "revised" =>
"Revised",
690 "unavailable" =>
"Unavailable",
695 $this->md_lif->update();
702 if ($this->
in(
"identifier")) {
704 $this->md_ide->update();
709 if ($this->
in(
"identifier")) {
711 $this->md_ide->update();
716 $this->md_chr_data =
'';
719 public function in(
string $a_name): bool
722 if (in_array($a_name, $this->path)) {
handlerEndTag($a_xml_parser, string $a_name)
handler for end of element
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
setDescription(string $a_val)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(\DOMDocument $a_manifest_dom, int $a_obj_id)
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
handler for begin of element
__pushParent(object $md_obj)
__construct(Container $dic, ilPlugin $plugin)
static _lookupType(int $id, bool $reference=false)
DOMDocument $manifest_dom