Examples of NavigationManager


Examples of net.sf.wfnm.NavigationManager

        AttributeContainer sessionWrapper = (AttributeContainer) HttpSessionWrapper.wrapItIfNecessary(req.getSession());

        if (!Config.getInstance().isEnabled() || !NavigationManagerFactory.existsInstance(sessionWrapper)) {
            filterChain.doFilter(servletRequest, servletResponse);
        } else {
            NavigationManager navigationManager = NavigationManagerFactory.getInstance(sessionWrapper);

            Object lock = navigationManager.getLock();
            boolean isFirst = (lock == null);

            try {
                if (isFirst) {
                    synchronized (req.getSession()) {
                        lock = navigationManager.getLock();
                        isFirst = (lock == null);

                        if (isFirst) {
                            lock = new Object();
                            navigationManager.setLock(lock);
                            filterChain.doFilter(servletRequest, servletResponse);
                        }
                    }
                }
            } finally {
                if (isFirst) {
                    synchronized (req.getSession()) {
                        synchronized (lock) {
                            navigationManager.setLock(null);
                            lock.notifyAll();
                        }
                    }
                } else {
                    synchronized (lock) {
                        Object currentLock = navigationManager.getLock();

                        if (currentLock == lock) {
                            try {
                                lock.wait();
                            } catch (InterruptedException ie) {
                                log.warn("Interrupted exception");
                            }
                        }
                    }

                    synchronized (req.getSession()) {
                        String url = navigationManager.getCurrentPage();
                        String rewrittenUrl = ((urlRewriter != null) ? urlRewriter.rewriteUrl(url) : url);
                        String fullUrl = req.getContextPath() + rewrittenUrl;
                        HttpServletResponse res = (HttpServletResponse) servletResponse;
                        res.sendRedirect(fullUrl);
                    }
View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param url the url of the page
     */
    public static void simulateNotifyPreviousPage(HttpSession session, String url) {
        if ((url != null) && Config.getInstance().isEnabled()) {
            AttributeContainer container = (AttributeContainer) HttpSessionWrapper.wrapItIfNecessary(session);
            NavigationManager navigationManager = NavigationManagerFactory.getInstance(container);

            if (navigationManager.isPageVisited(url)) {
                navigationManager.notifyPage(container, url, null, null);
            }
        }
    }
View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param session the http session
     */
    public static void simulateNotifyPreviousPage(HttpSession session) {
        if (Config.getInstance().isEnabled()) {
            AttributeContainer container = (AttributeContainer) HttpSessionWrapper.wrapItIfNecessary(session);
            NavigationManager navigationManager = NavigationManagerFactory.getInstance(container);
            String url = navigationManager.getPreviousPage();

            if ((url != null) && navigationManager.isPageVisited(url)) {
                navigationManager.notifyPage(container, url, null, null);
            }
        }
    }
View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param session the http session
     */
    public static void simulateNotifyPreviousWebflow(HttpSession session) {
        if (Config.getInstance().isEnabled()) {
            AttributeContainer container = (AttributeContainer) HttpSessionWrapper.wrapItIfNecessary(session);
            NavigationManager navigationManager = NavigationManagerFactory.getInstance(container);
            String url = navigationManager.getPreviousWebflow();

            if (url != null) {
                navigationManager.notifyPage(container, url, null, null);
            }
        }
    }
View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param webflowName the previous webflow
     */
    public static void simulateNotifyPreviousWebflow(HttpSession session, String webflowName) {
        if (Config.getInstance().isEnabled()) {
            AttributeContainer container = (AttributeContainer) HttpSessionWrapper.wrapItIfNecessary(session);
            NavigationManager navigationManager = NavigationManagerFactory.getInstance(container);
            String url = navigationManager.getPreviousWebflow(webflowName);

            if (url != null) {
                navigationManager.notifyPage(container, url, null, null);
            }
        }
    }
View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param session the http session
     *
     * @return the url of the current page
     */
    public static String getCurrentPage(HttpSession session) {
        NavigationManager navigationManager = getNavigationManager(session);

        return navigationManager.getCurrentPage();
    }
View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param session the http session
     *
     * @return the current webflow name (null=no webflow opened)
     */
    public static String getCurrentWebflowName(HttpSession session) {
        NavigationManager navigationManager = getNavigationManager(session);

        return navigationManager.getCurrentWebflow();
    }
View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param url the url of the page
     *
     * @return true if the page has been visited
     */
    public static boolean isPageVisited(HttpSession session, String url) {
        NavigationManager navigationManager = getNavigationManager(session);

        return navigationManager.isPageVisited(url);
    }
View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param currentIfNotExists indicates to reload the current page if it does not exists
     *
     * @return the url of the previous page
     */
    public static String getPreviousPage(HttpSession session, boolean currentIfNotExists) {
        NavigationManager navigationManager = getNavigationManager(session);

        String page = navigationManager.getPreviousPage();

        if ((page == null) && currentIfNotExists) {
            page = getCurrentPage(session);
        }

View Full Code Here

Examples of net.sf.wfnm.NavigationManager

     * @param currentIfNotExists indicates to reload the current page if it does not exists
     *
     * @return the url of the previous webflow (top page)
     */
    public static String getPreviousWebflow(HttpSession session, boolean currentIfNotExists) {
        NavigationManager navigationManager = getNavigationManager(session);

        String page = navigationManager.getPreviousWebflow();

        if ((page == null) && currentIfNotExists) {
            page = getCurrentPage(session);
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.