In a previous section it was recommended that users' custom applications and services be placed right inside the project directory. Since Eclipse does not allows multiple projects to be nested inside each other, that method allows one Keel project with multiple source directories defined from each Keel application or service. In this section, we will deviate from the norm and place the user modules outside the Keel project directory. This method works with a source distribution of Keel.
Let's take a project created using Keel's build system and move it. In this case, following previous chapters, we already have app-hoj in the project directory. The application could be moved practically anywhere in the filesystem, but for the sake of simplicity, let's keep it right in the Eclipse workspace directory, which also happens to be the parent directory of our Keel project. So, if the "mykeel" project is in myfiles/myworkspace/mykeel, move the app-hoj directory and its children to myfiles/myworkspace.
We need to change a couple of things due to the altered directory setup. Edit app-hoj/build.xml and change the setting of the "keelmodule" property. Normally it looks like:
<property name="keelmodule" value="${project.dir}/${keelmodule.name}"/>
We no longer have our module in ${project.dir}, but somehwere else, where we now need to point to. In this example, we moved it to the parent of the project directory, so we now change this to (note the subtle "/.." added after "${project.dir}"):
<property name="keelmodule" value="${project.dir}/../${keelmodule.name}"/>
Also, edit $KEEL_PROJ/user-modules.xml, and change the "moduleant" element to correctly locate app-hoj. Normally, it looks like:
<moduleant name="app-hoj" dir="${project.dir}" if="app.hoj"/>
We now change it to point to the new location of app-hoj, i.e. the parent of ${project.dir}.
<moduleant name="app-hoj" dir="${project.dir}/.." if="app.hoj"/>
As before in Section 3.1, “Initial Setup”, start Eclipse pointing to your workspace. Also as before in Section 3.2, “Creating a Eclipse Project For Your Keel Project”, create your project, except skip the creation of KEEL_SERVER and KEEL_CLIENT user libraries.
Right click on the Keel project, and select "Import", as shown in Figure 4.1, “Project Import Menu”.
In the import dialog, browse to $KEEL_HOME/keel-common as shown in Figure 4.2, “Import keel-common” and click "Finish".
Using the same method, import the "keel-core", "keel-client", "keel-container", and "keel-server" modules in that specific order. If you want to you can import other Keel modules, but that is completely optional. Finally, import the app-hoj module in the same way. If all goes well, your workspace should look similar to Figure 4.3, “Completed Keel Workspace”. That's it, Eclipse setup is complete!