AWM Model Extension "Local File Property Provider"

In addition to providing a tool this sample enables you to specify a function package linked properties. Linked properties have to be maintained by the parent function package. This means linked property values are not cached by AWM. AWM uses defined API methods to get and set values of linked properties. These API methods have to be implemented by the function package provider.

The sample demonstrates how to specify an AWM tool including the file output parameter and the properties used by the file output parameter. As the file output parameter and its properties are specified by the extension they are automatically generated when the tool is specified in an AWM model.

The sample shows you how to define a Property Provider within a function package definition. The property provider provides the values of three attributes of a file in the local OS system (name, size, and last modified date/time).

The following screenshot shows how this plug-in extends the AWM model extension point. The extension contains a toolType, fileDescriptor, and modelProperty. You can also see the specification of a propertyProvider for three attributes of a local file:


Local File Property Provider Definition

Two AWM models are provided for this sample within the models folder of the plugin project. The first model named GetLocalFiles.model is the same as the model provided with "Get Local Files" sample extension. The second model named LocalFilePropertyProvider.model additionally shows the usage of the linked properties of the samples function package.

The following screenshot shows how the tool Get Local Files is modeled in the sample model. There are two instances of the tool modeled. The first instance is meant to retrieve the content of the user's home directory. The second one retrieves the content of the folder when a path input parameter is provided:


Get Local Files Modeling

The following screenshot shows how the linked properties defined in the function package can be accessed and defined in the model:


Linked Properties Modeling

The Java class GetLocalFilesToolExecutor under the src folder package of the plug-in project shows how the input parameter is obtained if available and how the file output parameter is returned making use of the corresponding AWM API methods. It also shows how the mass processing input is handled within the method executeMassProcessing.

The Java class LocalFilePropertyProvider under the src folder package of the plug-in project shows an implementation of the interface IPropertyProvider.

In your Eclipse run-time environment, you can test the tool by expanding the application under an AWM Custom System. It will show the content of your local user's home directory. Folders under the user's home directory can be further expanded.

Note: In comparison to the GetLocalFiles.model the folder and file name is displayed instead of the resource path in the Application Explorer tree view. In the GetLocalFiles.model only the resource path was available as a resource property.

The application also offers a context menu command Show Properties which displays the attributes of a local resource in an AWM dialog.