    public void doViewSubscription(FormEvent event) {
        PortletRequest req = event.getPortletRequest();
        gsPortlets.clear();
        User user = req.getUser();
        List myNames = layoutMgr.getSubscribedPortlets(req);
        List groups = aclService.getGroups(user);
        Iterator it = groups.iterator();
        PanelBean panel = event.getPanelBean("panel");
        PortletRole role = req.getRole();
        while (it.hasNext()) {
            FrameBean frame = new FrameBean();
            DefaultTableModel model = new DefaultTableModel();
            PortletGroup g = (PortletGroup)it.next();
            TableRowBean tr = new TableRowBean();
            tr.setHeader(true);
            TableCellBean tc3 = new TableCellBean();
            TextBean text3 = new TextBean();
            text3.setValue(this.getLocalizedText(req, "SUBSCRIPTION_SUBSCRIBE"));
            tc3.addBean(text3);
            tr.addBean(tc3);
            TableCellBean tc = new TableCellBean();
            TextBean text = new TextBean();
            text.setValue(portletMgr.getPortletWebApplicationDescription(g.getName()));
            tc.addBean(text);
            tr.addBean(tc);
            tc = new TableCellBean();
            text = new TextBean();
            text.setValue(this.getLocalizedText(req, "SUBSCRIPTION_DESC"));
            tc.addBean(text);
            tr.addBean(tc);
            model.addTableRowBean(tr);
            Collection appColl = portletRegistry.getApplicationPortlets(g.getName());
            Iterator appIt = appColl.iterator();
            while (appIt.hasNext()) {
                ApplicationPortlet app = (ApplicationPortlet)appIt.next();
                List concPortlets = app.getConcretePortlets();
                Iterator cit = concPortlets.iterator();
                while (cit.hasNext()) {
                    ConcretePortlet conc = (ConcretePortlet)cit.next();
                    String concID = conc.getConcretePortletID();
                    PortletRole reqrole = conc.getConcretePortletConfig().getRequiredRole();
                    log.debug("subscribed to portlet: " + concID + " " + reqrole);
                    if (role.compare(role, reqrole) >= 0) {
                        CheckBoxBean cb = new CheckBoxBean(req, "portletsCB");
                        cb.setValue(concID);
                        if (myNames.contains(concID)) {
                            cb.setSelected(true);
                        }
                        if (g.equals(PortletGroupFactory.GRIDSPHERE_GROUP)) {
                            gsPortlets.add(concID);
                            cb.setDisabled(true);
                            cb.setSelected(true);
                        }
                        TableRowBean newtr = new TableRowBean();
                        TableCellBean newtc = new TableCellBean();
                        newtc.addBean(cb);
                        newtr.addBean(newtc);
                        TableCellBean newtc2 = new TableCellBean();
                        TextBean tb = new TextBean();
                        Locale loc = req.getLocale();
                        concID = conc.getDisplayName(loc);
                        tb.setValue(concID);
                        newtc2.addBean(tb);
                        newtr.addBean(newtc2);
                        newtc = new TableCellBean();
                        TextBean tb2 = new TextBean();
                        tb2.setValue(conc.getDescription(loc));
                        newtc.addBean(tb2);
                        newtr.addBean(newtc);
                        model.addTableRowBean(newtr);
                    }
                }
            }
            frame.setTableModel(model);
            panel.addBean(frame);
        }
        setNextState(req, VIEW_JSP);
    }

    public void doViewSubscription(FormEvent event) {
        PortletRequest req = event.getPortletRequest();
        gsPortlets.clear();
        User user = req.getUser();
        List myNames = layoutMgr.getSubscribedPortlets(req);
        List groups = aclService.getGroups(user);
        Iterator it = groups.iterator();
        PanelBean panel = event.getPanelBean("panel");
        PortletRole role = req.getRole();
        while (it.hasNext()) {
            FrameBean frame = new FrameBean();
            DefaultTableModel model = new DefaultTableModel();
            PortletGroup g = (PortletGroup)it.next();
            TableRowBean tr = new TableRowBean();
            tr.setHeader(true);
            TableCellBean tc3 = new TableCellBean();
            TextBean text3 = new TextBean();
            text3.setValue(this.getLocalizedText(req, "SUBSCRIPTION_SUBSCRIBE"));
            tc3.addBean(text3);
            tr.addBean(tc3);
            TableCellBean tc = new TableCellBean();
            TextBean text = new TextBean();
            text.setValue(portletMgr.getPortletWebApplicationDescription(g.getName()));
            tc.addBean(text);
            tr.addBean(tc);
            tc = new TableCellBean();
            text = new TextBean();
            text.setValue(this.getLocalizedText(req, "SUBSCRIPTION_DESC"));
            tc.addBean(text);
            tr.addBean(tc);
            model.addTableRowBean(tr);
            Collection appColl = portletRegistry.getApplicationPortlets(g.getName());
            Iterator appIt = appColl.iterator();
            while (appIt.hasNext()) {
                ApplicationPortlet app = (ApplicationPortlet)appIt.next();
                List concPortlets = app.getConcretePortlets();
                Iterator cit = concPortlets.iterator();
                while (cit.hasNext()) {
                    ConcretePortlet conc = (ConcretePortlet)cit.next();
                    String concID = conc.getConcretePortletID();
                    PortletRole reqrole = conc.getConcretePortletConfig().getRequiredRole();
                    log.debug("subscribed to portlet: " + concID + " " + reqrole);
                    if (role.compare(role, reqrole) >= 0) {
                        CheckBoxBean cb = new CheckBoxBean(req, "portletsCB");
                        cb.setValue(concID);
                        if (myNames.contains(concID)) {
                            cb.setSelected(true);
                        }
                        if (g.equals(PortletGroupFactory.GRIDSPHERE_GROUP)) {
                            gsPortlets.add(concID);
                            cb.setDisabled(true);
                            cb.setSelected(true);
                        }
                        TableRowBean newtr = new TableRowBean();
                        TableCellBean newtc = new TableCellBean();
                        newtc.addBean(cb);
                        newtr.addBean(newtc);
                        TableCellBean newtc2 = new TableCellBean();
                        TextBean tb = new TextBean();
                        Locale loc = req.getLocale();
                        tb.setValue(concID);
                        newtc2.addBean(tb);
                        newtr.addBean(newtc2);
                        newtc = new TableCellBean();
                        TextBean tb2 = new TextBean();
                        newtc.addBean(tb2);
                        newtr.addBean(newtc);
                        model.addTableRowBean(newtr);
                    }
                }
            }
            frame.setTableModel(model);
            panel.addBean(frame);
        }
        setNextState(req, VIEW_JSP);
    }
