Package net.sourceforge.pebble.dao

Examples of net.sourceforge.pebble.dao.DAOFactory


      setPermalinkProvider(new DefaultPermalinkProvider());
    }

    // load categories
    try {
      DAOFactory factory = DAOFactory.getConfiguredFactory();
      CategoryDAO dao = factory.getCategoryDAO();
      rootCategory = dao.getCategories(this);
    } catch (PersistenceException pe) {
      pe.printStackTrace();
    }
View Full Code Here


      setPermalinkProvider(new DefaultPermalinkProvider());
    }

    // load categories
    try {
      DAOFactory factory = DAOFactory.getConfiguredFactory();
      CategoryDAO dao = factory.getCategoryDAO();
      rootCategory = dao.getCategories(this);
    } catch (PersistenceException pe) {
      pe.printStackTrace();
    }
View Full Code Here

   * @throws  StaticPageServiceException if something goes wrong
   */
  public List<StaticPage> getStaticPages(Blog blog) throws StaticPageServiceException {
    List<StaticPage> staticPages = new ArrayList<StaticPage>();
    try {
      DAOFactory factory = DAOFactory.getConfiguredFactory();
      StaticPageDAO dao = factory.getStaticPageDAO();
      staticPages.addAll(dao.loadStaticPages(blog));
    } catch (PersistenceException pe) {
      throw new StaticPageServiceException(blog, pe);
    }

View Full Code Here

      if (staticPage != null) {
        log.debug("Got static page " + pageId+ " from cache");
      } else {
        log.debug("Loading static page " + pageId+ " from disk");

        DAOFactory factory = DAOFactory.getConfiguredFactory();
        StaticPageDAO dao = factory.getStaticPageDAO();
        staticPage = dao.loadStaticPage(blog, pageId);
        if (staticPage != null) {
          staticPage.setPersistent(true);
          cache.putStaticPage(staticPage);
        }
View Full Code Here

   * @param   staticPage    the StaticPage instance to store
   * @throws  StaticPageServiceException if something goes wrong
   */
  public void putStaticPage(StaticPage staticPage) throws StaticPageServiceException {
    ContentCache cache = ContentCache.getInstance();
    DAOFactory factory = DAOFactory.getConfiguredFactory();
    StaticPageDAO dao = factory.getStaticPageDAO();
    Blog blog = staticPage.getBlog();

    synchronized (blog) {
      try {
        StaticPage sp = getStaticPageById(blog, staticPage.getId());
View Full Code Here

   * @param staticPage    the StaticPage instance to remove
   * @throws  StaticPageServiceException if something goes wrong
   */
  public void removeStaticPage(StaticPage staticPage) throws StaticPageServiceException {
    ContentCache cache = ContentCache.getInstance();
    DAOFactory factory = DAOFactory.getConfiguredFactory();
    StaticPageDAO dao = factory.getStaticPageDAO();
    Blog blog = staticPage.getBlog();

    try {
      dao.removeStaticPage(staticPage);
      cache.removeStaticPage(staticPage);
View Full Code Here

        } else {
          category = new Category(id, name);
        }

        blog.addCategory(category);
        DAOFactory factory = DAOFactory.getConfiguredFactory();
        CategoryDAO dao = factory.getCategoryDAO();
        dao.addCategory(category, blog);
      }
    } catch (Exception e) {
      log.error("Exception encountered", e);
    }
View Full Code Here

    entry.setTrackBacksEnabled(allowPings.equals("1"));

    for (String categoryStr : categories) {
      if(categoryStr != null && categoryStr.trim().length() > 0) {
        Category category = new Category(categoryStr.trim(), categoryStr.trim());
        DAOFactory factory = DAOFactory.getConfiguredFactory();
        CategoryDAO dao = factory.getCategoryDAO();
        dao.addCategory(category, blog);
        blog.addCategory(category);
        entry.addCategory(category);
      }
    }
View Full Code Here

  /**
   * Initializes the filters.
   */
  private void init() {
    try {
      DAOFactory factory = DAOFactory.getConfiguredFactory();
      RefererFilterDAO dao = factory.getRefererFilterDAO();
      filters = dao.getRefererFilters(rootBlog);

      Iterator it = filters.iterator();
      RefererFilter filter;
      while (it.hasNext()) {
View Full Code Here

   *
   * @param newFilter   a RefererFilter instance
   */
  public synchronized void addFilter(RefererFilter newFilter) {
    try {
      DAOFactory factory = DAOFactory.getConfiguredFactory();
      RefererFilterDAO dao = factory.getRefererFilterDAO();

      if (!filters.contains(newFilter)) {
        dao.addRefererFilter(newFilter, rootBlog);
        filters.add(newFilter);
        newFilter.setId(nextId);
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.dao.DAOFactory

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.