Examples of PlanetConfigData


Examples of org.apache.roller.planet.pojos.PlanetConfigData

    public void testConfigurationStorage() throws Exception {
       
        PlanetManager planet = RollerFactory.getRoller().getPlanetManager();
       
        {   // retrieve config
            PlanetConfigData config = planet.getConfiguration();
            assertNotNull(config);
            assertEquals("test_title", config.getTitle());
            assertEquals("test_admin_email", config.getAdminEmail());
            assertNull(config.getSiteURL());
        }
        {   // save config
            PlanetConfigData config = planet.getConfiguration();
            config.setSiteURL("http://footest/lskdf/null");
            planet.saveConfiguration(config);
            TestUtils.endSession(true);
        }
        {
            // make sure config was saved
            PlanetConfigData config = planet.getConfiguration();
            assertNotNull(config);
            assertEquals("http://footest/lskdf/null", config.getSiteURL());
        }
    }
View Full Code Here

Examples of org.apache.roller.planet.pojos.PlanetConfigData

        PlanetManager planet = RollerFactory.getRoller().getPlanetManager();
       
        String feed_url1 = "http://rollerweblogger.org/roller/feed/entries/rss";
       
        {
            PlanetConfigData config = planet.getConfiguration();
            config.setCacheDir("." + File.separator + "planet-cache");
            planet.saveConfiguration(config);
           
            PlanetGroupData group = new PlanetGroupData();
            group.setDescription("test_group_desc");
            group.setHandle("test_handle");
View Full Code Here

Examples of org.apache.roller.planet.pojos.PlanetConfigData

        String technoratiFeedUrl = null;
        int inboundlinks = -1;
        int inboundblogs = -1;
        if (form.getSiteURL()!=null && form.getSiteURL().trim().length() > 0) {
            try {
                PlanetConfigData config = planet.getConfiguration();
                Technorati technorati = null;
                if (config.getProxyHost()!=null && config.getProxyPort() > 0) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
                Technorati.Result result =
                        technorati.getBloginfo(form.getSiteURL());
View Full Code Here

Examples of org.apache.roller.planet.pojos.PlanetConfigData

                BasePageModel pageModel = new BasePageModel(
                    "planetConfig.pageTitle", request, response, mapping);
                request.setAttribute("model",pageModel);               
                Roller roller = RollerFactory.getRoller();
                PlanetManager planet = roller.getPlanetManager();
                PlanetConfigData config = planet.getConfiguration();
                PlanetConfigForm form = (PlanetConfigForm)actionForm;
                if (config != null)
                {
                    form.copyFrom(config, request.getLocale());
                }
View Full Code Here

Examples of org.apache.roller.planet.pojos.PlanetConfigData

                BasePageModel pageModel = new BasePageModel(
                    "planetConfig.pageTitle", request, response, mapping);
                request.setAttribute("model",pageModel);               
                Roller roller = RollerFactory.getRoller();
                PlanetManager planet = roller.getPlanetManager();
                PlanetConfigData config = planet.getConfiguration();
                if (config == null)
                {
                    config = new PlanetConfigData();
                }
                PlanetConfigForm form = (PlanetConfigForm) actionForm;
                ActionErrors errors = validate(form);
                if (errors.isEmpty())
                {
View Full Code Here

Examples of org.apache.roller.planet.pojos.PlanetConfigData

       
        int count = 0;
        int errorCount = 0;
        try {
            PlanetManager planet = RollerFactory.getRoller().getPlanetManager();
            PlanetConfigData config = planet.getConfiguration();
            Technorati technorati = null;
            try {
                if (config.getProxyHost()!=null && config.getProxyPort() != -1) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
            } catch (IOException e) {
                log.error("Aborting collection of Technorati rankings.\n"
View Full Code Here

Examples of org.apache.roller.planet.pojos.PlanetConfigData

        throws RollerException {
        strategy.remove(sub);
    }
       
    public PlanetConfigData getConfiguration() throws RollerException {
        PlanetConfigData config = null;
        try {
            Session session = ((HibernatePersistenceStrategy)strategy).getSession();
            Criteria criteria = session.createCriteria(PlanetConfigData.class);
            criteria.setMaxResults(1);
            List list = criteria.list();
View Full Code Here

Examples of org.apache.roller.planet.pojos.PlanetConfigData

       
    public void refreshEntries(String cacheDirPath) throws RollerException {
       
        Date now = new Date();
        long startTime = System.currentTimeMillis();
        PlanetConfigData config = getConfiguration();
       
        // can't continue without cache dir
        if (cacheDirPath == null) {
            log.warn("Planet cache directory not set, aborting refresh");
            return;
        }
       
        // allow ${user.home} in cache dir property
        String cacheDirName = cacheDirPath.replaceFirst(
                "\\$\\{user.home}",System.getProperty("user.home"));
       
        // allow ${catalina.home} in cache dir property
        if (System.getProperty("catalina.home") != null) {
            cacheDirName = cacheDirName.replaceFirst(
                "\\$\\{catalina.home}",System.getProperty("catalina.home"));
        }
       
        // create cache  dir if it does not exist
        File cacheDir = null;
        try {
            cacheDir = new File(cacheDirName);
            if (!cacheDir.exists()) cacheDir.mkdirs();
        } catch (Exception e) {
            log.error("Unable to create planet cache directory");
            return;
        }
       
        // abort if cache dir is not writable
        if (!cacheDir.canWrite()) {
            log.error("Planet cache directory is not writable");
            return;
        }
       
        FeedFetcherCache feedInfoCache =
                new DiskFeedInfoCache(cacheDirName);
       
        if (config.getProxyHost()!=null && config.getProxyPort() > 0) {
            System.setProperty("proxySet", "true");
            System.setProperty("http.proxyHost", config.getProxyHost());
            System.setProperty("http.proxyPort",
                    Integer.toString(config.getProxyPort()));
        }
        /** a hack to set 15 sec timeouts for java.net.HttpURLConnection */
        System.setProperty("sun.net.client.defaultConnectTimeout", "15000");
        System.setProperty("sun.net.client.defaultReadTimeout", "15000");
       
View Full Code Here

Examples of org.apache.roller.pojos.PlanetConfigData

        strategy.remove(sub);
    }
   
   
    public PlanetConfigData getConfiguration() throws RollerException {
        PlanetConfigData config = null;
        try {
            Session session = ((HibernatePersistenceStrategy)strategy).getSession();
            Criteria criteria = session.createCriteria(PlanetConfigData.class);
            criteria.setMaxResults(1);
            List list = criteria.list();
            config = list.size()!=0 ? (PlanetConfigData)list.get(0) : null;
           
            // We inject the cache dir into the config object here to maintain
            // compatibility with the standaline version of the aggregator.
            if (config != null) {
                config.setCacheDir(
                        RollerConfig.getProperty("planet.aggregator.cache.dir"));
            }
        } catch (HibernateException e) {
            throw new RollerException(e);
        }
View Full Code Here

Examples of org.apache.roller.pojos.PlanetConfigData

       
        Roller roller = RollerFactory.getRoller();
       
        Date now = new Date();
        long startTime = System.currentTimeMillis();
        PlanetConfigData config = getConfiguration();
       
        // can't continue without cache dir
        if (config == null || config.getCacheDir() == null) {
            log.warn("Planet cache directory not set, aborting refresh");
            return;
        }
       
        // allow ${user.home} in cache dir property
        String cacheDirName = config.getCacheDir().replaceFirst(
                "\\$\\{user.home}",System.getProperty("user.home"));
       
        // allow ${catalina.home} in cache dir property
        cacheDirName = cacheDirName.replaceFirst(
                "\\$\\{catalina.home}",System.getProperty("catalina.home"));
       
        // create cache  dir if it does not exist
        File cacheDir = null;
        try {
            cacheDir = new File(cacheDirName);
            if (!cacheDir.exists()) cacheDir.mkdirs();
        } catch (Exception e) {
            log.error("Unable to create planet cache directory");
            return;
        }
       
        // abort if cache dir is not writable
        if (!cacheDir.canWrite()) {
            log.error("Planet cache directory is not writable");
            return;
        }
       
        FeedFetcherCache feedInfoCache =
                new DiskFeedInfoCache(cacheDirName);
       
        if (config.getProxyHost()!=null && config.getProxyPort() > 0) {
            System.setProperty("proxySet", "true");
            System.setProperty("http.proxyHost", config.getProxyHost());
            System.setProperty("http.proxyPort",
                    Integer.toString(config.getProxyPort()));
        }
        /** a hack to set 15 sec timeouts for java.net.HttpURLConnection */
        System.setProperty("sun.net.client.defaultConnectTimeout", "15000");
        System.setProperty("sun.net.client.defaultReadTimeout", "15000");
       
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.