19 package org.turro.forum.www;
21 import java.util.Date;
22 import org.turro.string.Strings;
23 import org.turro.auth.Authentication;
24 import org.turro.collections.KeyValueMap;
25 import org.turro.elephant.TemplateControl;
26 import org.turro.elephant.context.Application;
27 import org.turro.elephant.context.IConstructor;
28 import org.turro.elephant.db.ElephantPU;
29 import org.turro.elephant.entities.db.Topic;
30 import org.turro.entities.EntityCombobox;
31 import org.turro.forum.ForumContext;
32 import org.turro.forum.Forums;
33 import org.turro.forum.db.UniquePath;
34 import org.turro.html.HTMLEntities;
35 import org.turro.i18n.I_;
36 import org.turro.jpa.Dao;
37 import org.turro.marker.MarkerHelper;
38 import org.turro.plugin.contacts.IContact;
39 import org.zkoss.zk.ui.event.InputEvent;
40 import org.zkoss.zk.ui.select.annotation.Listen;
41 import org.zkoss.zk.ui.select.annotation.Wire;
42 import org.zkoss.zul.Label;
43 import org.zkoss.zul.Textbox;
51 private String contextPath;
54 @Wire(
"#text")
private Textbox text;
55 @Wire(
"#counter")
private Label counter;
57 @Listen(
"onChanging=#text")
59 counter.setValue(
I_.
get(
"Minimum") +
60 " " + event.getValue().length() +
64 @Listen(
"onClick=#save")
67 String topicText = text.getValue(),
69 if(entityPath !=
null && !Strings.isBlank(topicText) && topicText.length() > 100) {
76 topic = getDao().saveObject(topic);
86 @Listen(
"onClick=#cancel")
96 this.contextPath = contextPath;
109 private void initComponents() {
110 KeyValueMap kvm =
new KeyValueMap();
114 if(!Strings.isBlank(dossierCategories)) {
115 kvm.put(
"dossier-categories", dossierCategories);
124 private Dao getDao() {
126 _dao =
new ElephantPU();
static IContact getIContact()
IConstructor getConstructor()
abstract void sendRedirect(String uri)
static Application getApplication()
void setCreation(Date creation)
void setText(String text)
void setEntityPath(String entityPath)
void setAuthorId(String authorId)
void setParameters(KeyValueMap kvm)
void setRoot(String root)
static boolean getAllowNew(IConstructor constructor)
static String getAllowedRoots(IConstructor constructor)
static String getDossierCategories(IConstructor constructor)
static void markAsUnseenExceptFor(ITreeEntity entity, IContact contact)
static void notify(Topic topic)
static void normalizeUniquePaths(Topic topic)
void setContextPath(String contextPath)
void onTexting(InputEvent event)
static String escape(String html)
static String get(String msg)
static String setObfuscatedRightNowPars(String parameters)