01: package com.sun.portal.sra.desktop.commands;
02:
03: import java.io.IOException;
04: import java.util.HashMap;
05:
06: import javax.servlet.http.HttpServletRequest;
07: import javax.servlet.http.HttpServletResponse;
08:
09: import com.sun.portal.proxylet.provider.SRAProxyletProvider;
10:
11: public class ProxyletProcessEditCommand implements Command {
12:
13: public ProxyletProcessEditCommand() {
14: }
15:
16: /* (non-Javadoc)
17: * @see com.sun.portal.sra.desktop.commands.Command#execute(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
18: */
19: public void execute(HttpServletRequest req,
20: HttpServletResponse res, HashMap providerMap)
21: throws IOException, CommandExecutionException {
22:
23: Object provider;
24: try {
25: provider = Class
26: .forName(
27: "com.sun.portal.proxylet.provider.SRAProxyletProvider")
28: .newInstance();
29: // Execute the provider
30: SRAProxyletProvider sraProxyletProvider = (SRAProxyletProvider) provider;
31: sraProxyletProvider.init("ProxyletProvider", req);
32: sraProxyletProvider.processEdit(req, res);
33:
34: // This command is the edit command, it just saves content to the back end ( LDAP ) and then
35: // redirects to the home page by sending the getDefault command.
36:
37: res.sendRedirect(req.getAttribute("staticContext")
38: + "/dt?action=getDefault");
39:
40: } catch (Exception e) {
41: throw new CommandExecutionException(e);
42: }
43: }
44: }
|