Package org.rssowl.core.persist.dao

Examples of org.rssowl.core.persist.dao.DAOService


      }

      /* 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());
        }
View Full Code Here


      }

      /* 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());
        }
View Full Code Here

          if (dialog.open() == IDialogConstants.CANCEL_ID)
            return false;
        }

        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);
          }

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

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

      }
    }
  }

  public static IDescriptionDAO getDescriptionDAO() {
    DAOService daoService = InternalOwl.getDefault().getPersistenceService().getDAOService();
    if (daoService instanceof DAOServiceImpl)
      return ((DAOServiceImpl) daoService).getDescriptionDAO();

    throw new IllegalStateException("This method should only be called if DAOService is of type " + DAOServiceImpl.class + ", but it is of type: " + daoService.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    updateNewsToBeIndexed(db);
    updateNewsBins(db);
  }

  public static EntitiesToBeIndexedDAOImpl getEntitiesToBeIndexedDAO() {
    DAOService service = InternalOwl.getDefault().getPersistenceService().getDAOService();
    if (service instanceof DAOServiceImpl) {
      EntitiesToBeIndexedDAOImpl entitiesToBeIndexedDAO = ((DAOServiceImpl) service).getEntitiesToBeIndexedDAO();
      return entitiesToBeIndexedDAO;
    }
    return null;
View Full Code Here

          if (dialog.open() == IDialogConstants.CANCEL_ID)
            return false;
        }

        try {
          DAOService daoService = Owl.getPersistenceService().getDAOService();

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

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

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

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

      }
    }
  }

  public static IDescriptionDAO getDescriptionDAO() {
    DAOService daoService = InternalOwl.getDefault().getPersistenceService().getDAOService();
    if (daoService instanceof DAOServiceImpl)
      return ((DAOServiceImpl) daoService).getDescriptionDAO();

    throw new IllegalStateException("This method should only be called if DAOService is of type " + DAOServiceImpl.class + ", but it is of type: " + daoService.getClass()); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    updateNewsToBeIndexed(db);
    updateNewsBins(db);
  }

  public static EntitiesToBeIndexedDAOImpl getEntitiesToBeIndexedDAO() {
    DAOService service = InternalOwl.getDefault().getPersistenceService().getDAOService();
    if (service instanceof DAOServiceImpl) {
      EntitiesToBeIndexedDAOImpl entitiesToBeIndexedDAO = ((DAOServiceImpl) service).getEntitiesToBeIndexedDAO();
      return entitiesToBeIndexedDAO;
    }
View Full Code Here

          newBookMark.setCreationDate(oldBookMark.getCreationDate());
          newBookMark.setLastVisitDate(oldBookMark.getLastVisitDate());
          newBookMark.setPopularity(oldBookMark.getPopularity());

          // Create the feed if it does not yet exist
          DAOService daoService = Owl.getPersistenceService().getDAOService();
          if (!daoService.getFeedDAO().exists(newFeedLink)) {
            IFeed feed = Owl.getModelFactory().createFeed(null, newFeedLink);
            feed = DynamicDAO.save(feed);
          }

          // Save folder where new bookmark is in
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.dao.DAOService

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.