Exemplo n.º 1
0
 private function getRecord(Request $request)
 {
     try {
         $query = self::getQueryValues($request);
         if (!array_key_exists('identifier', $query) || !array_key_exists('metadataprefix', $query)) {
             throw new OaiError('not enough parameters"', self::ERROR_BAD_ARGUMENT);
         }
         if ($query['metadataprefix'] != self::getCommonValues($request)['metadataPrefix']) {
             throw new OaiError("Incorrect metadataPrefix parameter", self::ERROR_BAD_ARGUMENT);
         }
         $articleId = self::getArticleId($query['identifier'], $request);
         $articles = ArticleDao::findContentById($articleId);
         $articles = ArticleService::getEnrichedArticles($articles);
         $article = DaoUtil::returnSingleElement($articles);
         self::enrichArticle($article);
         $values = self::getCommonValues($request);
         $values['article'] = $article;
         return Response::view('oai.record', $values)->header('Content-Type', 'application/xml');
     } catch (OaiError $e) {
         return self::getErrorPage($request, self::$ERROR_CODES[$e->getCode()], $e->getMessage());
     }
 }
Exemplo n.º 2
0
 static function findById($id)
 {
     $article = DB::table('article')->where('article_id', $id)->get();
     return DaoUtil::returnSingleElement($article);
 }
Exemplo n.º 3
0
 static function findById($id)
 {
     $topic = DB::table('topic')->where('topic_id', $id)->get();
     return DaoUtil::returnSingleElement($topic);
 }
Exemplo n.º 4
0
 static function findById($id)
 {
     $edition = DB::table('journal_edition')->where('journal_edition_id', $id)->get();
     return DaoUtil::returnSingleElement($edition);
 }
Exemplo n.º 5
0
 static function findByPrefix($prefix)
 {
     $journal = DB::table('journal')->where('prefix', $prefix)->get();
     return DaoUtil::returnSingleElement($journal);
 }
Exemplo n.º 6
0
 static function findById($id)
 {
     $author = DB::table('author')->where('author_id', $id)->get();
     return DaoUtil::returnSingleElement($author);
 }