Package getfacts

Examples of getfacts.ConfigurationItems


        if( configuration.exists(title) == true )
        {
            throw new IllegalArgumentException(title);
        }
       
        ConfigurationItems config = RssReader.createConfig(title, url);
        configuration.addConfiguration(config);
    }
View Full Code Here


        if( configuration.exists(title) == true )
        {
            throw new IllegalArgumentException(title);
        }
       
        ConfigurationItems config = HtmlReader.createConfig(title, url,
                 xpathToFrontPageTitle,
                 xpathToArticleNodes,
                 xpathToArticleTitle,
                 xpathToArticleContent,
                 xpathToArticleUrl,
View Full Code Here

    @Override
    public Component getListCellRendererComponent(JList<?> jlist, Object o, int i, boolean bln, boolean bln1)
    {
        if( o instanceof ConfigurationItems )
        {
            ConfigurationItems config = (ConfigurationItems)o;
            o = config.getUserTitle();
        }
        return super.getListCellRendererComponent(jlist, o, i, bln, bln1);
    }
View Full Code Here

            String xpathToArticleUrl,
            String xpathToArticleGuid,
            String xpathToArticleImageUrl,
            String xpathToArticlePubDate)
    {
        ConfigurationItems output = new ConfigurationItems(PLUGIN_NAME);
       
        // title
        output.setUserTitle(title);
       
        // url
        ConfigurationItem urlItem = new TextFieldItem(CFG_URL_KEY, url);
        output.addItem(urlItem);
       
        // String xpathToFrontPageTitle
        ConfigurationItem xp_fp_title = new TextFieldItem(CFG_XP_FRONTPAGE_TITLE_KEY, xpathToFrontPageTitle);
        output.addItem(xp_fp_title);
       
        // String xpathToArticleNodes
        ConfigurationItem xp_a_nodes = new TextFieldItem(CFG_XP_ARTICLE_NODES_KEY, xpathToArticleNodes);
        output.addItem(xp_a_nodes);
       
        // String xpathToArticleTitle
        ConfigurationItem xp_a_title = new TextFieldItem(CFG_XP_ARTICLE_TITLE_KEY, xpathToArticleTitle);
        output.addItem(xp_a_title);
       
        // String xpathToArticleContent
        ConfigurationItem xp_a_content = new TextFieldItem(CFG_XP_ARTICLE_CONTENT_KEY, xpathToArticleContent);
        output.addItem(xp_a_content);
       
        // String xpathToArticleUrl
        ConfigurationItem xp_a_url = new TextFieldItem(CFG_XP_ARTICLE_URL_KEY, xpathToArticleUrl);
        output.addItem(xp_a_url);
       
        // String xpathToArticleGuid
        ConfigurationItem xp_a_guid = new TextFieldItem(CFG_XP_ARTICLE_GUID_KEY, xpathToArticleGuid);
        output.addItem(xp_a_guid);
       
        // String xpathToArticleImageUrl
        ConfigurationItem xp_a_img = new TextFieldItem(CFG_XP_ARTICLE_IMAGE_URL_KEY, xpathToArticleImageUrl);
        output.addItem(xp_a_img);
       
        // String xpathToArticlePubDate
        ConfigurationItem xp_a_date= new TextFieldItem(CFG_XP_ARTICLE_PUBLICATION_DATE_KEY, xpathToArticlePubDate);
        output.addItem(xp_a_date);
       
        return output;
    }
View Full Code Here

        return output;
    }

    public static ConfigurationItems createConfig(NodeList l)
    {
        ConfigurationItems output = new ConfigurationItems(PLUGIN_NAME);
       
        for(int i=0; i<l.getLength(); i++)
        {
            Node n = l.item(i);
            String itemName = XmlReader.getString(n, "./name");
            String itemValue = XmlReader.getString(n, "./value");
           
            if( itemName.compareTo(ConfigurationItems.CFG_USER_TITLE_KEY)==0 )
            {
                output.setUserTitle(itemValue);
            }
            else if( itemName.compareTo(CFG_URL_KEY)==0 )
            {
                ConfigurationItem urlItem = new TextFieldItem(CFG_URL_KEY, itemValue);
                output.addItem(urlItem);
            }
            else
            {
                ConfigurationItem item = new TextFieldItem(itemName, itemValue);
                output.addItem(item);
            }
        }
       
        return output;
    }
View Full Code Here

{
    public static final String PLUGIN_NAME = "getfacts.plugins.feeds.RssReader";
   
    public static ConfigurationItems createConfig(String title, String url)
    {
        ConfigurationItems output = new ConfigurationItems(PLUGIN_NAME);
       
        // title
        output.setUserTitle(title);
       
        // url
        ConfigurationItem urlItem = new TextFieldItem(CFG_URL_KEY, url);
        output.addItem(urlItem);
       
        return output;
    }
View Full Code Here

    }
   
   
    public static ConfigurationItems createConfig(NodeList l)
    {
        ConfigurationItems output = new ConfigurationItems(PLUGIN_NAME);
       
        for(int i=0; i<l.getLength(); i++)
        {
            Node n = l.item(i);
            String itemName = XmlReader.getString(n, "./name");
            String itemValue = XmlReader.getString(n, "./value");
           
            if( itemName.compareTo(ConfigurationItems.CFG_USER_TITLE_KEY)==0 )
            {
                output.setUserTitle(itemValue);
            }
            else if( itemName.compareTo(CFG_URL_KEY)==0 )
            {
                ConfigurationItem urlItem = new TextFieldItem(CFG_URL_KEY, itemValue);
                output.addItem(urlItem);
            }
        }
       
        return output;
    }
View Full Code Here

TOP

Related Classes of getfacts.ConfigurationItems

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.