19 package org.turro.publication.www;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.logging.Level;
24 import java.util.logging.Logger;
25 import org.turro.string.Strings;
26 import org.turro.auth.Authentication;
27 import org.turro.elephant.context.ElephantContext;
28 import org.turro.elephant.context.IConstructor;
29 import org.turro.elephant.impl.navigation.DefaultNavigatorItem;
30 import org.turro.html.HTMLHelper;
31 import org.turro.i18n.I_;
32 import org.turro.plugin.contacts.IContact;
33 import org.turro.publication.db.PublicationPU;
34 import org.turro.publication.entity.PublicationCategory;
35 import org.turro.publication.util.PublicationCategories;
36 import org.turro.util.Converter;
45 private final String uniqueId;
48 private boolean blogger;
51 this.constructor = constructor;
52 this.uniqueId = uniqueId;
60 this.blogger = blogger;
64 ArrayList<PublicationCategory> list =
new ArrayList<>();
73 public Collection<DefaultNavigatorItem>
pubCategories(String parameters,
long groupId) {
75 ArrayList<DefaultNavigatorItem> cats =
new ArrayList<>();
79 cats.add(
new DefaultNavigatorItem(pc.getName(), parameters +
"&category=" + pc.getId(),
null, selected !=
null && pc.
getId() == selected.
getId()));
87 html.
startTag(
"div",
"class='publication-categories'");
88 if(selected ==
null) {
97 if(selected !=
null && pc.
getId() == selected.
getId()) {
102 html.
startAnchor(parameters +
"&category=" + pc.getId(),
null)
112 if(!Strings.isBlank(category)) {
113 long id = Converter.STANDARD.convert(category, Long.class, 0L);
121 }
catch(Exception ex) {
static IContact getIContact()
static String logMsg(String msg)
HTMLGenerator endAllTags()
HTMLGenerator write(String value)
void setExtraAttributes(String extraAttributes)
HTMLGenerator startTag(String tag)
HTMLGenerator startAnchor(String url, String hint)
static String get(String msg)
static Collection< PublicationCategory > getPublicCategories()
static Collection<? extends PublicationCategory > getPrivateBloggerCategories(IContact contact)
static PublicationCategory getCategory(IConstructor constructor, String uniqueId)
Collection< DefaultNavigatorItem > pubCategories(String parameters, long groupId)
Collection< PublicationCategory > getCategories(long groupId)
void renderCategories(String parameters, long groupId)
void setBlogger(boolean blogger)
CategoryFilter(IConstructor constructor, String uniqueId)
String getParameter(String param)
void setSessionAttribute(String key, Object value)
void removeSessionAttribute(String key)
Object getSessionAttribute(String key)