19 package org.turro.elephant;
22 import java.io.FileReader;
23 import java.io.IOException;
24 import java.util.HashMap;
26 import java.util.logging.Level;
27 import java.util.logging.Logger;
28 import org.turro.auth.Authentication;
29 import org.turro.elephant.context.Application;
30 import org.turro.elephant.context.ElephantContext;
31 import org.turro.elephant.context.IConstructor;
32 import org.turro.marker.ElephantMarker;
33 import org.turro.security.FlatPermissions;
34 import static org.zkoss.zk.ui.Component.SESSION_SCOPE;
35 import org.zkoss.zk.ui.Executions;
36 import org.zkoss.zk.ui.IdSpace;
37 import org.zkoss.zk.ui.ext.AfterCompose;
38 import org.zkoss.zk.ui.select.Selectors;
39 import org.zkoss.zul.Div;
47 private String rootTmpl, tmpl;
50 this.rootTmpl = rootTmpl;
62 getPage().setAttribute(
"rolemap",
new FlatPermissions().asMap(), SESSION_SCOPE);
71 private void initControl() {
76 }
else if(ElephantMarker.existsTemplate(constructor,
false, rootTmpl, tmpl)) {
77 file = ElephantMarker.fileTemplate(constructor,
false, rootTmpl, tmpl);
81 Map<String, Object> args =
new HashMap<>();
82 args.put(
"tmplctrl",
this);
83 Executions.createComponentsDirectly(
new FileReader(file),
null,
this, args);
84 Selectors.wireComponents(
this,
this,
false);
85 Selectors.wireEventListeners(
this,
this);
86 }
catch (IOException ex) {
87 Logger.getLogger(TemplateControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static IContact getIContact()
static boolean hasContact()
void setTmpl(String tmpl)
void setRootTmpl(String rootTmpl)
IConstructor getConstructor()
static Application getApplication()
static File fileTemplate(IConstructor constructor, boolean mail, String root, String name)
static boolean existsTemplate(IConstructor constructor, boolean mail, String root, String name)