use of net.sourceforge.processdash.net.http.TinyCGIException in project processdash by dtuma.
the class EVReport method getEVModel.
private void getEVModel() throws TinyCGIException {
taskListName = settings.getTaskListName();
if (taskListName == null)
throw new TinyCGIException(400, "schedule name missing");
else if (FAKE_MODEL_NAME.equals(taskListName)) {
evModel = null;
return;
}
long now = System.currentTimeMillis();
synchronized (EVReport.class) {
if (drawingChart && (now - lastRecalcTime < MAX_DELAY) && taskListName.equals(lastTaskListName)) {
evModel = lastEVModel.get();
if (evModel != null)
return;
}
}
evModel = EVTaskList.openExisting(taskListName, getDataRepository(), getPSPProperties(), getObjectCache(), // change notification not required
false);
if (evModel == null)
throw new TinyCGIException(404, "Not Found", "No such task/schedule");
UserFilter f = settings.getUserGroupFilter();
if (f != null && !UserGroup.isEveryone(f) && evModel instanceof EVTaskListRollup) {
EVTaskListRollup rollup = (EVTaskListRollup) evModel;
rollup.applyTaskListFilter(new EVTaskListGroupFilter(f));
String permID = (parameters.containsKey(CHARTS_PARAM) ? EVPermissions.PERSONAL_CHARTS : EVPermissions.PERSONAL_REPORT);
settings.checkPersonalDataPermission(rollup, permID);
}
EVDependencyCalculator depCalc = new EVDependencyCalculator(getDataRepository(), getPSPProperties(), getObjectCache());
evModel.setDependencyCalculator(depCalc);
evModel.setTaskLabeler(new DefaultTaskLabeler(getDashboardContext()));
if (settings.getBool(CUSTOMIZE_HIDE_BASELINE))
evModel.disableBaselineData();
evModel.recalc();
synchronized (EVReport.class) {
lastTaskListName = taskListName;
lastRecalcTime = now;
lastEVModel = new WeakReference<EVTaskList>(evModel);
}
}
use of net.sourceforge.processdash.net.http.TinyCGIException in project processdash by dtuma.
the class RestoreIndivDataWorker method checkPreconditions.
private void checkPreconditions() throws IOException {
String hierProjectID = getStrData(projectPrefix, PROJECT_ID);
String importProjectID = getStrData(importedProjectRoot, PROJECT_ID);
if (!hierProjectID.equals(importProjectID))
throw new TinyCGIException(400, "Project IDs do not match");
}
Aggregations