Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Apereo 2013 Portlet Development Seminar

Apereo 2013 Portlet Development Seminar

Slides for the 2013 Apereo Portlet Development Seminar.

Avatar for Eric Dalquist

Eric Dalquist

June 02, 2013
Tweet

More Decks by Eric Dalquist

Other Decks in Education

Transcript

  1. May 21, 2013 • JSR-168 / v1 – 2003 •

    JSR-286 / v2 – 2008 • Fragment of Content 3 Java Portlet Specifications Sunday, June 2, 13
  2. May 21, 2013 Java Portlet Specifications • Security • Customization

    • Groups/Roles • User Data • Persistence 4 Sunday, June 2, 13
  3. May 21, 2013 JDK & Build Tools • JDK 1.7

    – http://www.oracle.com/technetwork/java/javase/downloads/index.html – JDK not JRE! • Ant 1.8.2 – This version exactly! – http://archive.apache.org/dist/ant/binaries/ • Maven 3 – http://maven.apache.org/download.cgi 6 Sunday, June 2, 13
  4. May 21, 2013 • Eclipse J2EE – http://www.eclipse.org/downloads/ • M2Eclipse

    • Spring Tool Suite • Subclipse • EGit • Sysdeo Tomcat Plugin – http://www.eclipsetotale.com/tomcatPlugin.html 7 Eclipse & Plugins Sunday, June 2, 13
  5. May 21, 2013 Other Tools • SQuirrel SQL – http://squirrel-sql.sourceforge.net/

    – Universal SQL Client – Uses JDBC Drivers 9 Sunday, June 2, 13
  6. May 21, 2013 • http://www.jasig.org/uportal/download • All-In-One uPortal Environment –

    Ant – Maven – Tomcat – uPortal 11 Quickstart Environment Sunday, June 2, 13
  7. May 21, 2013 Debugging • Start Database – $ ant

    hsql-start • Setup Sysdeo Eclipse Plugin – Eclipse > Preferences > Tomcat 14 Sunday, June 2, 13
  8. May 21, 2013 • Deployed to Container • Generally Themed

    • Shared Resources 17 Apps Tomcat / uPortal WebApp A WebApp B / PortletApp B WebApp C / PortletApp C Sunday, June 2, 13
  9. May 21, 2013 • Contained in an App • Usage

    / Role specific • Scoping Functionality 18 Servlets & Portlets WebApp / PortletApp Servlet A Portlet B Portlet C Sunday, June 2, 13
  10. May 21, 2013 /Context/Path/Path/File?param=value 21 Servlets have URLs • Context

    - The WebApp • Path & File - Maps to Servlet • Parameters - Arguments to the Servlet Sunday, June 2, 13
  11. May 21, 2013 ????????????????????? 22 Portlets Don’t • Parameters -

    Arguments to the Portlet • PortletMode - Portal Aware Parameter • VIEW, EDIT, HELP • WindowState - Portal Aware Parameter • NORMAL, MINIMIZED, MAXIMIZED Sunday, June 2, 13
  12. May 21, 2013 • Action – Make a Change •

    Event – InterPortlet Communication • Render – Render Markup • Resource – Render Markup Fragment 24 Multi-Request Lifecycle Sunday, June 2, 13
  13. May 21, 2013 • User & Subscription Scoped Data •

    String -> String[] • Available during request processing • No length limits • Cannot modify during render • Validation API • read-only Flag 30 Key-Values Store Sunday, June 2, 13
  14. May 21, 2013 33 Session Scopes Application Scope Portlet A

    Scope Portlet B Scope Portlet C Scope Sunday, June 2, 13
  15. May 21, 2013 Sessions & Servlets • Application Scope ==

    Servlet Session • Data Sharing! 34 Sunday, June 2, 13
  16. May 21, 2013 • Emulates browser cookies • Actually stored

    in database • Portal handles the real cookie 36 Portlet Cookies Sunday, June 2, 13
  17. May 21, 2013 • Declarative - portlet.xml • Runtime -

    Response Properties • Scope - private/public • Time Based • 0 - Never Cache • -1 - Never Expire 38 Expiration Caching Sunday, June 2, 13
  18. May 21, 2013 • Remote User – Portal Handles AuthN

    • User Roles – Ties into Portal Groups 42 Programmatic Security Sunday, June 2, 13
  19. May 21, 2013 • Java API or JSP Tag Library

    • “URLs” are opaque to the portlet 44 URLs Sunday, June 2, 13
  20. May 21, 2013 Forms • POST! • application/x-www-form-urlencoded 45 <form

    action="${formUrl}" method="POST"> Sunday, June 2, 13
  21. May 21, 2013 Namespace • Portlets Share the Page •

    Scope JavaScript & CSS 46 Sunday, June 2, 13
  22. May 21, 2013 Application Contexts • web.xml – Root App

    Context – DisptacherServlets • portlet.xml – DispatcherPortlets 52 Sunday, June 2, 13
  23. May 21, 2013 Portlet MVC Annotations • @Controller – Spring

    Component Annotation • @RequestMapping – Required at class level for portlets – Specify the PortletMode 55 Sunday, June 2, 13
  24. May 21, 2013 Portlet MVC Annotations • @ActionMapping • @EventMapping

    • @RenderMapping • @ResourceMapping 56 http://static.springsource.org/spring/docs/3.2.x/spring-framework- reference/html/portlet.html#portlet-ann-requestmapping-arguments Sunday, June 2, 13
  25. May 21, 2013 Gotchas • Minimization – Portlets ALWAYS Render

    Content • 57 http://search.maven.org/#search%7Cga%7C1%7Cportlet-mvc-util Sunday, June 2, 13
  26. May 21, 2013 Community Resources • uPortal Manual – https://wiki.jasig.org/display/UPM40

    • Mailing Lists – http://www.jasig.org/uportal/mailing-lists • Chat Room (IRC) – https://wiki.jasig.org/display/UPC/IRC+Channels • Issue Tracking – https://issues.jasig.org/browse/UP 59 Sunday, June 2, 13
  27. May 21, 2013 uPortal Theme Detection • “themeName” Request Property

    • portlet-mvc-util provides API – IViewSelector – ThemeNameViewSelectorImpl 62 https://github.com/Jasig/portlet-utils/blob/master/portlet-mvc-util/src/ main/java/org/jasig/portlet/utils/mvc http://search.maven.org/#search%7Cga%7C1%7Cportlet-mvc-util Sunday, June 2, 13