Project

General

Profile

« Previous | Next » 

Revision 59601

mainly delete and revoke added.

View differences:

EditRegisteredService.java
30 30
        SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,
31 31
                config.getServletContext());
32 32
    }
33

  
33 34
    @Override
34 35
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
35

  
36 36
        request.getSession().setAttribute("authenticated",
37 37
                !SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString()
38 38
                        .equals("anonymousUser"));
......
93 93

  
94 94
    @Override
95 95
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
96

  
97 96
        OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();
98 97
        String accessToken = authentication.getAccessTokenValue();
99 98

  
......
104 103
        HttpResponse resp = TokenUtils.updateService(serviceId, authentication.getSub(), name, description, authentication.getUserInfo().getEmail(), accessToken);
105 104

  
106 105
        if (resp.getStatusLine().getStatusCode()==200) {
106

  
107
            RegisteredService registeredService = new RegisteredService();
108
            registeredService.setName(name);
109
            registeredService.setAai_id(serviceId);
110
            try {
111
                registeredServicesUtils.getRegisteredServiceDao().update(registeredService);
112
            } catch (SQLException sqle) {
113
                logger.error("Unable to contact db.", sqle);
114
                request.getSession().setAttribute("message", "Fail to delete the service. Please try again later.");
115
                response.setContentType("text/html");
116
                request.getRequestDispatcher("./registeredServices.jsp").include(request, response);
117
            }
118

  
107 119
            request.getSession().setAttribute("success", "Your service with name '" + name + "' was successfully updated");
108 120
        }
109 121

  

Also available in: Unified diff