Package org.brixcms.web.nodepage

Examples of org.brixcms.web.nodepage.BrixNodeRequestHandler


    }

    @Override
    public Url mapHandler(IRequestHandler requestHandler) {
        if (requestHandler instanceof BrixNodeRequestHandler) {
            BrixNodeRequestHandler handler = (BrixNodeRequestHandler) requestHandler;
            String nodeURL = handler.getNodeURL();
            return encode(nodeURL, handler.getPageParameters(), null);
        } else if (requestHandler instanceof ListenerInterfaceRequestHandler) {
            ListenerInterfaceRequestHandler handler = (ListenerInterfaceRequestHandler) requestHandler;
            if (handler.getPage() instanceof BrixNodeWebPage) {
                BrixNodeWebPage page = (BrixNodeWebPage) handler.getPage();
                String componentPath = handler.getComponentPath();
                RequestListenerInterface listenerInterface = handler.getListenerInterface();
                Integer renderCount = null;
                if (listenerInterface.isIncludeRenderCount()) {
                    renderCount = page.getRenderCount();
                }
                PageInfo pageInfo = new PageInfo(page.getPageId());
                ComponentInfo componentInfo = new ComponentInfo(renderCount, requestListenerInterfaceToString(listenerInterface),
                        componentPath, handler.getBehaviorIndex());
                PageComponentInfo info = new PageComponentInfo(pageInfo, componentInfo);
                Url url = encode(page);
                encodePageComponentInfo(url, info);
                return url;
            } else {
                return null;
            }
        } else if (requestHandler instanceof RenderPageRequestHandler) {
            RenderPageRequestHandler handler = (RenderPageRequestHandler) requestHandler;
            if (handler.getPage() instanceof BrixNodeWebPage) {
                BrixNodeWebPage page = (BrixNodeWebPage) handler.getPage();
                PageInfo i = new PageInfo(page.getPageId());
                PageComponentInfo info = new PageComponentInfo(i, null);
                Url url = encode(page);
                encodePageComponentInfo(url, info);
                return url;
            } else {
                return null;
            }
        } else if (requestHandler instanceof BookmarkableListenerInterfaceRequestHandler) {
            BookmarkableListenerInterfaceRequestHandler target = (BookmarkableListenerInterfaceRequestHandler) requestHandler;
            BrixNodeWebPage page = (BrixNodeWebPage) target.getPage();
            BrixNode node = page.getModelObject();
            PageInfo info = new PageInfo(page.getPageId());
            return encode(node, page.getBrixPageParameters(), info);
        } else if (requestHandler instanceof BookmarkablePageRequestHandler
                && ((BookmarkablePageRequestHandler) requestHandler).getPageClass().equals(HomePage.class)) {
            BrixNode node = ((BrixRequestCycleProcessor) RequestCycle.get().getActiveRequestHandler()).getNodeForUriPath(Path.ROOT);
            return mapHandler(new BrixNodeRequestHandler(new BrixNodeModel(node)));
        } else {
            return null;
        }
    }
View Full Code Here


        }
    }

    public IRequestHandler getRequestTarget() {
        final IModel<BrixNode> model = getNodeModel();
        return new BrixNodeRequestHandler(model != null ? model : new BrixNodeModel("invalidId",
                "invalidWorkspace"), parameters != null ? parameters : new BrixPageParameters()) {
            @Override
            public String getNodeURL() {
                if (getType() == Type.NODE) {
                    return model != null ? super.getNodeURL() : "";
View Full Code Here

     * @param params parameters to be encoded into the url
     * @return url to the current brix page
     * @throws BrixException if the current request was not for a brix page
     */
    public static String urlForCurrentPage(BrixPageParameters params) {
        IRequestHandler target = new BrixNodeRequestHandler(getCurrentPage(), params);
        String url = RequestCycle.get().urlFor(target).toString();
        target.detach(RequestCycle.get());
        return url;
    }
View Full Code Here

        IModel<BrixNode> nodeModel = getModel();
        String workspace = nodeModel.getObject().getSession().getWorkspace().getName();
        parameters.set(BrixRequestCycleProcessor.WORKSPACE_PARAM, workspace);
        parameters.set(PREVIEW_PARAM, "true");
        StringBuilder url = new StringBuilder(getRequestCycle()
                .urlFor(new BrixNodeRequestHandler(nodeModel, parameters)));
        return url;
    }
View Full Code Here

TOP

Related Classes of org.brixcms.web.nodepage.BrixNodeRequestHandler

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.