previous next trail start tutorial home feedback openwings.org

The edit command

The edit command allows editing of policy files, which you will use as part of deploying your component.  Policies provides a way for components to be installed and executed in a variety of environments. A more detailed explanation of policies is provided in the Using Policies section of the Developing Components trail.

For now, just keep in mind that there are several kinds of policy files that you can edit.  You can use any text editor to edit any of these XML files, but we've provided some graphical tools to make it easier.

  1. Component descriptor policy XML files (-cd option).  These are usually titled "ComponentDescriptor.xml" or something similar.
  2. Installable component descriptor policy XML files (-icd option).  These are usually called something like "InstallableComponentDescriptorPolicy.xml".
  3. Other policy files, including policies within JAR archives (-pe option)

Syntax:

edit -cd [<file>]
edit -icd [<file>]
edit -pe

To edit a component descriptor or installable component descriptor, type the edit command followed by the appropriate switch (-cd or -icd), followed by the file name.  A graphical editing window will pop up, allowing you to view and modify the values in the policy file.  You may have to use the lcd command in the shell beforehand (to navigate to the file you want to edit) before issuing the edit command from the command line.

Example: Assume the Image_im demo component has been installed. Use the lcd command to change directory to <openwings_root>/Image_im/policies and key in the command

openwings@root/> edit -icd InstallableComponentDescriptorPolicy.xml

 

Click above image to see full size

At the top of the editing window, you will see a toolbar with a row of buttons.  Let the cursor linger over a button to view a short description of what it does.  The New buttons create a new cd or icd policy file (in memory, not on disk).  The Open buttons allow you to open a saved file from disk.  Select a file in the left-hand list and click the Save button to save a policy file to disk.  Select a file in the left-hand list and click the Delete button to remove it from the list. This action will not erase the file from your disk (if it exists).

The toolbar contains a Template Wizard button (magic wand). Click the button and then select a template from the list. This feature allows you to start with a pre-made template instead of filling in all the fields from scratch.

The large right panel of the editor contains the fields you can modify.  Click here for more information about the different policy editor fields. To determine how to use policies, review the Using Policies section of the Developing Components trail.


Long-time Openwings users may remember an older policy editor that we included with our alpha release.  This is a plain-vanilla editor that allows you to edit any policy type, including policies within Jar files.  Use the edit -pe option to bring up this editor, if you prefer it over the new ones we've included.

Future releases of Openwings will include a unified editor application which will auto-detect the type of policy that you are trying to edit.  At that time, you will no longer need to use the -cd, -icd, and -pe switches.

Next: The findclass command

back to top

© Copyright 2002, General Dynamics Decision Systems. All rights reserved.

previous next trail start tutorial home feedback openwings.org