1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.module.googlesitemap.app.subapp.sitemapdetail.virtualuris; |
35 |
|
|
36 |
|
import info.magnolia.event.EventBus; |
37 |
|
import info.magnolia.i18nsystem.SimpleTranslator; |
38 |
|
import info.magnolia.module.googlesitemap.app.subapp.sitemapdetail.base.SiteMapContentView; |
39 |
|
import info.magnolia.module.googlesitemap.app.subapp.sitemapdetail.base.SiteMapDetailPresenter; |
40 |
|
import info.magnolia.module.googlesitemap.bean.SiteMapEntry; |
41 |
|
import info.magnolia.module.googlesitemap.service.SiteMapService; |
42 |
|
import info.magnolia.ui.api.app.SubAppEventBus; |
43 |
|
import info.magnolia.ui.api.context.UiContext; |
44 |
|
|
45 |
|
import java.util.Collections; |
46 |
|
import java.util.List; |
47 |
|
|
48 |
|
import javax.inject.Named; |
49 |
|
import javax.jcr.Node; |
50 |
|
import javax.jcr.RepositoryException; |
51 |
|
|
52 |
|
import org.slf4j.Logger; |
53 |
|
import org.slf4j.LoggerFactory; |
54 |
|
|
55 |
|
import com.google.inject.Inject; |
56 |
|
|
57 |
|
|
58 |
|
@link |
59 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 5 |
Complexity Density: 0.62 |
|
60 |
|
public class SiteMapVirtualUrisPresenter extends SiteMapDetailPresenter<SiteMapContentView.Listener> { |
61 |
|
|
62 |
|
private static final String ERROR_MESSAGE = "google-sitemap.error.virtualuri"; |
63 |
|
|
64 |
|
private Logger log = LoggerFactory.getLogger(getClass()); |
65 |
|
|
66 |
|
private UiContext uiContext; |
67 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
68 |
0
|
@Inject... |
69 |
|
public SiteMapVirtualUrisPresenter(SiteMapVirtualUrisView view, SiteMapService service, @Named(SubAppEventBus.NAME) EventBus eventBus, SimpleTranslator translator, UiContext uiContext) { |
70 |
0
|
super(view, service, eventBus, translator); |
71 |
0
|
this.uiContext = uiContext; |
72 |
|
} |
73 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
74 |
0
|
@Override... |
75 |
|
protected List<SiteMapEntry> fetchSiteMapEntries(Node node) { |
76 |
0
|
try { |
77 |
0
|
return service.getSiteMapBeanForVirtualUri(true); |
78 |
|
} catch (RepositoryException e) { |
79 |
0
|
log.error("Failed to accumulate site map beans for virtual URI's", e); |
80 |
|
|
81 |
|
} |
82 |
0
|
return Collections.EMPTY_LIST; |
83 |
|
} |
84 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
0
|
@Override... |
86 |
|
public String getLabel() { |
87 |
0
|
return getTranslator().translate("siteMaps.virtualURI.label"); |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
0
|
@Override... |
91 |
|
protected SiteMapContentView.Listener getListener() { |
92 |
0
|
return this; |
93 |
|
} |
94 |
|
} |