wiki:Doc/SCDB/Eclipse

Version 2 (modified by /C=FR/O=CNRS/OU=UMR8607/CN=Michel Jouvin/emailAddress=jouvin@…, 17 years ago) (diff)

--

Using Eclipse with SCDB

Eclipse is an open source IDE (Integrated Development Environment), written in Java and thus available on all platforms, that provides a file browser, an editor, a SVN client, access to compilers and lot of other tools. It is neither part of SCDB, nor a requirement to use SCDB.

With SCDB, it brings a graphical interface for administering SCDB and editing templates. With very few customization, Eclipse can be used both to edit templates, compile them and deploy them while taking advantage of all the advanced features you find in Eclipse like local history, file browsing and searching, ability to open a template directly at the line causing an error...

Instructions in this page explain how to customize Eclipse for SCDB. This is not an introduction to Eclipse usage itself. Refer to online documentation in Eclipse. Configuration described here has already been tested on Linux, MacOS and Windows but should work on any other platforms as all components used are pure Java.

Installation

Installating Eclipse

Eclipse can be downloaded from http://www.eclipse.org. Installing Eclipse mainly consists to unarchive the distribution. The archive format is dependant on the platform (zip, tar...).

Before being able to run Eclipse, you need to install Java JRE or JDK on your machine. SCDB requires Java 1.5 or later. You need to check on Eclipse site minimum Java version required by Eclipse. As of Eclipse 3.2, it was lower than SCDB.

If you have several Java JRE o JDK installed on your machine, run Eclipse, goto Preferences->Java (in Window menu) and check the version used by Eclipse matches both Eclipse and SCDB requirements.

Note : Java JDK is required only for some advanced operations like generating new OS templates. Java JRE is enougth for every day administration of SCDB.

Installating Eclipse plugins

For Eclipse to work with SCDB, some additional software, called plugins, needs to be installed. To do this, run Eclipse and use Software Updates->Find and Install... in Help menu. Then add a new remote site for each of the following plugins :

After adding each site, select them and click on Finish button.

Configuration

Colorer

Colorer is used to do syntax colouring when editing PAN templates.

Syntax colouring rules are defined in a file pan.hrc that can be downloaded from Quattor CVS (in elfms/Quattor/utils/eclipse). This file must be placed in /path/to/eclipse/plugins/net.sf.colorer_VERSION/colorer/hrc/auto.

Then an entry for these syntax colouring rules must be added to /path/to/eclipse/plugins/net.sf.colorer_VERSION/colorer/catalog.xml. This is done by editing this file and adding the following line to the hrc-sets: <location link="hrc/auto/pan.hrc"/>

Last, add an association between .tpl file extension and Colorer Editor. To do this, go to Window->Preferences->General->Editors->File Associations, add .tpl and associate the Colorer Editor with it.

For the new Colorer configuration to be taken into account, you need to restart Eclipse.

Sunshade

Sunshade is used to parse PAN compiler output. Regexps appropriate to PAN compiler output must be added, using Window->Preferences->Sunshade->Errorlink in Eclipse. The required regexps are :

\[pan-syntax\]\s*(.*\.tpl):(\d+):
\[pan-compile\]\s*(.*\.tpl):(\d+)
\[pan-syntax\].*[\s\(](.*\.tpl)

JavaSVN and certificates

When using JavaSVN in combination with certificates, you must add the password in the ~/.subversion/servers file. Make sure that this file has correct access rights (as it contains cleartext password, it must have mode 400).

A full example looks like :

[groups]
somegroup = some.full.host, *.some.domain
[somegroup]
ssl-client-cert-file = /bla/bla/bla.p12
ssl-client-cert-password=hahahahaha
[global]
ssl-authority-files = /bla/bla/bla/ca_local.crt