24require_once (
"Services/MetaData/classes/class.ilMDLanguageItem.php");
60 $this->
ilias =& $ilias;
62 $this->import_id = array();
64 $this->language = array();
65 $this->description = array();
66 $this->keyword = array();
67 $this->technicals = array();
69 $this->structure =
"";
74 $this->
setID($this->content_obj->getId());
88 $this->bibliography_attr = $a_data;
100 $this->
abstract = $a_data;
112 $this->bib_item_data[$a_bib_item_nr][
"$a_key"] = $a_value;
126 $this->bib_item_data[$a_bib_item_nr][
"$a_key"] = array_merge($this->bib_item_data[$a_bib_item_nr][
"$a_key"],array($a_value));
132 return $this->bib_item_data;
142 return $this->bibliography_attr ? $this->bibliography_attr : array();
191 $this->xml = $this->nested_obj->export($this->content_obj->getId(),
"bib");
205 $this->encoding = $a_encoding;
234 include_once(
"./Services/Xml/classes/class.ilNestedSetXML.php");
237 $this->nested_obj->init($this->
getID(),
"bib");
239 return $this->nested_obj->initDom();
244 if ($a_booktitle ==
"")
246 $a_booktitle =
"NO TITLE";
249 $this->booktitle = $a_booktitle;
254 return $this->booktitle;
259 $this->edition = $a_edition;
264 return $this->edition;
269 $this->publisher = $a_publisher;
274 return $this->publisher;
279 $this->year = $a_year;
292 $this->meta = $a_data;
317 $this->type = $a_type;
331 $this->$a_name = $a_data;
345 $p =
"//Bibliography";
350 $nodes = $this->nested_obj->getDomContent($p, $a_name, $a_index);
361 return $this->$a_name;
368 $bibData = $this->
create();
372 $bibData[
"booktitle"] = $this->nested_obj->getFirstDomContent(
"//Bibliography/BibItem/Booktitle");
373 $bibData[
"edition"] = $this->nested_obj->getFirstDomContent(
"//Bibliography/BibItem/Edition");
374 $bibData[
"publisher"] = $this->nested_obj->getFirstDomContent(
"//Bibliography/BibItem/Publisher");
375 $bibData[
"year"] = $this->nested_obj->getFirstDomContent(
"//Bibliography/BibItem/Year");
381 $this->
setYear($bibData[
"year"]);
397 $bibData[
"booktitle"] =
"NO TITLE";
399 $bibData[
"edition"] =
"N/A";
400 $bibData[
"publisher"] =
"";
401 $bibData[
"year"] =
"N/A";
405 <BibItem Type="" Label="">
406 <Identifier Catalog="ILIAS" Entry="il__' . $this->
getType() .
'_' . $this->
getID() .
'"></Identifier>
407 <Language Language="' . $this->
ilias->account->getLanguage() .
'"></Language>
408 <Booktitle Language="' . $this->
ilias->account->getLanguage() .
'">'. $bibData[
"booktitle"] .
'</Booktitle>
409 <Edition>'. $bibData[
"edition"] .
'</Edition>
410 <HowPublished Type=""></HowPublished>
411 <Publisher>'. $bibData[
"publisher"] .
'</Publisher>
412 <Year>'. $bibData[
"year"] .
'</Year>
417 $this->nested_obj->import(
$xml, $this->
getID(),
"bib");
425 function delete($a_name, $a_path, $a_index)
434 $p =
"//Bibliography";
439 $this->nested_obj->deleteDomNode($p, $a_name, $a_index);
440 $this->nested_obj->updateFromDom();
447 function add($a_name, $a_path, $a_index = 0)
454 $p =
"//Bibliography";
459 $attributes = array();
460# echo "Index: " . $a_index . " | Path: " . $p . " | Name: " . $a_name . "<br>\n";
463 case "BibItem" :
$xml =
'
464 <BibItem Type="" Label="">
465 <Identifier Catalog="ILIAS" Entry="il__' . $this->
getType() .
'_' . $this->
getID() .
'"></Identifier>
466 <Language Language="' . $this->
ilias->account->getLanguage() .
'"></Language>
467 <Booktitle Language="' . $this->
ilias->account->getLanguage() .
'">NO TITLE</Booktitle>
468 <Edition>N/A</Edition>
469 <HowPublished Type=""></HowPublished>
470 <Publisher></Publisher>
475 $this->nested_obj->addXMLNode($p,
$xml, $a_index);
477 case "Identifier" : $value =
"";
478 $attributes[0] = array(
"name" =>
"Catalog",
"value" =>
"");
479 $attributes[1] = array(
"name" =>
"Entry",
"value" =>
"");
480 $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
484 case "Language" : $value =
"";
485 $attributes[0] = array(
"name" =>
"Language", value => $this->
ilias->account->getLanguage());
486 $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
488 case "Author" :
$xml =
'
490 <Lastname></Lastname>
493 $this->nested_obj->addXMLNode($p,
$xml, $a_index);
495 case "HowPublished" : $value =
"";
496 $attributes[0] = array(
"name" =>
"Type", value =>
"");
497 $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
499 case "Series" :
$xml =
'
501 <SeriesTitle></SeriesTitle>
504 $this->nested_obj->addXMLNode($p,
$xml, $a_index);
506 default : $value =
"";
508 $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
511 $this->nested_obj->updateFromDom();
518 $lng->loadLanguageModule(
"meta");
520 $cntcodes = array (
"DE",
"ES",
"FR",
"GB",
"AT",
"CH",
"AF",
"AL",
"DZ",
"AS",
"AD",
"AO",
521 "AI",
"AQ",
"AG",
"AR",
"AM",
"AW",
"AU",
"AT",
"AZ",
"BS",
"BH",
"BD",
"BB",
"BY",
522 "BE",
"BZ",
"BJ",
"BM",
"BT",
"BO",
"BA",
"BW",
"BV",
"BR",
"IO",
"BN",
"BG",
"BF",
523 "BI",
"KH",
"CM",
"CA",
"CV",
"KY",
"CF",
"TD",
"CL",
"CN",
"CX",
"CC",
"CO",
"KM",
524 "CG",
"CK",
"CR",
"CI",
"HR",
"CU",
"CY",
"CZ",
"DK",
"DJ",
"DM",
"DO",
"TP",
"EC",
525 "EG",
"SV",
"GQ",
"ER",
"EE",
"ET",
"FK",
"FO",
"FJ",
"FI",
"FR",
"FX",
"GF",
"PF",
526 "TF",
"GA",
"GM",
"GE",
"DE",
"GH",
"GI",
"GR",
"GL",
"GD",
"GP",
"GU",
"GT",
"GN",
527 "GW",
"GY",
"HT",
"HM",
"HN",
"HU",
"IS",
"IN",
"ID",
"IR",
"IQ",
"IE",
"IL",
"IT",
528 "JM",
"JP",
"JO",
"KZ",
"KE",
"KI",
"KP",
"KR",
"KW",
"KG",
"LA",
"LV",
"LB",
"LS",
529 "LR",
"LY",
"LI",
"LT",
"LU",
"MO",
"MK",
"MG",
"MW",
"MY",
"MV",
"ML",
"MT",
"MH",
530 "MQ",
"MR",
"MU",
"YT",
"MX",
"FM",
"MD",
"MC",
"MN",
"MS",
"MA",
"MZ",
"MM",
"NA",
531 "NR",
"NP",
"NL",
"AN",
"NC",
"NZ",
"NI",
"NE",
"NG",
"NU",
"NF",
"MP",
"NO",
"OM",
532 "PK",
"PW",
"PA",
"PG",
"PY",
"PE",
"PH",
"PN",
"PL",
"PT",
"PR",
"QA",
"RE",
"RO",
533 "RU",
"RW",
"KN",
"LC",
"VC",
"WS",
"SM",
"ST",
"SA",
"CH",
"SN",
"SC",
"SL",
"SG",
534 "SK",
"SI",
"SB",
"SO",
"ZA",
"GS",
"ES",
"LK",
"SH",
"PM",
"SD",
"SR",
"SJ",
"SZ",
535 "SE",
"SY",
"TW",
"TJ",
"TZ",
"TH",
"TG",
"TK",
"TO",
"TT",
"TN",
"TR",
"TM",
"TC",
536 "TV",
"UG",
"UA",
"AE",
"GB",
"UY",
"US",
"UM",
"UZ",
"VU",
"VA",
"VE",
"VN",
"VG",
537 "VI",
"WF",
"EH",
"YE",
"ZR",
"ZM",
"ZW");
539 foreach($cntcodes as $cntcode)
541 $cntrs[$cntcode] =
$lng->txt(
"meta_c_".$cntcode);
551 $this->language = $a_lang;
567 $lng->loadLanguageModule(
"meta");
569 $lngcodes = array(
"aa",
"ab",
"af",
"am",
"ar",
"as",
"ay",
"az",
"ba",
"be",
"bg",
"bh",
570 "bi",
"bn",
"bo",
"br",
"ca",
"co",
"cs",
"cy",
"da",
"de",
"dz",
"el",
"en",
"eo",
571 "es",
"et",
"eu",
"fa",
"fi",
"fj",
"fo",
"fr",
"fy",
"ga",
"gd",
"gl",
"gn",
"gu",
572 "ha",
"he",
"hi",
"hr",
"hu",
"hy",
"ia",
"ie",
"ik",
"id",
"is",
"it",
"iu",
"ja",
573 "jv",
"ka",
"kk",
"kl",
"km",
"kn",
"ko",
"ks",
"ku",
"ky",
"la",
"ln",
"ru",
"rw",
574 "sa",
"sd",
"sg",
"sh",
"si",
"sk",
"sl",
"sm",
"sn",
"so",
"sq",
"sr",
"ss",
"st",
575 "su",
"sv",
"sw",
"ta",
"te",
"tg",
"th",
"ti",
"tk",
"tl",
"tn",
"to",
"tr",
"ts",
576 "tt",
"tw",
"ug",
"uk",
"ur",
"uz",
"vi",
"vo",
"wo",
"xh",
"yi",
"yo",
"za",
"zh",
579 foreach($lngcodes as $lngcode)
581 $langs[$lngcode] =
$lng->txt(
"meta_l_".$lngcode);
add($a_name, $a_path, $a_index=0)
add meta data node
getXMLContent()
get xml content of BibItem
ilBibItem($content_obj=0)
Constructor @access public.
getBibliographyAttributes()
appendBibItemData($a_key, $a_value, $a_bib_item_nr)
setElement($a_name, $a_data)
set identifier catalog value note: only one value implemented currently
setBibliographyAttributes($a_data)
setMeta($a_data)
set (posted) meta data
setBooktitle($a_booktitle)
appendXMLContent($a_xml)
append xml content to BibItem setXMLContent must be called before and the same encoding must be used
setBibItemData($a_key, $a_value, $a_bib_item_nr)
setPublisher($a_publisher)
setXMLContent($a_xml, $a_encoding="UTF-8")
set xml content of BibItem, start with <BibItem...>, end with </BibItemt>, comply with ILIAS DTD,...
create()
create bib data object in db
getElement($a_name, $a_path="", $a_index=0)
get identifier catalog value note: only one value implemented currently
getLanguages()
get iso conform languages see http://www.oasis-open.org/cover/iso639a.html
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
redirection script todo: (a better solution should control the processing via a xml file)