Package org.xadoop.servlet.pages

Examples of org.xadoop.servlet.pages.AbstractPage


    actionMap.put(LogoutAction.ACTIONNAME, new LogoutAction());
    actionMap.put(XQueryMRAction.ACTIONNAME, new XQueryMRAction());
    context.setAttribute(XadoopConstants.CTX_ACTIONMAP, actionMap);

    // page map
    AbstractPage errorPage = new ErrorPage("");
    AbstractPage homePage = new HomePage();
    AbstractPage loginPage = new LoginPage();
    AbstractPage xquerymroriginalPage = new XQueryMROriginalPage();
    AbstractPage xquerymrsaxonPage = new XQueryMRSaxonPage();
    AbstractPage xquerymrzorbaPage = new XQueryMRZorbaPage();
    HashMap<String, AbstractPage> pageMap = new HashMap<String, AbstractPage>();
    pageMap.put(errorPage.name, errorPage);
    pageMap.put(homePage.name, homePage);
    pageMap.put(loginPage.name, loginPage);
    pageMap.put(xquerymroriginalPage.name, xquerymroriginalPage);
View Full Code Here


        }
      }
    }

    // find page to render
    AbstractPage page = null;
    if (msg != null) {
      page = new ErrorPage(msg);
    } else {
      if (isLoggedIn) {

        // logged in users may see all pages
        ServletContext ctx = req.getSession().getServletContext();
        HashMap<String, AbstractPage> pageMap = getPageMap(ctx);
        String pageStr = req.getParameter(AbstractPage.P_PAGE);
        page = pageMap.get(pageStr);
        if (page == null) {
          String pagenameDefault = AbstractPage.extractPagename(HomePage.class);
          page = pageMap.get(pagenameDefault);
        }
      } else {

        // not logged in users may see only the login page
        page = new LoginPage();
      }
    }

    // get html
    StringBuffer html = null;
    try {
      html = page.getHtml(req);
    } catch (Exception e) {
      html = new ErrorPage(e.getMessage()).getHtml(req);
    }

    // produce output
View Full Code Here

TOP

Related Classes of org.xadoop.servlet.pages.AbstractPage

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.