protected PageDefinition parse(String path, URL url, Object extra) throws Exception { final Locator locator = extra != null ? (Locator) extra : getLocator(_wapp, path); return new Parser(_wapp, locator).parse(url, path); } }
/** Returns the page definition of the specified path, or null if not found. * * <p>Dependency: Execution.createComponents -& Execution.getPageDefinition * -& UiFactory.getPageDefiition -& PageDefinitions.getPageDefinition */ public PageDefinition getPageDefinition(RequestInfo ri, String path) { return PageDefinitions.getPageDefinition(ri.getWebApp(), ri.getLocator(), path); }
/** Returns the page definition of the specified raw content; never null. * * <p>This is the lowest method that other getPageDefinitionDirectly depends. * * <p>Dependency: Execution.createComponentsDirectly -& Execution.getPageDefinitionDirectly * -& UiFactory.getPageDefiitionDirectly -& PageDefintions.getPageDefinitionDirectly * * @param locator the locator used to locate taglib and other resources. * If null, wapp is assumed ({@link WebApp} is also assumed). * @param extension the default extension if the content doesn't specify * an language. In other words, if * the content doesn't specify an language, {@link LanguageDefinition#getByExtension} * is called. * If extension is null and the content doesn't specify a language, * the language called "xul/html" is assumed. * @exception UiException if failed to parse */ public static final PageDefinition getPageDefinitionDirectly(WebApp wapp, Locator locator, String content, String extension) { try { return getPageDefinitionDirectly(wapp, locator, new StringReader(content), extension); } catch (IOException ex) { throw UiException.Aide.wrap(ex); } }
/** Returns the page definition of the specified path, or null if not * found or failed to parse. * * <p>This is the lowest method that other getPageDefinition depends. * * <p>Dependency: Execution.createComponents -& Execution.getPageDefinition * -& UiFactory.getPageDefiition -& PageDefintions.getPageDefinition * * @param locator the locator used to locate taglib and other resources. * If null, wapp is assumed ({@link WebApp} is also assumed). */ public static final PageDefinition getPageDefinition(WebApp wapp, Locator locator, String path) { wapp.getConfiguration().invokeURIInterceptors(path); //give the security a chance to reject return ResourceCaches.get(getCache(wapp), wapp.getServletContext(), path, locator); }
protected PageDefinition parse(String path, File file, Object extra) throws Exception { final Locator locator = extra != null ? (Locator) extra : getLocator(_wapp, path); Parser parser = new Parser(_wapp, locator); // Bug ZK-1132 if (file.exists()) { return parser.parse(file, path); } else { InputStream stream = parser.getLocator().getResourceAsStream(path); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(stream)); PageDefinition pgdef = parser.parse(reader, Servlets.getExtension(path)); pgdef.setRequestPath(path); return pgdef; } finally { if (reader != null) reader.close(); } } }
protected PageDefinition parse(InputStream is, String path, String orgpath) throws Exception { return PageDefinitions.getPageDefinitionDirectly(getWebApp(), _webctx.getLocator(), new java.io.InputStreamReader(is, "UTF-8"), Servlets.getExtension(path)); }
private RequestInfo newRequestInfo(String uri) { final Desktop dt = getDesktop(); return new RequestInfoImpl(dt, _request, PageDefinitions.getLocator(getDesktop().getWebApp(), uri)); }
/** Returns the page definition of the specified content; never null. * * <p>Dependency: Execution.createComponentsDirectly -& Execution.getPageDefinitionDirectly * -& UiFactory.getPageDefiitionDirectly -& PageDefintions.getPageDefinitionDirectly */ public PageDefinition getPageDefinitionDirectly(RequestInfo ri, String content, String extension) { return PageDefinitions.getPageDefinitionDirectly(ri.getWebApp(), ri.getLocator(), content, extension); }
PageDefinitions.getLocator(wapp, path));
public PageDefinition getPageDefinitionDirectly(RequestInfo ri, Reader reader, String extension) throws IOException { return PageDefinitions.getPageDefinitionDirectly(ri.getWebApp(), ri.getLocator(), reader, extension); } }
PageDefinitions.getLocator(wapp, path)); ((SessionCtrl) sess).notifyClientRequest(true);
public PageDefinition getPageDefinitionDirectly(RequestInfo ri, Document content, String extension) { return PageDefinitions.getPageDefinitionDirectly(ri.getWebApp(), ri.getLocator(), content, extension); }
/** Creates an desktop. */ private Desktop newDesktop(Session sess, ServletRequest request, ServletResponse response, String path) { final Locator loc = PageDefinitions.getLocator(_wapp, path); //we have to retrieve locator before setting execution, //since it assumes exec.getDesktop not null //which is true except this moment (before desktop is created) final Execution exec = ExecutionsCtrl.getCurrent(); final TemporaryExecution de = new TemporaryExecution(_ctx, (HttpServletRequest) request, (HttpServletResponse) response, null); ExecutionsCtrl.setCurrent(de); try { Desktop desktop = ((WebAppCtrl) _wapp).getUiFactory() .newDesktop(new RequestInfoImpl(_wapp, sess, null, request, loc), _updateURI, path); return !de.isVoided() ? desktop : null; } finally { ExecutionsCtrl.setCurrent(exec); } }
PageDefinitions.getLocator(wapp, path)); ((SessionCtrl) sess).notifyClientRequest(true);
final RequestInfo ri = new RequestInfoImpl( wapp, sess, desktop, request, PageDefinitions.getLocator(wapp, path)); ((SessionCtrl)sess).notifyClientRequest(true);
PageDefinitions.getLocator(wapp, path)); ((SessionCtrl) sess).notifyClientRequest(true);
PageDefinitions.getLocator(wapp, path)); ((SessionCtrl) sess).notifyClientRequest(true);