use of org.olat.core.util.io.SystemFilenameFilter in project OpenOLAT by OpenOLAT.
the class GTACoachRevisionAndCorrectionsController method doConfirmCollect.
private void doConfirmCollect(UserRequest ureq) {
String toName = null;
if (assessedGroup != null) {
toName = assessedGroup.getName();
} else if (assessedIdentity != null) {
toName = userManager.getUserDisplayName(assessedIdentity);
}
File[] submittedDocuments;
VFSContainer documentsContainer;
int iteration = assignedTask.getRevisionLoop();
if (GTAType.group.name().equals(gtaNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsContainer = gtaManager.getRevisedDocumentsContainer(courseEnv, gtaNode, iteration, assessedGroup);
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
} else {
documentsContainer = gtaManager.getRevisedDocumentsContainer(courseEnv, gtaNode, iteration, getIdentity());
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, getIdentity());
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
}
FilesLocked lockedBy = TaskHelper.getDocumentsLocked(documentsContainer, submittedDocuments);
if (lockedBy != null) {
showWarning("warning.submit.documents.edited", new String[] { lockedBy.getLockedBy(), lockedBy.getLockedFiles() });
} else {
String title = translate("coach.collect.revisions.confirm.title");
String text = translate("coach.collect.revisions.confirm.text", new String[] { toName });
text = "<div class='o_warning'>" + text + "</div>";
confirmCollectCtrl = activateOkCancelDialog(ureq, title, text, confirmCollectCtrl);
listenTo(confirmCollectCtrl);
}
}
use of org.olat.core.util.io.SystemFilenameFilter in project OpenOLAT by OpenOLAT.
the class GTAAbstractController method getNumberOfRevisionDocuments.
protected int getNumberOfRevisionDocuments(Task assignedTask) {
File[] submittedDocuments;
int iteration = assignedTask.getRevisionLoop();
if (GTAType.group.name().equals(gtaNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
} else {
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, assessedIdentity);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
}
return submittedDocuments == null ? 0 : submittedDocuments.length;
}
use of org.olat.core.util.io.SystemFilenameFilter in project OpenOLAT by OpenOLAT.
the class GTANotifications method getNumberOfSubmittedDocuments.
private int getNumberOfSubmittedDocuments(Identity assessedIdentity, BusinessGroup assessedGroup) {
File[] submittedDocuments;
if (GTAType.group.name().equals(gtaNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
} else {
File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedIdentity);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
}
return submittedDocuments == null ? 0 : submittedDocuments.length;
}
use of org.olat.core.util.io.SystemFilenameFilter in project OpenOLAT by OpenOLAT.
the class GTAParticipantRevisionAndCorrectionsController method doConfirmSubmit.
private void doConfirmSubmit(UserRequest ureq) {
int iteration = assignedTask.getRevisionLoop();
String title = translate("run.submit.revision.button");
String text;
File[] submittedDocuments;
VFSContainer documentsContainer;
if (GTAType.group.name().equals(gtaNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsContainer = gtaManager.getRevisedDocumentsContainer(courseEnv, gtaNode, iteration, assessedGroup);
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
if (submittedDocuments.length == 0) {
text = "<div class='o_warning'>" + translate("run.submit.revision.confirm.warning.group", new String[] { StringHelper.escapeHtml(assessedGroup.getName()) }) + "</div>";
} else {
text = translate("run.submit.revision.confirm.group", new String[] { StringHelper.escapeHtml(assessedGroup.getName()) });
}
} else {
documentsContainer = gtaManager.getRevisedDocumentsContainer(courseEnv, gtaNode, iteration, getIdentity());
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, getIdentity());
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
if (submittedDocuments.length == 0) {
text = "<div class='o_warning'>" + translate("run.submit.revision.confirm.warning") + "</div>";
} else {
text = translate("run.submit.revision.confirm");
}
}
FilesLocked lockedBy = TaskHelper.getDocumentsLocked(documentsContainer, submittedDocuments);
if (lockedBy != null) {
showWarning("warning.submit.documents.edited", new String[] { lockedBy.getLockedBy(), lockedBy.getLockedFiles() });
} else {
confirmSubmitDialog = activateOkCancelDialog(ureq, title, text, confirmSubmitDialog);
}
}
use of org.olat.core.util.io.SystemFilenameFilter in project openolat by klemens.
the class GTACoachRevisionAndCorrectionsController method doConfirmCollect.
private void doConfirmCollect(UserRequest ureq) {
String toName = null;
if (assessedGroup != null) {
toName = assessedGroup.getName();
} else if (assessedIdentity != null) {
toName = userManager.getUserDisplayName(assessedIdentity);
}
File[] submittedDocuments;
VFSContainer documentsContainer;
int iteration = assignedTask.getRevisionLoop();
if (GTAType.group.name().equals(gtaNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsContainer = gtaManager.getRevisedDocumentsContainer(courseEnv, gtaNode, iteration, assessedGroup);
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
} else {
documentsContainer = gtaManager.getRevisedDocumentsContainer(courseEnv, gtaNode, iteration, getIdentity());
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, getIdentity());
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
}
FilesLocked lockedBy = TaskHelper.getDocumentsLocked(documentsContainer, submittedDocuments);
if (lockedBy != null) {
showWarning("warning.submit.documents.edited", new String[] { lockedBy.getLockedBy(), lockedBy.getLockedFiles() });
} else {
String title = translate("coach.collect.revisions.confirm.title");
String text = translate("coach.collect.revisions.confirm.text", new String[] { toName });
text = "<div class='o_warning'>" + text + "</div>";
confirmCollectCtrl = activateOkCancelDialog(ureq, title, text, confirmCollectCtrl);
listenTo(confirmCollectCtrl);
}
}
Aggregations