19 package org.turro.publication.zul.ctrl;
21 import java.util.Date;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.string.Strings;
25 import org.turro.auth.Authentication;
26 import org.turro.elephant.context.Application;
27 import org.turro.elephant.context.ElephantContext;
28 import org.turro.elephant.util.Messages;
29 import org.turro.jpa.composer.EntityComposer;
30 import org.turro.jpa.entity.DaoEntity;
31 import org.turro.publication.db.PublicationPU;
32 import org.turro.publication.entity.Publication;
33 import org.turro.publication.util.PublicationWrapper;
34 import org.turro.publication.zul.menu.PublicationMenu;
35 import org.turro.zkoss.locale.LangListbox;
36 import org.turro.zkoss.text.RepositoriesTree;
37 import org.turro.zkoss.text.WikiEditor;
38 import org.turro.zul.frame.Framework;
39 import org.zkoss.zk.ui.Component;
40 import org.zkoss.zk.ui.event.InputEvent;
41 import org.zkoss.zk.ui.select.annotation.Listen;
42 import org.zkoss.zk.ui.select.annotation.Wire;
43 import org.zkoss.zul.Checkbox;
44 import org.zkoss.zul.Datebox;
45 import org.zkoss.zul.Textbox;
53 private boolean modified;
56 private Textbox author;
62 private Datebox pubDate;
65 private Datebox retainTill;
77 private Checkbox accepted;
80 private Checkbox sent;
83 private Textbox pubTitle;
85 @Wire(
"#pubWikiSummary")
91 @Listen(
"onClick = #preview")
95 }
catch (InterruptedException ex) {
100 @Listen(
"onChange = #author")
102 entity.setAuthor(event.getValue());
112 @Listen(
"onChange = #pubTitle")
114 entity.setTitle(event.getValue());
118 @Listen(
"onChange = #pubSummary")
120 entity.setSummary(event.getValue());
124 @Listen(
"onChange = #pubBody")
126 entity.setBody(event.getValue());
130 @Listen(
"onChange = #pubWikiSummary")
132 entity.setWikiSummary(event.getValue());
136 @Listen(
"onChange = #pubWikiBody")
138 entity.setWikiBody(event.getValue());
144 return "publication";
151 entity.setCreation(
new Date());
171 author.setValue(
entity.getAuthor());
173 pubDate.setValue(
entity.getDate());
174 retainTill.setValue(
entity.getRetainTill());
178 pubTitle.setValue(
entity.getUnescapedTitle());
181 accepted.setChecked(
entity.isAccepted());
182 sent.setChecked(
entity.isSent());
184 sent.setDisabled(
true);
185 accepted.setDisabled(
true);
204 entity.setAccepted(
false);
206 return super.beforeSave();
211 return !
entity.isEmpty() && super.shouldBeSaved();
static IContact getIContact()
boolean isInRole(String role)
static Application getApplication()
static String logMsg(String msg)
static Messages confirmDeletion()
void setCategory(PublicationCategory category)
void setGroup(PublicationGroup group)
void onTitle(InputEvent event)
void onSummary(InputEvent event)
void onAuthor(InputEvent event)
void onWikiSummary(InputEvent event)
String getAttributeName()
void onBody(InputEvent event)
DaoEntity getWrapperInstance(Component comp)
Publication getEntityInstance(Long id)
void onWikiBody(InputEvent event)
void setImageFolder(String folder)
void setValue(String value)
void setFileFolder(String folder)
static Framework getCurrent()
void setSelectedLabel(String text)
void setSelectedTooltiptext(String text)