Cross Platform Portlets

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Cross Platform Portlets - Presentation Transcript

    1. live. learn. work. play. Cross-Portal/Container/JVM Development A Presentation By: Jason Shao, Director of Product Development 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    2. live. learn. work. play. Agenda Agenda Portlet Containers & Platforms “Categories” of containers & the Landscape Challenges Programming APIs & Practices Deployment Challenges Look & Feel/Consistency Portable vs. Non-portable 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    3. live. learn. work. play. Portlet Containers & Platforms What have people used? What have people heard of? What *else* have people heard of? 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    4. live. learn. work. play. Portlet Containers & Platforms The list: Pluto Tomcat OC4J uPortal Liferay Exo Sakai OpenPortal/WebSynergy/??? Webcenter Peoplesoft Portal Luminus, IBM Webspheere, BEA Weblogic/Plumbtree 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    5. live. learn. work. play. “Categories” of containers & the Landscape Open Source Containers Often leverage newer technologies May encourage container behavior modification Often have extensive bundled libraries Often extend the JSR-168/286 standards 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    6. live. learn. work. play. “Categories” of containers & the Landscape Enterprise/Commercial Containers Many are still J2EE 1.4 Often have *looong* build/deploy processes Often have extensive bundled libraries Often have custom tooling/IDEs Often extend the JSR-168/286 standards 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    7. live. learn. work. play. Challenges Programming APIs & Practices Deployment Challenges Configuration Issues Look & Feel/Consistency Portable vs. Non-portable 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    8. live. learn. work. play. Challenges : Programming APIs & Practices Avoid Vendor specific APIs com.xxxshould be a warning sign When a vendor specific API must be used, consider wrapping the API in your own configurable façade/adapter. Avoid deploying vendor specific libraries along with your portlet; chances are you could expose the API via RMI/WebService! 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    9. live. learn. work. play. Challenges : Programming APIs & Practices Writing Adaptors for Vendor/Platform Code and Workarounds • If you do end up writing an adapter for odd portal behavior, TEST IT! • Create some mock requests to simulate the behavior of the portal. • Try to be efficient in detecting the Portal vendor in your adapter - avoid using reflection, try to pull vendor from getPortalInfo(). 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    10. live. learn. work. play. Challenges : Programming APIs & Practices Use Old Technology JSR168/286 don't dictate J2EE or Java version. Stick to the tried and true servlet 2.3 specification. In this day and age it is not likely that you'll run into many Portal deployments running on anything older than Java 1.3 and J2EE 2.3 Use JSTL 1.0, *not* 1.1! 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    11. live. learn. work. play. Challenges : Programming APIs & Practices Avoid using JSP 2.0/JSTL 1.1/EL taglibs, EL, and JSP evaluation is one of the biggest pain points in writing cross platform code. Avoid using EL in conjunction with taglibs (<spring:formcommandName=\"${commandName }\"> = “world of hurt“ try <spring:formcommandName=\"<%= pageContext.getAttribute(\"commandName\")%>” 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    12. live. learn. work. play. Challenges : Programming APIs & Practices Avoid Pre-compiling JSPs This technique can introduce run-time dependencies on taglibs, libraries These may not be the same if you develop in a different container than you deploy in 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    13. live. learn. work. play. Challenges : Programming APIs & Practices Alternatively use velocity or freemarker for your views (easy to do if you're writing Spring MVC!) • They're guaranteed to work in a Java 1.4 & J2EE 2.3 environment. • Be wary of the fact that its harder to hire devs that know FTL than those that know JSPs! • Also be wary of the fact that taglibs are harder to use from FTL than from JSPs (obviously). 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    14. live. learn. work. play. Challenges : Programming APIs & Practices Avoid using Java 1.5 or newer features. Many of the APIs that come with 1.6 can be obtained as separate packages and most of the 1.5 features can be emulated in 1.4. If you *must* use 1.5 code (believe me I understand - Spring annotation configuration is sooo much easier than xml-hell; type-safe collections save you time too) try retroweaver. 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    15. live. learn. work. play. Challenges : Programming APIs & Practices Be aware of JVM Differences Run unit tests on all deployment-target JVMs . You'll be surprised how different the IBM JDK and compiler are from the Sun JDK and compiler! Not just class libraries, but things like string equality (.equals vs ==; == has some “hilarious properties” on IBM JVMs) 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    16. live. learn. work. play. Challenges : Programming APIs & Practices Build & Deployment Automation is a Need, not a Want for cross-Container Development • At CampusEAI we have a system which allows us to automatically deploy a portlet to Oracle or Liferay portal (or both) following an SVN commit. • Maven is an easy way to automate builds and script deployments - use the antrun +ssh/scp tasks; avoid vendor-specific ANT deployment tasks - these are *hard* to get to work right. 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    17. live. learn. work. play. Challenges : Programming APIs & Practices Establish a minimum dependency development environment • portlet-archetype where you have a Portal environment with the BARE minimums: • barely functioning Portal (pluto) + portlet container (jetty) and an isolated class loader. • This will help you both increase productivity and increase the probability that your code will work in a more \"complicated\" environment. 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    18. live. learn. work. play. Challenges : Deployment Challenges Deployment Challenges : App Servers J2EE Servers and Servlet containers are never compliant with the specs. Expect things to fail. Use the 2.3 web.xml descriptor format; make sure it validates Some older Portal versions (WPS 5.1, Oracle 10.1.2/OC4J 10.1.2) don't support the 2.4 spec Make sure that your Servlet container loads classes from your portlet web application first IBM WAS, Tomcat/JBoss and Oracle use *radically* different class loader hierarchies 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    19. live. learn. work. play. Challenges : Deployment Challenges If something doesn’t work quite right, Google! • Many issues: classloaders, username formats, etc. can be worked around through configuration • Configuration workarounds are often obscure or hard to isolate in documentation • Deployment issues are common, and generally already documented 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    20. live. learn. work. play. Challenges : Deployment Challenges Deployment Challenges : Portal Servers *Always* Use your portal container’s deployment mechanism *Always* Check the output of your portal container’s deployment mechanism Understand your container’s configuration/descriptor files/mechanisms 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    21. live. learn. work. play. Challenges : Deployment Challenges Investigate your container’s configuration • Different containers will react differently to basic calls likerequest#getRemoteUser() or request#getAttribute(PortletRequest.USER_INFO)! • E.g. uPortal will return “TestUser” Liferay will \"943242\" when getRemoteUser() is invoked with a portlet request originating from a user with a screen name of \"TestUser” • Liferay can be configured to return “TestUser” 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    22. live. learn. work. play. Look and Feel Consistency Look and Feel Consistency Extremely Hard JSR-168/286 Standards are Very Vague on Look & Feel, and UI Consistency Common practices often need to be adapted for portlet/portal environments 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    23. live. learn. work. play. Look and Feel Consistency Portable vs. Non-Portable This is a judgment call Portable is harder, more expensive, requires lots of testing, and even then has few guarantees Strategies involving “slim” portlets which can be easily rewritten may be simpler in the long run 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    24. live. learn. work. play. Challenges : Deployment Challenges Test, Test, Test, Test some More • Unit, integration, and load testing are absolutely invaluable when writing cross-portal code. • Try to mock as much vendor functionality as possible in mock portlet requests. • JUnit 3 is a pain compared with JUnit 4 or TestNG, but ensures your tests run in 1.4... • Different containers and platforms can have drastically different performance profiles 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    25. live. learn. work. play. Look and Feel Consistency Acknowledgements Development staff at CampusEAI Our many members Eugene Rachitskiy, CampusEAI Lead Architect 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org
    26. live. learn. work. play. Cross-Portal/Container/JVM Development A Presentation By: Jason Shao, Director of Product Development 1940 East 6th Street • 11th Floor • Cleveland • Ohio 44114 • Tel: 216.589.9626 • Fax: 216.589.9639 • info@campuseai.org• http://www.campuseai.org

    + Jason ShaoJason Shao, 8 months ago

    custom

    321 views, 0 favs, 0 embeds more stats

    Tips and tricks for developing portlets that will r more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 321
      • 321 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 16
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories