1 5 package org.exoplatform.portlets.exomvc.velocity; 6 7 import java.util.List ; 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 { 26 PortalContainer container = PortalContainer.getInstance() ; 27 OrganizationService orgService = 28 (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class) ; 29 PageList pageList = orgService.getUserPageList(15) ; List all = pageList.getAll() ; Context ctx = new VelocityContext() ; 33 ctx.put("users", all) ; 34 setVelocityContext(req, ctx) ; 35 super.render(req, res) ; 36 } 37 } | Popular Tags |