KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > exomvc > velocity > ListUserPage


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.exomvc.velocity;
6
7 import java.util.List JavaDoc;
8 import javax.portlet.ActionRequest;
9 import javax.portlet.ActionResponse;
10 import javax.portlet.RenderRequest;
11 import javax.portlet.RenderResponse;
12 import org.apache.velocity.VelocityContext;
13 import org.apache.velocity.context.Context;
14 import org.exoplatform.commons.utils.PageList;
15 import org.exoplatform.container.PortalContainer;
16 import org.exoplatform.portlet.exomvc.VelocityPage;
17 import org.exoplatform.services.organization.OrganizationService;
18
19 public class ListUserPage extends VelocityPage {
20   
21   public void processAction(ActionRequest req, ActionResponse res) {
22  
23   }
24   
25   public void render(RenderRequest req, RenderResponse res) throws Exception JavaDoc {
26     PortalContainer container = PortalContainer.getInstance() ;
27     OrganizationService orgService =
28       (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class) ;
29     PageList pageList = orgService.getUserPageList(15) ; // 15 users per page
30
//List page = pageList.currentPage() ; //get current use in page 1
31
List JavaDoc all = pageList.getAll() ; // get all users in db
32
Context ctx = new VelocityContext() ;
33     ctx.put("users", all) ;
34     setVelocityContext(req, ctx) ;
35     super.render(req, res) ;
36   }
37 }
Popular Tags