Example #1
0
 @Checked("ResultPredicates.createPredicate")
 private void setOnCreateAtributes() {
   if (AccessControl.getUserView() != null) {
     super.setModifiedBy(AccessControl.getPerson().getName());
     setCreator(AccessControl.getPerson());
   }
   super.setLastModificationDate(new DateTime());
 }
Example #2
0
  /** Removes all references to result. */
  private void removeAssociations() {
    super.setCountry(null);
    removeCreator();
    for (; !getAllResultDocumentFiles().isEmpty(); getAllResultDocumentFiles().get(0).delete()) {}

    for (; !getPrizes().isEmpty(); getPrizes().get(0).delete()) {}

    for (; !getResultUnitAssociations().isEmpty(); getResultUnitAssociations().get(0).delete()) {}

    for (; !getResultTeachers().isEmpty(); getResultTeachers().get(0).delete()) {}

    // These should be the last to remove, because of access control
    // verifications.
    for (; !getResultParticipations().isEmpty(); getResultParticipations().get(0).delete()) {}
  }
Example #3
0
 private void updateModifiedByAndDate() {
   if (AccessControl.getUserView() != null) {
     super.setModifiedBy(AccessControl.getPerson().getName());
   }
   super.setLastModificationDate(new DateTime());
 }