Naming Components (Aspire 2)

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

All components created within an Aspire installation have a name. Further, like files in a directory, a component name can be a simple name or a full path name.

This method for naming and referencing components provides enormous flexibility when creating your Aspire configurations and reusing components in multiple places.

Simple Names

The simple name for a component is specified when it is configured. For example, the simple name of the following component is simply "FetchUrl":

  <component name="FetchUrl" subType="default" factoryName="aspire-fetch-url" />

Note: The new standard is for all component names to start with a capital letter. This helps distinguish them from pipeline names, factory names, and subType names.

Names of Configuration Managers

The name of the top-level application is specified at the top of its Application Configuration (Aspire 2) file. For example, the name of the following configuration manager would be "FeedOneExample" :

<?xml version="1.0" encoding="UTF-8"?>
<application name="FeedOneExample">
  <components>
    .
    .
    .
  </components>
</application>

Full Path Names

Since every component lives within some other, larger unit (either a component manager, a pipeline manager, or the Aspire application as a whole), all components can be uniquely referenced throughout the Aspire system with their full path name.

In the following example, the full path name for the "MyComponentManager" component manager is "/MyComponentManager" (note the leading slash).

Similarly, the full path name for the "FeedOne" component is "/MyComponentManager/FeedOne", since the "FeedOne" component lives within the scope of the "MyComponentManager" component manager.

<?xml version="1.0" encoding="UTF-8"?>
<application name="MyComponentManager">
  <components>
    <component name="FeedOne" subType="feedOne" factoryName="aspire-tools"> . . . </component>
    .
    .
    .
  </components>
</application>

As a more complex example, consider a component manager which contains a nested pipeline manager, as below:

<?xml version="1.0" encoding="UTF-8"?>
<application name="MyComponentManager">
  <components>
    <component name="FeedOne" subType="feedOne" factoryName="aspire-tools">
      <branches>
        <branch event="onPublish" pipelineManager="MyPipeMgr" />
      </branches>
    </component>
    .
    .
    .
    <component name="MyPipeMgr" subType="pipeline" factoryName="aspire-application">
      <components>
        <component name="FetchUrl" subType="default" factoryName="aspire-fetch-url" />

        <component name="GetCCDMeta" subType="default" factoryName="aspire-getccdmeta">
          <ccdName>/SystemCommon/CCD</ccdName>
          <metadataMap> . . . </metadataMap>
        </component>
        .
        .
        .
      </components>
      <pipelines>
        <pipeline name="doc-process" default="true">
          <stages>
            <stage component="FetchUrl" />
            .
            .
            .
          </stages>
        </pipeline>
      </pipelines>
    </component>
  </components>
</appication>

The full path names for all of the components in the above example are as follows:

  • /MyComponentManager - The application as a whole, a Component Manager
    • /MyComponentManager/FeedOne - A feeder
    • /MyComponentManager/MyPipeMgr - A pipeline manager
      • /MyComponentManager/MyPipeMgr/FetchUrl - A pipeline stage
      • /MyComponentManager/MyPipeMgr/GetCCDMeta - A pipeline stage

Relative References by Name

In the above example, there are two situations where components reference other components.

The first reference, also shown below, is a relative reference. Relative references (without the leading "/" slash) will reference components that exist within the same configuration manager or pipeline manager (i.e., within the same <components> tag).

In the case below, the feedOne component is referencing the pipeline manager using the relative reference "MyPipeMgr":

    <component name="FeedOne" subType="feedOne" factoryName="aspire-tools">
      <branches>
        <branch event="onPublish" pipelineManager="MyPipeMgr" />
      </branches>
    </component>

Note that relative references can also use "." and "..", just like with Unix file-path names.

Absolute References by Name

Components can also reference each other by absolute, full-path references. In the above example (also shown below), the "GetCCDMeta" component references the Content Control Database component by full path name.

  <component name="GetCCDMeta" subType="default" factoryName="aspire-getccdmeta">
    <ccdName>/SystemCommon/CCD</ccdName>
    <metadataMap> . . . </metadataMap>
  </component>

This example shows how a component can reference another component from some other configuration manager.

Implications and Uses

The methods for naming and referencing components within Aspire have many and various implications on the Aspire system.

  1. Configurations which use relative references are portable
    • For example, a pipeline manager which contains relative references for all of the stages that it contains can be copied to other configuration files. The relative references ensure everything remains correctly "wired up".
  2. Shared resources can be referenced by absolute path names
    • In the example above, the shared resource for the Content Control Database was created once and then shared amongst multiple component managers.
  3. All component names follow the same structure
    • This includes, interestingly, pipeline stages, which usually reference components by the relative name. However, if you wanted to share a pipeline stage amongst multiple pipelines or component managers, you could do that with an absolute name, or a more complex relative name (such as "../../OtherPipelineStage").