1 5 package org.exoplatform.portlets.communication.forum.component; 6 7 import java.util.* ; 8 import javax.portlet.PortletPreferences; 9 import org.exoplatform.Constants; 10 import org.exoplatform.faces.FacesUtil; 11 import org.exoplatform.faces.core.component.UIPortlet; 12 import org.exoplatform.services.communication.forum.*; 13 14 20 public class UIForumAdminController extends UIPortlet { 21 public UIForumAdminController(ForumServiceContainer container) throws Exception { 22 setId("UIForumAdminPortlet"); 23 setRendererType("ChildrenRenderer") ; 24 PortletPreferences prefs = FacesUtil.getPortletPreferences() ; 25 String owner = prefs.getValue("forum-owner", Constants.DEFAUL_PORTAL_OWNER) ; 26 ForumService service = container.findForumService(owner) ; 27 28 List children = getChildren() ; 29 UIAdminViewCategories uiCategories = new UIAdminViewCategories(service) ; 30 uiCategories.setRendered(true) ; 31 children.add(uiCategories) ; 32 33 UICategoryForm uiCategoryForm = new UICategoryForm(service) ; 34 uiCategoryForm.setRendered(false) ; 35 children.add(uiCategoryForm) ; 36 37 UIForumForm uiForumForm = new UIForumForm(service) ; 38 uiForumForm.setRendered(false) ; 39 children.add(uiForumForm) ; 40 } 41 } | Popular Tags |