The metadata.json file defines the
components, policies, and links between specific source and target
component types for the Pattern Builder.
Other files are referenced from the metadata.json file,
such as image files for icons to display in Pattern Builder.
The metadata describes how Pattern Builder visually
displays components, links, and policies and determines which configuration
parameters are exposed to users. You can modify the metadata.json file
with the PDK JSON Editor.
Procedure
- If you already have the PDK JSON Editor open
for your plug-in project, click the Application Model tab.
Otherwise,
- In the Project Explorer view,
expand the plug-in project node.
- Expand the plugin folder node.
- Expand the appmodel folder node.
- Double-click the metadata.json file,
or right-click the file and select .
The
Overview tab, which shows the
structure and contents of the plug-in, is displayed. This tab has
four sections:
- Package
- Lists the parts, node parts, and roles in the plug-in. Click Add to
add a part, node part, or role to the plug-in.
- Metadata
- List the components, links, and policies in the plug-in. Click Add to
create a metadata element in metadata.json.
- Runtime
- Provides links to the metadata.json, operation.json,
and tweak.json files for the plug-in.
If an item is available for editing in Eclipse, you
can double-click to open it.
- Click the metadata.json link on
the Overview tab, or click the Application
Model tab to customize the metadata.json file.
From this tab, you can:
- Add or remove parts, node parts, or roles in the plug-in.
- Add or remove application model elements by metadata type (component,
policy, or link) to the list of metadata elements.
- Click a metadata element in the list to open the Application
Model tab, where you can view and modify the following
metadata details:
- ID
- Label
- Description
- Category (for component type)
- An associated image file (for component and policy types)
- An associated thumbnail image file (for component and policy types)
- Applicable components (for policy type)
- Source and target components (for link type)
- Add and remove attribute types (string, string-options, string-radio,
string-password, string-multi, number, number-percentage, boolean,
array, array-options, file, or range)
- Modify attribute type information, specifying ID, Label, and Description
information, and whether the attribute is required.
- Manage the order in which the attribute information is displayed
in the Pattern Builder.
Values that you specify are immediately validated, and
errors, such as missing required fields, duplicate IDs, are flagged,
with help tips, for correction.
In some cases you might prefer
to modify the configuration text directly, by clicking the
metadata.json tab
to present the configuration information in a formatted text editor.
Changes that are made in either the
Application Model user
interface or the source text editor are immediately reflected in both
views.
Note: If you use a string attribute type with a regular expression
(RegExp) that contains a slash (/
),
the expression might be truncated. To avoid this issue, use an escape
sequence (\
) before each /
in the
regular expression.