public StaleSessionException(String message, IPage page) { super(message, page, null, null); _page = page; if (page != null) _pageName = page.getPageName(); else _pageName = null; }
public Page getSiteMeshPage() { return Util.getPage(getPage().getRequestCycle()); } }
/** * Finds a component with the current address using the given RequestCycle. * * @param cycle * the RequestCycle to use to locate the component * @return IComponent a component that has been initialized for the given RequestCycle */ public IComponent findComponent(IRequestCycle cycle) { IPage objPage = cycle.getPage(_pageName); return objPage.getNestedComponent(_idPath); }
/** * Builds a key from an existing page, using the page's name and locale. This is used when * storing a page into the pool. * * @param page * The page to build the key for. * * @return The unique key for the specified page instance. */ protected PageKey buildKey(IPage page) { return new PageKey(page.getPageName(), page.getLocale()); }
private IPage loadPage(String name) { IPage result = _pageSource.getPage(this, name); // Get the recorder that will eventually observe and record // changes to persistent properties of the page. IPageRecorder recorder = getPageRecorder(name); // Have it rollback the page to the prior state. Note that // the page has a null observer at this time (which keeps // these changes from being sent to the page recorder). recorder.rollback(result); // Now, have the page use the recorder for any future // property changes. result.setChangeObserver(recorder); // fire off pageAttached now that properties have been restored result.firePageAttached(); return result; }
public void render(IMarkupWriter writer, IRequestCycle cycle) { IPage page = cycle.getPage(); StringBuffer sb = new StringBuffer(); sb.append("/"); if (page.getNamespace().getId() == null) { String name = page.getPageName(); int slashx = name.lastIndexOf('/'); // Include the directory and trailing slash. if (slashx > 0) sb.append(name.substring(0, slashx + 1)); } String url = cycle.getAbsoluteURL(sb.toString()); writer.beginEmpty("base"); writer.attribute("href", url); writer.printRaw("<!--[if IE]></base><![endif]-->"); writer.println(); }
_component.getPage().addPageDetachListener(this); _registeredForDetach = true; _component.getPage().addPageEndRenderListener(this); _registeredForRender = true;
/** * Gets the page from a pool, or otherwise loads the page. This operation is threadsafe. */ public IPage getPage(IRequestCycle cycle, String pageName) { IEngine engine = cycle.getEngine(); Object key = buildKey(engine, pageName); IPage result; // lock our page specific key lock first // This is only a temporary measure until a more robust // page pool implementation can be created. try { result = (IPage) _pool.borrowObject(key); } catch (Exception ex) { if (RuntimeException.class.isInstance(ex)) throw (RuntimeException)ex; else throw new ApplicationRuntimeException(PageloadMessages.errorPagePoolGet(key), ex); } if (result.getEngine() == null) { // This call will also fire events to any PageAttachListeners result.attach(engine, cycle); } return result; }
public void finishLoad(IRequestCycle objCycle, IPageLoader arg0, ComponentSpecification arg1) { super.finishLoad(objCycle, arg0, arg1); getPage().addPageDetachListener(this); m_objOpenNodeImage = getAsset("_openNodeImage"); m_objCloseNodeImage = getAsset("_closeNodeImage"); }
/** * Returns the page to the appropriate pool. Invokes {@link IPage#detach()}. */ public void releasePage(IPage page) { Tapestry.clearMethodInvocations(); page.detach(); Tapestry.checkMethodInvocation(Tapestry.ABSTRACTPAGE_DETACH_METHOD_ID, "detach()", page); PageKey key = buildKey(page); try { _pool.returnObject(key, page); } catch (Exception ex) { if (RuntimeException.class.isInstance(ex)) throw (RuntimeException)ex; else throw new ApplicationRuntimeException(PageloadMessages.errorPagePoolGet(key), ex); } }
page.attach(cycle.getEngine(), cycle);
/** * Builds a key from an existing page, using the page's name and locale. This is used when * storing a page into the pool. * * @param page * The page to build the key for. * * @return The unique key for the specified page instance. */ protected PageKey buildKey(IPage page) { return new PageKey(page.getPageName(), page.getLocale()); }
public void render(IMarkupWriter writer, IRequestCycle cycle) { IPage page = cycle.getPage(); StringBuffer sb = new StringBuffer(); sb.append("/"); if (page.getNamespace().getId() == null) { String name = page.getPageName(); int slashx = name.lastIndexOf('/'); // Include the directory and trailing slash. if (slashx > 0) sb.append(name.substring(0, slashx + 1)); } String url = cycle.getAbsoluteURL(sb.toString()); writer.beginEmpty("base"); writer.attribute("href", url); writer.printRaw("<!--[if IE]></base><![endif]-->"); writer.println(); }
_component.getPage().addPageDetachListener(this); _registeredForDetach = true; _component.getPage().addPageEndRenderListener(this); _registeredForRender = true;
private IPage loadPage(String name) { IPage result = _pageSource.getPage(this, name); // Get the recorder that will eventually observe and record // changes to persistent properties of the page. IPageRecorder recorder = getPageRecorder(name); // Have it rollback the page to the prior state. Note that // the page has a null observer at this time (which keeps // these changes from being sent to the page recorder). recorder.rollback(result); // Now, have the page use the recorder for any future // property changes. result.setChangeObserver(recorder); // fire off pageAttached now that properties have been restored result.firePageAttached(); return result; }
/** * Gets the page from a pool, or otherwise loads the page. This operation is threadsafe. */ public IPage getPage(IRequestCycle cycle, String pageName) { IEngine engine = cycle.getEngine(); Object key = buildKey(engine, pageName); IPage result; // lock our page specific key lock first // This is only a temporary measure until a more robust // page pool implementation can be created. try { result = (IPage) _pool.borrowObject(key); } catch (Exception ex) { if (RuntimeException.class.isInstance(ex)) throw (RuntimeException)ex; else throw new ApplicationRuntimeException(PageloadMessages.errorPagePoolGet(key), ex); } if (result.getEngine() == null) { // This call will also fire events to any PageAttachListeners result.attach(engine, cycle); } return result; }
page.beginPageRender(); page.endPageRender();
/** * Returns the page to the appropriate pool. Invokes {@link IPage#detach()}. */ public void releasePage(IPage page) { Tapestry.clearMethodInvocations(); page.detach(); Tapestry.checkMethodInvocation(Tapestry.ABSTRACTPAGE_DETACH_METHOD_ID, "detach()", page); PageKey key = buildKey(page); try { _pool.returnObject(key, page); } catch (Exception ex) { if (RuntimeException.class.isInstance(ex)) throw (RuntimeException)ex; else throw new ApplicationRuntimeException(PageloadMessages.errorPagePoolGet(key), ex); } }
page.attach(cycle.getEngine(), cycle);