Post on 25-Jan-2015
description
Building Science Gateways with Apache Rave
Marlon PierceScience Gateway Group
Indiana University
Apache Rave Overview
• Rave is an Apache incubator for building a Web portal on the Open Social and W3C Widget specifications.– Joint effort of Mitre, Hippo Software, SURFnet, and the
OGCE project– Replaces the OGCE Gadget Container
• Goal 1: Provide a useable, packaged, downloadable OpenSocial portal.– Get started with minimal hassle.
• Goal 2: Provide a platform for non-invasive developer extensions, customizations– Science gateways, for example
Gadget Dashboard View
Gadget Store View
Mobile View
Rave Building Blocks
• Rave is implemented in JavaScript, Java with Spring MVC– Bean initialization specified in XML configuration files.– Inversion of Control makes it easy to swap out
implementations.– Disciplined MVC through Java annotations
• Builds on Apache Shindig and Wookie– Provide layout management, user management,
administration tools, production backend data systems, etc.
Rave ComponentsComponent Description
Models User, Page, Region, RegionWidget. These are interfaces with default implementations
Controllers Associates a specific URL with backing code to render JSP views or provide access to REST and RPC services.
Services Internal services that implement a specific action, such as adding a new user to the repository.
Repositories Control Object-Relational Mappings between model objects and backend storage.
Views User interfaces implemented as JSPs. These include welcome pages, layout managers for both standard and mobile views, administration pages, and widget store pages.
Rave Configuration FilesConfiguration File Description Developer
ModificationsapplicationContext.xml Instantiates all beans,
controllers, and services.
Add new Java Beans here to support extensions.
applicationContext-security.xml
Specifies allowed URL patterns, enables OpenID support, and to specifies the authentication provider.
Change the default authentication module or expose additional REST services.
dataContext.xml Used to set up the default H2 database and to populate it with demo accounts.
Override default data store, initial population methods.
Extending Rave
• Rave is designed to be extended.– Good design (interfaces, easily pluggable
implementations) and code organization are required.
– It helps to have a diverse, distributed developer community• How can you work on it if we can’t work on it?
• Rave is also packaged so that you can extend it without touching the source tree.
Rave Developer DependenciesComponent Description
rave-portal-dependencies
Maven POM file listing all Rave-produced JARs and third-party dependencies.
rave-portal-resources Java WAR file containing all Rave Web resources
rave-shindig Java WAR file containing Rave modifications and extensions to Apache Shindig
Rave Extension General Steps
• Download and install Rave’s source– “mvn clean install” puts JARs, WARs, and POMs
into your local Apache Maven repository.• Create a new Apache Maven project– You’ll need rave-portal-dependencies POM in your
<dependencies/>.– Include any configuration files that you would like
to modify.– Include the source code for your extensions.
Case Study: GridShib and Community Credentials
• XSEDE Science Gateways use shared community credentials when accessing backend resources. – Many portal users map to one community
account.• GridShib adds attributes to grid credentials– Gateway membership, originating IP address, user
email, creation time, etc.• For Rave, we’ll have to change the User
service implementation to support this.
GridShib Step By Step• Install Rave in your Maven repo.• Create a Maven project with standard directory layout for
WAR packaging • Create a new user service (ComUserService) for obtaining a
community credential and adding GridShib attributes.• Replace applicationContext-security.xml with your version• In the XML, replace the default UserService with
ComUserService.• Place all GridShib resources in src/main/resources • Place web.xml in src/main/webapp/WEB-INF– You’ll need an additional listener to get the IP address.
GridShib and Rave Postmortem
• The full example is available from the Rave sandbox SVN.
• It is also includes examples of how to build new REST services.
• GridShib’s dependence on XML library jars are a challenge for one step packaging.– These must be in an endorsed directory
The Apache Way• Apache is open community, not just open source licensing or
code on the web.• Projects start as incubators with 1 champion and several
mentors.– Making good choices is very important
• Champion and mentors will judge you, help you on the following• Good, open engineering practices
– DEV mailing list design discussions, issue tracking• Properly packaged code
– Build out of the box– Licenses, disclaimers, notices, change logs, etc.
• Developer diversity– Three or more unconnected developers
Apache and Science Gateways
• Apache rewards projects for cross-pollination.– Connecting with complementary Apache projects
strengthens both sides.– New requirements, new development methods
• Apache methods foster sustainability– Building communities of developers, not just users
• Apache methods provide governance– Incubators learn best practices from mentors– Releases are peer-reviewed
More Information
• As an Apache Incubator, Rave welcomes (and needs) new developer involvement
• Rave Web Site:• Rave Developer List (public):• Rave includes contributions from many
individuals. See http://incubator.apache.org/rave/ for a list of champions, mentors, and contributors.