forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditLink.jsp
63 lines (53 loc) · 3.5 KB
/
editLink.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<%@ page import="org.sakaiproject.tool.assessment.ui.bean.author.AssessmentBean" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.bean.author.AuthorBean" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.bean.author.AuthorBean" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.bean.delivery.DeliveryBean" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.bean.shared.PersonBean" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.bean.authz.AuthorizationBean" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.listener.author.ConfirmEditPublishedAssessmentListener" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.listener.author.EditPublishedSettingsListener" %>
<%@ page import="org.sakaiproject.tool.assessment.ui.listener.author.AuthorActionListener" %>
<%@ page import="org.sakaiproject.tool.assessment.facade.AuthzQueriesFacadeAPI" %>
<%@ page import="org.sakaiproject.tool.assessment.services.PersistenceService" %>
<%@ page import="org.sakaiproject.tool.cover.ToolManager" %>
<%@ page import="org.sakaiproject.site.api.Site" %>
<%@ page import="org.sakaiproject.site.api.ToolConfiguration" %>
<%@ page import="org.sakaiproject.site.cover.SiteService" %>
<%@ page import="javax.faces.context.FacesContext" %>
<%
DeliveryBean delivery = (DeliveryBean) ContextUtil.lookupBeanFromExternalServlet("delivery", request, response);
PersonBean person = (PersonBean) ContextUtil.lookupBeanFromExternalServlet("person", request, response);
AuthorBean author = (AuthorBean) ContextUtil.lookupBeanFromExternalServlet("author", request, response);
author.setIsEditPendingAssessmentFlow(false);
String publishedAssessmentId = ContextUtil.lookupParam("publishedAssessmentId");
AssessmentBean assessmentBean = (AssessmentBean) ContextUtil.lookupBeanFromExternalServlet(
"assessmentBean", request, response);
assessmentBean.setAssessmentId(publishedAssessmentId);
Site site = null;
try {
site = SiteService.getSite(ToolManager.getCurrentPlacement().getContext());
} catch (Exception impossible) {
out.println("Can't find site");
return;
}
ToolConfiguration tool = site.getToolForCommonId("sakai.samigo");
AuthorizationBean authzBean = (AuthorizationBean) ContextUtil.lookupBeanFromExternalServlet(
"authorization", request, response);
if (authzBean.getAuthzMap().size()==0){
authzBean.addAllPrivilege(site.getId());
}
// context for main assessment list, in case they cancel out of the specific action
AuthorActionListener authorActionListener = new AuthorActionListener();
authorActionListener.processAction(null);
// requested action
if (ContextUtil.lookupParam("settings") != null) {
EditPublishedSettingsListener editPublishedSettingsListener = new EditPublishedSettingsListener();
editPublishedSettingsListener.processAction(null);
response.sendRedirect("/portal/tool/" + tool.getId() + "/jsf/author/publishedSettings");
} else {
ConfirmEditPublishedAssessmentListener confirmEditPublishedAssessmentListener = new ConfirmEditPublishedAssessmentListener();
confirmEditPublishedAssessmentListener.processAction(null);
response.sendRedirect("/portal/tool/" + tool.getId() + "/jsf/author/confirmEditPublishedAssessment");
}
%>