Creating a new ModelModule
Note: a NetBeans or Eclipse plug-in would be advantageous to make this process easier. (Volunteers?)
In the meantime, follow this manual process:
- Pick an identifier for the ModelModule, such as com.example.models.myspecialmodel.
- Create a new NetBeans project with that name (com.example.models.myspecialmodel). Consider the recommended source tree layout.
- In NetBeans' "Files" view, create a new directory called infogrid-models at the root level of the new project.
- Inside infogrid-models, create the file model.xml. Edit the file to capture your Model. It may be advantageous to use an existing model.xml file from another ModelModule as a template.
- Make sure the model.xml file declares its dependencies on other ModelModules correctly. It does not need to declare dependencies on the InfoGrid Kernel, which is presumed as a dependency.
- In NetBeans, select the project folder, and open the "Project Properties" dialog. In the "Libraries" tab, add the required compile-time libraries. These are:
- In NetBeans' "Files" view, edit file build.xml to read as follows:
<?xml version="1.0" encoding="UTF-8"?> <project name="com.example.models.myspecialmodel" default="default" basedir="."> <description>Builds, tests, and runs the project com.example.models.myspecialmodel.</description> <import file="../../../ig-tools/infogrid-ant-library.xml"/> <import file="nbproject/build-impl.xml"/> <target name="-pre-compile" depends="-module-setup"/> </project>
- From NetBeans, build the project. It may be advantageous to turn off the checkbox "Build Projects on Classpath" in the "Project Properties" / "Libraries" tab first as you may not want to build dependent projects at this time.
- In NetBeans, select the project folder, and open the "Project Properties" dialog. In the "Sources" tab, add as "Source Package Folder" the newly generated (from the previous invocation of the build) folder build/module-generated.
- From NetBeans, rebuild the project.
- Add the project to your command-line build, if you use one. Consider the recommended source tree layout in order to use InfoGrid's build facilities.