/*
* Created on 9/Fev/2005
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package net.sourceforge.fenixedu.applicationTier.Servico.commons;
import java.util.List;
import net.sourceforge.fenixedu.applicationTier.FenixService;
import net.sourceforge.fenixedu.dataTransferObject.InfoExecutionYear;
import net.sourceforge.fenixedu.domain.DegreeCurricularPlan;
import net.sourceforge.fenixedu.domain.ExecutionDegree;
import net.sourceforge.fenixedu.domain.ExecutionYear;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Transformer;
import pt.ist.fenixWebFramework.services.Service;
/**
*
* @author Amin Amirali
* @author Francisco Paulo
*
*/
public class ReadExecutionYearsByDegreeCurricularPlanID extends FenixService {
@Service
public static List run(Integer degreeCurricularPlanID) {
DegreeCurricularPlan degreeCurricularPlan = rootDomainObject.readDegreeCurricularPlanByOID(degreeCurricularPlanID);
List executionYears = (List) CollectionUtils.collect(degreeCurricularPlan
.getExecutionDegrees(), new Transformer() {
public Object transform(Object arg0) {
ExecutionDegree executionDegree = (ExecutionDegree) arg0;
return InfoExecutionYear.newInfoFromDomain(executionDegree.getExecutionYear());
}
});
return executionYears;
}
}