當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Opus_Document::addTitleMain方法代碼示例

本文整理匯總了PHP中Opus_Document::addTitleMain方法的典型用法代碼示例。如果您正苦於以下問題:PHP Opus_Document::addTitleMain方法的具體用法?PHP Opus_Document::addTitleMain怎麽用?PHP Opus_Document::addTitleMain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Opus_Document的用法示例。


在下文中一共展示了Opus_Document::addTitleMain方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 * @version     $Id$
 */
$doc = new Opus_Document();
$doc->setType('all');
$doc->setServerState('published');
$doc->setServerDatePublished('1900-01-01');
// damn API. $doc->addPersonSubmiter() doesn't work for link models!
// -> we should change this in 4.x
$submitter = new Opus_Person();
$submitter->setFirstName('Donald')->setLastName('Duck')->setEmail('donald@example.org')->setDateOfBirth('1920-03-13')->setPlaceOfBirth('Entenhausen');
$doc->addPersonSubmitter($submitter);
$author = new Opus_Person();
$author->setFirstName('Daniel')->setLastName('Düsentrieb')->setAcademicTitle('Dr.-Ing.');
$doc->addPersonAuthor($author);
$doc->setLanguage('deu');
$titleMain = $doc->addTitleMain();
$titleMain->setValue('Dokument zur empirischen Unterschung der OAI-Schnittstelle');
$titleMain->setLanguage('deu');
$titleMainEng = $doc->addTitleMain();
$titleMainEng->setValue('Document for empirical testing OAI interface');
$titleMainEng->setLanguage('eng');
$abstract = $doc->addTitleAbstract();
$abstract->setValue('Dokument, dass alle Daten enhält, um testen zu können, wie die OAI-Schnittstelle sie ausgibt.');
$abstract->setLanguage('deu');
$titleSub = $doc->addTitleSub();
$titleSub->setValue('Beispielhaft erleutert an OPUS 4.0.0');
$titleSub->setLanguage('deu');
$titleAdditional = $doc->addTitleAdditional();
$titleAdditional->setValue('OAI-Schnittstellen empirisch testen am Beispiel von OPUS 4.0');
$titleAdditional->setLanguage('deu');
$titleParent = $doc->addTitleParent();
開發者ID:belapp,項目名稱:opus4-application,代碼行數:31,代碼來源:create_all_fields_document.php

示例2: rand

 *
 * @category    Application
 * @author      Thoralf Klein <thoralf.klein@zib.de>
 * @copyright   Copyright (c) 2008-2011, OPUS 4 development team
 * @license     http://www.gnu.org/licenses/gpl.html General Public License
 * @version     $Id$
 */
/**
 * script to create 10000 documents, e.g., for performance testing
 */
for ($i = 1; $i < 10000; $i++) {
    $d = new Opus_Document();
    $d->setServerState('published');
    $d->setType('preprint');
    $d->setLanguage('deu');
    $title = $d->addTitleMain();
    $title->setLanguage('deu');
    $title->setValue('title-' . rand());
    $date = new Opus_Date();
    $date->setNow();
    $date->setYear(1990 + $i % 23);
    $d->setPublishedDate($date);
    $p = new Opus_Person();
    $p->setFirstName("foo-" . $i % 7);
    $p->setLastName("bar-" . $i % 5);
    $p = $d->addPersonAuthor($p);
    $c = new Opus_Collection(15990 + $i % 103);
    $d->addCollection($c);
    $s = $d->addSubject()->setType('ddc');
    $s->setValue($i % 97);
    $docId = $d->store();
開發者ID:belapp,項目名稱:opus4-application,代碼行數:31,代碼來源:create_10000_documents.php

示例3:

 * @version     $Id: create_all_fields_document.php 13048 2014-04-08 15:18:31Z mlang $
 */
$doc = new Opus_Document();
$doc->setType('all');
$doc->setServerState('published');
$doc->setServerDatePublished('1900-01-01');
// damn API. $doc->addPersonSubmiter() doesn't work for link models!
// -> we should change this in 4.x
$submitter = new Opus_Person();
$submitter->setFirstName('Donald')->setLastName('Duck')->setEmail('donald@example.org')->setDateOfBirth('1920-03-13')->setPlaceOfBirth('Entenhausen');
$doc->addPersonSubmitter($submitter);
$author = new Opus_Person();
$author->setFirstName('Daniel')->setLastName('Düsentrieb')->setAcademicTitle('Dr.-Ing.');
$doc->addPersonAuthor($author);
$doc->setLanguage('deu');
$titleMain = $doc->addTitleMain();
$titleMain->setValue('Dokument zur empirischen Unterschung der OAI-Schnittstelle');
$titleMain->setLanguage('deu');
$titleMain2 = $doc->addTitleMain();
$titleMain2->setValue('Document for empirical testing OAI interface');
$titleMain2->setLanguage('eng');
$abstract = $doc->addTitleAbstract();
$abstract->setValue('Dokument, dass alle Daten enhält, um testen zu können, wie die OAI-Schnittstelle sie ausgibt.');
$abstract->setLanguage('deu');
$titleSub = $doc->addTitleSub();
$titleSub->setValue('Beispielhaft erleutert an OPUS 4.0.0');
$titleSub->setLanguage('deu');
$titleAdditional = $doc->addTitleAdditional();
$titleAdditional->setValue('OAI-Schnittstellen empirisch testen am Beispiel von OPUS 4.0');
$titleAdditional->setLanguage('deu');
$titleParent = $doc->addTitleParent();
開發者ID:alexukua,項目名稱:opus4,代碼行數:31,代碼來源:create_all_fields_document.php

示例4: testFrontdoorTitleRespectsDocumentLanguageMultipleCandidates

 /**
  * Regression test for OPUSVIER-2165
  *
  * if database contains more than one title in the document's language,
  * the first title is used as page title
  */
 public function testFrontdoorTitleRespectsDocumentLanguageMultipleCandidates()
 {
     $d = new Opus_Document(146);
     $lang = $d->getLanguage();
     $d->setLanguage('deu');
     $titles = $d->getTitleMain();
     $d->addTitleMain()->setValue('VBOK')->setLanguage('deu');
     $d->store();
     $this->dispatch('/frontdoor/index/index/docId/146');
     // restore language
     // restore titles
     $d = new Opus_Document(146);
     $d->setLanguage($lang);
     $d->setTitleMain($titles);
     $d->store();
     $this->assertNotContains('<title>OPUS 4 | COLN</title>', $this->getResponse()->getBody());
     $this->assertNotContains('<title>OPUS 4 | VBOK</title>', $this->getResponse()->getBody());
     $this->assertContains('<title>OPUS 4 | KOBV</title>', $this->getResponse()->getBody());
 }
開發者ID:belapp,項目名稱:opus4-application,代碼行數:25,代碼來源:IndexControllerTest.php

示例5: handleTitleMain

 /**
  *
  * @param DOMNode $node
  * @param Opus_Document $doc
  */
 private function handleTitleMain($node, $doc)
 {
     foreach ($node->childNodes as $childNode) {
         if ($childNode instanceof DOMElement) {
             $t = $doc->addTitleMain();
             $t->setValue(trim($childNode->textContent));
             $t->setLanguage(trim($childNode->getAttribute('language')));
         }
     }
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:15,代碼來源:MetadataImport.php


注:本文中的Opus_Document::addTitleMain方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。