/* * Created on 31/Jul/2003 */ package net.sourceforge.fenixedu.applicationTier.Servico.manager; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import net.sourceforge.fenixedu.applicationTier.FenixService; import net.sourceforge.fenixedu.applicationTier.Servico.exceptions.FenixServiceException; import net.sourceforge.fenixedu.domain.DegreeCurricularPlan; import net.sourceforge.fenixedu.domain.exceptions.DomainException; import pt.ist.fenixWebFramework.security.accessControl.Checked; import pt.ist.fenixWebFramework.services.Service; /** * @author lmac1 */ public class DeleteDegreeCurricularPlans extends FenixService { @Checked("RolePredicates.MANAGER_PREDICATE") @Service public static List run(List degreeCurricularPlansIds) throws FenixServiceException { Iterator iter = degreeCurricularPlansIds.iterator(); List undeletedDegreeCurricularPlansNames = new ArrayList(); while (iter.hasNext()) { Integer degreeCurricularPlanId = (Integer) iter.next(); DegreeCurricularPlan degreeCurricularPlan = rootDomainObject.readDegreeCurricularPlanByOID(degreeCurricularPlanId); try { degreeCurricularPlan.delete(); } catch (DomainException e) { undeletedDegreeCurricularPlansNames.add(degreeCurricularPlan.getName()); } } return undeletedDegreeCurricularPlansNames; } }