use of org.openforis.collect.persistence.SurveyStoreException in project collect by openforis.
the class SurveySelectVM method performSurveyPublishing.
protected void performSurveyPublishing(CollectSurvey survey, Binder binder) {
try {
User loggedUser = getLoggedUser();
surveyManager.publish(survey, loggedUser);
selectedSurvey = null;
notifyChange("selectedSurvey");
reloadSurveySummaries(binder);
MessageUtil.showInfo("survey.successfully_published", survey.getName());
surveyManager.validateRecords(survey.getId(), loggedUser);
} catch (SurveyStoreException e) {
throw new RuntimeException(e);
}
}
use of org.openforis.collect.persistence.SurveyStoreException in project collect by openforis.
the class SurveySelectVM method performSelectedSurveyUnpublishing.
private void performSelectedSurveyUnpublishing(Binder binder) {
try {
Integer publishedSurveyId = selectedSurvey.isTemporary() ? selectedSurvey.getPublishedId() : selectedSurvey.getId();
CollectSurvey temporarySurvey = surveyManager.unpublish(publishedSurveyId, getLoggedUser());
selectedSurvey = null;
notifyChange("selectedSurvey");
reloadSurveySummaries(binder);
MessageUtil.showInfo("survey.successfully_unpublished", temporarySurvey.getName());
} catch (SurveyStoreException e) {
throw new RuntimeException(e);
}
}
use of org.openforis.collect.persistence.SurveyStoreException in project collect by openforis.
the class SessionManager method saveActiveDesignerSurvey.
public void saveActiveDesignerSurvey() {
try {
SessionState sessionState = getSessionState();
CollectSurvey survey = getActiveDesignerSurvey();
boolean activeSurveyWork = sessionState.isActiveSurveyWork();
if (activeSurveyWork) {
surveyManager.save(survey);
} else {
throw new IllegalArgumentException("Active designer survey should be a 'work' survey");
}
} catch (SurveyStoreException e) {
LOG.error("Error updating taxonomy related attributes.", e);
}
}
Aggregations