140 likes | 347 Views
Best Practices for Channel Development. Al Wold Arizona State University. Strategy Overview. Revision Control: CVS Build Process: ant Deployment: CAR files Development Environment: Eclipse. Eclipse. Initially developed by IBM, now community-developed Free and open source
E N D
Best Practices for Channel Development Al Wold Arizona State University
Strategy Overview • Revision Control: CVS • Build Process: ant • Deployment: CAR files • Development Environment: Eclipse
Eclipse • Initially developed by IBM, now community-developed • Free and open source • GUI is native to the OS, providing higher performance than pure Java IDEs • Integration with open source standard tools (ant, CVS, JUnit)
CVS • The de facto standard for open source projects • Focus on multiple developers • Concurrent checkout and development
CVS: The Repository • Projects are represented as modules • The entire source tree of a module is checked out • Working copy can be updated with latest changes in repository • When you are finished with a change, the file is committed to the repository
CVS: Tags • Tags can be used to “flag” a specific set of files • This can be used to identify development/QA/production code • Branches are a form of tag which allow you to work on a separate line of changes
CVS • Documentation is available at http://www.cvshome.org • The subversion project will be the successor to CVS, but is currently not as well adopted • Subversion information is available at http://subversion.tigris.org
CAR Files • Allow for deployment of a channel as a single easily-migrated unit • Can contain all of your code, stylesheets, images, and other resources
CAR File Development • Laying out your source tree for CAR support • Coding your channel to support CAR files for external resources
Sample CAR File layout test.car: edu/asu/portal/channels/test/CTest.class edu/asu/portal/channels/test/CTest.ssl edu/asu/portal/channels/test/CTest.xsl edu/asu/portal/channels/test/images/test.gif
Coding for CAR files • Pass the base media URL to the XSLT process:xslt.setStylesheetParam(“mediaPath”, runtimeData.getBaseMediaURL(this)); • Reference the base media URL in the XSL:<xsl:param name=“mediaPath”/><img src=“{$mediaPath}edu/asu/portal/channels/test/images/test.gif”/>
ant • Open source build tool developed by the Apache foundation • Currently the most widely adopted standard build tool for Java • Used by the uPortal project • Ant manual: http://ant.apache.org/manual/
Using ant to build a channel • Prepare the build directories • Compile code • Package the car file • Deploy the car file • Reload the application
Development Considerations • How to implement development environment • Multiple build environments, one runtime environment • Runtime environment for each user • Commit policy • Commit files as frequently as possible to minimize conflicts, but make sure they are in a stable state • Non-eclipse users • Using ant and CVS allows for theoretical use of any IDE, or no IDE