Rev 1345 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1345 | jmachado | 1 | package pt.estgp.estgweb.web.controllers; |
2 | |||
3 | import org.apache.struts.action.ActionForm; |
||
4 | import org.apache.struts.action.ActionForward; |
||
5 | import org.apache.struts.action.ActionMapping; |
||
1348 | jmachado | 6 | import pt.estgp.estgweb.domain.views.UserView; |
1345 | jmachado | 7 | import pt.estgp.estgweb.web.form.CertificadoForm; |
8 | import pt.estgp.estgweb.web.utils.RequestUtils; |
||
9 | import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
||
10 | import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
||
11 | |||
12 | import javax.servlet.http.HttpServletRequest; |
||
13 | import javax.servlet.http.HttpServletResponse; |
||
1348 | jmachado | 14 | import java.util.List; |
1345 | jmachado | 15 | |
16 | /** |
||
17 | * Created by jorgemachado on 05/04/16. |
||
18 | */ |
||
19 | public class CertificadoController extends ApplicationDispatchController |
||
20 | { |
||
21 | |||
22 | public ActionForward criarCertificadoPeloId(ActionMapping mapping, |
||
23 | ActionForm form, |
||
24 | HttpServletRequest request, |
||
25 | HttpServletResponse response) |
||
26 | throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
||
27 | |||
28 | CertificadoForm frm = (CertificadoForm) form; |
||
29 | |||
30 | 1.5.0/docs/api/java/lang/System.html">System.out.println("USER PEDIDO=" + frm.getUserId()); |
||
31 | |||
32 | IServiceManager sm = ServiceManager.getInstance(); |
||
33 | 5+0%2Fdocs%2Fapi+Object">Object[] args = new 5+0%2Fdocs%2Fapi+Object">Object[]{frm.getUserId()}; |
||
34 | 1.5.0/docs/api/java/lang/String.html">String certificado = (1.5.0/docs/api/java/lang/String.html">String) sm.execute( |
||
35 | RequestUtils.getRequester(request, response),"CreateCertificate",args); |
||
36 | |||
37 | 1.5.0/docs/api/java/lang/System.html">System.out.println("Cetificado Criado=" + certificado); |
||
38 | |||
39 | return mapping.findForward("criado"); |
||
40 | |||
41 | } |
||
1348 | jmachado | 42 | |
43 | public ActionForward searchUsers(ActionMapping mapping, |
||
44 | ActionForm form, |
||
45 | HttpServletRequest request, |
||
46 | HttpServletResponse response) |
||
47 | throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable { |
||
48 | |||
49 | CertificadoForm frm = (CertificadoForm) form; |
||
50 | |||
51 | 1.5.0/docs/api/java/lang/System.html">System.out.println("USER PEDIDO=" + frm.getUserId()); |
||
52 | |||
53 | IServiceManager sm = ServiceManager.getInstance(); |
||
54 | 5+0%2Fdocs%2Fapi+Object">Object[] args = new 5+0%2Fdocs%2Fapi+Object">Object[]{frm.getTextoPesquisar(),null}; |
||
55 | List<UserView> users = (List<UserView>) sm.execute( |
||
56 | RequestUtils.getRequester(request, response), "SearchUser", args); |
||
57 | |||
58 | frm.setUsers(users); |
||
59 | 1.5.0/docs/api/java/lang/System.html">System.out.println("Encontrados " + users.size()); |
||
60 | |||
61 | return mapping.getInputForward(); |
||
62 | |||
63 | } |
||
1345 | jmachado | 64 | } |