Examples of RollerPropertyData


Examples of org.apache.roller.pojos.RollerPropertyData

            testUser = TestUtils.setupUser("referTestUser");
            testWeblog = TestUtils.setupWeblog("referTestWeblog", testUser);
           
            // add "spamtest" to refererSpamWords
            PropertiesManager pmgr = RollerFactory.getRoller().getPropertiesManager();
            RollerPropertyData spamprop = pmgr.getProperty("spam.blacklist");
            this.origSpamWords = spamprop.getValue();
            spamprop.setValue(spamprop.getValue() + ", spamtest");
            pmgr.saveProperty(spamprop);
           
            // add a number of referers to play with
            RefererManager rmgr = RollerFactory.getRoller().getRefererManager();
            Calendar lCalendar = Calendar.getInstance();
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

    public void tearDown() throws Exception {
       
        try {
            // reset refererSpamWords to original value
            PropertiesManager pmgr = RollerFactory.getRoller().getPropertiesManager();
            RollerPropertyData spamprop = pmgr.getProperty("spam.blacklist");
            spamprop.setValue(this.origSpamWords);
            pmgr.saveProperty(spamprop);
           
            TestUtils.teardownWeblog(testWeblog.getId());
            TestUtils.teardownUser(testUser.getId());
           
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

       
        List refs = rmgr.getReferers(testWeblog);
        assertEquals(count, refs.size());
       
        PropertiesManager pmgr = RollerFactory.getRoller().getPropertiesManager();
        RollerPropertyData spamprop = pmgr.getProperty("spam.blacklist");
        String origWords = spamprop.getValue();
        spamprop.setValue(spamprop.getValue() + ", test");
        pmgr.saveProperty(spamprop);
        TestUtils.endSession(true);
       
        rmgr.applyRefererFilters();
        TestUtils.endSession(true);
       
        refs = rmgr.getReferers(testWeblog);
        assertEquals(0, refs.size());
       
        spamprop = pmgr.getProperty("spam.blacklist");
        spamprop.setValue(origWords);
        pmgr.saveProperty(spamprop);
        TestUtils.endSession(true);
    }
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

        UserManager umgr = getRoller().getUserManager();
        mWebsite = (WebsiteData)umgr.getWebsites(mUser, null, null).get(0);
       
        PropertiesManager propmgr = getRoller().getPropertiesManager();
        Map props = propmgr.getProperties();
        RollerPropertyData prop =
                (RollerPropertyData)props.get("site.absoluteurl");
        prop.setValue("http://localhost:8080/roller");
        propmgr.saveProperties(props);
       
        PlanetManager planet = getRoller().getPlanetManager();
        PlanetConfigData config = config = new PlanetConfigData();
        config.setCacheDir("");
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

                Map props = propsManager.getProperties();
                request.setAttribute("RollerProps", props);
               
                // only set values for properties that are already defined
                String propName = null;
                RollerPropertyData updProp = null;
                String incomingProp = null;
                Iterator propsIT = props.keySet().iterator();
                while(propsIT.hasNext()) {
                    propName = (String) propsIT.next();
                    updProp = (RollerPropertyData) props.get(propName);
                    incomingProp = request.getParameter(updProp.getName());
                   
                    mLogger.debug("Checking property ["+propName+"]");
                   
                    // some special treatment for booleans
                    // this is a bit hacky since we are assuming that any prop
                    // with a value of "true" or "false" is meant to be a boolean
                    // it may not always be the case, but we should be okay for now
                    if( updProp.getValue() != null // null check needed w/Oracle
                        && (updProp.getValue().equals("true") || updProp.getValue().equals("false"))) {
                       
                        if(incomingProp == null || !incomingProp.equals("on"))
                            incomingProp = "false";
                        else
                            incomingProp = "true";
                    }
                   
                    // only work on props that were submitted with the request
                    if(incomingProp != null) {
                        mLogger.debug("Setting new value for ["+propName+"]");
                       
                        // NOTE: the old way had some locale sensitive way to do this??
                        updProp.setValue(incomingProp.trim());
                    }
                }
               
                // save it
                propsManager.saveProperties(props);
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

       
        // remember, the properties table is initialized during Roller startup
        PropertiesManager mgr = RollerFactory.getRoller().getPropertiesManager();
        TestUtils.endSession(true);
       
        RollerPropertyData prop = null;
       
        // get a property by name
        prop = mgr.getProperty("site.name");
        assertNotNull(prop);
       
        // update a property
        prop.setValue("testtest");
        mgr.saveProperty(prop);
        TestUtils.endSession(true);
       
        // make sure property was updated
        prop = null;
        prop = mgr.getProperty("site.name");
        assertNotNull(prop);
        assertEquals("testtest", prop.getValue());
       
        // get all properties
        Map props = mgr.getProperties();
        assertNotNull(props);
        assertTrue(props.containsKey("site.name"));
       
        // update multiple properties
        prop = (RollerPropertyData) props.get("site.name");
        prop.setValue("foofoo");
        prop = (RollerPropertyData) props.get("site.description");
        prop.setValue("blahblah");
        mgr.saveProperties(props);
        TestUtils.endSession(true);
       
        // make sure all properties were updated
        props = mgr.getProperties();
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

            testWeblog = TestUtils.setupWeblog("referTestWeblog1", testUser);
            testWeblog2 = TestUtils.setupWeblog("referTestWeblog2", testUser);
           
            // add "spamtest" to refererSpamWords
            PropertiesManager pmgr = RollerFactory.getRoller().getPropertiesManager();
            RollerPropertyData spamprop = pmgr.getProperty("spam.blacklist");
            this.origSpamWords = spamprop.getValue();
            spamprop.setValue(spamprop.getValue() + ", spamtest");
            pmgr.saveProperty(spamprop);
           
            // add a number of referers to play with
            RefererManager rmgr = RollerFactory.getRoller().getRefererManager();
            Calendar lCalendar = Calendar.getInstance();
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

    public void tearDown() throws Exception {
       
        try {
            // reset refererSpamWords to original value
            PropertiesManager pmgr = RollerFactory.getRoller().getPropertiesManager();
            RollerPropertyData spamprop = pmgr.getProperty("spam.blacklist");
            spamprop.setValue(this.origSpamWords);
            pmgr.saveProperty(spamprop);
           
            TestUtils.teardownWeblog(testWeblog.getId());
            TestUtils.teardownWeblog(testWeblog2.getId());
            TestUtils.teardownUser(testUser.getId());
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

       
        List refs = rmgr.getReferers(testWeblog);
        assertEquals(count, refs.size());
       
        PropertiesManager pmgr = RollerFactory.getRoller().getPropertiesManager();
        RollerPropertyData spamprop = pmgr.getProperty("spam.blacklist");
        String origWords = spamprop.getValue();
        spamprop.setValue(spamprop.getValue() + ", test");
        pmgr.saveProperty(spamprop);
        TestUtils.endSession(true);
       
        rmgr.applyRefererFilters();
        TestUtils.endSession(true);
       
        refs = rmgr.getReferers(testWeblog);
        assertEquals(0, refs.size());
       
        spamprop = pmgr.getProperty("spam.blacklist");
        spamprop.setValue(origWords);
        pmgr.saveProperty(spamprop);
        TestUtils.endSession(true);
    }
View Full Code Here

Examples of org.apache.roller.pojos.RollerPropertyData

                Map props = propsManager.getProperties();
                request.setAttribute("RollerProps", props);
               
                // only set values for properties that are already defined
                String propName = null;
                RollerPropertyData updProp = null;
                String incomingProp = null;
                Iterator propsIT = props.keySet().iterator();
                while(propsIT.hasNext()) {
                    propName = (String) propsIT.next();
                    updProp = (RollerPropertyData) props.get(propName);
                    incomingProp = request.getParameter(updProp.getName());
                   
                    mLogger.debug("Checking property ["+propName+"]");
                   
                    // some special treatment for booleans
                    // this is a bit hacky since we are assuming that any prop
                    // with a value of "true" or "false" is meant to be a boolean
                    // it may not always be the case, but we should be okay for now
                    if( updProp.getValue() != null // null check needed w/Oracle
                        && (updProp.getValue().equals("true") || updProp.getValue().equals("false"))) {
                       
                        if(incomingProp == null || !incomingProp.equals("on"))
                            incomingProp = "false";
                        else
                            incomingProp = "true";
                    }
                   
                    // only work on props that were submitted with the request
                    if(incomingProp != null) {
                        mLogger.debug("Setting new value for ["+propName+"]");
                       
                        // NOTE: the old way had some locale sensitive way to do this??
                        updProp.setValue(incomingProp.trim());
                    }
                }
               
                // save it
                propsManager.saveProperties(props);
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.