19 package org.turro.newsletter;
22 import org.turro.command.Command;
23 import org.turro.command.Context;
24 import org.turro.composer.EntityPathComposer;
25 import org.turro.elephant.context.ElephantContext;
26 import org.turro.i18n.I_;
27 import org.turro.publication.db.PublicationPU;
28 import org.turro.publication.entity.NewsSection;
29 import org.turro.zkoss.dialog.SelectionDialog;
30 import org.turro.zkoss.text.RepositoryContent;
31 import org.turro.zkoss.text.RepositoryWalker;
32 import org.zkoss.zk.ui.Component;
33 import org.zkoss.zk.ui.event.Event;
34 import org.zkoss.zk.ui.event.Events;
35 import org.zkoss.zk.ui.select.annotation.Listen;
36 import org.zkoss.zk.ui.select.annotation.Wire;
37 import org.zkoss.zul.Html;
38 import org.zkoss.zul.Textbox;
50 private Textbox urlLink;
52 @Listen(
"onClick = #selImage")
61 public Object execute(Context context) {
64 entity.setWiki(
"$no_wiki\n" + imageString(result));
65 entity.setBody(imageString(result));
66 html.setContent(
entity.getBody());
67 Events.postEvent(
new Event(Events.ON_CHANGE));
74 @Listen(
"onChange = #urlLink")
76 entity.setBanner(urlLink.getValue());
77 Events.postEvent(
new Event(Events.ON_CHANGE));
82 super.doAfterCompose(comp);
83 html.setContent(
entity.getBody());
84 urlLink.setValue(
entity.getBanner());
87 private String imageString(File image) {
88 StringBuilder sb =
new StringBuilder();
89 sb.append(
"<img border=\"0\" style=\"width:100%;\" src=\"")
static String getRelativePath(String path)
static String getRootWebPath()
static String get(String msg)
void doAfterCompose(Component comp)
static String getObjectPath(Object object)
static void showComponent(Page page, String title, Component component, String width, String height, final Command command)
static final String IMAGE_FILTER
void setFilter(String filter)
void selectFolder(String folder)
void setNoTreeRepository(boolean noTreeRepository)
void setReadOnlyRepository(boolean readOnlyRepository)