Esempio n. 1
0
 /**
  * Construct a sitemap for a scheduled conference
  * @return XMLNode
  */
 function createSchedConfSitemap()
 {
     $publishedPaperDao =& DAORegistry::getDAO('PublishedPaperDAO');
     $galleyDao =& DAORegistry::getDAO('PaperGalleyDAO');
     $conference =& Request::getConference();
     $conferenceId = $conference->getId();
     $schedConf = Request::getSchedConf();
     $doc =& XMLCustomWriter::createDocument();
     $root =& XMLCustomWriter::createElement($doc, 'urlset');
     XMLCustomWriter::setAttribute($root, 'xmlns', SITEMAP_XSD_URL);
     // Sched. Conf. home
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath())));
     // About page
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'about')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'about', 'submissions')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'about', 'siteMap')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'about', 'aboutThisPublishingSystem')));
     // Search
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'search')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'search', 'authors')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'search', 'titles')));
     // Conference Information
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'schedConf', 'overview')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'schedConf', 'trackPolicies')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'schedConf', 'presentations')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'schedConf', 'accommodation')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'schedConf', 'location')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'schedConf', 'organizingTeam')));
     // Individual Papers
     $publishedPapers =& $publishedPaperDao->getPublishedPapers($schedConf->getId());
     while ($paper =& $publishedPapers->next()) {
         // Abstract
         XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'paper', 'view', $paper->getId())));
         // Galley files
         $galleys = $galleyDao->getGalleysByPaper($paper->getId());
         foreach ($galleys as $galley) {
             XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($conference->getPath(), $schedConf->getPath(), 'paper', 'view', array($paper->getId(), $galley->getId()))));
         }
     }
     XMLCustomWriter::appendChild($doc, $root);
     return $doc;
 }
Esempio n. 2
0
 /**
  * Construct the sitemap
  * @return XMLNode
  */
 function createJournalSitemap()
 {
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     $doc =& XMLCustomWriter::createDocument();
     $root =& XMLCustomWriter::createElement($doc, 'urlset');
     XMLCustomWriter::setAttribute($root, 'xmlns', SITEMAP_XSD_URL);
     // Journal home
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'index', 'index')));
     // About page
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'about')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'about', 'editorialTeam')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'about', 'editorialPolicies')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'about', 'submissions')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'about', 'siteMap')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'about', 'aboutThisPublishingSystem')));
     // Search
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'search')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'search', 'authors')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'search', 'titles')));
     // Issues
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'issue', 'current')));
     XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'issue', 'archive')));
     $publishedIssues =& $issueDao->getPublishedIssues($journalId);
     while ($issue =& $publishedIssues->next()) {
         XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'issue', 'view', $issue->getId())));
         // Articles for issue
         $articles = $publishedArticleDao->getPublishedArticles($issue->getId());
         foreach ($articles as $article) {
             // Abstract
             XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'article', 'view', array($article->getId()))));
             // Galley files
             $galleys = $galleyDao->getGalleysByArticle($article->getId());
             foreach ($galleys as $galley) {
                 XMLCustomWriter::appendChild($root, SitemapHandler::createUrlTree($doc, Request::url($journal->getPath(), 'article', 'view', array($article->getId(), $galley->getId()))));
             }
         }
         unset($issue);
     }
     XMLCustomWriter::appendChild($doc, $root);
     return $doc;
 }