Package org.encuestame.persistence.domain.survey

Examples of org.encuestame.persistence.domain.survey.SurveyFolder


     * @return
     * @throws EnMeNoResultsFoundException
     */
    public FolderBean createSurveyFolder(final String folderName, final String username)
            throws EnMeNoResultsFoundException{
        final SurveyFolder surveyFolderDomain = new SurveyFolder();
        surveyFolderDomain.setUsers(getUserAccount(username).getAccount());
        surveyFolderDomain.setCreatedAt(new Date());
        surveyFolderDomain.setFolderName(folderName);
        this.getSurveyDaoImp().saveOrUpdate(surveyFolderDomain);
        return ConvertDomainBean.convertFolderToBeanFolder(surveyFolderDomain);
       }
View Full Code Here


     * @return
     * @throws EnMeNoResultsFoundException
     */
    public FolderBean updateSurveyFolder(final Long folderId, final String folderName, final String username)
                throws EnMeNoResultsFoundException{
        final SurveyFolder surveyPollFolder = this.getSurveyFolder(folderId);
        if(surveyPollFolder == null) {
            throw new EnMeNoResultsFoundException("Survey Poll Folder not found");
        }
        else{
            surveyPollFolder.setFolderName(folderName);
            getSurveyDaoImp().saveOrUpdate(surveyPollFolder);
        }
         return ConvertDomainBean.convertFolderToBeanFolder(surveyPollFolder);
     }
View Full Code Here

     * Delete Survey Folder.
     * @param folderId
     * @throws EnMeNoResultsFoundException
     */
    public void deleteSurveyFolder(final Long folderId) throws EnMeNoResultsFoundException{
        final SurveyFolder surveyFolder = this.getSurveyFolder(folderId);
        if(surveyFolder != null){
            getSurveyDaoImp().delete(surveyFolder);
        } else {
            throw new EnMeNoResultsFoundException("Survey folder not found");
        }
View Full Code Here

     * (non-Javadoc)
     * @see org.encuestame.core.service.imp.ISurveyService#retrieveSurveyByFolder(java.lang.Long, java.lang.Long)
     */
    public List<Survey> retrieveSurveyByFolder(final Long accountId,
            final Long folderId) throws EnMeNoResultsFoundException {
        final SurveyFolder surveyFolder = this.getSurveyFolder(folderId);
        List<Survey> surveysByFolder = new ArrayList<Survey>();
        if (surveyFolder != null) {
            surveysByFolder = getSurveyDaoImp().retrieveSurveyByFolder(
                    accountId, folderId);
        } else {
View Full Code Here

     * @param username
     * @param surveyId
     * @throws EnMeNoResultsFoundException
     */
    public void addSurveyToFolder(final Long folderId, final String username, final Long surveyId) throws EnMeNoResultsFoundException{
        final SurveyFolder surveyFolder = this.getSurveysFolderByFolderIdandUser(folderId, getUserAccountId(username));
        if(surveyFolder!=null) {
            final Survey survey = getSurveyDaoImp().getSurveyByIdandUserId(surveyId, getUserAccountId(username));
            survey.setSurveysfolder(surveyFolder);
            getSurveyDaoImp().saveOrUpdate(survey);
            } else {
View Full Code Here

   * @param folderName
   * @param users
   * @return
   */
    public SurveyFolder createSurveyFolders(final String folderName, final UserAccount users){
        final SurveyFolder surveyFolders = new SurveyFolder();
        surveyFolders.setCreatedAt(new Date());
        surveyFolders.setFolderName(folderName);
        surveyFolders.setUsers(users.getAccount());
        surveyFolders.setStatus(Status.ACTIVE);
        surveyFolders.setCreatedBy(users);
        getSurveyDaoImp().saveOrUpdate(surveyFolders);
        return surveyFolders;
    }
View Full Code Here

     * @param surveyId
     * @return
     * @throws EnMeNoResultsFoundException
     */
    public Survey addSurveyToFolder(final Long folderId, final Long userId, final Long surveyId) throws EnMeNoResultsFoundException{
        final SurveyFolder sfolder = getSurveyDaoImp().getSurveyFolderById(folderId);
        final Survey survey = getSurveyDaoImp().getSurveyByIdandUserId(surveyId, userId);
        survey.setSurveysfolder(sfolder);
        getSurveyDaoImp().saveOrUpdate(survey);
        return survey;
    }
View Full Code Here

     */
    @Test
    public void testGetSurveyFolderByIdandUser(){
        assertNotNull(this.surveyFolder);
        assertNotNull(this.user);
        final SurveyFolder folder = getSurveyDaoImp().getSurveyFolderByIdandUser(this.surveyFolder.getId(), this.user.getUid());
        assertNotNull(folder.getId());
        assertEquals("Should be equals", this.surveyFolder.getId(), surveyFolder.getId());
    }
View Full Code Here

     * Test Get Survey by Id.
     */
    @Test
    public void testGetSurveyFolderById(){
        assertNotNull(this.surveyFolder);
        final SurveyFolder folder = getSurveyDaoImp().getSurveyFolderById(this.surveyFolder.getId());
        assertNotNull(folder.getId());
        log.debug("SURVEY FOLDER ID--->"+ this.surveyFolder.getId());
        log.debug("MY SURVEY FOLDER--->"+ surveyFolder.getId());
        assertEquals("Should be equals", this.surveyFolder.getId(), surveyFolder.getId());
    }
View Full Code Here

    /**
     * Test get surveys by folder.
     */
    @Test
    public void testGetSurveyFolder() {
        final SurveyFolder folder = createSurveyFolders("My Folder",
                this.secondaryUser);
        final Survey mySurvey = createDefaultSurvey(user, "My Last Survey",
                this.myDate.getTime());
        mySurvey.setSurveysfolder(folder);
        getSurveyDaoImp().saveOrUpdate(mySurvey);
        final List<Survey> mySurveysByFolder = getSurveyDaoImp()
                .retrieveSurveyByFolder(this.user.getUid(), folder.getId());
        assertEquals("Should be equals", 1, mySurveysByFolder.size());
    }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.survey.SurveyFolder

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.