Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.Bookmark


    FeedSubscription feed = result.getResult().get(0);
    assertEquals(3,feed.getImportFolders().size());
   
   
    FeedSubscription newFeed = new FeedSubscription();
    newFeed.setBookmark(new Bookmark(302));
    newFeed.setAutoImport(false);
    newFeed.setMatchText("999");
   
    int id = feedDao.createSubscription(newFeed);
    assertTrue(id > 0);
View Full Code Here


 
  public void testAddBookmarks() throws Exception{
    Folder myFolder = folderManager.createFolder(new User("hchen1"), "Harry's Folder", "");
   
    List<Bookmark> bmarks = new ArrayList<Bookmark>();
    bmarks.add(new Bookmark(300));
    boolean[] opOkay = folderManager.addBookmarks(new User("hchen1"), "Harry's Folder", bmarks);
    assertTrue(opOkay[0]);
   
    myFolder = folderManager.createFolder(new User("hchen1"), "Harry's Folder", "");
    assertEquals(1,myFolder.getSize());
   
    Bookmark bm300 = bookmarkDao.getBookmark(300);
    assertTrue(bm300.getFolderList().contains("Harry's Folder"));
    assertTrue(bm300.getFolderList().contains("my folder1"));
  }
View Full Code Here

  public void testRemoveBookmarks() throws Exception {
    Folder f1 = folderManager.createFolder(new User("jsmith"), "my folder1","");
    assertEquals(3,f1.getSize());
   
    List<Bookmark> bmarks = new ArrayList<Bookmark>();
    bmarks.add(new Bookmark(300));
    bmarks.add(new Bookmark(301));
   
    boolean[] opOkay = folderManager.removeBookmarks(new User("jsmith"), "my folder1", bmarks);
    for(boolean b : opOkay){
      assertTrue(b);
    }
View Full Code Here

 
  public void testPageBookmarksWithTag() throws Exception{
    DaoResult<Bookmark> result = folderManager.pageFolderContent(new User("jsmith"), "my folder1", "foo", 0, 10);
    assertEquals(1,result.getSize());
   
    Bookmark b = result.getResult().get(0);
    assertEquals(303,b.getId());
   
    result = folderManager.pageFolderContent(new User("jsmith"), "my folder1", "cnn", 0, 10);
    assertEquals(3,result.getSize());
    assertEquals(3,result.getResult().size());
  }
View Full Code Here

    Link link = createLink(entry, fromFeed, fromSubscription);
    List<PointMarker> pm = createPointMarkers(entry, fromFeed, fromSubscription);

    BookmarkEntry newBmEntry = null;
    if(title != null && user != null && link != null){
      Bookmark bm = new Bookmark(user,link);
      if(tags != null && tags.isEmpty() == false){
        StringBuffer sb = new StringBuffer();
        for(String t : tags){
          sb.append(t.trim());
          sb.append(' ');
        }
        bm.setTags(sb.toString().trim());
      }
      if(machineTags != null && machineTags.isEmpty() == false){
        StringBuffer sb = new StringBuffer();
        for(MachineTag mt : machineTags){
          sb.append(mt.toString().trim());
          sb.append(' ');
        }
        String tagline = bm.getTags();
        if(tagline != null){
          sb.append(tagline);
        }
        bm.setTags(sb.toString().trim());
      }
      bm.setTitle(title);
      if(notes != null){
        bm.setNotes(notes);
      }else{
        bm.setNotes("");
      }
      bm.setCreatedOn(createdOn);
      bm.setLastUpdated(lastUpdated);
      newBmEntry = new BookmarkEntry();
      newBmEntry.setBookmark(bm);
      if(pm != null && pm.isEmpty() == false){
        newBmEntry.setPointMarkers(pm);
      }
View Full Code Here

    }

    public void run() {
      for (BookmarkListener aListener : listeners) {
        try {
          aListener.notifyUpdated(BookmarkManager.this, new Bookmark(
              oldBookmark), new Bookmark(newBookmark));
        } catch (Exception e) {
          logger.error("RunBookmarkUpdatedNotify.run()" + e);
        }
      }
    }
View Full Code Here

    }

    public void run() {
      for (BookmarkListener aListener : listeners) {
        try {
          aListener.notifyAdded(BookmarkManager.this, new Bookmark(
              bookmarkAdded));
        } catch (Exception e) {
          logger.error("RunBookmarkAddedNotify.run()" + e);
        }
      }
View Full Code Here

    }

    public void run() {
      for (BookmarkListener aListener : listeners) {
        try {
          aListener.notifyDeleted(BookmarkManager.this, new Bookmark(
              bookmarkDeleted));
        } catch (Exception e) {
          logger.error("RunBookmarkDeletedNotify.run()" + e);
        }
      }
View Full Code Here

    List<BookmarkTag> bTags = tagManager.listBookmarkTag(gnizr);
    assertEquals(2,bTags.size());
    assertEquals("zirrus",bTags.get(1).getBookmark().getTitle());

    BookmarkManager bManager = new BookmarkManager(getGnizrDao());
    Bookmark bm300 = bManager.getBookmark(300);
    String tags = bm300.getTags();
    bm300.setTags(tags + " web cnn");
    assertTrue(bManager.updateBookmark(bm300));
    assertEquals(202,bm300.getLink().getId());
   
    bTags = tagManager.listBookmarkTag(gnizr);
    assertEquals(3,bTags.size());
    assertEquals(202,bTags.get(1).getBookmark().getLink().getId());
    assertEquals(202,bTags.get(2).getBookmark().getLink().getId());   
View Full Code Here

  protected IDataSet getDataSet() throws Exception {
    return new FlatXmlDataSet(TestLinkManager.class.getResourceAsStream("/TestLinkHistory-input.xml"));
  }
 
  public void testFirstMatchedBookmark() throws Exception{
    Bookmark b = linkManager.getFirstMatchedBookmark("http://www.springframework.org/docs/reference/beans.html");
    assertNotNull(b);
    assertEquals("Spring Framework: Inversion of Control (IoC)",b.getTitle());
  }
View Full Code Here

TOP

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

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.