Class PageDAO

All Implemented Interfaces:
LogEnabled, Component, Contextualizable, Serviceable

public class PageDAO extends AbstractDAO
DAO for manipulating survey pages.
  • Field Details

    • ROLE

      public static final String ROLE
      The Avalon role
  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager serviceManager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Overrides:
      service in class AbstractDAO
      Throws:
      ServiceException
    • getPage

      public Map<String,Object> getPage(String id)
      Gets properties of a survey page
      Parameters:
      id - The id of the survey page
      Returns:
      The properties
    • getPage

      Gets properties of a survey page
      Parameters:
      page - The survey page
      Returns:
      The properties
    • isLastPage

      public boolean isLastPage(String id)
      Determines if a page is the last of survey's pages.
      Parameters:
      id - The page id
      Returns:
      True if the page is the last one.
    • createPage

      public Map<String,String> createPage(Map<String,Object> values) throws Exception
      Creates a survey page.
      Parameters:
      values - The survey page's values
      Returns:
      The id of the created survey page
      Throws:
      Exception - if an exception occurs during the page creation process
    • editPage

      public Map<String,String> editPage(Map<String,Object> values)
      Edits a survey page.
      Parameters:
      values - The survey page's values
      Returns:
      The id of the edited survey page and the id of its survey parent
    • copyPage

      public Map<String,String> copyPage(String surveyId, String pageId)
      Copies and pastes a survey page.
      Parameters:
      surveyId - The id of the survey, target of the copy
      pageId - The id of the page to copy
      Returns:
      The id of the created page
    • deletePage

      Deletes a survey page.
      Parameters:
      id - The id of the survey page to delete
      Returns:
      The id of the deleted survey page and the id of its survey parent
    • addRule

      public Map<String,Object> addRule(String id, String rule, String page)
      Adds a a new rule to a page.
      Parameters:
      id - The id of the page
      rule - The rule type
      page - The page to jump or skip
      Returns:
      An empty map
    • deleteRule

      Deletes a rule to a page
      Parameters:
      id - The id of the page
      Returns:
      An empty map
    • getRule

      public Map<String,Object> getRule(String id)
      Gets the rule for a survey page.
      Parameters:
      id - The id of the survey page.
      Returns:
      The rule, or null
    • getBranches

      Gets the branches for a survey page.
      Parameters:
      id - The id of the survey page.
      Returns:
      The branches