Package org.exoplatform.web.controller.router

Examples of org.exoplatform.web.controller.router.Router


    private void loadConfiguration(URL url) throws RouterConfigException, IOException {
        log.info("Loading router configuration " + url);
        InputStream in = url.openStream();
        try {
            ControllerDescriptor routerDesc = new DescriptorBuilder().build(in);
            Router router = new Router(routerDesc);
            routerRef.set(router);
        } finally {
            Safe.close(in);
        }
    }
View Full Code Here


    @Managed
    @ManagedDescription("Enumerates the routes found for the specified request")
    @Impact(ImpactType.READ)
    public String findRoutes(
            @ManagedDescription("The request uri relative to the web application") @ManagedName("uri") String uri) {
        Router router = routerRef.get();
        if (router != null) {
            Map<String, String[]> parameters;
            String path;
            int pos = uri.indexOf('?');
            if (pos != -1) {
                parameters = QueryStringParser.getInstance().parseQueryString(uri.substring(pos + 1));
                path = uri.substring(0, pos);
            } else {
                parameters = Collections.emptyMap();
                path = uri;
            }

            //
            List<Map<QualifiedName, String>> results = new ArrayList<Map<QualifiedName, String>>();
            Iterator<Map<QualifiedName, String>> matcher = router.matcher(path, parameters);
            while (matcher.hasNext()) {
                Map<QualifiedName, String> match = matcher.next();
                results.add(match);
            }
View Full Code Here

        } catch (UnsupportedEncodingException e) {
            log.error("Encoding not supported", e);
        }

        String portalPath = req.getRequestURI().substring(req.getContextPath().length());
        Router router = routerRef.get();

        //
        if (router != null) {
            Iterator<Map<QualifiedName, String>> matcher = router.matcher(portalPath, req.getParameterMap());

            //
            boolean started = false;
            boolean processed = false;
View Full Code Here

    private void loadConfiguration(URL url) throws RouterConfigException, IOException {
        log.info("Loading router configuration " + url);
        InputStream in = url.openStream();
        try {
            ControllerDescriptor routerDesc = new DescriptorBuilder().build(in);
            Router router = new Router(routerDesc);
            routerRef.set(router);
        } finally {
            Safe.close(in);
        }
    }
View Full Code Here

    @Managed
    @ManagedDescription("Enumerates the routes found for the specified request")
    @Impact(ImpactType.READ)
    public String findRoutes(
            @ManagedDescription("The request uri relative to the web application") @ManagedName("uri") String uri) {
        Router router = routerRef.get();
        if (router != null) {
            Map<String, String[]> parameters;
            String path;
            int pos = uri.indexOf('?');
            if (pos != -1) {
                parameters = QueryStringParser.getInstance().parseQueryString(uri.substring(pos + 1));
                path = uri.substring(0, pos);
            } else {
                parameters = Collections.emptyMap();
                path = uri;
            }

            //
            List<Map<QualifiedName, String>> results = new ArrayList<Map<QualifiedName, String>>();
            Iterator<Map<QualifiedName, String>> matcher = router.matcher(path, parameters);
            while (matcher.hasNext()) {
                Map<QualifiedName, String> match = matcher.next();
                results.add(match);
            }
View Full Code Here

        } catch (UnsupportedEncodingException e) {
            log.error("Encoding not supported", e);
        }

        String portalPath = req.getRequestURI().substring(req.getContextPath().length());
        Router router = routerRef.get();

        //
        if (router != null) {
            Iterator<Map<QualifiedName, String>> matcher = router.matcher(portalPath, req.getParameterMap());

            //
            boolean started = false;
            boolean processed = false;
View Full Code Here

    private void loadConfiguration(URL url) throws RouterConfigException, IOException {
        log.info("Loading router configuration " + url);
        InputStream in = url.openStream();
        try {
            ControllerDescriptor routerDesc = new DescriptorBuilder().build(in);
            Router router = new Router(routerDesc);
            routerRef.set(router);
        } finally {
            Safe.close(in);
        }
    }
View Full Code Here

    @Managed
    @ManagedDescription("Enumerates the routes found for the specified request")
    @Impact(ImpactType.READ)
    public String findRoutes(
            @ManagedDescription("The request uri relative to the web application") @ManagedName("uri") String uri) {
        Router router = routerRef.get();
        if (router != null) {
            Map<String, String[]> parameters;
            String path;
            int pos = uri.indexOf('?');
            if (pos != -1) {
                parameters = QueryStringParser.getInstance().parseQueryString(uri.substring(pos + 1));
                path = uri.substring(0, pos);
            } else {
                parameters = Collections.emptyMap();
                path = uri;
            }

            //
            List<Map<QualifiedName, String>> results = new ArrayList<Map<QualifiedName, String>>();
            Iterator<Map<QualifiedName, String>> matcher = router.matcher(path, parameters);
            while (matcher.hasNext()) {
                Map<QualifiedName, String> match = matcher.next();
                results.add(match);
            }
View Full Code Here

        } catch (UnsupportedEncodingException e) {
            log.error("Encoding not supported", e);
        }

        String portalPath = req.getRequestURI().substring(req.getContextPath().length());
        Router router = routerRef.get();

        //
        if (router != null) {
            Iterator<Map<QualifiedName, String>> matcher = router.matcher(portalPath, req.getParameterMap());

            //
            boolean started = false;
            boolean processed = false;
View Full Code Here

    public List<RouteDescriptor> getRoutes() {
        return routes;
    }

    public Router build() throws RouterConfigException {
        return new Router(this);
    }
View Full Code Here

TOP

Related Classes of org.exoplatform.web.controller.router.Router

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.