/*
 *  Copyright (C) 2010-2015 Stichting Akvo (Akvo Foundation)
 *
 *  This file is part of Akvo FLOW.
 *
 *  Akvo FLOW is free software: you can redistribute it and modify it under the terms of
 *  the GNU Affero General Public License (AGPL) as published by the Free Software Foundation,
 *  either version 3 of the License or any later version.
 *
 *  Akvo FLOW is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU Affero General Public License included below for more details.
 *
 *  The full license text can also be seen at <http://www.gnu.org/licenses/agpl.html>.
 */

package org.waterforpeople.mapping.app.gwt.client.survey;

import java.util.ArrayList;
import java.util.Date;

import com.gallatinsystems.framework.gwt.dto.client.BaseDto;
import com.gallatinsystems.framework.gwt.dto.client.NamedObject;
import com.gallatinsystems.survey.domain.SurveyGroup.PrivacyLevel;
import com.gallatinsystems.survey.domain.SurveyGroup.ProjectType;

public class SurveyGroupDto extends BaseDto implements NamedObject {

    private static final long serialVersionUID = -2235565143615667202L;

    private String description;
    private String name;
    private String code;
    private String path;
    private Boolean monitoringGroup;
    private Long newLocaleSurveyId;
    private Date createdDateTime;
    private Date lastUpdateDateTime;
    private ProjectType projectType;
    private Long parentId;
    private String defaultLanguageCode;
    private PrivacyLevel privacyLevel;
    private Boolean published;

    private ArrayList<SurveyDto> surveyList = null;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Date getCreatedDateTime() {
        return createdDateTime;
    }

    public void setCreatedDateTime(Date createdDateTime) {
        this.createdDateTime = createdDateTime;
    }

    public Date getLastUpdateDateTime() {
        return lastUpdateDateTime;
    }

    public void setLastUpdateDateTime(Date lastUpdateDateTime) {
        this.lastUpdateDateTime = lastUpdateDateTime;
    }

    public void setSurveyList(ArrayList<SurveyDto> surveyList) {
        this.surveyList = surveyList;
    }

    public ArrayList<SurveyDto> getSurveyList() {
        return surveyList;
    }

    public void addSurvey(SurveyDto item) {
        if (surveyList == null) {
            surveyList = new ArrayList<SurveyDto>();
        }
        surveyList.add(item);
    }

    @Override
    public String getDisplayName() {
        return getCode();
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public Boolean getMonitoringGroup() {
        return monitoringGroup;
    }

    public void setMonitoringGroup(Boolean monitoringGroup) {
        this.monitoringGroup = monitoringGroup;
    }

    public Long getNewLocaleSurveyId() {
        return newLocaleSurveyId;
    }

    public void setNewLocaleSurveyId(Long newLocaleSurveyId) {
        this.newLocaleSurveyId = newLocaleSurveyId;
    }

    public ProjectType getProjectType() {
        return projectType;
    }

    public void setProjectType(ProjectType projectType) {
        this.projectType = projectType;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parent) {
        this.parentId = parent;
    }

    public String getDefaultLanguageCode() {
        return defaultLanguageCode;
    }

    public void setDefaultLanguageCode(String defaultLanguageCode) {
        this.defaultLanguageCode = defaultLanguageCode;
    }

    public PrivacyLevel getPrivacyLevel() {
        return privacyLevel;
    }

    public void setPrivacyLevel(PrivacyLevel privacyLevel) {
        this.privacyLevel = privacyLevel;
    }

    public Boolean getPublished() {
        return published;
    }

    public void setPublished(Boolean published) {
        this.published = published;
    }

}

@@ -812,16 +812,39 @@
 il.Date;
+%0Aimport java.util.List;
 %0A%0Aimport
@@ -1664,16 +1664,52 @@
 blished;
+%0A    private List%3CLong%3E ancestorIds;
 %0A%0A    pr
@@ -4477,10 +4477,190 @@
 %0A    %7D%0A%0A
+    public List%3CLong%3E getAncestorIds() %7B%0A        return ancestorIds;%0A    %7D%0A%0A    public void setAncestorIds(List%3CLong%3E ancestorIds) %7B%0A        this.ancestorIds = ancestorIds;%0A    %7D%0A%0A
 %7D%0A

Return `ancestorIds` parameter in `SurveyGroup` list