Developer Guide (version 2.0)

If you are planing to create some OpenKM enhacement, please fell free to tell us across our contact form, because it’ll can be more easilly added on new OpenKM releases and you’ll be notified periodically by mail about some interesting changes on cvs coding that can facilitate your job.

Developer requirements

The developer environment can be set in any Operating System (Linux, Windows, etc…) since it is a multi-platform system, but Linux is recommended, because is what it is being used.

In order to set the developer environment it is needed to install Eclipse Europa for Java EE Developers & Jboss Tools plugins for eclipse, JBoss 4.2.2 version or higher, Java Development Kit 1.5, Google Web ToolKit 1.5.3 and source code.

Eclipse Europa for Java EE Developers
Jboss Tools
Jboss aplication server
Google Web Toolkit

Some useful information about jboss tools could be found on:
JBoss Tools 2.0 GA goes final
Fast and incremental packaging in JBoss Tools
DeployTipsAndBuildSampleScripts

Add “-XX:MaxPermSize=256m” to eclipse.ini on Eclipse Europa to correct some problem with memory.

Finally the Java Development Kit (JDK) 1.5.X is available at java sun website ( download the JDK not de JRE ).

CONFIGURING JBOSS SERVER ON ECLIPSE

At this point we assume that Eclipse, Jboss Tools plugins for eclipse, jboss, and jdk 1.5 are properly installed on your system.

It’s better to configure Jboss Sever 4.X before first time compilation, because some libraries links Jboss Server configuration.

For it we’ll add server configuration on Jboss Server View using New Server option on this tab.

:dev:jboss1.gif

:dev:jboss2.gif

:dev:jboss3.gif

:dev:jboss4.gif

At end process you’ll get something like this:

:dev:jboss5.gif

Downloading OpenKM source code

You ought to access using anonymous CVS user (only authorized users can update files, before obtaining this credentials. Future developers on a first phase must give us their code directly in order to be validated to make sure that you have understood the OpenKM zen).

OpenKM importing code from CVS repository

Import project to eclipse option File / Import and select Checkout Project from CVS option

:dev:import.gif

Put CVS repository values :
Host: openkm.cvs.sourceforge.net
Repository path: /cvsroot/openkm
User: anonymous
Connection type: pserver

:dev:checkoutcvs.gif

Then select the module to check-out openkm

:dev:checkoutmodule.gif

And check out on your workspace with his original name , (i.e. Openkm).

:dev:checkoutname.gif

Select the directory where you want to checkout the code ( i.e. default workspace).

:dev:checkoutfinal.gif

And finally check out the code

:dev:checkoutas.gif

The code will be downloaded in a few minutes

:dev:checkinout.gif

Runtime environment configuration

Looking for JDK 1.5 version

First take a look to correct jdk version compiling on eclipse. Take a look at openkm Properties and on Java Build Path look at libraries. Make sure that the version of jdk 1.5. is correct. If this is not the case, press Edit button, and correct to jdk 1.5 path.

:dev:runjdk.gif

Executing Xdoclet to generate classes

OpenKM uses Xdoclet, you must execute it to generate some classes. Press Keys Shift + CTRL + F1 to run Xdoclet.

:dev:runxdoclet.gif

Setting GWT libraries on OpenKM

Download the GWT 1.5.3 and copy the directory structure on openkm main folder. The directory structure will appear like this way

:dev:rungwt.gif

Refresh the eclipse project to reflect these new files copied, by pressing F5.

Preventing some Project html errors we recomend you delete doc folder from GWT and some .html files on root.

First time compiling project

If eclipse build automatically is not enabled, enable it Project / Build automatically.

Note: Perhaps it will appear some XML error malformed, don’t worry eclipse validator seems not likes xml, because are parts to be merged by xdoclet.

:problems_error.jpeg

Now set visible eclipse project archives tab.

:project1.jpeg

And select some OpenKM folder on Navigator or Project Explorer eclipse tab. This enables project archives project selection ( note that if you’ve got several projects opened at same time, project archives selection depents on your folder selection ).

:project2.jpeg

Project archives is new jboss tool packaging that refreshing war, and ear packages on fly, synchronizing wiht classes and project resources.

Now compile the GWT project for it now we’ve got two external program call, one for frontend and other to administration. Opening external tools you’ll get something like this:

:externaltools1.jpeg

Note that windows users must change generate.sh to generate.bat ( the same to generaback.sh).

Ensure that variables are set propertly for your system (take a look at your JAVA_HOME path).

:externaltools2.jpeg

Then Run external tool ( for frontend and backoffice ).

BE PATIENT THIS COULD TAKE SOME MINUTES !!!!

At this point we’ve compiled and generated all project files.

Configuring Jboss 4.2.X

Create file alias (on windows shortcut file) of openkm project configuration files on jboss home. It will be as follows:

Files need to create alias are:

  • OpenKM.cfg
  • repository.xml

:dev:jbossfilealias.gif

It’s nessary to create alias on deploy for some database definition, it’ll be as follows:

  • openkm-ds.xml

:dev:jbossfilealias2.gif

Optional files to create alias if you want to test property groups:

  • PropertyGroupBundle.properties ( take a look at test_property_group project path )
  • PropertyGroupValues.properties
  • my_groups.cnd ( a testing property groups / metadata ).

Configure security : Configure login-config.xml ( see installation guide or download the openkm project with jboss configured to see it ).

Configure mail service: Configure mails.services and mail-service.xml ( see installation guide or dowload the openkm project with jboss configured to see it ).

Running first time OpenKM on Jboss under eclipse

On Jboss Server View tab, select option add and remove projects then add OpenKM.ear to configured projects.

:dev:jbossfirstrun.gif

Run the server from eclipse( make sure that jboss uses jdk 1.5).

:dev:jbossfirstrun2.gif

If everything runs smoothly openkm has created a new directory on Jboss_Home called “repository”

:dev:jbossfirstrun3.gif

No you can try OpenKM application from your web browser on http://localhost:8080/OpenKM/

Configuring OpenKM project for development

Run Jboss server on debug mode on eclipse:

:dev:jbossdebug1.gif

Remove OpenKM.ear project from server. Select add and remove projects option and remove OpenKM.ear.

:dev:jbossdebug2.gif

Add java source to configuration launch. Select edit configuration launch option and go to source tab.

:dev:jbossdebug3.gif

Add a the OpenKM java project.

:dev:jbossdebug4.gif

:dev:jbossdebug5.gif

:dev:jbossdebug6.gif

Configure OpenKM project archives to explode on jboss deploy folder server. For it select project archives tab.

:dev:projectarchives_01.jpeg

Select OpenKM.war and select Edit Archive option. Enable explode archiving.

:dev:projectarchives_02.jpeg

Select OpenKM.ear and and select Edit Archive option. Change destination to your system jboss deploy path and Enable explode archiving.

:dev:projectarchives_03.jpeg

Note: ensure enable explode archiving option is enabled,sometimes jboss tools seems not setting well. On deploy folder (jboss server) must have a OpenKM.ear directory ( not OpenKM.ear file, if not appears take a look at configuration to see explode is yet enabled ).

Now we can run on debug mode jboss with OpenKM, if all is ok you must see a screen like this.

:dev:projectarchives_04.jpeg

Note: Every changes made on java class is refreshed automatically, and every change on GWT code needs to run external tool to generate frontend or backend.

For fastly compiling we use on development firefox, uncommenting gecko line on file Main.gwt.xml GWT compilation only for gecko browser runs fine. Don’t forget at finish to comment it and try application with IE or other browsers. Now are two files called Main.gwt.xml one for frontend and other to backend

<!-- Compile for firefox only more fastly for developement -->
<set-property name="user.agent" value="gecko"/>

Now we’ll setting GWT Shell Open run window you’ll see some GWT - OpenKM ( jboss ) entry.

:dev:gwtshell.gif

Run it, but ensure that jboss is running too, because shell now is configured as -no server option !!!

:dev:runningshell.gif

Changes between developer guide 1.2 to 2.0

  • Changed IDE to Eclipse Europa / Jboss tools, before was Jboss IDE.
  • GWT 1.5.3 is needed to compile, before was version 1.4.6
  • Changed packaging to new jboss tools packaging.
  • Changed GWT generating to temporary jboss folder to project folders to developing.
  • Added new generateback.sh and generateback.bat to GWT admin.
  • Upgraded jboss server to version 4.2.2GA

Changes between developer guide 1.0 and 1.1 to 1.2

  • GWT 1.4.6 is needed to compile, before was version 1.3.3.
  • Changes on GWT shell configuration, now not uses GWTDS variable ( code deleted ).
  • Configured generate.sh to deploy to tmp jboss with OpenKM.ear deployed to fast developing.
  • Added gecko to Main.gwt.xml to fast compiling only gecko when is uncommented.

Developers support on environment changes

If you are a developer or simply you want to be informed when some changes are made and affect to developer environment, email us and we’ll tell you, because developer guide only it’ll be remixed when a new version it’ll be released at last.

We think development enviroment now is fine, and we doubt change it on new version. Althought it, especially when we make repository upgrades is needed on development to recreate repository several times on a week, this could be unpleasant for some developer if no are informed about it, because one or two weeks could be especially difficult to get a good cvs compiling code without problems. Normally when we are upgrading repository, the developers that are making UI changes must not check-outs cvs code for some time

 
/home/openkm/web/components/com_openwiki/data/pages/developer_guide.txt (5641 views) · Last modified: 2008/10/25 18:30 by jllort
 
Recent changes RSS feed Creative Commons License Donate Valid XHTML 1.0 Valid CSS Driven by DokuWiki