예제 #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());
     }
 }
예제 #2
0
 static function findById($id)
 {
     $article = DB::table('article')->where('article_id', $id)->get();
     return DaoUtil::returnSingleElement($article);
 }
예제 #3
0
 static function findById($id)
 {
     $topic = DB::table('topic')->where('topic_id', $id)->get();
     return DaoUtil::returnSingleElement($topic);
 }
예제 #4
0
 static function findById($id)
 {
     $edition = DB::table('journal_edition')->where('journal_edition_id', $id)->get();
     return DaoUtil::returnSingleElement($edition);
 }
예제 #5
0
 static function findByPrefix($prefix)
 {
     $journal = DB::table('journal')->where('prefix', $prefix)->get();
     return DaoUtil::returnSingleElement($journal);
 }
예제 #6
0
 static function findById($id)
 {
     $author = DB::table('author')->where('author_id', $id)->get();
     return DaoUtil::returnSingleElement($author);
 }