01: package com.sun.portal.sra.desktop.commands;
02:
03: import java.io.IOException;
04:
05: import javax.servlet.http.HttpServletRequest;
06: import javax.servlet.http.HttpServletResponse;
07: import javax.servlet.http.HttpSession;
08: import java.util.HashMap;
09:
10: import com.sun.portal.sra.beans.IProviderBean;
11: import com.sun.portal.sra.beans.ProviderBeanImpl;
12: import com.sun.portal.proxylet.provider.SRAProxyletProvider;
13:
14: public class ProxyletEditContentCommand implements Command {
15:
16: public ProxyletEditContentCommand() {
17: }
18:
19: /* (non-Javadoc)
20: * @see com.sun.portal.sra.desktop.commands.Command#execute(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
21: */
22: public void execute(HttpServletRequest req,
23: HttpServletResponse res, HashMap providerMap)
24: throws IOException, CommandExecutionException {
25:
26: IProviderBean bean = new ProviderBeanImpl();
27: Object provider;
28: try {
29: provider = Class
30: .forName(
31: "com.sun.portal.proxylet.provider.SRAProxyletProvider")
32: .newInstance();
33: StringBuffer sb = new StringBuffer();
34: // Execute the provider
35: SRAProxyletProvider sraProxyletProvider = (SRAProxyletProvider) provider;
36: sraProxyletProvider.init("ProxyletProvider", req);
37: sb.append(sraProxyletProvider.getEdit(req, res).toString());
38:
39: // Set the content into a bean
40: bean.set_HtmlContent(sb);
41: HttpSession session = req.getSession(true);
42: session.setAttribute("SRA_PROXYLET_PROVIDER_EDIT_BEAN",
43: bean);
44: } catch (Exception e) {
45: throw new CommandExecutionException(e);
46: }
47: }
48: }
|