Package org.apache.wicket

Examples of org.apache.wicket.Session$IPageMapVisitor


      // if there is a pagemap name specified and multiwindow support is
      // on
      if (getPageMapName() != null)
      {
        // try to find out whether the pagemap already exists
        Session session = Session.get();
        if (session.pageMapForName(getPageMapName(), false) == null)
        {
          deletePageMap = true;
        }
        parameters.setPageMapName(getPageMapName());
      }
View Full Code Here


      // should we cleanup the pagemap?
      if (deletePageMap == true)
      {
        // get the pagemap
        Session session = Session.get();
        IPageMap pageMap = session.pageMapForName(getPageMapName(), false);

        // if there is any remove it
        if (pageMap != null)
        {
          session.removePageMap(pageMap);
          deletePageMap = false;
        }
      }

      if (windowClosedCallback != null)
View Full Code Here

   * Test for WICKET-3123
   */
  @Test
  public void sessionBinding()
  {
    Session session = tester.getSession();
    assertTrue(session.isTemporary());
    session.bind();
    assertFalse(session.isTemporary());
  }
View Full Code Here

    {
      if (activeRequests.get() > 0)
      {
        requestdata.setActiveRequest(activeRequests.decrementAndGet());
      }
      Session session = Session.get();
      String sessionId = session.getId();
      requestdata.setSessionId(sessionId);

      Object sessionInfo = getSessionInfo(session);
      requestdata.setSessionInfo(sessionInfo);

      long sizeInBytes = -1;
      if (Application.exists() && Application.get().getRequestLoggerSettings().getRecordSessionSize())
      {
        try
        {
          sizeInBytes = session.getSizeInBytes();
        }
        catch (Exception e)
        {
          // log the error and let the request logging continue (this is what happens in
          // the detach phase of the request cycle anyway. This provides better
View Full Code Here

      // if there is a pagemap name specified and multiwindow support is
      // on
      if (getPageMapName() != null)
      {
        // try to find out whether the pagemap already exists
        Session session = Session.get();
        if (session.pageMapForName(getPageMapName(), false) == null)
        {
          deletePageMap = true;
        }
        parameters.setPageMapName(getPageMapName());
      }
View Full Code Here

      // should we cleanup the pagemap?
      if (deletePageMap == true)
      {
        // get the pagemap
        Session session = Session.get();
        IPageMap pageMap = session.pageMapForName(getPageMapName(), false);

        // if there is any remove it
        if (pageMap != null)
        {
          session.removePageMap(pageMap);
          deletePageMap = false;
        }
      }

      if (windowClosedCallback != null)
View Full Code Here

      else
      {
        name = name.replace('"', '_');
      }

      Session session = Session.get();

      Session.PageMapAccessMetaData meta = (Session.PageMapAccessMetaData)session
          .getMetaData(Session.PAGEMAP_ACCESS_MDK);
      if (meta == null)
      {
        meta = new Session.PageMapAccessMetaData();
        session.setMetaData(Session.PAGEMAP_ACCESS_MDK, meta);
      }
      boolean firstAccess = meta.add(pageMap);

      if (firstAccess)
      {
        // this is the first access to the pagemap, set window.name
        JavascriptUtils.writeOpenTag(response);
        response
            .write("if (window.name=='' || window.name.indexOf('wicket') > -1) { window.name=\"");
        response.write(name);
        response.write("\"; }");
        JavascriptUtils.writeCloseTag(response);
      }
      else
      {
        // Here is our trickery to detect whether the current request
        // was
        // made in a new window/ tab, in which case it should go in a
        // different page map so that we don't intermangle the history
        // of
        // those windows
        CharSequence url = null;
        if (target instanceof IBookmarkablePageRequestTarget)
        {
          IBookmarkablePageRequestTarget current = (IBookmarkablePageRequestTarget)target;
          BookmarkablePageRequestTarget redirect = new BookmarkablePageRequestTarget(
              session.createAutoPageMapName(), current.getPageClass(), current
                  .getPageParameters());
          url = cycle.urlFor(redirect);
        }
        else
        {
View Full Code Here

   */
  protected ClientInfo newClientInfo()
  {
    if (getApplication().getRequestCycleSettings().getGatherExtendedBrowserInfo())
    {
      Session session = getSession();
      if (session.getMetaData(BROWSER_WAS_POLLED_KEY) == null)
      {
        // we haven't done the redirect yet; record that we will be
        // doing that now and redirect
        session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE);
        throw new RestartResponseAtInterceptPageException(new BrowserInfoPage(getRequest().getRelativePathPrefixToContextRoot() + getRequest().getURL()));
      }
      // if we get here, the redirect already has been done; clear
      // the meta data entry; we don't need it any longer is the client
      // info object will be cached too
      session.setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null);
    }
    return new WebClientInfo(this);
  }
View Full Code Here

   *
   */
  protected Object load()
  {
    // Initialise information that we need to work successfully
    final Session session = Session.get();
    if (session != null)
    {
      this.localizer = Application.get().getResourceSettings().getLocalizer();
      this.locale = session.getLocale();
    }
    else
    {
      throw new WicketRuntimeException(
          "Cannot attach a string resource model without a Session context because that is required to get a Localizer");
View Full Code Here

        if (active > 0)
        {
          rd.setActiveRequest(active--);
        }
      }
      Session session = Session.get();
      String sessionId = session.getId();
      rd.setSessionId(sessionId);

      Object sessionInfo = getSessionInfo(session);
      rd.setSessionInfo(sessionInfo);

      long sizeInBytes = -1;
      if (Application.get().getRequestLoggerSettings().getRecordSessionSize())
      {
        try
        {
          sizeInBytes = session.getSizeInBytes();
        }
        catch (Exception e)
        {
          // log the error and let the request logging continue (this is what happens in the
          // detach phase of the request cycle anyway. This provides better diagnostics).
View Full Code Here

TOP

Related Classes of org.apache.wicket.Session$IPageMapVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.