ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilBibItem Class Reference

Class ilBibItem. More...

+ Collaboration diagram for ilBibItem:

Public Member Functions

 ilBibItem ($content_obj=0)
 Constructor @access public. More...
 
 setBibliographyAttributes ($a_data)
 
 setAbstract ($a_data)
 
 setBibItemData ($a_key, $a_value, $a_bib_item_nr)
 
 appendBibItemData ($a_key, $a_value, $a_bib_item_nr)
 
 getBibItemData ()
 
 getBibliographyAttributes ()
 
 getAbstract ()
 
 getTitle ()
 
 getXML ()
 
 readXML ()
 
 setXMLContent ($a_xml, $a_encoding="UTF-8")
 set xml content of BibItem, start with <BibItem...>, end with </BibItemt>, comply with ILIAS DTD, use utf-8! More...
 
 appendXMLContent ($a_xml)
 append xml content to BibItem setXMLContent must be called before and the same encoding must be used More...
 
 getXMLContent ()
 get xml content of BibItem More...
 
 __initNestedSet ()
 
 setBooktitle ($a_booktitle)
 
 getBooktitle ()
 
 setEdition ($a_edition)
 
 getEdition ()
 
 setPublisher ($a_publisher)
 
 getPublisher ()
 
 setYear ($a_year)
 
 getYear ()
 
 setMeta ($a_data)
 set (posted) meta data More...
 
 getMeta ()
 get meta data More...
 
 setID ($a_id)
 set id More...
 
 getID ()
 
 setType ($a_type)
 
 getType ()
 
 setElement ($a_name, $a_data)
 set identifier catalog value note: only one value implemented currently More...
 
 getElement ($a_name, $a_path="", $a_index=0)
 get identifier catalog value note: only one value implemented currently More...
 
 read ()
 
 create ()
 create bib data object in db More...
 
 delete ($a_name, $a_path, $a_index)
 delete bibitem data node More...
 
 add ($a_name, $a_path, $a_index=0)
 add meta data node More...
 
 getCountries ()
 
 setLanguage ($a_lang)
 
 getLanguage ()
 
 getLanguages ()
 get iso conform languages see http://www.oasis-open.org/cover/iso639a.html More...
 

Data Fields

 $nested_obj
 
 $content_obj
 
 $xml
 
 $bibliography_attr
 
 $abstract
 
 $id = 0
 
 $type = "bib"
 
 $meta
 
 $language
 

Detailed Description

Class ilBibItem.

Handles Bib-Items of ILIAS DigiLib-Books (see ILIAS DTD)

Author
Databay AG jc@da.nosp@m.taba.nosp@m.y.de
Version
$Id$

Definition at line 36 of file class.ilBibItem.php.

Member Function Documentation

◆ __initNestedSet()

ilBibItem::__initNestedSet ( )

Definition at line 232 of file class.ilBibItem.php.

233 {
234 include_once("./Services/Xml/classes/class.ilNestedSetXML.php");
235
236 $this->nested_obj =& new ilNestedSetXML();
237 $this->nested_obj->init($this->getID(), "bib");
238
239 return $this->nested_obj->initDom();
240 }
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.

References getID().

Referenced by add(), create(), delete(), getElement(), read(), and readXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add()

ilBibItem::add (   $a_name,
  $a_path,
  $a_index = 0 
)

add meta data node

Definition at line 447 of file class.ilBibItem.php.

448 {
449 if(!$this->__initNestedSet())
450 {
451 return false;
452 }
453
454 $p = "//Bibliography";
455 if ($a_path != "")
456 {
457 $p .= "/" . $a_path;
458 }
459 $attributes = array();
460# echo "Index: " . $a_index . " | Path: " . $p . " | Name: " . $a_name . "<br>\n";
461 switch ($a_name)
462 {
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>
471 <Year>N/A</Year>
472 <URL></URL>
473 </BibItem>
474 ';
475 $this->nested_obj->addXMLNode($p, $xml, $a_index);
476 break;
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);
481 break;
482 case "Keyword" : ;
483 case "Booktitle" : ;
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);
487 break;
488 case "Author" : $xml = '
489 <Author>
490 <Lastname></Lastname>
491 </Author>
492 ';
493 $this->nested_obj->addXMLNode($p, $xml, $a_index);
494 break;
495 case "HowPublished" : $value = "";
496 $attributes[0] = array("name" => "Type", value => "");
497 $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
498 break;
499 case "Series" : $xml = '
500 <Series>
501 <SeriesTitle></SeriesTitle>
502 </Series>
503 ';
504 $this->nested_obj->addXMLNode($p, $xml, $a_index);
505 break;
506 default : $value = "";
507 $attributes = "";
508 $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
509 break;
510 }
511 $this->nested_obj->updateFromDom();
512 }
redirection script todo: (a better solution should control the processing via a xml file)

References $xml, __initNestedSet(), getID(), and getType().

+ Here is the call graph for this function:

◆ appendBibItemData()

ilBibItem::appendBibItemData (   $a_key,
  $a_value,
  $a_bib_item_nr 
)
Parameters

access public

Returns

Definition at line 124 of file class.ilBibItem.php.

125 {
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));
127 }

◆ appendXMLContent()

ilBibItem::appendXMLContent (   $a_xml)

append xml content to BibItem setXMLContent must be called before and the same encoding must be used

Parameters
string$a_xmlxml content

Definition at line 216 of file class.ilBibItem.php.

217 {
218 $this->xml.= $a_xml;
219 }

◆ create()

ilBibItem::create ( )

create bib data object in db

Definition at line 387 of file class.ilBibItem.php.

388 {
389 $this->__initNestedSet();
390
391/* if (is_object($this->obj))
392 {
393 $bibData["booktitle"] = $this->obj->getTitle();
394 }
395 else
396 {*/
397 $bibData["booktitle"] = "NO TITLE";
398/* }*/
399 $bibData["edition"] = "N/A";
400 $bibData["publisher"] = "";
401 $bibData["year"] = "N/A";
402
403 $xml = '
404 <Bibliography>
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>
413 <URL></URL>
414 </BibItem>
415 </Bibliography>
416 ';
417 $this->nested_obj->import($xml, $this->getID(), "bib");
418
419 return $bibData;
420 }

References $xml, __initNestedSet(), getID(), and getType().

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilBibItem::delete (   $a_name,
  $a_path,
  $a_index 
)

delete bibitem data node

Definition at line 425 of file class.ilBibItem.php.

426 {
427 if(!$this->__initNestedSet())
428 {
429 return false;
430 }
431
432 if ($a_name != "")
433 {
434 $p = "//Bibliography";
435 if ($a_path != "")
436 {
437 $p .= "/" . $a_path;
438 }
439 $this->nested_obj->deleteDomNode($p, $a_name, $a_index);
440 $this->nested_obj->updateFromDom();
441 }
442 }

References __initNestedSet().

+ Here is the call graph for this function:

◆ getAbstract()

ilBibItem::getAbstract ( )
Returns
string
See also
ilias_co.dtd @access User interface

Definition at line 149 of file class.ilBibItem.php.

150 {
151 return $this->abstract;
152 }

References $abstract.

◆ getBibItemData()

ilBibItem::getBibItemData ( )

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

131 {
132 return $this->bib_item_data;
133 }

◆ getBibliographyAttributes()

ilBibItem::getBibliographyAttributes ( )
Returns
array e.g array("version" => 1,...)
See also
ilias_co.dtd @access User interface

Definition at line 140 of file class.ilBibItem.php.

141 {
142 return $this->bibliography_attr ? $this->bibliography_attr : array();
143 }

◆ getBooktitle()

ilBibItem::getBooktitle ( )

Definition at line 252 of file class.ilBibItem.php.

253 {
254 return $this->booktitle;
255 }

◆ getCountries()

ilBibItem::getCountries ( )

Definition at line 514 of file class.ilBibItem.php.

515 {
516 global $lng;
517
518 $lng->loadLanguageModule("meta");
519
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");
538 $cntrs = array();
539 foreach($cntcodes as $cntcode)
540 {
541 $cntrs[$cntcode] = $lng->txt("meta_c_".$cntcode);
542 }
543 asort($cntrs);
544 return $cntrs;
545
546 }
global $lng
Definition: privfeed.php:40

References $lng.

◆ getEdition()

ilBibItem::getEdition ( )

Definition at line 262 of file class.ilBibItem.php.

263 {
264 return $this->edition;
265 }

◆ getElement()

ilBibItem::getElement (   $a_name,
  $a_path = "",
  $a_index = 0 
)

get identifier catalog value note: only one value implemented currently

Definition at line 338 of file class.ilBibItem.php.

339 {
340 if(!$this->__initNestedSet())
341 {
342 return false;
343 }
344
345 $p = "//Bibliography";
346 if ($a_path != "")
347 {
348 $p .= "/" . $a_path;
349 }
350 $nodes = $this->nested_obj->getDomContent($p, $a_name, $a_index);
351 $this->setElement($a_name, $nodes);
352/* if ($a_name == "Author" ||
353 $a_name == "FirstName" ||
354 $a_name == "MiddleName" ||
355 $a_name == "LastName")
356 {
357 echo "Index: " . $a_index . " | Path: " . $p . " | Name: " . $a_name . "<br>\n";
358 vd($this->$a_name);
359 }
360*/
361 return $this->$a_name;
362 }
setElement($a_name, $a_data)
set identifier catalog value note: only one value implemented currently

References __initNestedSet(), and setElement().

+ Here is the call graph for this function:

◆ getID()

ilBibItem::getID ( )

Definition at line 310 of file class.ilBibItem.php.

311 {
312 return $this->id;
313 }

References $id.

Referenced by __initNestedSet(), add(), and create().

+ Here is the caller graph for this function:

◆ getLanguage()

ilBibItem::getLanguage ( )

Definition at line 554 of file class.ilBibItem.php.

555 {
556 return $this->language;
557 }

References $language.

◆ getLanguages()

ilBibItem::getLanguages ( )

get iso conform languages see http://www.oasis-open.org/cover/iso639a.html

Definition at line 563 of file class.ilBibItem.php.

564 {
565 global $lng;
566
567 $lng->loadLanguageModule("meta");
568
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",
577 "zu");
578 $langs = array();
579 foreach($lngcodes as $lngcode)
580 {
581 $langs[$lngcode] = $lng->txt("meta_l_".$lngcode);
582 }
583 asort($langs);
584 return $langs;
585 }

References $lng.

◆ getMeta()

ilBibItem::getMeta ( )

get meta data

Definition at line 298 of file class.ilBibItem.php.

299 {
300 return $this->meta;
301 }

References $meta.

◆ getPublisher()

ilBibItem::getPublisher ( )

Definition at line 272 of file class.ilBibItem.php.

273 {
274 return $this->publisher;
275 }

◆ getTitle()

ilBibItem::getTitle ( )
Parameters

access public

Returns
string title

Definition at line 161 of file class.ilBibItem.php.

162 {
163 return $this->title;
164 }

◆ getType()

ilBibItem::getType ( )

Definition at line 320 of file class.ilBibItem.php.

321 {
322 return $this->type;
323 }

References $type.

Referenced by add(), and create().

+ Here is the caller graph for this function:

◆ getXML()

ilBibItem::getXML ( )
Parameters

access public

Returns
string xml-structure

Definition at line 173 of file class.ilBibItem.php.

174 {
175 return $this->xml;
176 }

References $xml.

◆ getXMLContent()

ilBibItem::getXMLContent ( )

get xml content of BibItem

Definition at line 225 of file class.ilBibItem.php.

226 {
227
228 return $this->xml;
229 }

References $xml.

◆ getYear()

ilBibItem::getYear ( )

Definition at line 282 of file class.ilBibItem.php.

283 {
284 return $this->year;
285 }

◆ ilBibItem()

ilBibItem::ilBibItem (   $content_obj = 0)

Constructor @access public.

Definition at line 56 of file class.ilBibItem.php.

57 {
58 global $ilias;
59
60 $this->ilias =& $ilias;
61
62 $this->import_id = array();
63 $this->title = "";
64 $this->language = array();
65 $this->description = array();
66 $this->keyword = array();
67 $this->technicals = array(); // technical sections
68 $this->coverage = "";
69 $this->structure = "";
70
71 $this->content_obj =& $content_obj;
72 if(is_object($content_obj))
73 {
74 $this->setID($this->content_obj->getId());
75 $this->readXML();
76# $this->read();
77 }
78 }
setID($a_id)
set id

References $content_obj, readXML(), and setID().

+ Here is the call graph for this function:

◆ read()

ilBibItem::read ( )

Definition at line 364 of file class.ilBibItem.php.

365 {
366 if(!$this->__initNestedSet())
367 {
368 $bibData = $this->create();
369 }
370 else
371 {
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");
376 }
377
378 $this->setBooktitle($bibData["booktitle"]);
379 $this->setEdition($bibData["edition"]);
380 $this->setPublisher($bibData["publisher"]);
381 $this->setYear($bibData["year"]);
382 }
setBooktitle($a_booktitle)
setYear($a_year)
setPublisher($a_publisher)
create()
create bib data object in db
setEdition($a_edition)

References __initNestedSet(), create(), setBooktitle(), setEdition(), setPublisher(), and setYear().

+ Here is the call graph for this function:

◆ readXML()

ilBibItem::readXML ( )
Parameters

access public

Returns

Definition at line 185 of file class.ilBibItem.php.

186 {
187 if(!$this->__initNestedSet())
188 {
189 return false;
190 }
191 $this->xml = $this->nested_obj->export($this->content_obj->getId(),"bib");
192 }

References __initNestedSet().

Referenced by ilBibItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAbstract()

ilBibItem::setAbstract (   $a_data)
Parameters

access public

Returns

Definition at line 98 of file class.ilBibItem.php.

99 {
100 $this->abstract = $a_data;
101 }

◆ setBibItemData()

ilBibItem::setBibItemData (   $a_key,
  $a_value,
  $a_bib_item_nr 
)
Parameters

access public

Returns

Definition at line 110 of file class.ilBibItem.php.

111 {
112 $this->bib_item_data[$a_bib_item_nr]["$a_key"] = $a_value;
113
114 return true;
115 }

◆ setBibliographyAttributes()

ilBibItem::setBibliographyAttributes (   $a_data)
Parameters
arraye.g array("version" => 1,...)
See also
ilias_co.dtd @access User interface

Definition at line 86 of file class.ilBibItem.php.

87 {
88 $this->bibliography_attr = $a_data;
89 }

◆ setBooktitle()

ilBibItem::setBooktitle (   $a_booktitle)

Definition at line 242 of file class.ilBibItem.php.

243 {
244 if ($a_booktitle == "")
245 {
246 $a_booktitle = "NO TITLE";
247 }
248
249 $this->booktitle = $a_booktitle;
250 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEdition()

ilBibItem::setEdition (   $a_edition)

Definition at line 257 of file class.ilBibItem.php.

258 {
259 $this->edition = $a_edition;
260 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setElement()

ilBibItem::setElement (   $a_name,
  $a_data 
)

set identifier catalog value note: only one value implemented currently

Definition at line 329 of file class.ilBibItem.php.

330 {
331 $this->$a_name = $a_data;
332 }

Referenced by getElement().

+ Here is the caller graph for this function:

◆ setID()

ilBibItem::setID (   $a_id)

set id

Definition at line 305 of file class.ilBibItem.php.

306 {
307 $this->id = $a_id;
308 }

Referenced by ilBibItem().

+ Here is the caller graph for this function:

◆ setLanguage()

ilBibItem::setLanguage (   $a_lang)

Definition at line 549 of file class.ilBibItem.php.

550 {
551 $this->language = $a_lang;
552 }

◆ setMeta()

ilBibItem::setMeta (   $a_data)

set (posted) meta data

Definition at line 290 of file class.ilBibItem.php.

291 {
292 $this->meta = $a_data;
293 }

◆ setPublisher()

ilBibItem::setPublisher (   $a_publisher)

Definition at line 267 of file class.ilBibItem.php.

268 {
269 $this->publisher = $a_publisher;
270 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setType()

ilBibItem::setType (   $a_type)

Definition at line 315 of file class.ilBibItem.php.

316 {
317 $this->type = $a_type;
318 }

◆ setXMLContent()

ilBibItem::setXMLContent (   $a_xml,
  $a_encoding = "UTF-8" 
)

set xml content of BibItem, start with <BibItem...>, end with </BibItemt>, comply with ILIAS DTD, use utf-8!

Parameters
string$a_xmlxml content
string$a_encodingencoding of the content (here is no conversion done! it must be already utf-8 encoded at the time)

Definition at line 203 of file class.ilBibItem.php.

204 {
205 $this->encoding = $a_encoding;
206 $this->xml = $a_xml;
207 }

◆ setYear()

ilBibItem::setYear (   $a_year)

Definition at line 277 of file class.ilBibItem.php.

278 {
279 $this->year = $a_year;
280 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $abstract

ilBibItem::$abstract

Definition at line 43 of file class.ilBibItem.php.

Referenced by getAbstract().

◆ $bibliography_attr

ilBibItem::$bibliography_attr

Definition at line 42 of file class.ilBibItem.php.

◆ $content_obj

ilBibItem::$content_obj

Definition at line 39 of file class.ilBibItem.php.

Referenced by ilBibItem().

◆ $id

ilBibItem::$id = 0

Definition at line 45 of file class.ilBibItem.php.

Referenced by getID().

◆ $language

ilBibItem::$language

Definition at line 50 of file class.ilBibItem.php.

Referenced by getLanguage().

◆ $meta

ilBibItem::$meta

Definition at line 48 of file class.ilBibItem.php.

Referenced by getMeta().

◆ $nested_obj

ilBibItem::$nested_obj

Definition at line 38 of file class.ilBibItem.php.

◆ $type

ilBibItem::$type = "bib"

Definition at line 46 of file class.ilBibItem.php.

Referenced by getType().

◆ $xml

ilBibItem::$xml

Definition at line 40 of file class.ilBibItem.php.

Referenced by add(), create(), getXML(), and getXMLContent().


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