The Web Graph Database

wiki:Docs/CreatingNewModelModule

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:

  1. Pick an identifier for the ModelModule, such as com.example.models.myspecialmodel.
  2. Create a new NetBeans project with that name (com.example.models.myspecialmodel). Consider the recommended source tree layout.
  3. In NetBeans' "Files" view, create a new directory called infogrid-models at the root level of the new project.
  4. 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.
  5. 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.
  6. In NetBeans, select the project folder, and open the "Project Properties" dialog. In the "Libraries" tab, add the required compile-time libraries. These are:
  7. 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>
    
  8. 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.
  9. 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.
  10. From NetBeans, rebuild the project.
  11. 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.

See also:

Last modified 5 years ago Last modified on 01/19/10 05:47:18