Package org.apache.roller.planet.business

Examples of org.apache.roller.planet.business.PropertiesManager


   
    @Override
    public void myPrepare() {
        try {
            // just grab our properties map
            PropertiesManager pMgr = PlanetFactory.getPlanet().getPropertiesManager();
            setProperties(pMgr.getProperties());
        } catch (RollerException ex) {
            log.error("Error loading planet properties");
        }
       
        // set config def used to draw the view
View Full Code Here


                    updProp.setValue(incomingProp.trim());
                }
            }
           
            // save it
            PropertiesManager pMgr = PlanetFactory.getPlanet().getPropertiesManager();
            pMgr.saveProperties(this.properties);
            PlanetFactory.getPlanet().flush();
           
            addMessage("ConfigForm.message.saveSucceeded");
           
        } catch (RollerException e) {
View Full Code Here

    private Map properties = Collections.EMPTY_MAP;
   
   
    public void prepare() throws Exception {
        // just grab our properties map and put it in the request
        PropertiesManager pMgr = PlanetFactory.getPlanet().getPropertiesManager();
        this.properties = pMgr.getProperties();
    }
View Full Code Here

                    updProp.setValue(incomingProp.trim());
                }
            }
           
            // save it
            PropertiesManager pMgr = PlanetFactory.getPlanet().getPropertiesManager();
            pMgr.saveProperties(this.properties);
            PlanetFactory.getPlanet().flush();
           
        } catch (PlanetException e) {
            log.error(e);
            setError("ConfigForm.error.saveFailed");
View Full Code Here

   
   
    public void testProperiesCRUD() throws Exception {
       
        // remember, the properties table is initialized during Roller startup
        PropertiesManager mgr = PlanetFactory.getPlanet().getPropertiesManager();
        TestUtils.endSession(true);
       
        RuntimeConfigProperty 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 = (RuntimeConfigProperty) props.get("site.name");
        prop.setValue("foofoo");
        prop = (RuntimeConfigProperty) props.get("site.description");
        prop.setValue("blahblah");
        mgr.saveProperties(props);
        TestUtils.endSession(true);
       
        // make sure all properties were updated
        props = mgr.getProperties();
        assertNotNull(props);
        assertEquals("foofoo", ((RuntimeConfigProperty)props.get("site.name")).getValue());
        assertEquals("blahblah", ((RuntimeConfigProperty)props.get("site.description")).getValue());
    }
View Full Code Here

    public static String getProperty(String name) {
       
        String value = null;
       
        try {
            PropertiesManager pmgr = PlanetFactory.getPlanet().getPropertiesManager();
            value = pmgr.getProperty(name).getValue();
        } catch(Exception e) {
            log.warn("Trouble accessing property: "+name, e);
        }
       
        log.debug("fetched property ["+name+"="+value+"]");
View Full Code Here

   
    @Override
    public void myPrepare() {
        try {
            // just grab our properties map
            PropertiesManager pMgr = PlanetFactory.getPlanet().getPropertiesManager();
            setProperties(pMgr.getProperties());
        } catch (RollerException ex) {
            log.error("Error loading planet properties");
        }
       
        // set config def used to draw the view
View Full Code Here

                    updProp.setValue(incomingProp.trim());
                }
            }
           
            // save it
            PropertiesManager pMgr = PlanetFactory.getPlanet().getPropertiesManager();
            pMgr.saveProperties(this.properties);
            PlanetFactory.getPlanet().flush();
           
            addMessage("ConfigForm.message.saveSucceeded");
           
        } catch (RollerException e) {
View Full Code Here

TOP

Related Classes of org.apache.roller.planet.business.PropertiesManager

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.