KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > user > component > UIWelcomePortlet


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.portlets.user.component ;
6
7 import java.util.List JavaDoc;
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 /**
14  * Wed, Dec 22, 2003 @ 23:14
15  * @author: Tuan Nguyen
16  * @email: tuan08@users.sourceforge.net
17  * @version: $Id: UIIC3LoginPortlet.java,v 1.1 2004/11/01 15:21:42 tuan08 Exp $
18  */

19 public class UIWelcomePortlet extends UIPortlet {
20     
21     public UIWelcomePortlet(UILogin uiLogin,
22                           UILogout uiLogout) throws Exception JavaDoc {
23         setClazz("UIWelcomePortlet");
24     setRendererType("ChildrenRenderer");
25     List JavaDoc 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