Before creating modifications, an InfoSphere® MDM module
project for modifications must be created.
The MDM development project
The InfoSphere MDM module
project contains a set of related modifications to InfoSphere MDM.
You can create a MDM development projects to extend physical MDM services
using the MDM Development Project wizard. This
wizard generates the necessary components and bundle information used
in the OSGi framework, as well as the metadata, application server
information, database connection information, and other related content
to enable you to begin creating the modifications you want for InfoSphere MDM.
Contents of the MDM Development Project wizard
When
you launch the
MDM Development Project wizard,
there are two dialog boxes that appear in sequence: the
MDM
Development Project dialog box, and the
MDM Development
Settings dialog box:
- MDM Development Project dialog box:
- Project name: the name you assign the project
you are creating
- Use default location: select this to use
the default workspace. Clear it to specify an MDM development project
other than the default
- Location: clear the Use default
location checkbox to specify a location for the MDM development
project other than the default
- Application location: the location of the InfoSphere MDM installation
- Configure: click this link to change the Preferences
(filtered) dialog box for the . This selection
determines how the Workbench generates code for the project being
created.
- Installed application: the default selection,
which is the location of the of the InfoSphere MDM installation
- File System: select to specify a location
for your OSGi bundles other than the current workspace or the default
workspace. This option is only available for use with OSGi.
- Base Java package name: name of the base Java™ package
- Service Namespace URI: URI of the service
namespace
- MDM Development Project Settings dialog box:
- Target runtime: contains a dropdown box where
you can specify the target runtime environment. The installed target
runtime appears in this drop down box. If you have more than one runtime
installed, you can select which target runtime you want this project
to use.
- Application level settings
- Identifier: name of the MDM Development
project you are creating.
- Database schema name: name of the database
schema that contains the runtime tables.
- New Runtime: click to create or connect
to a new runtime that does not appear in the Target runtime drop
down box.
Important: If you get an error reading No
supported target runtimes are available in the MDM
Development Project Settings dialog box, you must click
the New Runtime button to locate a WebSphere® Application Server
runtime, or you must close the wizard and launch the IBM® Installation Manager to install WebSphere Application Server.
- OSGi composite bundle membership:
- Add module to composite: selected by default.
Adds the bundle to an OSGi composite bundle.
- Composite project: drop down box from which
you can choose which OSGi composite bundle to add the MDM development
project
Modifying the module model file
You can
modify the module model file using the MDM development model editor.
This editor provides two tabs that separate general project properties
(the
Overview tab) from the MDM development
model itself (the
Model tab). The
Overview tab
shows the properties supplied when the project was created. In the
Overview tab's
Metadata section, the following two properties define a numerical
range used during code generation to allocate certain unique key values:
- Start ID: The starting value used for allocating
unique IDs.
- Maximum offset: The maximum offset from
the Start ID that can be allocated.
This range is automatically configured when the project is created
to ensure that it does not conflict with other projects in the workspace.
When projects are imported, you may need to manually adjust the Start
ID and Maximum Offset values to ensure a unique range for each project.
Important: When you generate code for your custom projects,
new identifiers (Start IDs) may be assigned to your error
reasons. To verify, view the ID property in
the Properties view for a selected error reason. Set the value of
the ID property to the suffix of the desired
identifier; for example, set the value to 30 if
you want to assign the identifier 10200030.
The project also contains two other files:
- mdmgen.xml: This ANT script is run to generate
code from the module model.
- mdmgen.properties: This file allows you to set
properties that affect the code generation process.
Shared resources project
When you create
a project, for the first time, a shared resources project called
MDMSharedResources will
be created automatically. This shared resources project is created
automatically when you create your first module project, or if you
have an existing installation of
InfoSphere MDM from
which you want to generate artifacts from an
mdmxmi model.
This shared resource project enables any new or existing modules have
a place to share and merge XSD files.
Important: Only
one MDMSharedResources can exist per workspace.
The
shared resources project contains the
application.mdmxmi.
The application.mdmxmi file
contains code generation options that apply to all the modules that
are part of the same application. In particular, you can change the Identifier and
set the database schema name used when generating SQL files in the application.mdmxmi file.
Also,
when you create a project for the first time, the Workbench default
is to associate the project that you create with a
composite
bundle, or
.cba file. Composite bundles
are used in OSGi to group associated modules together so that they
can be deployed jointly to the server. You can associate a project
with one or more composite bundles, or you can opt not to add a module
to a composite. If there is already a composite project in the workspace
it will be selected in the dropdown box in the
MDM Development
Project wizard, or, if there is not yet any composite project,
one will be created automatically using the
Base Java package
name that you enter in the
MDM Development Project wizard.
The composite bundle does not contain code. Instead, it contains metadata
in the form of a
MANIFEST.MF file that lists
the bundles contained by the composite bundle. Like all bundles, the
composite bundle imports and exports packages, declares a version
for itself, and so it has many of the same components in its manifest
that a regular bundle has, but also contains a list of composite bundle
contents. For example:
CompositeBundle-Content:
com.ibm.mdm.server.bundle1, om.ibm.mdm.server.bundle2
When
you deploy a composite bundle, the Workbench
.cba file
that contains the constituent bundles as
.jar files.
The
module model file (module.mdmxmi) file contains definitions
of the customizations that you are developing and is the input for
code generation. Definitions of the various data additions, extensions,
transactions and so on are created in this model. Additional definitions
can be added to this model using the MDM development model editor.
When you are you happy with the model contents, you can use the Generate
code action from within the editor to generate the implementation.
Merged XSDs
When the Workbench generates
code, a reference model is created in the shared resources project
for the module being generated. This allows developers to share the
project with other members of a development team, allowing model validation
to use information from shared modules without needing to share the
original module project or projects that containing all the generated
code and other resources. This helps to keep workspaces small and
more manageable.
During code generation in the Workbench, a
builder in the
MDMSharedResources project looks
for application XSDs, as well as shared resources that are not explicitly
part of the bundle, in order to generate a merged XSD. The
MDMSharedResources project
also holds a schema folder structure that contains a complete merged
XSD:
A full merged schema is maintained in the shared resources
project. This is composed of XSD files from the InfoSphere MDM application,
as specified on the Application Location preference page, along with
XSD fragments from your own modules and any modules which have reference
models in the shared resources project. During module code generation,
the reference model (reference.mdmxmi) is copied
to the shared resources project. There is a builder in the MDMSharedResources
project that notices the reference model and regenerates the XSD fragments
(stored as .xsd-fragment files) from the reference
models to be combined with the XSDs found in the target platform to
create a single XSD in the schema/full folder.
Since no XSDs are copied to the MDMSharedResources project, there
should be no issues with the project contents being out-of-sync with
the target platform.
If errors are encountered during code generation,
problem markers are added to the project to identify which part of
the bundle is causing the problem.