use of org.openforis.collect.web.session.SessionState in project collect by openforis.
the class SessionManager method checkIsActiveRecordLocked.
public void checkIsActiveRecordLocked() throws RecordUnlockedException {
SessionState sessionState = getSessionState();
CollectRecord record = sessionState.getActiveRecord();
if (record == null) {
throw new RecordUnlockedException();
} else if (record.getId() != null) {
User user = sessionState.getUser();
String lockId = sessionState.getSessionId();
try {
recordManager.checkIsLocked(record.getId(), user, lockId);
sessionState.keepActiveRecordAlive();
} catch (RecordUnlockedException e) {
clearActiveRecord();
throw e;
}
}
}
use of org.openforis.collect.web.session.SessionState 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);
}
}
use of org.openforis.collect.web.session.SessionState in project collect by openforis.
the class SessionManager method setActiveRecord.
public void setActiveRecord(CollectRecord record) {
SessionState sessionState = getSessionState();
sessionState.setActiveRecord(record);
sessionState.keepActiveRecordAlive();
}
use of org.openforis.collect.web.session.SessionState in project collect by openforis.
the class SessionManager method setActiveSurvey.
public void setActiveSurvey(CollectSurvey survey) {
SessionState sessionState = getSessionState();
sessionState.setActiveSurvey(survey);
}
Aggregations