1 5 package org.exoplatform.portlets.user.component ; 6 7 import java.util.List ; 8 import org.exoplatform.container.SessionContainer; 9 import org.exoplatform.faces.core.component.UIPortlet; 10 import org.exoplatform.faces.user.component.UILogin; 11 import org.exoplatform.faces.user.component.UILogout; 12 import org.exoplatform.portal.session.RequestInfo; 13 19 public class UIWelcomePortlet extends UIPortlet { 20 21 public UIWelcomePortlet(UILogin uiLogin, 22 UILogout uiLogout) throws Exception { 23 setClazz("UIWelcomePortlet"); 24 setRendererType("ChildrenRenderer"); 25 List children = getChildren() ; 26 RequestInfo rinfo = (RequestInfo) SessionContainer.getComponent(RequestInfo.class) ; 27 if (RequestInfo.PUBLIC_ACCESS.equals(rinfo.getAccessibility())) { 28 children.add(uiLogin) ; 29 } else { 30 children.add(uiLogout) ; 31 } 32 } 33 } 34 | Popular Tags |