public List<ComponentAgent> getRoots() { List<ComponentAgent> agents = new ArrayList<ComponentAgent>(); Iterator<?> iterator = page.getRoots().iterator(); while (iterator.hasNext()) agents.add(new DefaultComponentAgent(this, (Component) iterator .next())); return agents; }
public Desktop getDesktop() { return _page != null ? _page.getDesktop() : null; }
/** Shows notification at given coordinate */ public AuNotification(String msg, String type, Page page, Component ref, int x, int y, int duration, boolean closable) { super("showNotification", new Object[] { msg, type, page.getUuid(), ref, null, new int[] { x, y }, duration, closable }); }
/** Constructs a page with another page as instance * @since 6.0.0 */ public PageImpl(Page ref) { this(ref.getLanguageDefinition(), ref.getComponentDefinitionMap(), ref.getRequestPath(), ref.getZScriptLanguage()); }
public Page getPageIfAny(String pageId) { //Spec: we allow user to access this method concurrently, so //synchronized is required Page page = null; synchronized (_pages) { for (Page pg : _pages) { if (Objects.equals(pageId, pg.getId())) return pg; if (Objects.equals(pageId, pg.getUuid())) page = pg; } } return page; }
private static void outDivTemplateEnd(Page page, Writer out) throws IOException { final Desktop dt; if (page != null && (dt = page.getDesktop()) != null) { if (dt.getAttribute(ATTR_DESKTOP_CLIENTINFO) != null) { dt.removeAttribute(ATTR_DESKTOP_CLIENTINFO); if (!"CE".equals(WebApps.getEdition())) out.write( "<script type=\"text/javascript\">if(zk.clientinfo === undefined)zk.clientinfo = true;</script>"); } if (dt.getAttribute(ATTR_DESKTOP_VISIBILITYCHANGE) != null) { dt.removeAttribute(ATTR_DESKTOP_VISIBILITYCHANGE); out.write( "<script type=\"text/javascript\">if(zk.visibilitychange === undefined)zk.visibilitychange = true;</script>"); } String resourceURL = (String) page.getAttribute(ATTR_PORTLET2_RESOURCEURL, Page.PAGE_SCOPE), namespace = (String) page.getAttribute(ATTR_PORTLET2_NAMESPACE, Page.PAGE_SCOPE); if (resourceURL != null) { page.removeAttribute(ATTR_PORTLET2_RESOURCEURL, Page.PAGE_SCOPE); page.removeAttribute(ATTR_PORTLET2_NAMESPACE, Page.PAGE_SCOPE); // B65-ZK-2210: store url and namespace per desktop. out.write("<script type=\"text/javascript\">if(!zk.portlet2Data) zk.portlet2Data = {};\n" + "zk.portlet2Data['" + dt.getId() + "'] = {" + "resourceURL: '" + resourceURL + "', " + "namespace: '" + namespace + "'};</script>"); } } outSEOContent(page, out); out.write("</div>"); }
final Desktop desktop = page.getDesktop(); final PageCtrl pageCtrl = (PageCtrl) page; final Component owner = pageCtrl.getOwner(); String style = page.getStyle(); if (style == null || style.length() == 0) { style = null; outDivTemplateBegin(out, page.getUuid()); out.write(','); out.write("\n[0,'"); //0: page out.write(page.getUuid()); out.write("',{"); final String pgid = page.getId(); if (pgid.length() > 0) appendProp(props, "id", pgid); out.write("},["); for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) ((ComponentCtrl) root).redraw(out);
out.write(page.getUuid()); out.write("','"); out.write(desktop.getId()); out.write('\''); String style = page.getStyle(); if (style != null && style.length() > 0) { out.write(",{style:'"); for (Iterator it = page.getRoots().iterator(); it.hasNext();) { final Component comp = (Component)it.next(); if (!(comp instanceof Inline)) { out.write(">"); if (page != null) { final WebApp wapp = page.getDesktop().getWebApp(); String currentVersion = wapp.getVersion(); if (Utils.compareVersion(Utils.parseVersion(currentVersion),
public Class<?> resolveImplementationClass(Page page, String clsnm) throws ClassNotFoundException { final Object cls = clsnm != null ? clsnm : _implcls; if (cls instanceof String) { clsnm = (String) cls; final Class<?> found = page != null ? page.resolveClass(clsnm) : Classes.forNameByThread(clsnm); if (clsnm.equals(_implcls)) _implcls = found; //cache to _implcls (to improve the performance) return found; } return (Class) cls; }
public void render(Page page, Writer out) throws IOException { out.write(HtmlPageRenders.outLangStyleSheets(_exec, null, null)); out.write(HtmlPageRenders.outLangJavaScripts(_exec, null, null)); if (_pageDOM) { HtmlPageRenders.outPageContent(_exec, page, out, false); return; } final Desktop desktop = _exec.getDesktop(); out.write("<script class=\"z-runonce\" type=\"text/javascript\">zkpb('"); out.write(page.getUuid()); out.write("','"); out.write(desktop.getId()); out.write("','"); out.write(getContextURI()); out.write("','"); out.write(desktop.getUpdateURI(null)); out.write("','"); out.write(desktop.getRequestPath()); out.write('\''); String style = page.getStyle(); if (style != null && style.length() > 0) { out.write(",{style:'"); out.write(style); out.write("'}"); } out.write(");zkpe();</script>\n"); for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) { HtmlPageRenders.outStandalone(_exec, root, out); } }
bean = page.getZScriptVariable(comp, beanid); if (bean == null) { final Object self = page.getAttribute("self"); try { page.setAttribute("self", comp); bean = comp.getAttributeOrFellow(beanid, true); if (bean == null) bean = page.getXelVariable(null, null, beanid, true); } finally { if (self == null) { page.removeAttribute("self"); } else { page.setAttribute("self", self);
return page.getFirstRoot(); //the first root assumed
Initiator[] sysinits = null; if (page != null) { final WebApp wapp = page.getDesktop().getWebApp(); String currentVersion = wapp.getVersion(); if(org.zkoss.util.Utils.compareVersion( if (frag != null) Utils.adjustChildren( page, null, page.getRoots(), out.toString()); } catch (Exception ex) {
if (page.getAttribute(_name) != null) { //already a binder on the page throw new UiException( "Page is already covered by another Data Binder. Cannot be covered by this Data Binder again. Page:" + page.getId()); } else { page.setAttribute(_name, _binder); final Component comp = page.getFellow(_compPath); _binder = new AnnotateDataBinder(comp, b);
if(p.getFirstRoot() == null) { continue; if (p.getFirstRoot() == null) { foundComponents = new LinkedList<Component>(); } else { Page pg = comp.getPage(); if (desktopAgent == null) { desktopAgent = new DefaultDesktopAgent(parent.getClient(), pg.getDesktop());
case PAGE_SCOPE: if (_page != null) return _page.getAttributes(); return Collections.emptyMap(); case DESKTOP_SCOPE: if (_page != null) return _page.getDesktop().getAttributes(); return Collections.emptyMap(); case SESSION_SCOPE: if (_page != null) return _page.getDesktop().getSession().getAttributes(); return Collections.emptyMap(); case APPLICATION_SCOPE: if (_page != null) return _page.getDesktop().getWebApp().getAttributes(); return Collections.emptyMap(); case COMPONENT_SCOPE:
public Object getAttribute(String name) { return _page.getAttribute(name, true); }
if (pageTemplates != null) { for (Map.Entry<String, TemplateInfo> entry : pageTemplates.entrySet()) { page.addTemplate(entry.getKey(), new TemplateImpl(entry.getValue(), null)); richlet.service(page); for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) { doAfterCompose(composer, root); afterCreate(exec, new Component[] { root });
ComponentDefinition compdef; if (_macroURI != null) { compdef = page.getLanguageDefinition().getMacroDefinition(_name, _macroURI, _inline, null); final ComponentDefinition ref = page.getLanguageDefinition() .getComponentDefinition(_extends); if (ref.isMacro()) throw new UiException(" The Macro-define's property: 'use' cannot be empty! "); final ComponentDefinitionImpl cdi = new ComponentDefinitionImpl(page.getLanguageDefinition(), null, _name, (Class)null); cdi.setCurrentDirectory(null); page.getComponentDefinitionMap().add(compdef); ZkProxy.getProxy().addMold(compdef, _widgetClass, _moldName, _moldURI);
private static boolean isRawLabel(Page page) { final LanguageDefinition langdef = page.getLanguageDefinition(); return langdef != null && langdef.isRawLabel(); }