Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IBookMark


  private boolean isInputRelatedTo(INews news, EventType type) {
    for (IMark mark : fInput) {

      /* Check if BookMark references the News' Feed */
      if (mark instanceof IBookMark) {
        IBookMark bookmark = (IBookMark) mark;
        if (bookmark.getFeedLinkReference().equals(news.getFeedReference()))
          return true;
      }

      /* TODO This is a workaround! */
      else if (type != EventType.PERSIST && mark instanceof ISearchMark) {
View Full Code Here


      }
    }

    /* Update BookMark */
    else if (entity instanceof IBookMark) {
      IBookMark bookmark = (IBookMark) entity;

      /* Check for changed Name */
      if (!bookmark.getName().equals(fNameInput.getText())) {
        bookmark.setName(fNameInput.getText());
        entitiesToSave.add(bookmark);
      }

      /* Append "http" to Link if missing */
      String uriAsString = fFeedInput.getText();
      if (URIUtils.looksLikeLink(uriAsString)) {
        if (!uriAsString.contains("://"))
          uriAsString = "http://" + uriAsString;
      }

      /* Check for changed Feed */
      if (!bookmark.getFeedLinkReference().getLink().toString().equals(uriAsString)) {
        try {
          DAOService daoService = Owl.getPersistenceService().getDAOService();

          /* Create URL */
          URI newFeedLink = new URI(uriAsString.trim());
          fReloadRequired = true;

          /* Try to load this Feed from the DB (might be existing already) */
          FeedReference feedRef = daoService.getFeedDAO().loadReference(newFeedLink);

          /* This is a new Feed, so create it! */
          if (feedRef == null) {
            IFeed feed = Owl.getModelFactory().createFeed(null, newFeedLink);
            feed = DynamicDAO.save(feed);
          }

          /* Remember the old Reference */
          FeedLinkReference oldFeedRef = bookmark.getFeedLinkReference();

          /* Apply the new Reference */
          bookmark.setFeedLinkReference(new FeedLinkReference(newFeedLink));
          entitiesToSave.add(bookmark);

          /* Check if the old reference can be deleted now */
          if (daoService.getBookMarkDAO().loadAll(oldFeedRef).size() == 1)
            DynamicDAO.delete(oldFeedRef.resolve());

          /* Delete the Favicon since the feed has changed */
          OwlUI.deleteImage(bookmark.getId());
        }

        /* Supplied Feed Link not valid */
        catch (URISyntaxException e) {
          fSite.select(this);
View Full Code Here

     */
    @Override
    public String getToolTipText(Object element) {
      ScoredNews scoredNews = (ScoredNews) element;
      FeedLinkReference feedRef = scoredNews.getNews().getFeedReference();
      IBookMark bookMark = Controller.getDefault().getCacheService().getBookMark(feedRef);
      if (bookMark != null)
        return bookMark.getName();

      return null;
    }
View Full Code Here

        Object o = ss.getFirstElement();

// ********************* CB TODO
// We force an inspection on the bookmark first.
        if (o instanceof IBookMark) {
          IBookMark lBookMark = (IBookMark) o;
          IPersonalBookMark lPBookMark = PersonalCache.getInstance()
              .getPersonalBookMark(lBookMark);
          mMediaController.setMediaView(lPBookMark);
          // Invoke a codelet sequence for inspection.
          InstructionService.getInstance().inspectInstruction(this, lPBookMark);
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.IBookMark

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.