Package org.apache.wicket

Examples of org.apache.wicket.Session$PageAccessSynchronizerProvider


   */
  protected IRequestTarget resolveBookmarkablePage(final RequestCycle requestCycle,
    final RequestParameters requestParameters)
  {
    String bookmarkablePageClass = requestParameters.getBookmarkablePageClass();
    Session session = requestCycle.getSession();
    Class pageClass;
    try
    {
      pageClass = session.getClassResolver().resolveClass(bookmarkablePageClass);
    }
    catch (ClassNotFoundException e)
    {
      return new WebErrorCodeResponseTarget(HttpServletResponse.SC_NOT_FOUND,
        "Unable to load Bookmarkable Page");
    }

    try
    {
      PageParameters params = new PageParameters(requestParameters.getParameters());
      if (requestParameters.getComponentPath() != null &&
        requestParameters.getInterfaceName() != null)
      {
        final String componentPath = requestParameters.getComponentPath();
        final Page page = session.getPage(requestParameters.getPageMapName(),
          componentPath, requestParameters.getVersionNumber());

        if (page != null && page.getClass() == pageClass)
        {
          return resolveListenerInterfaceTarget(requestCycle, page, componentPath,
View Full Code Here


   * @return the home page as a request target
   */
  protected IRequestTarget resolveHomePageTarget(final RequestCycle requestCycle,
    final RequestParameters requestParameters)
  {
    Session session = requestCycle.getSession();
    Application application = session.getApplication();
    try
    {
      // Get the home page class
      Class homePageClass = application.getHomePage();

View Full Code Here

   */
  protected IRequestTarget resolveRenderedPage(final RequestCycle requestCycle,
    final RequestParameters requestParameters)
  {
    final String componentPath = requestParameters.getComponentPath();
    final Session session = requestCycle.getSession();
    final Page page = session.getPage(requestParameters.getPageMapName(), componentPath,
      requestParameters.getVersionNumber());

    // Does page exist?
    if (page != null)
    {
View Full Code Here

        if (requestParameters.isOnlyProcessIfPathActive())
        {
          // this request has indeed been flagged as
          // process-only-if-path-is-active

          Session session = Session.get();
          IPageMap pageMap = session.pageMapForName(requestParameters.getPageMapName(),
            false);
          if (pageMap == null)
          {
            // requested pagemap no longer exists - ignore this
            // request
View Full Code Here

          log.debug("will use " + sessionKey +
            " as the session key to get the Wicket session");
        }
      }

      Session session = (Session)httpSession.getAttribute(sessionKey);
      if (session != null)
      {
        // set the session's threadlocal
        Session.set(session);
View Full Code Here

   *
   */
  protected Object load()
  {
    // Initialize information that we need to work successfully
    final Session session = Session.get();
    if (session != null)
    {
      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

      // 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

     */
    public void put(Page page)
    {
      if (!page.isPageStateless())
      {
        Session session = getSession();
        String sessionId = session.getId();
        if (sessionId != null && !session.isSessionInvalidated())
        {
          // the id could have changed from null during request
          this.sessionId = sessionId;
          getStore().storePage(sessionId, page);
          setLastPage(page);
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("wicket-" + 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 intermingle 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

    final IResourceStreamLocator locator = Application.get()
      .getResourceSettings()
      .getResourceStreamLocator();


    final Session session = Session.get();
    final String style = session.getStyle();
    final Locale locale = session.getLocale();

    MarkupResourceStream markupResourceStream = null;
    Class containerClass = getClass();

    while (!(containerClass.equals(MarkupComponentBorder.class)))
View Full Code Here

TOP

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

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.