GridSphereServlet.login(GridSphereEvent event) |
appears to be the section of code we need to modify if we want to use Crowd authentication. Then, rebuild gridsphere.jar and deploy it along with the tdar.
PortletRequest req = event.getPortletRequest(); PortletResponse response = event.getPortletResponse(); String username = req.getParameter("username"); String password = req.getParameter("password"); HttpAuthenticator authenticator = HttpAuthenticatorFactory.getHttpAuthenticator(); try { authenticator.authenticate(req, response, username, password); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidAuthorizationTokenException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidAuthenticationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InactiveAccountException e) { // TODO Auto-generated catch block e.printStackTrace(); } |
WEB-INF/portlet.xml
and WEB-INF/layout.xml
gridsphere/WEB-INF/layout.xml
and gridsphere/WEB-INF/CustomPortal/layout/groups/gridsphere.xml
<portlet-tab label="tdaregister"> <title lang="en">Register</title> <portlet-tabbed-pane style="sub-menu"> <portlet-tab label="TDAR Project/Data Registration"> <title lang="en">TDAR Project/Data Registration</title> <table-layout> <row-layout> <column-layout width="100%"> <portlet-frame label="tdaregister"> <portlet-class>org.tdar.portlets.ProjectRegistrationPortlet</portlet-class> </portlet-frame> </column-layout> </row-layout> </table-layout> </portlet-tab> </portlet-tabbed-pane> </portlet-tab> |
org.gridlab.gridsphere.provider.portlet.jsr.ActionPortlet
- the created portlet must be in a portlets
subpackage, otherwise GridSphere won't find it. You can also subclass AbstractTdarPortlet
, which will probably live in TdarCorePortlet soon.init(PortletConfig config)
method, assign DEFAULT_VIEW_PAGE to the method you want to invoke when the first portlet is encountered. For instance,
public void init(PortletConfig config) throws PortletException { super.init(config); DEFAULT_VIEW_PAGE = "listProjects"; } public void listProjects(RenderFormEvent event) { setNextState(event.getRenderRequest(), LIST_PROJECTS_JSP); } |
Spring Portlets docs: http://static.springframework.org/spring/docs/2.5.x/reference/portlet.html
Hibernate docs: http://hibernate.org
EJB Persistence Annotations docs: http://java.sun.com/javaee/5/docs/tutorial/doc/bnbpz.html
Gridsphere docs page: http://www.gridsphere.org/gridsphere/gridsphere/guest/docsTab/r/
DeveloperWorks article on how to develop portlets for Gridsphere: http://www.ibm.com/developerworks/grid/library/gr-portlets/
Good overview of portlet/servlet technology: http://dhruv.uits.indiana.edu/portals/portals-101.pdf
Gridsphere, Webwork, and Portlets? http://ieeexplore.ieee.org/Xplore/login.jsp?url=/iel5/9268/29441/01333397.pdf
Spring Web MVC Portlets: http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html