01: package com.nabhinc.portlet.psiteadmin;
02:
03: import java.io.IOException;
04:
05: import javax.portlet.ActionRequest;
06: import javax.portlet.ActionResponse;
07: import javax.portlet.PortletException;
08: import javax.portlet.PortletSecurityException;
09:
10: import com.nabhinc.portal.api.PortalInformationStore;
11: import com.nabhinc.portal.api.PortalInformationStoreLocator;
12: import com.nabhinc.portal.core.PortalConstants;
13: import com.nabhinc.portal.model.PortalApplicationView;
14: import com.nabhinc.portlet.mvcportlet.core.ActionConfig;
15: import com.nabhinc.portlet.mvcportlet.core.ActionProcessor;
16: import com.nabhinc.portlet.mvcportlet.core.BaseRequestProcessor;
17: import com.nabhinc.util.StringUtil;
18: import com.nabhinc.ws.core.WebServiceSecurityException;
19:
20: public class PsiteMembersUpdater extends BaseRequestProcessor implements
21: ActionProcessor {
22:
23: public String process(ActionRequest request,
24: ActionResponse response, ActionConfig actionConfig)
25: throws PortletException, IOException {
26: String memberStr = request.getParameter("members");
27: PortalInformationStore store = PortalInformationStoreLocator
28: .getPortalInformationStore();
29: String appPath = ((PortalApplicationView) request
30: .getAttribute(PortalConstants.CURRENT_PORTAL_APP_VIEW))
31: .getPortalApplication().getPath();
32:
33: try {
34: if (memberStr == null || memberStr.trim().equals("")) {
35: store.setPortalApplicationMembers(appPath, null);
36: } else {
37: String[] members = StringUtil.split(memberStr, " \n\r");
38: store.setPortalApplicationMembers(appPath, members);
39: }
40: } catch (WebServiceSecurityException e) {
41: throw new PortletSecurityException(e);
42: }
43:
44: return "success";
45: }
46:
47: }
|