示例#1
0
 @Atomic
 public static void run(final String degreeModuleID, final String contextID)
     throws FenixServiceException {
   final DegreeModule degreeModule = FenixFramework.getDomainObject(degreeModuleID);
   if (degreeModule == null) {
     throw new FenixServiceException("error.noDegreeModule");
   }
   final Context context = FenixFramework.getDomainObject(contextID);
   if (context == null) {
     throw new FenixServiceException("error.noCourseGroup");
   }
   degreeModule.deleteContext(context);
 }
 private List<SelectItem> readDegreeModules(Class<? extends DegreeModule> clazz) {
   final List<SelectItem> result = new ArrayList<SelectItem>();
   final List<List<DegreeModule>> degreeModulesSet =
       getDegreeCurricularPlan().getDcpDegreeModulesIncludingFullPath(clazz, getExecutionYear());
   for (final List<DegreeModule> degreeModules : degreeModulesSet) {
     final StringBuilder pathName = new StringBuilder();
     for (final DegreeModule degreeModule : degreeModules) {
       pathName.append((pathName.length() == 0) ? "" : " > ").append(degreeModule.getName());
     }
     result.add(
         new SelectItem(
             degreeModules.get(degreeModules.size() - 1).getExternalId(), pathName.toString()));
   }
   Collections.sort(result, new BeanComparator("label"));
   result.add(
       0,
       new SelectItem(this.NO_SELECTION_STRING, BundleUtil.getString(Bundle.BOLONHA, "choose")));
   return result;
 }