Examples of PropertiesManager


Examples of org.apache.roller.model.PropertiesManager

                List lastUploads) throws RollerException {
           
            super("uploadFiles.title", req, res, mapping);
           
            Roller roller = RollerFactory.getRoller();
            PropertiesManager pmgr = roller.getPropertiesManager();
            FileManager fmgr = roller.getFileManager();
           
            String dir = fmgr.getUploadDir();
            resourcesBaseURL = getBaseURL() + fmgr.getUploadUrl() + "/" + weblogHandle;
           
View Full Code Here

Examples of org.apache.roller.model.PropertiesManager

            RollerSession rollerSession = RollerSession.getRollerSession(request);
            if (rollerSession.isGlobalAdminUser() ) {
               
                // just grab our properties map and put it in the request
                Roller mRoller = RollerFactory.getRoller();
                PropertiesManager propsManager = mRoller.getPropertiesManager();
                Map props = propsManager.getProperties();
                request.setAttribute("RollerProps", props);
               
            } else {
                forward = mapping.findForward("access-denied");
            }
View Full Code Here

Examples of org.apache.roller.model.PropertiesManager

            request.setAttribute("model",pageModel);               
            if (rollerSession.isGlobalAdminUser()) {
           
                // just grab our properties map and put it in the request
                Roller mRoller = RollerFactory.getRoller();
                PropertiesManager propsManager = mRoller.getPropertiesManager();
                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);
                RollerFactory.getRoller().flush();
               
                // this operation causes OutOfMemory exceptions on sites with
                // lots of referers so i am disabling it until it's
                // not as dangerous -- Allen G
View Full Code Here

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

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

                    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

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

    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

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

                    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

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

   
   
    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

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

    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

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
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.