O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Liferay Portal 5.2 Systems Development

Book Description

Build Java-based custom intranet systems on top of Liferay portal

  • Learn to use Liferay tools to create your own applications as a Java developer, with hands-on examples

  • Customize Liferay portal using the JSR-286 portlet, extension environment, and Struts framework

  • Build your own Social Office with portlets, hooks, and themes and manage your own community

  • The only Liferay book aimed at Java developers

In Detail

Liferay portal is one of the most mature portal frameworks in the market, offering many key business benefits that involve personalization, customization, and workflow. If you are a Java developer who wants to build custom web sites and intranet applications using Liferay portal, this is where your search ends.

This book shows how Java developers can use Liferay as a framework to develop custom intranet systems, based on Liferay portal platform thus helping you to maximize your productivity gains. Get ready for a rich, friendly, intuitive and collaborative end-user experience!

The author's experience customizing Liferay using Java enables him to explain in a clear and precise manner how to build custom systems on top of Liferay portal.

Using this book you can customize Liferay into a single point of access to all an organization's data, content, web content, and other information from both existing in-house applications (HR, CRM) and external sources (such as Alfresco, FatWire, Magnolia, Vignette).

Table of Contents

  1. Liferay Portal 5.2 Systems Development
    1. Table of Contents
    2. Liferay Portal 5.2 Systems Development
    3. Credits
    4. About the author
    5. Acknowledgement
    6. About the reviewer
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code for the book
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Introducing Liferay Portal Architecture and Framework
      1. What's Liferay portal?
        1. Liferay portal
        2. Liferay CMS and WCM
        3. Liferay collaboration and social networking software
      2. Why Liferay portal?
        1. A rich, friendly, intuitive, and collaborative end user experience
        2. A single point of access to all information
        3. High adaptability to the demands of fast-changing market
        4. Highest values
      3. Architecture and framework
        1. Service oriented architecture: SOA
        2. Enterprise service bus: ESB
      4. Portal development strategies
        1. Extension environment
        2. Plugins SDK environment
        3. Development strategies
      5. Summary
    9. 2. Working with JSR-286 Portlets
      1. Experiencing Liferay portal and portlets
        1. What is a portal?
        2. What is a portlet?
        3. What is a portlet container?
        4. Why JSR-286 portlets?
      2. Using JSR-286 portlets
        1. Understanding portlet life cycle
        2. Utilizing portlet modes
        3. Employing window states
        4. What's the difference between a portlet and a servlet?
          1. Use cookies, document head section elements, and HTTP headers
      3. Employing portlet configuration, context, request, response, and preferences
        1. Using portlet configuration
        2. Employing portlet context
        3. Using portlet request
        4. Employing portlet response
        5. Working with portlet preference
      4. Extending JSR-286 portlets
        1. Using portlet filters
        2. Using portlet-managed modes
        3. Utilizing container runtime options
      5. Serving resources
        1. Using Resource URL
        2. Using caching levels of resources
        3. Serving the AJAX data directly from the portlet
        4. Utilizing other features
          1. Using JAVA 5 features
          2. Employing caching features
          3. Sharing runtime ID
          4. Using taglib
      6. Coordinating portlets
        1. Sharing data via the session
          1. Using PortletSession
          2. Using PortletContext
          3. Using page parameters
        2. Using portlet events
          1. Sending events
          2. Receiving events
        3. Employing public render parameters
      7. Summary
    10. 3. ServiceBuilder and Development Environments
      1. Setting up Ext
        1. Required tools
          1. JDK
          2. Ant
        2. Databases
          1. MySQL
        3. Application servers
          1. Tomcat
        4. IDE
          1. Eclipse IDE
          2. Workspace
          3. Subclipse
          4. Tomcat plugins
        5. Portal source code
      2. Building Ext
        1. Getting portal source code
          1. Source structures and Ant targets
        2. Updating Tomcat to support Ext development
        3. Customizing properties
        4. Building via Ant
        5. Navigating Ext structures
      3. Deploying Ext
        1. Configuring database
        2. Using Ant deploy
          1. View portal structures in Tomcat
          2. Fast-deploy in Ext
      4. Using ServiceBuilder in Ext
        1. Viewing portlet development structures
        2. Building services
          1. Create service XML
          2. Build services
          3. What's happening?
        3. Navigating portlet specification
      5. Setting up Plugins SDK
        1. Building Plugins SDK project
        2. Deploying plugins
        3. Fast development of plugins with Tomcat
      6. Using development environments efficiently
        1. How does Ext work?
        2. When do we use Ext?
      7. Summary
    11. 4. Experiencing Struts Portlets
      1. Developing a JSP portlet
        1. Defining the JSP portlet
        2. Changing the title and category
        3. Using JSP portlet efficiently
          1. Fast deploy
          2. Employing JSP portlet
      2. Constructing a basic Struts portlet
        1. Defining a Struts portlet
        2. Specifying the page flow and page layout
        3. Creating JSP pages
        4. Changing the title and category
      3. Building an advanced Struts portlet
        1. Adding an action
          1. Creating an action
          2. Defining the action
          3. Adding a form in JSP page
          4. Creating success and error pages
        2. Interacting with the database
          1. Creating a database structure
          2. Creating methods to add and retrieve records
          3. Updating existing files
          4. Retrieving records from the database
        3. Redirecting
          1. Updating the action
          2. Updating action paths
          3. Updating existing JSP files
        4. Adding more actions
          1. Creating methods to edit and delete records
          2. Updating the action
          3. Creating actions menu JSP file
          4. Updating existing JSP files
        5. Setting up permissions
          1. Setting up permissions in the backend
          2. Setting up permissions in frontend
          3. Deploying
      4. Using Struts efficiently
        1. Why use Struts?
        2. Why use tiles?
        3. When do we use Struts?
      5. Summary
    12. 5. Managing Pages
      1. Extending Communities portlet
        1. Building Ext Communities portlet
          1. Constructing the portlet
          2. Setting up actions
          3. Setting up page flow and page layout
          4. Preparing JSP files
        2. Setting up the Ext Communities portlet in the backend
          1. Creating database structure
          2. Creating methods to update, delete, and retrieve
          3. Updating the action classes
        3. Setting up the Ext Communities portlet in the frontend
          1. Updating and deleting Community customized columns
          2. Retrieving community-customized columns
      2. Customizing the Manage Pages portlet
        1. Building a standalone layout management portlet
          1. Constructing the portlet
          2. Setting up the action
            1. Setting up page flow and page layout
            2. Preparing JSP files
          3. Setting up the Ext Layout Management portlet in the backend
            1. Creating a database structure
            2. Creating methods to update, delete, and retrieve
            3. Updating the action class
          4. Setting up the layout management portlet in the frontend
      3. Customizing page management with more features
        1. Adding localized feature
          1. Extending model for locale
          2. Customizing language properties
          3. Displaying multiple languages
        2. Employing tabs
        3. Applying layout templates dynamically
          1. Setting up pages, layout templates, and portlets mappings
          2. Adding layout templates
          3. Displaying layout templates by sections
        4. Tracking pages
      4. Using communities and layout page efficiently
        1. Employing group, community, and permissions
        2. Using communities, layout pages, comments, and ratings
        3. Extending the community and layout pages
      5. Summary
    13. 6. Customizing the WYSIWYG Editor
      1. Configuring the WYSIWYG editor
        1. Extending the Ant target for fast deployment
        2. Upgrading the WYSIWYG editor: FCKeditor
        3. Setting up the FCKeditor
          1. Adding customized icons
          2. Employing default configuration
      2. Adding templates and styles in FCKeditor
        1. Constructing styles and formats
          1. Preparing CSS styles in themes
          2. Employing customized CSS styles from themes
          3. Customizing styles
        2. Building templates
      3. Inserting images and links from different services
        1. Configuring a File Browser Connector with Liferay portal services
          1. Configuring the services for images, documents, and pages
          2. Browsing images and links
          3. Preparing Liferay portal services
        2. Customizing the File Browser Connector with RESTful services
          1. Adding advanced search view features
          2. Adding advanced search functions to links and images
          3. Preparing RESTful services
      4. Inserting content-rich flashes into Web Content
        1. Querying flashes
        2. Adding single flash SWF, videos, and slideshows to journal articles
          1. Adding advanced search views
            1. Adding advanced search functions
            2. Adding flash objects
          2. Adding video queue and video list as part of journal articles
            1. Putting a video list into journal articles
            2. Setting up video queue in journal articles
          3. Adding games and playlists as part of journal articles
            1. Playing games beside text message
            2. Employing playlist as visualization of text information
          4. Preparing RESTful services
        3. Using the WYSIWYG editor FCKeditor efficiently
          1. Extending the file browser connector
          2. Employing the WYSIWYG editor in portlets
            1. Employing the WYSIWYG editor in the Web Content portlet
            2. Using Liferay display tag
            3. Adding the WYSIWYG editor in a custom portlet
          3. When do we use the WSYIWYG editor?
      5. Summary
    14. 7. Customizing CMS and WCM
      1. Managing Terms of Use dynamically
        1. Customizing static Terms of Use
        2. Building dynamic Terms of Use
      2. Constructing featured content
        1. Customizing the Web Content Display portlet
          1. Creating the Ext Web Content Display portlet
          2. Building a view action
        2. Setting up structure and template
          1. Building a structure
          2. Preparing the icon images
          3. Building a template
        3. Building featured content articles
          1. Preparing images
          2. Building an article with images and text
      3. Customizing the Web Content List portlet
        1. Constructing the Ext Web Content List portlet
        2. Building a view action
        3. Setting up the view page
          1. Adding custom article types
          2. Consuming custom article types
      4. Customizing the Asset Publisher portlet
        1. Adding a large-size image and a medium-size image in Web Content
        2. Building the Ext Asset Publisher portlet
        3. Extending view with tags
          1. Configuring tags
          2. Setting up default tags
          3. Updating views
      5. Building dynamic articles with recently added content and related content
        1. Displaying journal articles through asset ID
        2. Showing touts with article ID
          1. Adding Velocity services
          2. Building touts structure and template
          3. Building article touts
        3. Listing recently added content
        4. Exhibiting related content
      6. Building dynamic articles with polls
        1. Adding template node poll
        2. Updating the Web Content portlet with template node poll
        3. Associating journal articles with polls
      7. Extending CMS and WCM
        1. Employing articles, structures, and templates
          1. Using journal template—Velocity templates
        2. Enjoying the Web Content search portlet
        3. Tagging content
        4. Extending Image Gallery and Document Library
        5. Adding Velocity templates in Asset Publisher
      8. Summary
    15. 8. Building a Personalized Community
      1. Sharing content with friends
        1. Building print preview as article template
        2. Sharing applications on any web site by widget
        3. Sending emails with sharing links to friends
          1. Building the Share portlet
          2. Setting up view action and email
          3. Setting up the view page with jQuery
          4. Preparing jQuery service
          5. Building the article template
      2. Setting up the most popular journal articles
        1. Adding a view counter in the Web Content Display portlet
        2. Setting up VM service
        3. Building article template for the most popular journal articles
          1. Setting up the default article type
          2. Setting up the article template
          3. Putting all article templates together
        4. Having a handle on view counter for assets
          1. Using journal article tokens
          2. Get view count on Wiki articles
          3. Getting views count on blog entries
          4. Getting views on Message Boards threads
          5. Setting up view counter on the Image Gallery images
          6. Setting up view counter on Document Library documents
          7. Getting visits on bookmark entries
      3. Personalizing user comments
        1. Creating user comments model
        2. Building the Ext Comment portlet
          1. Adding permissions based on user groups
          2. Updating the UI tag
          3. Setting up email notification
      4. Customizing My Account
        1. Customizing login view
          1. Locating the portlet My Account
          2. Overriding login view
        2. Creating a customized account on the fly
      5. Building personal community—My Street
        1. Customizing user model
        2. Building the portlet My Street
          1. Adding Struts view page
          2. Sharing the My Street theme
          3. Adding videos, games, and playlists into My Street
      6. Using personal community efficiently
        1. Extending user account and user preferences
        2. Setting My Community
        3. Using Control Panel to manage My Account
        4. Using dynamic query API
        5. Using pop ups
          1. Applying Floating DIV pop up
          2. Employing window pop up
      7. Summary
    16. 9. Developing Layout Templates and Themes
      1. Building layout templates in Ext
        1. Constructing custom layout templates
          1. Experiencing default layout templates
          2. Adding customized layout templates
        2. Registering layout templates
      2. Developing layout templates in Plugins SDK
        1. Building layout templates
        2. Creating layout templates
      3. Building themes in Plugins SDK
        1. Creating a customized theme
          1. Setting up the theme project
          2. Building differences of themes
        2. What's happening after deploying themes?
          1. Putting HTML to use
          2. Experiencing CSS and images
          3. Using jQuery JavaScript library
          4. Employ theme settings
          5. Adding color schemes
          6. Adhering to WAP standard
          7. Adding runtime portlets to a theme
        3. Using theme, CSS, and JavaScript
          1. Making use of themes
          2. Applying CSS
          3. Employing JavaScript
          4. Experiencing the developing and debugging tools
      4. Customizing Velocity templates in themes
        1. Using default Velocity templates
          1. Experiencing default Velocity variables
          2. Customizing Velocity variables
        2. Adding customized Velocity templates
          1. Using Velocity templates in drop-down menu
          2. Using Velocity templates in journal article-based navigation
        3. Setting up customized themes and layout templates as default
      5. Using Plugins SDK more efficiently
        1. How does it work?
        2. When to use Plugins SDK?
      6. Summary
    17. 10. Building My Social Office
      1. Experiencing the Control Panel
        1. What's Control Panel?
        2. How does it work?
          1. Using the Control Panel theme
          2. Employing Control Panel settings
          3. Configuring portlets for Control Panel
        3. How to customize it?
          1. Changing theme
          2. Updating both edit page and view page
          3. Configuring customized portlets
      2. Building Inter-Portlet Communication
        1. Creating IPC portlet project
        2. Constructing IPC portlets
          1. Defining portlets
          2. Defining events
          3. Registering portlets
        3. Specifying portlet process actions
        4. Specifying portlet views
      3. Developing Social Office theme
        1. Setting up the theme project
        2. Constructing differences of the so-theme
      4. Adding mail and chat portlets
        1. Setting up the mail portlet
        2. Setting up the chat portlet
          1. Deploying the chat portlet
          2. What's happening behind?
      5. Building Social Office with portlets
        1. Rearing the Social Office portlets project
        2. Assembling social portlets
        3. Raising JavaScript functions and friendly URL
        4. Erecting social views
        5. What's happening?
          1. Experiencing social models
          2. Experiencing social services
          3. Adding social activity tracking
      6. Hooking properties and JSP files into Social Office
        1. Building hooks
          1. Applying portal event handlers
          2. Putting model listeners to use
        2. Erecting portal properties
        3. Employing JSP hooks
      7. Using hooks more efficiently
        1. General usage
          1. WOL—World of Liferay
        2. Special usage
          1. Document library hooks
          2. Auto-login hooks
          3. Mail hooks
      8. Summary
    18. 11. Staging and Publishing
      1. Building dynamic navigation and site map
        1. Constructing custom navigation and street navigation
          1. Build portlets' views
        2. Establishing custom site map
          1. Constructing the street site map portlet
          2. Building up portlet view
      2. Customizing event handlers and model listeners
        1. Handling events
          1. Configuring global startup and shutdown actions
          2. Creating a custom cookie on login
        2. Building custom model listeners
          1. Creating custom model listener
          2. What's happening?
      3. Undergoing local staging and publishing
        1. Activating staging
        2. What's happening?
          1. How does it work?
        3. Staging and publishing locally
          1. Copying from live
          2. Publishing to live
      4. Employing staging workflow and other workflows
        1. Activating staging workflow
          1. Creating a proposal
          2. What's happening?
        2. Customizing staging workflow
          1. Extending model
          2. Building a standalone workflow portlet
          3. Enjoying other workflows
          4. Employing the journal article workflow
          5. Play with the jBPM workflow
          6. Using Intalio | BPMS
      5. Scheduling web content
        1. Scheduling pages
          1. Scheduling the web content
        2. What's happening?
          1. Setting a scheduler engine
          2. Scheduling layouts
          3. Configuring scheduler class
      6. Experiencing remote staging and publishing
        1. What's remote staging and publishing?
        2. How does it work?
          1. Importing and exporting
          2. Using tunnel web
          3. Setting up tunnel web
        3. Using LAR to export and import
          1. Defining portlet-data-handler
          2. Configuring a portlet with portlet-data-handler
          3. Using portlet-data-handler
          4. Using SCORM
      7. Summary
    19. 12. Using Common API
      1. Adding custom attributes
        1. Building dynamic table with Velocity Expando template
          1. Creating a journal structure
          2. Creating a journal template
          3. Building Book Title List
        2. What's happening?
          1. The Expando Velocity template variables
          2. Models and services
          3. Extending custom attributes
        3. Enhancing users and organizations
          1. What's happening?
          2. Sharing the Expando portlet
      2. Building OpenSearch
        1. What's happening?
        2. Adding the OpenSearch capability on custom portlets
        3. Adding search capabilities in portlets
        4. Using Solr for enterprise search
      3. Overriding the Spring services
        1. Overriding method validation
        2. Changing model name via ServiceBuilder
        3. What's happening?
        4. Consuming Liferay services in portlets
          1. How does it work?
        5. Customizing friendly URL mappings
          1. What's happening?
      4. Constructing web services
        1. Building custom web services
        2. Consuming web services in portlets
          1. How does it work?
        3. What's happening?
      5. Enjoying best practices
        1. Using JavaScript Portlet URL
        2. Customizing user and organization administration
          1. Creating a new section
          2. Customizing fields of form section
          3. Customizing columns of the list
        3. Speeding up the portal
        4. Sharing UI Taglibs in portlets
          1. How does it work?
        5. Consuming WSRP
          1. How do we get the WSRP portlets?
          2. How does it work?
        6. Integrating with SharePoint
        7. Integrating with Terracota DSO
      6. Summary
    20. Index