Package org.apache.portals.applications.webcontent.rewriter.rules

Examples of org.apache.portals.applications.webcontent.rewriter.rules.Ruleset


        return (Ruleset) rulesets.get(id);
    }

    public Ruleset loadRuleset( Reader reader )
    {
        Ruleset ruleset = null;
        try
        {
            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbfactory.newDocumentBuilder();

            InputSource source = new InputSource(reader);

            Document doc = builder.parse(source);

            Unmarshaller unmarshaller = new Unmarshaller(this.mapper);

            ruleset = (Ruleset) unmarshaller.unmarshal(doc);
            ruleset.sync();
            rulesets.put(ruleset.getId(), ruleset);

        }
        catch (Throwable t)
        {
            log.error("ForwardService: Could not unmarshal: " + reader, t);
View Full Code Here


        return ruleset;
    }
   
    public Ruleset loadRuleset( InputStream input )
    {
        Ruleset ruleset = null;
        try
        {
            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbfactory.newDocumentBuilder();

            InputSource source = new InputSource(input);

            Document doc = builder.parse(source);

            Unmarshaller unmarshaller = new Unmarshaller(this.mapper);

            ruleset = (Ruleset) unmarshaller.unmarshal(doc);
            ruleset.sync();
            rulesets.put(ruleset.getId(), ruleset);

        }
        catch (Throwable t)
        {
            log.error("ForwardService: Could not unmarshal: " + input, t);
View Full Code Here

                                                                  proxyPathMapper.getDefaultRequestCookies(),
                                                                  proxyPathMapper.getRewriteCookiePathIncludes(),
                                                                  proxyPathMapper.getRewriteCookiePathExcludes());
                   
                    RewriterController rewriterController = rewriterControllerMap.get(proxyPathMapper);
                    Ruleset rewriterRules = rewriterRulesetMap.get(proxyPathMapper);
                   
                    if (rewriterController != null)
                    {
                        rewriterControllerMap.put(derivedMapper, rewriterController);
                    }
View Full Code Here

                                                                  proxyPathMapper.getDefaultRequestCookies(),
                                                                  proxyPathMapper.getRewriteCookiePathIncludes(),
                                                                  proxyPathMapper.getRewriteCookiePathExcludes());
                   
                    RewriterController rewriterController = rewriterControllerMap.get(proxyPathMapper);
                    Ruleset rewriterRules = rewriterRulesetMap.get(proxyPathMapper);
                   
                    if (rewriterController != null)
                    {
                        rewriterControllerMap.put(derivedMapper, rewriterController);
                    }
View Full Code Here

        }
    }
   
    private Rewriter createRewriter(RewriterController rewriterController, HttpReverseProxyPathMapper proxyPathMapper) throws Exception
    {
        Ruleset rewriterRuleset = proxyPathMapperProvider.getRewriterRuleset(proxyPathMapper);
       
        if (rewriterRuleset == null)
        {
            return rewriterController.createRewriter();
        }
View Full Code Here

        RewriterController rwc = new MappingRewriterController(contextPath + "conf/rewriter-rules-mapping.xml", Arrays
                .asList(rewriterClasses), Arrays.asList(adaptorClasses));

        FileReader reader = new FileReader(contextPath + "conf/default-rewriter-rules.xml");

        Ruleset ruleset = rwc.loadRuleset(reader);
        reader.close();
        rewriter = rwc.createRewriter(ruleset);
        return rwc;
    }
View Full Code Here

        RewriterController rwc = new MappingRewriterController(contextPath + "conf/rewriter-rules-mapping.xml", Arrays
                .asList(rewriterClasses), Arrays.asList(adaptorClasses));

        FileReader reader = new FileReader(contextPath + "conf/default-rewriter-rules.xml");

        Ruleset ruleset = rwc.loadRuleset(reader);
        reader.close();
        rewriter = rwc.createRewriter(ruleset);
        return rwc;
    }
View Full Code Here

        return (Ruleset) rulesets.get(id);
    }

    public Ruleset loadRuleset( Reader reader )
    {
        Ruleset ruleset = null;
        try
        {
            DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dbfactory.newDocumentBuilder();

            InputSource source = new InputSource(reader);

            Document doc = builder.parse(source);

            Unmarshaller unmarshaller = new Unmarshaller(this.mapper);

            ruleset = (Ruleset) unmarshaller.unmarshal(doc);
            ruleset.sync();
            rulesets.put(ruleset.getId(), ruleset);

        }
        catch (Throwable t)
        {
            log.error("ForwardService: Could not unmarshal: " + reader, t);
View Full Code Here

                    if (rewriterController != null)
                    {
                        rewriterControllerMap.put(proxyPathMapper, rewriterController);
                       
                        String rules = rewritersConf.getString("rules");
                        Ruleset ruleset = loadRewriterRuleset(rewriterController, rules);
                       
                        if (ruleset != null)
                        {
                            rewriterRulesetMap.put(proxyPathMapper, ruleset);
                        }
View Full Code Here

        }
    }
   
    private Ruleset loadRewriterRuleset(RewriterController rewriterController, String rulesConfResourcePath) throws IOException
    {
        Ruleset ruleset = null;
       
        InputStream is = null;
        InputStream bis = null;
       
        try
View Full Code Here

TOP

Related Classes of org.apache.portals.applications.webcontent.rewriter.rules.Ruleset

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.