Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.FeedSubscription


    return feedDao.removeImportFolders(feedSub, folderImport);
  }
 
  public List<Folder> listImportFolder(User feedOwner, String feedUrl) throws NoSuchUserException, NoSuchFeedSubscriptionException{
    GnizrDaoUtil.fillId(userDao,feedOwner);
    FeedSubscription feedSub = getSubscription(feedOwner, feedUrl);
    if(feedSub == null){
      throw new NoSuchFeedSubscriptionException("no such feed: " + feedUrl + " for user: " + feedOwner.getUsername());
    }
    List<Folder> folders = new ArrayList<Folder>();
    folders.addAll(feedDao.listImportFolder(feedSub));
View Full Code Here


  protected void tearDown() throws Exception {
    super.tearDown();
  }
 
  public void testCreateEntry1() throws Exception{
    fromSub = new FeedSubscription();
    Bookmark rssBm = new Bookmark();
    rssBm.setUser(new User("hchen1"));
    rssBm.setLink(new Link(rssUrl));
    fromSub.setBookmark(rssBm);
    fromSub.setImportFolders(new ArrayList<String>());
View Full Code Here

    assertEquals("hchen1",b.getUser().getUsername());   
  }
 
 
  public void testCreateEntry2() throws Exception{
    fromSub = new FeedSubscription();
    Bookmark rssBm = new Bookmark();
    rssBm.setUser(new User("hchen1"));
    rssBm.setLink(new Link(rssUrl));
    rssBm.setTags("tag:mycoolfeed gn:tag=geonames:21024,md tag:    ");
    fromSub.setBookmark(rssBm);
View Full Code Here

  protected IDataSet getDataSet() throws Exception {
    return new FlatXmlDataSet(TestFeedSubscribeListener.class.getResourceAsStream("/TestFeedSubscribeListener-input.xml"));
  }

  public void testDeleteBookmark() throws Exception{
    FeedSubscription sub = feedManager.getSubscription(400);
    assertNotNull(sub);
   
    boolean deleted = bookmarkManager.deleteBookmark(new Bookmark(300));
    assertTrue(deleted);
   
View Full Code Here

   
    int id = bookmarkManager.addBookmark(b);
    assertTrue((id >0));
    bookmarkManager.shutdown();
 
    FeedSubscription sub = feedManager.getSubscription(new User(1),"http://link.com/rss");
    assertNotNull(sub);
  }
View Full Code Here

    Bookmark bm = bookmarkManager.getBookmark(301);
    bm.setTags("subscribe:this abc");
    bookmarkManager.updateBookmark(bm);
    bookmarkManager.shutdown();
   
    FeedSubscription feed = feedManager.getSubscription(new User(1), "http://rss.slashdot.org/Slashdot/slashdot");
    assertNotNull(feed);
  }
View Full Code Here

      String safeTagStr = TagUtil.makeSafeTagString(tag);
      if (safeTagStr.length() > 0) {
        MachineTag mt = MachineTags.GN_TAG(safeTagStr);
        String fullSynx = mt.toString();
        String shrtSynx = mt.getPredicate()+":"+mt.getValue();
        FeedSubscription feed = feedSubscriptionManager.getSubscription(getUser(),feedUrl);
        if(feed != null){
          String tagline = feed.getBookmark().getTags();
          if(tagline.contains(fullSynx) == true){
            tagline = tagline.replace(fullSynx," ");
          }else if(tagline.contains(shrtSynx) == true){
            tagline = tagline.replace(shrtSynx, " ");
          }
          Bookmark bm = feed.getBookmark();
          bm.setTags(tagline);
          bookmarkManager.updateBookmark(bm);
        }
        doDefault();
        return INPUT;
View Full Code Here

        + feedUrl + ",feedTitle=" + feedTitle);
    if (feedUrl != null && user != null) {
      // if a feed that we asked to create already exists,
      // fetch it from the database and return SUCCESS
      try {
        FeedSubscription existFeed = feedSubscriptionManager
            .getSubscription(user, feedUrl);
        if (existFeed != null) {
          feed = existFeed;
          return SUCCESS;
        }
View Full Code Here

TOP

Related Classes of com.gnizr.db.dao.FeedSubscription

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.