Class PageDAO

    • Field Detail

      • ROLE

        public static final String ROLE
        The Avalon role
    • Constructor Detail

    • Method Detail

      • getPage

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

        public Map<String,​ObjectgetPage​(SurveyPage page)
        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,​StringcreatePage​(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,​StringeditPage​(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,​StringcopyPage​(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

        public Map<String,​StringdeletePage​(String id)
        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,​ObjectaddRule​(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
      • getRule

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

        public Map<String,​ObjectgetBranches​(String id)
        Gets the branches for a survey page.
        Parameters:
        id - The id of the survey page.
        Returns:
        The branches