Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EPF Wiki Development Guide

Revision as of 15:31, 16 January 2009 by Onno.van.der.straaten.Logicacmg.com (Talk | contribs) (Removed section about build process)

Welcome to the EPF Wiki Development Guide. This guide covers the steps necessary to begin development on EPF Wiki using Aptana Studio, CVS, and Bugzilla.

Development Environment Setup

Minimum Requirements

  • Ruby 1.8.4 but 1.8.6 is recommended
  • Ruby Gems 0.9.4 or higher
  • Rails 2.0.2
  • MySQL 5.0.15 or higher
  • Windows UnxUtils (for Windows)
  • TinyMCE 2.1.3 stable (currently the only supported editor)

You can use another database, in fact you can use any of supported databases by Rails migrations. UnxUtils is included with the requirements because the current documentation of EPF Wiki assumes the development environment will run on Windows (XP) and the production environment on Linux.

Ruby is shipped with SCIntilla based Text Editor so this minimum setup is already very complete. But for more serious development work the following extra components come highly recommended.

  • XAMPP
  • Aptana Studio

XAMPP includes MySQL so this replaces the MySQL database listed with the minimum requirements. On top of that XAMPP includes many other useful components for development.

Install UnxUtils

This step is documented in the Installation Guide, see http://wiki.eclipse.org/EPF_Wiki_Installation_Guide#UnxUtils


Install HTML Tidy

HTML Tidy can be downloaded from tidy.sf.net. The easiest way to install this is to save the executable tidy.exe in the location C:\WINDOWS\system32. Alternatively you can of course put in another location and add that location to your PATH system variable.

Install Ruby and Ruby Gems

Download and install Ruby from www2.ruby-lang.org. Download and install Ruby Gems from rubygems.org

The following gems need te be installed

These can be installed with the following commands:

gem install tidy
gem install mysql
gem install rails -v=2.0.2
gem install xhtmldiff

Ruby Gems can be installed using command gem install or can be installed manually by downloading the gems from gems.rubyforge.org. Your proxy server can be specified using p switch, for more information type gem help install

The version of Ruby on Rails to install depends on the version EPF Wiki is currently using. You can check the version online in environment.rb in the EPF Wiki CVS Repository.

Aptana Studio

  1. Download Aptana Studio
  2. Add RadRails to Aptana Studio by following the Start Page instructions (Help > Aptana Studio Start Page...).

See the screencast for more information.

Checkout project from CVS

Start Aptana Studio and switch to the CVS repository perspective. Add a repository location with the following properties

Connection type: extssh
Host: dev.eclipse.org
Repository path: /cvsroot/technology

See also CVS Repository Setup in the EPF Composer Development Guide.

From the menu bar select File > New > Project > CVS > Project from CVS.

In the wizard check Use and existing repository location and select the newly created repository. Select Use an existing module and then browse to and select the module name org.eclipse.epf/epfwiki/source


CVS does not version folders so after the previous step we need to run rails -s source to create the folders that are missing. Of course none of the files that we checked out need to be overwritten. The -s option skips over all of these files.


TinyMCE

This commercial editor can be integrated with EPF Wiki.

  1. Download TinyMCE 2.1.3 stable from tinymce.moxiecode.com
  2. Extract the contents and copy the folder tinymce\jscripts\tiny_mce to [Checked out project from CVS]\public\javascripts. The folder javascripts\tinymce should now contain Javascript library tiny_mce.js



The most recent version of TinyMCE is not supported yet.


Create a Development Database

Assuming you have created a MySQL user with enough privileges to create and drop databases you can create a development database with some test accounts, a test Wiki and a Templates Wiki by executing a few simple commands from the EPF Wiki application root folder:

set RAILS_ENV=development
rake db:create db:migrate db:fixtures:load
ruby script/runner 'create_templates'
ruby script/runner 'create_oup_wiki'

If you want to recreate the database you can do so by adding a drop command to the second command displayed above:

rake db:drop db:create db:migrate db:fixtures:load

This steps above are explained in more detail in the remainder of this section. Edit the database configuration file config/database.yml file, specify the information for your databases or accept the defaults. It is recommended to specify a MySQL user with enough privileges to create and drop databases. With such a setup you can (re)create the database, create some test accounts with a single command executed from the application root:

rake db:drop db:create db:migrate db:fixtures:load

Of course you can split up this command and do it step by step.

  1. Drop the database: rake db:drop
  2. Create the database: rake db:create
  3. Create the database schema: rake db:migrate

The default environment this works on is the development environment, see #How to specify, use the Rails environments if you want to use this for other environments.

Load some test data (optional)

Navigate to the application root and specify to environment

set RAILS_ENV=development

Create some users

rake db:fixtures:load

This command creates the following users:

  1. Administrator andy.kaufman@epf.eclipse.org with password Andy Kaufman.
  2. User cash.oshman@epf.eclipse.org with password Cash Oshman
  3. Central administrator george.shapiro@epf.eclipse.org with password George Shapiro

Create a Wiki using OpenUP

ruby script/runnner -e development 'create_oup_wiki'

Create the Templates Wiki

ruby script/runner -e development 'create_templates'

Run Unit, Functional, Integration Tests

To run the tests you need the gem feedvalidator. See also http://validator.w3.org/feed/. You can install with:

gem install feedvalidator

Test Coverage

To genereate a test coverage report, you can use rcov. This can be installed with:

gem install rcov

You can generate a HTML report with the following commands:

rcov --rails --aggregate rcoverage.data --text-summary --no-html test/unit/*_test.rb
rcov --rails --aggregate rcoverage.data --text-summary --no-html test/functional/*_test.rb
rcov --rails --aggregate rcoverage.data --text-summary --html test/integration/*_test.rb

This will create a directory coverage that contains a HTML report with the test coverage results.

How To

How to specify, use the Rails environments

TODO

Know Issues

undefined method `require_gem'

After upgrade of Ruby Gems things are not working as expected. For instance when you run a rake tasks you get a message similar to

c:/ruby/bin/rake.bat:24: undefined method `require_gem' for main:Object (NoMethodError)

You fix this by reinstalling gems. You can find out what to reinstall by doing a search for require_gem in c:\ruby\bin. You can also replace manually all instance of of require_gem with gem.

Bugzilla Setup

See EPF Composer Development Guide

References

  1. Wikipedia Cheatsheet
  2. EPF Composer Development Guide
  3. Welcome to RadRails, the Ruby on Rails authoring environment for Aptana Studio and Eclipse
  4. CQ2254 IPZilla for HTML editor

Back to the top