Package de.nava.informa.impl.basic

Examples of de.nava.informa.impl.basic.Item


    // create dummy channel
    ChannelIF channel = new Channel(ch_title);
    channel.setDescription(ch_desc);
    channel.setSite(new URL("http://nava.de"));
    channel.setLocation(new URL("http://nava.de/news.rdf"));
    ItemIF itemA = new Item("Bugo", "All about it!",
                            new URL("http://nava.de/huhu2002"));
    itemA.setFound(new Date());
    channel.addItem(itemA);
    // TODO: what about markup here ???
    ItemIF itemB = new Item("SoCool",
                            "????**$12 @??? # <strong>should</strong> work",
                            new URL("http://nava.de/very/nested/98"));
    itemB.setFound(new Date());
    channel.addItem(itemB);
    assertEquals(2, channel.getItems().size());
    // export this channel to file (encoding: utf-8)
    String basename = "export-rss10.xml";
    String exp_file = getOutputDir() + FS + basename;
View Full Code Here


    super("TestChannelIndexer", name);
  }

  public void testIndexItems() throws MalformedURLException, IOException {
    Collection<ItemIF> items = new ArrayList<ItemIF>();
    ItemIF itemA = new Item("Java 1.5 out", "Long awaited...",
                            new URL("http://example.org/1234"));
    items.add(itemA);
    ItemIF itemB = new Item("XML virus found", "All about it here.",
                            new URL("http://example.org/2345"));
    items.add(itemB);
    assertEquals(2, items.size());
    ChannelIndexer indexer = new ChannelIndexer(getIndexDir());
    indexer.indexItems(true, items);
View Full Code Here

  }

  protected void setUp() throws MalformedURLException {
    ChannelIF channelA = new Channel("example.org");
    channelId = channelA.getId();
    itemA = new Item("Java 1.5 out", "Long awaited...",
                     new URL("http://example.org/1234"));
    channelA.addItem(itemA);
    ItemIF itemB = new Item("XML virus found", "All about it here.",
                            new URL("http://example.org/2345"));
    channelA.addItem(itemB);
    ItemIF itemC = new Item("Quiet Slashdot", "No news today.",
                            new URL("http://example.org/3456"));
    channelA.addItem(itemC);
    channels = new ChannelGroup("Default");
    channels.add(channelA);
  }
View Full Code Here

    // folder may be left out blank or null, because its not needed anyway.
    Collection items = channel.getItems();
    Iterator iter = items.iterator();
   
    while(iter.hasNext()){
      Item item = (Item) iter.next();
      if( item.getTitle().equalsIgnoreCase((String) key) ) {
        return new ItemWrapper(item);
      }
    }
    return null;
  }
View Full Code Here

    List items = new ArrayList(channel.getItems());
    Map itemMap = new LinkedMap();
    Iterator iter = items.iterator();
   
    while(iter.hasNext()){
      Item item = (Item) iter.next();
      itemMap.put( (new Long(item.getId())).toString() , new ItemWrapper(item) );
      }
    return itemMap;
  }
View Full Code Here

TOP

Related Classes of de.nava.informa.impl.basic.Item

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.