19 package org.turro.elephant.sitemap;
21 import java.io.IOException;
22 import java.util.ArrayList;
23 import java.util.Collection;
25 import java.util.logging.Level;
26 import java.util.logging.Logger;
27 import org.turro.annotation.ElephantSitemap;
28 import org.turro.elephant.context.ElephantContext;
29 import org.turro.elephant.impl.repository.Repository;
30 import org.turro.elephant.impl.repository.RepositoryFile;
31 import org.turro.elephant.web.ElContext;
32 import org.turro.elephant.web.ElContextMap;
33 import org.turro.util.ImageUtil;
49 private void doRoot(ArrayList<Sitemaps.SitemapLink> list,
ElContext context) {
55 if(ImageUtil.biggerThan(rf.getFile(), 599, 599)) {
56 sml.addImage(rf.getWebPath());
58 }
catch (IOException ex) {
59 Logger.getLogger(DefaultSitemap.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
67 private void doChildren(ArrayList<Sitemaps.SitemapLink> list, Set<ElContext> context,
int level) {
68 if(level < 2 && context !=
null) {
69 for(ElContext cni : context) {
70 if(!cni.hasRestrictions() && cni.isIndexable()) {
71 Sitemaps.SitemapLink sml =
new Sitemaps.SitemapLink(cni.getWebPath());
72 Repository repository = cni.getRepository();
73 for(RepositoryFile rf : repository.getRepositoryFiles(
"*.jpg,*.png")) {
75 if(ImageUtil.biggerThan(rf.getFile(), 599, 599)) {
76 sml.addImage(rf.getWebPath());
78 }
catch (IOException ex) {
79 Logger.getLogger(DefaultSitemap.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
84 doChildren(list, cni.getChildren(), level + 1);
Set< RepositoryFile > getRepositoryFiles(String pattern)
Collection< Sitemaps.SitemapLink > getLinks()
static ElContext getContext(IConstructor constructor)
TreeSet< ElContext > getChildren()
Repository getRepository()
boolean hasRestrictions()