Examples of PropertiesManager


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

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

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

       
        testWeblog = TestUtils.getManagedWebsite(testWeblog);
        List refs = rmgr.getReferers(testWeblog);
        assertEquals(count, refs.size());
       
        PropertiesManager pmgr = WebloggerFactory.getWeblogger().getPropertiesManager();
        RuntimeConfigProperty 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);
       
        testWeblog = TestUtils.getManagedWebsite(testWeblog);
        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.weblogger.business.PropertiesManager

     */
    @Override
    public void myPrepare() {
        try {
            // just grab our properties map and make it available to the action
            PropertiesManager mgr = WebloggerFactory.getWeblogger().getPropertiesManager();
            setProperties(mgr.getProperties());
        } catch (WebloggerException ex) {
            log.error("Error getting runtime properties map", ex);
            // TODO: i18n
            addError("Unexpected error accessing Roller properties");
        }
       
        try {
            WeblogManager mgr =  WebloggerFactory.getWeblogger().getWeblogManager();
            setWeblogs(mgr.getWeblogs(true, null, null, null, 0, -1));
        } catch (WebloggerException ex) {
            log.error("Error getting weblogs", ex);
            addError("frontpageConfig.weblogs.error");
        }

View Full Code Here

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

    public static String getProperty(String name) {
       
        String value = null;
       
        try {
            PropertiesManager pmgr = WebloggerFactory.getWeblogger().getPropertiesManager();
            RuntimeConfigProperty prop = pmgr.getProperty(name);
            if(prop != null) {
                value = prop.getValue();
            }
        } catch(Exception e) {
            log.warn("Trouble accessing property: "+name, e);
View Full Code Here

Examples of org.apache.tools.ant.gui.core.PropertiesManager

    /**
     * Save the window size for the next session
     */
    protected void persistSize () {
        Dimension d = getSize();
        PropertiesManager pm = _context.getPropertiesManager();
        pm.setProperty("MainFrame.height", new Integer(new Double(d.getHeight()).intValue()).toString());
        pm.setProperty("MainFrame.width", new Integer(new Double(d.getWidth()).intValue()).toString());
        try {
        _context.saveProperties();
        }
        catch (java.io.FileNotFoundException e) {
            // log it?
View Full Code Here

Examples of org.apache.tools.ant.gui.core.PropertiesManager

   
     /**
     * Restore the window size from the previous session
     */
    protected void restorePersistentSize () {
      PropertiesManager pm = _context.getPropertiesManager();
      try {
      setSize(pm.get_int_property("MainFrame.width"), pm.get_int_property("MainFrame.height"));
      }
      catch (PropertiesManager.NoSuchPropertyException e) {
       // Just means that it's never been saved to persistent properties yet.  
      }
     
View Full Code Here

Examples of org.apache.tools.ant.gui.core.PropertiesManager

    /**
     * Saves the list to the global PropertiesManager and causes a props file save.
     */
    protected void saveList() {
        Iterator i = _fileList.keySet().iterator();
        PropertiesManager pm = getContext().getPropertiesManager();
        while(i.hasNext()) {
            String key = (String) i.next();
            String value = (String) _fileList.get(key);
            pm.setProperty(makeReopenerFilelistKey(key), value);
        }
        try {
            getContext().saveProperties();
        }
        catch (java.io.FileNotFoundException e) {
View Full Code Here

Examples of org.apache.tools.ant.gui.core.PropertiesManager

    /**
     * Refreshes the Properties used by the Reopened from the global PropertiesManager.
     */
    protected void loadList() {
        _fileList.clear();
        PropertiesManager pm = getContext().getPropertiesManager();
        Iterator i = pm.keySet().iterator();
        String key = null;
        String value = null;
        while(i.hasNext()) {
            key = (String) i.next();
            if (isReopenerFilelistKey(key)) {
                value = (String) pm.getProperty(key);
                _fileList.setProperty(stripReopenerFilelistKey(key), value);
            }
        }
    }
View Full Code Here

Examples of org.jahia.utils.properties.PropertiesManager

     * This method load and convert properties from the jahia.properties file,
     * and set some variables used by the SettingsBean class.
     */
    public void load () {
      if (properties == null && propertiesFileName != null) {
        properties = new PropertiesManager(propertiesFileName).getPropertiesObject();
      }

        // try to get values from the properties object...
        try {
            // disk path, url's and context...
View Full Code Here

Examples of org.jahia.utils.properties.PropertiesManager

    private void storeSettings(MailSettings cfg, ProcessingContext jParams,
            HttpServletRequest request) throws IOException, ServletException {
        SettingsBean settings = SettingsBean.getInstance();

        // set new values in the properties manager...
        PropertiesManager properties = new PropertiesManager(JahiaContextLoaderListener.getServletContext().getRealPath(SettingsBean.JAHIA_PROPERTIES_FILE_PATH));
        properties.setProperty("mail_service_activated", cfg.isServiceActivated() ? "true" : "false");
        properties.setProperty("mail_server", cfg.getHost());
        properties.setProperty("mail_administrator", cfg.getTo());
        properties.setProperty("mail_from", cfg.getFrom());
        properties.setProperty("mail_paranoia", cfg.getNotificationLevel());

        // write in the jahia properties file...
        properties.storeProperties();

        settings.setMail_service_activated(cfg.isServiceActivated());
        settings.setMail_server(cfg.getHost());
        settings.setMail_administrator(cfg.getTo());
        settings.setMail_from(cfg.getFrom());
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.