BrightSide Workbench Full Report + Source Code
org.turro.publication.util.PublicationSitemap Class Reference
Inheritance diagram for org.turro.publication.util.PublicationSitemap:
Collaboration diagram for org.turro.publication.util.PublicationSitemap:

Public Member Functions

Collection< Sitemaps.SitemapLink > getLinks ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 44 of file PublicationSitemap.java.

Member Function Documentation

◆ getLinks()

Collection<Sitemaps.SitemapLink> org.turro.publication.util.PublicationSitemap.getLinks ( )

Implements org.turro.elephant.sitemap.IElephantSitemap.

Definition at line 47 of file PublicationSitemap.java.

47  {
48  ArrayList<Sitemaps.SitemapLink> list = new ArrayList<>();
49  String path = ElephantContext.getEntityWebContext("/publication");
50  if(!Strings.isBlank(path)) {
51  // TODO: make the exact selection the context do
52  WhereClause wc = new WhereClause();
53  wc.addClause("select p.id from Publication as p");
54  wc.addClause("where p.publicationGroup.publishable = TRUE");
55  wc.addClause("and p.publicationCategory.publishable = TRUE");
56  Dao dao = new PublicationPU();
57  for(Long pubId : (List<Long>) dao.getResultList(wc)) {
58  Publication pub = dao.find(Publication.class, pubId);
59  String ewu = EntityWebUrls.getUrlFromEntity(pub);
60  if(!Strings.isBlank(ewu)) {
61  Sitemaps.SitemapLink sml = new Sitemaps.SitemapLink(
62  ElephantContext.getRootWebPath() + path + ewu);
63  FileAttach fa = new FileAttach(PublicationPU.getObjectPath(pub));
64  Repository repository = fa.getPublishableRepository(Application.getApplication().getConstructor());
65  for(RepositoryFile rf : repository.getRepositoryFiles("/topmost", "*.jpg,*.png")) {
66  sml.addImage(rf.getWebPath());
67  }
68  for(RepositoryFile rf : repository.getRepositoryFiles("/priorized", "*.jpg,*.png")) {
69  sml.addImage(rf.getWebPath());
70  }
71  for(RepositoryFile rf : repository.getRepositoryFiles("/included", "*.jpg,*.png")) {
72  sml.addImage(rf.getWebPath());
73  }
74  list.add(sml);
75  }
76  }
77  }
78  return list;
79  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: