//# 0 errors, 227 messages
//#
/*
    //#staticpageservice.java:1:1: class: net.sourceforge.pebble.service.StaticPageService
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.service;

import net.sourceforge.pebble.ContentCache;
import net.sourceforge.pebble.comparator.StaticPageByNameComparator;
import net.sourceforge.pebble.dao.DAOFactory;
import net.sourceforge.pebble.dao.PersistenceException;
import net.sourceforge.pebble.dao.StaticPageDAO;
import net.sourceforge.pebble.domain.Blog;
import net.sourceforge.pebble.domain.StaticPage;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * Service that encompasses all functionality related to getting, putting
 * and removing static pages.
 *
 * @author    Simon Brown
 */
public class StaticPageService {
    //#staticpageservice.java:55: method: void net.sourceforge.pebble.service.StaticPageService.net.sourceforge.pebble.service.StaticPageService()
    //#staticpageservice.java:55: end of method: void net.sourceforge.pebble.service.StaticPageService.net.sourceforge.pebble.service.StaticPageService()

  private static final Log log = LogFactory.getLog(StaticPageService.class);
    //#staticpageservice.java:57: method: net.sourceforge.pebble.service.StaticPageService.net.sourceforge.pebble.service.StaticPageService__static_init
    //#staticpageservice.java:57: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: net.sourceforge.pebble.service.StaticPageService__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): __Descendant_Table[net/sourceforge/pebble/service/StaticPageService]
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.getStaticPageById(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;)Lnet/sourceforge/pebble/domain/StaticPage;
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.getStaticPageByName(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;)Lnet/sourceforge/pebble/domain/StaticPage;
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.getStaticPages(Lnet/sourceforge/pebble/domain/Blog;)Ljava/util/List;
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.lock(Lnet/sourceforge/pebble/domain/StaticPage;)Z
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.putStaticPage(Lnet/sourceforge/pebble/domain/StaticPage;)V
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.removeStaticPage(Lnet/sourceforge/pebble/domain/StaticPage;)V
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.unlock(Lnet/sourceforge/pebble/domain/StaticPage;)Z
    //#output(net.sourceforge.pebble.service.StaticPageService__static_init): log
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): __Descendant_Table[net/sourceforge/pebble/service/StaticPageService] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.getStaticPageById(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;)Lnet/sourceforge/pebble/domain/StaticPage; == &getStaticPageById
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.getStaticPageByName(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;)Lnet/sourceforge/pebble/domain/StaticPage; == &getStaticPageByName
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.getStaticPages(Lnet/sourceforge/pebble/domain/Blog;)Ljava/util/List; == &getStaticPages
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.lock(Lnet/sourceforge/pebble/domain/StaticPage;)Z == &lock
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.putStaticPage(Lnet/sourceforge/pebble/domain/StaticPage;)V == &putStaticPage
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.removeStaticPage(Lnet/sourceforge/pebble/domain/StaticPage;)V == &removeStaticPage
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): __Dispatch_Table.unlock(Lnet/sourceforge/pebble/domain/StaticPage;)Z == &unlock
    //#post(net.sourceforge.pebble.service.StaticPageService__static_init): init'ed(log)
    //#staticpageservice.java:57: end of method: net.sourceforge.pebble.service.StaticPageService.net.sourceforge.pebble.service.StaticPageService__static_init

  /**
   * Gets the list of static pages for the given blog.
   *
   * @param blog    the Blog
   * @return  a list of BlogEntry instances
   * @throws  StaticPageServiceException if something goes wrong
   */
  public List<StaticPage> getStaticPages(Blog blog) throws StaticPageServiceException {
    List<StaticPage> staticPages = new ArrayList<StaticPage>();
    //#staticpageservice.java:67: method: List net.sourceforge.pebble.service.StaticPageService.getStaticPages(Blog)
    //#input(List getStaticPages(Blog)): blog
    //#output(List getStaticPages(Blog)): new ArrayList(getStaticPages#1) num objects
    //#output(List getStaticPages(Blog)): return_value
    //#new obj(List getStaticPages(Blog)): new ArrayList(getStaticPages#1)
    //#presumption(List getStaticPages(Blog)): net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory(...)@69 != null
    //#presumption(List getStaticPages(Blog)): net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO(...)@70 != null
    //#post(List getStaticPages(Blog)): return_value == &new ArrayList(getStaticPages#1)
    //#post(List getStaticPages(Blog)): new ArrayList(getStaticPages#1) num objects == 1
    //#unanalyzed(List getStaticPages(Blog)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:error
    //#unanalyzed(List getStaticPages(Blog)): Effects-of-calling:net.sourceforge.pebble.PebbleException
    //#unanalyzed(List getStaticPages(Blog)): Effects-of-calling:java.lang.Exception:getMessage
    try {
      DAOFactory factory = DAOFactory.getConfiguredFactory();
    //#staticpageservice.java:69: Warning: method not available
    //#    -- call on DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: List getStaticPages(Blog)
    //#    unanalyzed callee: DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
      StaticPageDAO dao = factory.getStaticPageDAO();
    //#staticpageservice.java:70: Warning: method not available
    //#    -- call on StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: List getStaticPages(Blog)
    //#    unanalyzed callee: StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
      staticPages.addAll(dao.loadStaticPages(blog));
    //#staticpageservice.java:71: Warning: method not available
    //#    -- call on Collection net.sourceforge.pebble.dao.StaticPageDAO:loadStaticPages(Blog)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: List getStaticPages(Blog)
    //#    unanalyzed callee: Collection net.sourceforge.pebble.dao.StaticPageDAO:loadStaticPages(Blog)
    } catch (PersistenceException pe) {
      throw new StaticPageServiceException(blog, pe);
    }

    Collections.sort(staticPages, new StaticPageByNameComparator());
    //#staticpageservice.java:76: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.comparator.StaticPageByNameComparator()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: List getStaticPages(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.comparator.StaticPageByNameComparator()

    return staticPages;
    //#staticpageservice.java:78: end of method: List net.sourceforge.pebble.service.StaticPageService.getStaticPages(Blog)
  }

  /**
   * Gets the page with the specified id.
   *
   * @param pageId   the id of the static page
   * @param blog    the Blog
   * @return  a Page instance, or null if the page couldn't be found
   * @throws  StaticPageServiceException if something goes wrong
   */
  public StaticPage getStaticPageById(Blog blog, String pageId) throws StaticPageServiceException {
    StaticPage staticPage;
    ContentCache cache = ContentCache.getInstance();
    //#staticpageservice.java:91: method: StaticPage net.sourceforge.pebble.service.StaticPageService.getStaticPageById(Blog, String)
    //#staticpageservice.java:91: Warning: method not available
    //#    -- call on ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#input(StaticPage getStaticPageById(Blog, String)): blog
    //#input(StaticPage getStaticPageById(Blog, String)): log
    //#input(StaticPage getStaticPageById(Blog, String)): pageId
    //#output(StaticPage getStaticPageById(Blog, String)): return_value
    //#presumption(StaticPage getStaticPageById(Blog, String)): net.sourceforge.pebble.ContentCache:getInstance(...)@91 != null
    //#presumption(StaticPage getStaticPageById(Blog, String)): net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory(...)@100 != null
    //#presumption(StaticPage getStaticPageById(Blog, String)): net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO(...)@101 != null
    //#presumption(StaticPage getStaticPageById(Blog, String)): org.apache.commons.logging.LogFactory:getLog(...)@57 != null
    //#post(StaticPage getStaticPageById(Blog, String)): init'ed(return_value)
    //#unanalyzed(StaticPage getStaticPageById(Blog, String)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:error
    //#unanalyzed(StaticPage getStaticPageById(Blog, String)): Effects-of-calling:net.sourceforge.pebble.PebbleException
    //#unanalyzed(StaticPage getStaticPageById(Blog, String)): Effects-of-calling:java.lang.Exception:getMessage
    //#test_vector(StaticPage getStaticPageById(Blog, String)): net.sourceforge.pebble.ContentCache:getStaticPage(...)@94: Addr_Set{null}, Inverse{null}
    //#test_vector(StaticPage getStaticPageById(Blog, String)): net.sourceforge.pebble.dao.StaticPageDAO:loadStaticPage(...)@102: Addr_Set{null}, Inverse{null}

    try {
      staticPage = cache.getStaticPage(blog, pageId);
    //#staticpageservice.java:94: Warning: method not available
    //#    -- call on StaticPage net.sourceforge.pebble.ContentCache:getStaticPage(Blog, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: StaticPage net.sourceforge.pebble.ContentCache:getStaticPage(Blog, String)
      if (staticPage != null) {
        log.debug("Got static page " + pageId+ " from cache");
    //#staticpageservice.java:96: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
      } else {
        log.debug("Loading static page " + pageId+ " from disk");
    //#staticpageservice.java:98: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)

        DAOFactory factory = DAOFactory.getConfiguredFactory();
    //#staticpageservice.java:100: Warning: method not available
    //#    -- call on DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
        StaticPageDAO dao = factory.getStaticPageDAO();
    //#staticpageservice.java:101: Warning: method not available
    //#    -- call on StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
        staticPage = dao.loadStaticPage(blog, pageId);
    //#staticpageservice.java:102: Warning: method not available
    //#    -- call on StaticPage net.sourceforge.pebble.dao.StaticPageDAO:loadStaticPage(Blog, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: StaticPage net.sourceforge.pebble.dao.StaticPageDAO:loadStaticPage(Blog, String)
        if (staticPage != null) {
          staticPage.setPersistent(true);
    //#staticpageservice.java:104: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.StaticPage:setPersistent(bool)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.StaticPage:setPersistent(bool)
          cache.putStaticPage(staticPage);
    //#staticpageservice.java:105: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.ContentCache:putStaticPage(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: void net.sourceforge.pebble.ContentCache:putStaticPage(StaticPage)
        }
      }
    } catch (PersistenceException pe) {
      throw new StaticPageServiceException(blog, pe);
    }

    if (staticPage != null) {
      staticPage = (StaticPage)staticPage.clone();
    //#staticpageservice.java:113: Warning: method not available
    //#    -- call on Object net.sourceforge.pebble.domain.StaticPage:clone()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageById(Blog, String)
    //#    unanalyzed callee: Object net.sourceforge.pebble.domain.StaticPage:clone()
    }

    return staticPage;
    //#staticpageservice.java:116: end of method: StaticPage net.sourceforge.pebble.service.StaticPageService.getStaticPageById(Blog, String)
  }

  /**
   * Gets the static page with the specified name.
   *
   * @param name    the name of the static page
   * @param blog    the Blog
   * @return  a StaticPage instance, or null if the page couldn't be found
   * @throws  StaticPageServiceException if something goes wrong
   */
  public StaticPage getStaticPageByName(Blog blog, String name) throws StaticPageServiceException {
    String id = blog.getStaticPageIndex().getStaticPage(name);
    //#staticpageservice.java:128: method: StaticPage net.sourceforge.pebble.service.StaticPageService.getStaticPageByName(Blog, String)
    //#staticpageservice.java:128: Warning: method not available
    //#    -- call on StaticPageIndex net.sourceforge.pebble.domain.Blog:getStaticPageIndex()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageByName(Blog, String)
    //#    unanalyzed callee: StaticPageIndex net.sourceforge.pebble.domain.Blog:getStaticPageIndex()
    //#staticpageservice.java:128: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.index.StaticPageIndex:getStaticPage(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: StaticPage getStaticPageByName(Blog, String)
    //#    unanalyzed callee: String net.sourceforge.pebble.index.StaticPageIndex:getStaticPage(String)
    //#input(StaticPage getStaticPageByName(Blog, String)): __Descendant_Table[net/sourceforge/pebble/service/StaticPageService]
    //#input(StaticPage getStaticPageByName(Blog, String)): __Descendant_Table[others]
    //#input(StaticPage getStaticPageByName(Blog, String)): __Dispatch_Table.getStaticPageById(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;)Lnet/sourceforge/pebble/domain/StaticPage;
    //#input(StaticPage getStaticPageByName(Blog, String)): blog
    //#input(StaticPage getStaticPageByName(Blog, String)): log
    //#input(StaticPage getStaticPageByName(Blog, String)): name
    //#input(StaticPage getStaticPageByName(Blog, String)): this
    //#input(StaticPage getStaticPageByName(Blog, String)): this.__Tag
    //#output(StaticPage getStaticPageByName(Blog, String)): return_value
    //#pre[1] (StaticPage getStaticPageByName(Blog, String)): blog != null
    //#pre[4] (StaticPage getStaticPageByName(Blog, String)): this.__Tag == net/sourceforge/pebble/service/StaticPageService
    //#presumption(StaticPage getStaticPageByName(Blog, String)): net.sourceforge.pebble.domain.Blog:getStaticPageIndex(...)@128 != null
    //#post(StaticPage getStaticPageByName(Blog, String)): init'ed(return_value)
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:error
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.PebbleException
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:java.lang.Exception:getMessage
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.ContentCache:getInstance
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.ContentCache:getStaticPage
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.dao.StaticPageDAO:loadStaticPage
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:setPersistent
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.ContentCache:putStaticPage
    //#unanalyzed(StaticPage getStaticPageByName(Blog, String)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:clone
    return getStaticPageById(blog, id);
    //#staticpageservice.java:129: end of method: StaticPage net.sourceforge.pebble.service.StaticPageService.getStaticPageByName(Blog, String)
  }

  /**
   * Puts the static page.
   *
   * @param   staticPage    the StaticPage instance to store
   * @throws  StaticPageServiceException if something goes wrong
   */
  public void putStaticPage(StaticPage staticPage) throws StaticPageServiceException {
    ContentCache cache = ContentCache.getInstance();
    //#staticpageservice.java:139: method: void net.sourceforge.pebble.service.StaticPageService.putStaticPage(StaticPage)
    //#staticpageservice.java:139: Warning: method not available
    //#    -- call on ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#input(void putStaticPage(StaticPage)): __Descendant_Table[net/sourceforge/pebble/service/StaticPageService]
    //#input(void putStaticPage(StaticPage)): __Descendant_Table[others]
    //#input(void putStaticPage(StaticPage)): __Dispatch_Table.getStaticPageById(Lnet/sourceforge/pebble/domain/Blog;Ljava/lang/String;)Lnet/sourceforge/pebble/domain/StaticPage;
    //#input(void putStaticPage(StaticPage)): __Dispatch_Table.putStaticPage(Lnet/sourceforge/pebble/domain/StaticPage;)V
    //#input(void putStaticPage(StaticPage)): log
    //#input(void putStaticPage(StaticPage)): staticPage
    //#input(void putStaticPage(StaticPage)): this
    //#input(void putStaticPage(StaticPage)): this.__Tag
    //#pre[1] (void putStaticPage(StaticPage)): staticPage != null
    //#pre[3] (void putStaticPage(StaticPage)): this.__Tag == net/sourceforge/pebble/service/StaticPageService
    //#presumption(void putStaticPage(StaticPage)): java.util.Date:getTime(...)@151 <= 18_446_744_073_709_551_614
    //#presumption(void putStaticPage(StaticPage)): net.sourceforge.pebble.ContentCache:getInstance(...)@139 != null
    //#presumption(void putStaticPage(StaticPage)): net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory(...)@140 != null
    //#presumption(void putStaticPage(StaticPage)): net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO(...)@141 != null
    //#presumption(void putStaticPage(StaticPage)): net.sourceforge.pebble.domain.Blog:getSearchIndex(...)@159 != null
    //#presumption(void putStaticPage(StaticPage)): net.sourceforge.pebble.domain.Blog:getStaticPageIndex(...)@160 != null
    //#presumption(void putStaticPage(StaticPage)): net.sourceforge.pebble.domain.StaticPage:getBlog(...)@159 != null
    //#presumption(void putStaticPage(StaticPage)): net.sourceforge.pebble.domain.StaticPage:getBlog(...)@160 != null
    //#presumption(void putStaticPage(StaticPage)): net.sourceforge.pebble.domain.StaticPage:getDate(...)@151 != null
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:error
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.PebbleException
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:java.lang.Exception:getMessage
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.ContentCache:getInstance
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.ContentCache:getStaticPage
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:org.apache.commons.logging.Log:debug
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.dao.StaticPageDAO:loadStaticPage
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:setPersistent
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.ContentCache:putStaticPage
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:clone
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:isPersistent
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.ContentCache:removeStaticPage
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:getBlog
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:getSearchIndex
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:getStaticPageIndex
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:getId
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:getDate
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:java.util.Date:getTime
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:java.util.Date
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.StaticPage:setDate
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:putStaticPage
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.dao.StaticPageDAO:storeStaticPage
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.index.SearchIndex:index
    //#unanalyzed(void putStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.index.StaticPageIndex:index
    //#test_vector(void putStaticPage(StaticPage)): net.sourceforge.pebble.domain.StaticPage:isPersistent(...)@148: {1}, {0}
    DAOFactory factory = DAOFactory.getConfiguredFactory();
    //#staticpageservice.java:140: Warning: method not available
    //#    -- call on DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    StaticPageDAO dao = factory.getStaticPageDAO();
    //#staticpageservice.java:141: Warning: method not available
    //#    -- call on StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    Blog blog = staticPage.getBlog();
    //#staticpageservice.java:142: Warning: method not available
    //#    -- call on Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: Blog net.sourceforge.pebble.domain.StaticPage:getBlog()

    synchronized (blog) {
      try {
        StaticPage sp = getStaticPageById(blog, staticPage.getId());
    //#staticpageservice.java:146: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.StaticPage:getId()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.StaticPage:getId()

        if (!staticPage.isPersistent() && sp != null) {
    //#staticpageservice.java:148: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.StaticPage:isPersistent()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.StaticPage:isPersistent()
          // the static page is new but one exists with the same ID already
          // - increment the date/ID and try again
          staticPage.setDate(new Date(staticPage.getDate().getTime() + 1));
    //#staticpageservice.java:151: Warning: method not available
    //#    -- call on Date net.sourceforge.pebble.domain.StaticPage:getDate()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: Date net.sourceforge.pebble.domain.StaticPage:getDate()
    //#staticpageservice.java:151: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.StaticPage:setDate(Date)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.StaticPage:setDate(Date)
          putStaticPage(staticPage);
        } else {
          dao.storeStaticPage(staticPage);
    //#staticpageservice.java:154: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.StaticPageDAO:storeStaticPage(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.StaticPageDAO:storeStaticPage(StaticPage)
          staticPage.setPersistent(true);
    //#staticpageservice.java:155: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.StaticPage:setPersistent(bool)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.StaticPage:setPersistent(bool)
          cache.removeStaticPage(staticPage);
    //#staticpageservice.java:156: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.ContentCache:removeStaticPage(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.ContentCache:removeStaticPage(StaticPage)
        }

        staticPage.getBlog().getSearchIndex().index(staticPage);
    //#staticpageservice.java:159: Warning: method not available
    //#    -- call on Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#staticpageservice.java:159: Warning: method not available
    //#    -- call on SearchIndex net.sourceforge.pebble.domain.Blog:getSearchIndex()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: SearchIndex net.sourceforge.pebble.domain.Blog:getSearchIndex()
    //#staticpageservice.java:159: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.index.SearchIndex:index(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.index.SearchIndex:index(StaticPage)
        staticPage.getBlog().getStaticPageIndex().index(staticPage);
    //#staticpageservice.java:160: Warning: method not available
    //#    -- call on Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#staticpageservice.java:160: Warning: method not available
    //#    -- call on StaticPageIndex net.sourceforge.pebble.domain.Blog:getStaticPageIndex()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: StaticPageIndex net.sourceforge.pebble.domain.Blog:getStaticPageIndex()
    //#staticpageservice.java:160: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.index.StaticPageIndex:index(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void putStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.index.StaticPageIndex:index(StaticPage)
      } catch (PersistenceException pe) {
        throw new StaticPageServiceException(blog, pe);
      }
    }
  }
    //#staticpageservice.java:165: end of method: void net.sourceforge.pebble.service.StaticPageService.putStaticPage(StaticPage)

  /**
   * Removes a static page.
   *
   * @param staticPage    the StaticPage instance to remove
   * @throws  StaticPageServiceException if something goes wrong
   */
  public void removeStaticPage(StaticPage staticPage) throws StaticPageServiceException {
    ContentCache cache = ContentCache.getInstance();
    //#staticpageservice.java:174: method: void net.sourceforge.pebble.service.StaticPageService.removeStaticPage(StaticPage)
    //#staticpageservice.java:174: Warning: method not available
    //#    -- call on ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#input(void removeStaticPage(StaticPage)): staticPage
    //#pre[1] (void removeStaticPage(StaticPage)): staticPage != null
    //#presumption(void removeStaticPage(StaticPage)): net.sourceforge.pebble.ContentCache:getInstance(...)@174 != null
    //#presumption(void removeStaticPage(StaticPage)): net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory(...)@175 != null
    //#presumption(void removeStaticPage(StaticPage)): net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO(...)@176 != null
    //#presumption(void removeStaticPage(StaticPage)): net.sourceforge.pebble.domain.Blog:getSearchIndex(...)@183 != null
    //#presumption(void removeStaticPage(StaticPage)): net.sourceforge.pebble.domain.Blog:getStaticPageIndex(...)@184 != null
    //#presumption(void removeStaticPage(StaticPage)): net.sourceforge.pebble.domain.StaticPage:getBlog(...)@183 != null
    //#presumption(void removeStaticPage(StaticPage)): net.sourceforge.pebble.domain.StaticPage:getBlog(...)@184 != null
    //#unanalyzed(void removeStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:error
    //#unanalyzed(void removeStaticPage(StaticPage)): Effects-of-calling:net.sourceforge.pebble.PebbleException
    //#unanalyzed(void removeStaticPage(StaticPage)): Effects-of-calling:java.lang.Exception:getMessage
    DAOFactory factory = DAOFactory.getConfiguredFactory();
    //#staticpageservice.java:175: Warning: method not available
    //#    -- call on DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    StaticPageDAO dao = factory.getStaticPageDAO();
    //#staticpageservice.java:176: Warning: method not available
    //#    -- call on StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    Blog blog = staticPage.getBlog();
    //#staticpageservice.java:177: Warning: unused assignment
    //#    unused assignment into blog
    //#    severity: LOW
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#staticpageservice.java:177: Warning: method not available
    //#    -- call on Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: Blog net.sourceforge.pebble.domain.StaticPage:getBlog()

    try {
      dao.removeStaticPage(staticPage);
    //#staticpageservice.java:180: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.StaticPageDAO:removeStaticPage(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.StaticPageDAO:removeStaticPage(StaticPage)
      cache.removeStaticPage(staticPage);
    //#staticpageservice.java:181: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.ContentCache:removeStaticPage(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.ContentCache:removeStaticPage(StaticPage)

      staticPage.getBlog().getSearchIndex().unindex(staticPage);
    //#staticpageservice.java:183: Warning: method not available
    //#    -- call on Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#staticpageservice.java:183: Warning: method not available
    //#    -- call on SearchIndex net.sourceforge.pebble.domain.Blog:getSearchIndex()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: SearchIndex net.sourceforge.pebble.domain.Blog:getSearchIndex()
    //#staticpageservice.java:183: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.index.SearchIndex:unindex(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.index.SearchIndex:unindex(StaticPage)
      staticPage.getBlog().getStaticPageIndex().unindex(staticPage);
    //#staticpageservice.java:184: Warning: method not available
    //#    -- call on Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: Blog net.sourceforge.pebble.domain.StaticPage:getBlog()
    //#staticpageservice.java:184: Warning: method not available
    //#    -- call on StaticPageIndex net.sourceforge.pebble.domain.Blog:getStaticPageIndex()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: StaticPageIndex net.sourceforge.pebble.domain.Blog:getStaticPageIndex()
    //#staticpageservice.java:184: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.index.StaticPageIndex:unindex(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: void removeStaticPage(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.index.StaticPageIndex:unindex(StaticPage)
    } catch (PersistenceException pe) {
      // remove from the cache so that it's picked up from storage when accessed next
      cache.removeStaticPage(staticPage);

      throw new StaticPageServiceException(staticPage.getBlog(), pe);
    }
  }
    //#staticpageservice.java:191: end of method: void net.sourceforge.pebble.service.StaticPageService.removeStaticPage(StaticPage)

  /**
   * Locks a given static page.
   *
   * @param staticPage    the static page to lock
   * @return  true if the page could be locked, false otherwise
   */
  public boolean lock(StaticPage staticPage) {
    if (staticPage.isPersistent()) {
    //#staticpageservice.java:200: method: bool net.sourceforge.pebble.service.StaticPageService.lock(StaticPage)
    //#staticpageservice.java:200: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.StaticPage:isPersistent()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool lock(StaticPage)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.StaticPage:isPersistent()
    //#input(bool lock(StaticPage)): staticPage
    //#output(bool lock(StaticPage)): return_value
    //#pre[1] (bool lock(StaticPage)): staticPage != null
    //#presumption(bool lock(StaticPage)): net.sourceforge.pebble.ContentCache:getInstance(...)@202 != null
    //#presumption(bool lock(StaticPage)): net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory(...)@201 != null
    //#presumption(bool lock(StaticPage)): net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO(...)@201 != null
    //#post(bool lock(StaticPage)): init'ed(return_value)
    //#test_vector(bool lock(StaticPage)): net.sourceforge.pebble.domain.StaticPage:isPersistent(...)@200: {0}, {1}
      boolean success = DAOFactory.getConfiguredFactory().getStaticPageDAO().lock(staticPage);
    //#staticpageservice.java:201: Warning: method not available
    //#    -- call on DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool lock(StaticPage)
    //#    unanalyzed callee: DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#staticpageservice.java:201: Warning: method not available
    //#    -- call on StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool lock(StaticPage)
    //#    unanalyzed callee: StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    //#staticpageservice.java:201: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.dao.StaticPageDAO:lock(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool lock(StaticPage)
    //#    unanalyzed callee: bool net.sourceforge.pebble.dao.StaticPageDAO:lock(StaticPage)
      ContentCache.getInstance().removeStaticPage(staticPage);
    //#staticpageservice.java:202: Warning: method not available
    //#    -- call on ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool lock(StaticPage)
    //#    unanalyzed callee: ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#staticpageservice.java:202: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.ContentCache:removeStaticPage(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool lock(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.ContentCache:removeStaticPage(StaticPage)

      return success;
    } else {
      return true;
    //#staticpageservice.java:206: end of method: bool net.sourceforge.pebble.service.StaticPageService.lock(StaticPage)
    }
  }

  /**
   * Unlocks a given static page.
   *
   * @param staticPage    the static page to unlock
   * @return  true if the page could be unlocked, false otherwise
   */
  public boolean unlock(StaticPage staticPage) {
    if (staticPage.isPersistent()) {
    //#staticpageservice.java:217: method: bool net.sourceforge.pebble.service.StaticPageService.unlock(StaticPage)
    //#staticpageservice.java:217: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.StaticPage:isPersistent()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool unlock(StaticPage)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.StaticPage:isPersistent()
    //#input(bool unlock(StaticPage)): staticPage
    //#output(bool unlock(StaticPage)): return_value
    //#pre[1] (bool unlock(StaticPage)): staticPage != null
    //#presumption(bool unlock(StaticPage)): net.sourceforge.pebble.ContentCache:getInstance(...)@219 != null
    //#presumption(bool unlock(StaticPage)): net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory(...)@218 != null
    //#presumption(bool unlock(StaticPage)): net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO(...)@218 != null
    //#post(bool unlock(StaticPage)): init'ed(return_value)
    //#test_vector(bool unlock(StaticPage)): net.sourceforge.pebble.domain.StaticPage:isPersistent(...)@217: {0}, {1}
      boolean success = DAOFactory.getConfiguredFactory().getStaticPageDAO().unlock(staticPage);
    //#staticpageservice.java:218: Warning: method not available
    //#    -- call on DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool unlock(StaticPage)
    //#    unanalyzed callee: DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#staticpageservice.java:218: Warning: method not available
    //#    -- call on StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool unlock(StaticPage)
    //#    unanalyzed callee: StaticPageDAO net.sourceforge.pebble.dao.DAOFactory:getStaticPageDAO()
    //#staticpageservice.java:218: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.dao.StaticPageDAO:unlock(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool unlock(StaticPage)
    //#    unanalyzed callee: bool net.sourceforge.pebble.dao.StaticPageDAO:unlock(StaticPage)
      ContentCache.getInstance().removeStaticPage(staticPage);
    //#staticpageservice.java:219: Warning: method not available
    //#    -- call on ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool unlock(StaticPage)
    //#    unanalyzed callee: ContentCache net.sourceforge.pebble.ContentCache:getInstance()
    //#staticpageservice.java:219: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.ContentCache:removeStaticPage(StaticPage)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.service.StaticPageService
    //#    method: bool unlock(StaticPage)
    //#    unanalyzed callee: void net.sourceforge.pebble.ContentCache:removeStaticPage(StaticPage)

      return success;
    } else {
      return true;
    //#staticpageservice.java:223: end of method: bool net.sourceforge.pebble.service.StaticPageService.unlock(StaticPage)
    }
  }

}    //#staticpageservice.java:: end of class: net.sourceforge.pebble.service.StaticPageService
