49 ArrayList<Sitemaps.SitemapLink> list =
new ArrayList<>();
50 String path = ElephantContext.getEntityWebContext(
"/dossier");
51 if(!Strings.isBlank(path)) {
53 WhereClause wc =
new WhereClause();
54 wc.addClause(
"select d.id from Dossier as d");
55 wc.addClause(
"where d.category.knowledgeBase = TRUE");
56 wc.addClause(
"and d.publishable = TRUE");
57 Dao dao =
new DossierPU();
58 for(Long dossierId : (List<Long>) dao.getResultList(wc)) {
59 Dossier dossier = dao.find(Dossier.class, dossierId);
60 String ewu = EntityWebUrls.getUrlFromEntity(dossier);
61 if(!Strings.isBlank(ewu)) {
62 Sitemaps.SitemapLink sml =
new Sitemaps.SitemapLink(
63 ElephantContext.getRootWebPath() + path + ewu);
64 FileAttach fa =
new FileAttach(DossierPU.getObjectPath(dossier));
65 Repository repository = fa.getPublishableRepository(Application.getApplication().getConstructor());
66 for(RepositoryFile rf : repository.getRepositoryFiles(
"/",
"*.jpg,*.png")) {
67 sml.addImage(rf.getWebPath());
73 path = ElephantContext.getEntityWebContext(
"/project");
74 if(!Strings.isBlank(path)) {
76 WhereClause wc =
new WhereClause();
77 wc.addClause(
"select d.id from Dossier as d");
78 wc.addClause(
"where d.category.ownsProjects = TRUE");
79 wc.addClause(
"and d.publishable = TRUE");
80 wc.addClause(
"and d.type = :type");
81 wc.addNamedValue(
"type", DossierType.TYPE_PROJECT);
82 Dao dao =
new DossierPU();
83 for(Long dossierId : (List<Long>) dao.getResultList(wc)) {
84 Dossier dossier = dao.find(Dossier.class, dossierId);
85 String ewu = EntityWebUrls.getUrlFromEntity(dossier);
86 if(!Strings.isBlank(ewu)) {
87 Sitemaps.SitemapLink sml =
new Sitemaps.SitemapLink(
88 ElephantContext.getRootWebPath() + path + ewu);
89 FileAttach fa =
new FileAttach(DossierPU.getObjectPath(dossier));
90 Repository repository = fa.getPublishableRepository(Application.getApplication().getConstructor());
91 for(RepositoryFile rf : repository.getRepositoryFiles(
"/",
"*.jpg,*.png")) {
92 sml.addImage(rf.getWebPath());