1,8 → 1,15 |
package pt.estgp.estgweb.web.controllers.courses; |
|
|
import jomm.dao.impl.AbstractDao; |
import org.apache.struts.action.ActionForm; |
import org.apache.struts.action.ActionForward; |
import org.apache.struts.action.ActionMapping; |
import org.json.JSONObject; |
import pt.estgp.estgweb.domain.CourseImpl; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.web.controllers.utils.AbstractWidgetAjaxController; |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import pt.estgp.estgweb.web.utils.RequestUtils; |
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
10,6 → 17,7 |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
|
|
/** |
* Created by jorgemachado on 06/01/17. |
*/ |
42,5 → 50,48 |
return new JSONObject(json); |
} |
|
public JSONObject generateGlobalLearningResultsChartYearImg(ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Throwable { |
|
String courseReportDocument = request.getParameter("courseReportDocument"); |
|
|
IServiceManager sm = ServiceManager.getInstance(); |
String json = (String) sm.execute(RequestUtils.getRequester(request, response), |
"CourseReportGenerateGlobalLearningResultsChartYearImg", |
new Object[]{courseReportDocument}); |
return new JSONObject(json); |
} |
|
|
public JSONObject saveCourseReportDocument(ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Throwable { |
String courseReportDocument = request.getParameter("courseReportDocument"); |
|
IServiceManager sm = ServiceManager.getInstance(); |
String json = (String) sm.execute(RequestUtils.getRequester(request, response), |
"SaveCourseReportDocument", |
new Object[]{courseReportDocument}); |
return new JSONObject(json); |
} |
|
|
|
|
/* Req3 Esta função é chamada no struts e chamada o serviço load através do ServiceManager que é o Berserk |
* antes de começar a ser editado */ |
public ActionForward startEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Throwable { |
String courseCode = request.getParameter("courseCode"); |
String year = request.getParameter("year"); |
|
IServiceManager sm = ServiceManager.getInstance(); |
String courseReportJson = (String) sm.execute( |
RequestUtils.getRequester(request, response), |
"LoadCourseReportDocument", |
new Object[]{courseCode, year}, |
new String[]{"courseCode", "year"}); |
request.setAttribute("courseReportJson", courseReportJson); |
|
|
return mapping.findForward("editCourseReport"); |
} |
|
} |