16 import(
'lib.pkp.pages.sitemap.PKPSitemapHandler');
24 $doc = parent::_createContextSitemap($request);
25 $root = $doc->documentElement;
27 $press = $request->getPress();
28 $pressId = $press->getId();
31 $root->appendChild($this->
_createUrlTree($doc, $request->url($press->getPath(),
'catalog')));
33 $submissionsIterator =
Services::get(
'submission')->getMany([
'status' => STATUS_PUBLISHED,
'contextId' => $pressId,
'count' => 1000]);
34 foreach ($submissionsIterator as $submission) {
36 $root->appendChild($this->
_createUrlTree($doc, $request->url($press->getPath(),
'catalog',
'view', array($submission->getBestId()))));
39 $publicationFormats =
DAORegistry::getDAO(
'PublicationFormatDAO')->getApprovedByPublicationId($submission->getCurrentPublication()->getId())->toArray();
40 foreach ($publicationFormats as $format) {
42 if ($format->getIsAvailable()) {
45 $availableFiles = array_filter(
46 $submissionDao->getLatestRevisionsByAssocId(ASSOC_TYPE_PUBLICATION_FORMAT, $format->getId(), $submission->getId()),
48 return $a->getDirectSalesPrice() !== null;
51 foreach ($availableFiles as $file) {
52 $root->appendChild($this->
_createUrlTree($doc, $request->url($press->getPath(),
'catalog',
'view', array($submission->getBestId(), $format->getBestId(), $file->getBestId()))));
59 $root->appendChild($this->
_createUrlTree($doc, $request->url($press->getPath(),
'catalog',
'newReleases')));
62 $seriesResult = $seriesDao->getByPressId($pressId);
63 while ($series = $seriesResult->next()) {
64 $root->appendChild($this->
_createUrlTree($doc, $request->url($press->getPath(),
'catalog',
'series', $series->getPath())));
68 $categoriesResult = $categoryDao->getByContextId($pressId);
69 while ($category = $categoriesResult->next()) {
70 $root->appendChild($this->
_createUrlTree($doc, $request->url($press->getPath(),
'catalog',
'category', $category->getPath())));
73 $doc->appendChild($root);