How to create a custom project
This guide explains how to create a custom project for openCRX. A custom project allows to extend the customizing delivered with the standard distribution of openCRX by adding and modifying
- Headers, footers and logos
- Groovy-based controls
- Code tables
- Wizards
- Reports
- Java classes
- openCRX model and database
A custom project allows you to strictly separate the directory structures of the openCRX distribution and your custom-specific files.
This guide assumes that you have installed openCRX 2.4 / 2.5 SDK (also see here).
Create the sample custom project
In a first step download the distributions for the sample project from here:
- opencrx-2.4.0-sample.jre-1.5.zip
- opencrx-2.5.1-sample.jre-1.5.zip
- opencrx-2.5.2-sample.jre-1.5.tar.gz
and expand to content to a directory of your choice, e.g. c:\temp\SF. This creates the new directory c:\temp\SF\opencrx-custom\sample.
Next create the directory opt in opencrx-custom. The directory structure should then look as shown below.
Next navigate to the folder .\opencrxSdk-2.4.0\repository\distribution (we assume that you have openCRX 2.4 SDK installed).
Extract the content of opencrx-2.4.0-core.jre-1.5.zip to .\opencrx-custom\opt.
Next extract the following archives to the same location:
- openmdx-2.4.0-core.jre-1.5.zip
- openmdx-2.4.0-portal.jre-1.5.zip
- openmdx-2.4.0-security.jre-1.5.zip
- openmdx-2.4.0-log.jre-1.5.zip (not required for version 2.5.1)
Finally the directory structure of .\opencrx-custom looks as shown below.
Next open a shell. Make sure that the environment variables such as JAVA_HOME, JRE_15, etc. are correctly set as described in openCRX 2.4 SDK for Ant Step-by-Step.
Enter the command ant install-src. The command must complete without errors.
Then enter the command ant deliverables. This processes custom-specific models, Java classes and generates JAR libraries. If you get the error build-library.xml:1354: Problem creating zip: Negative seek offset ignore it and run ant deliverables again.
Then enter the command ant assemble. This generates the EARs containing all custom-specific files.
After successfully building the project the directory structure looks as shown below.
- jre-1.5/sample/deployment-units: custom-specific EARs
- jre-1.5/sample/lib: custom-specific JARs
- sample/build.properties: allows to customize project-specific properties
- sample/build.xml: custom-specific Ant build.xml
- sample/src/data/org.opencrx.sample: contains the custom-specific UI extensions. You have to put the custom-specific files such for ui, codes, reports, wizards, etc. in these directories. They are added to the WAR. A very important file is the .\WEB-INF\web.xml which contains the configuration of all servlets.
- sample/src/java: custom-specific Java classes
Next steps
- If you want to rename the project sample by your own name, e.g. myname then you have to adapt build.xml, build.properties and the directory name containing the data files in src/data
- If you want to learn more about UI customizing then see here for more information
- In the near future we will add a guide which shows how to extend the model
Congratulations
You have successfully created your first openCRX custom project.
Attachments
- opencrx-2.4.0-sample.jre-1.5.zip (35.2 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic020.gif (95.5 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic030.gif (32.1 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic040.gif (72.0 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic050.gif (94.5 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic110.gif (20.2 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic120.gif (3.6 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic130.gif (19.5 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic140.gif (37.9 KB) - added by wfro 3 years ago.
- Sdk24.CustomProject.pic150.gif (24.4 KB) - added by wfro 3 years ago.
- opencrx-2.5.1-sample.jre-1.5.zip (32.1 KB) - added by wfro 3 years ago.
- opencrx-2.5.2-sample.jre-1.5.tar.gz (28.5 KB) - added by wfro 3 years ago.








