The <resourceRef> element is an optional child of the <component> element. This element specifies the resource that is managed by the component. This element can only be used by a simple component. This element cannot be used in conjunction with the <componentRefList> element, which can only be used by composite components. The configurable attributes of this element and its children can reference component substitution variables. Resources have implicit PUBLIC access mode. If used, this element can only appear one time.
A component is a simple component if it is derived from a simple component or if it is a nonderived component that contains a <resourceRef> element. A derived component can only contain a <resourceRef> element if it is derived from a simple component.
The <resourceRef> element has child elements, which must appear in the following order:
<installSpec> – A required element for nonderived components that specifies how the resource is to be installed. This element cannot be included in derived components.
<resource> – A required element for nonabstract components that identifies the associated resource. This element cannot be included in abstract components.
By default, a derived component inherits the <resourceRef> element of its base component.
A derived component can override the modifier and the <resource> element of a nonfinal inherited <resourceRef> element by re-declaring the <resourceRef> element. When a <resourceRef> element is overridden, the <installSpec> element is omitted, as its contents cannot be overridden. The <resource> element is specified only if the overriding <resourceRef> is nonabstract.
When a <resourceRef> is overridden, all uses of the resource (including <deployResource> and <addResource>) resolve to the overridden value, including uses in the base component.
If the derived component is declared as nonabstract and the <resourceRef> element of the base component is abstract, the derived component must override the <resourceRef> element.
The <resourceRef> element has one optional attribute, modifier, which has a value of type modifierEnum. The modifier attribute specifies the following override requirements for the resource:
ABSTRACT – The <resource> element of <resourceRef> is omitted and must be specified by nonabstract derived components. A <resourceRef> can only be declared abstract if the component is also declared abstract. A nonabstract <resourceRef> must declare a <resource> element.
FINAL – <resourceRef> cannot be overridden by derived components.
If this attribute is omitted, derived components can choose whether to override the <resourceRef>.
The <installSpec> element is a child of the <resourceRef> element. This element specifies the way in which the associated resource is to be installed. This element is inherited by derived components and cannot be overridden. However, the base component can use component variables to specify values for <installSpec> attributes. The values of these variables can also be overridden.
The <installSpec> element has the following attributes. These attributes can reference component-scoped substitution variables.
name – A required string that is the name to use for the resource when it is installed.
path – An optional string that is the path in which to install the resource. Relative directories are considered relative to the installPath attribute of the containing component. If this argument is omitted, the component's installPath attribute is used by default.
permissions – An optional string that indicates the permissions to assign to the resource when installed.
The string is in the format of an octal triplet, as defined by the UNIX chmod command. See the chmod(1M) man page. If this attribute is omitted, the resource is installed with default permissions.
user – An optional string that is the owner of this resource when it is installed. If this attribute is omitted, the user is determined by the plan executor.
group – An optional string that is the group to assign to this resource when it is installed. If this attribute is omitted, the group is determined by the plan executor.
deployMode – An optional attribute that specifies the way in which the associated directory resource is deployed. This attribute is ignored if the resource is not a directory.
ADD_TO – The directory contents are added to any existing files in the target directory.
REPLACE – The directory contents replace all existing files in the target directory.
If this argument is omitted, the default value, REPLACE, is used.
diffDeploy – An optional value of type boolean, which specifies whether the resource should be deployed in differential deploy mode. If this attribute is omitted, differential deploy mode is disabled. If differential deploy mode is enabled, only resources that have not previously been deployed are deployed.
The <resource> element is a child of the <resourceRef> element. This element identifies the resource to be deployed by the component.
If the referenced resource is a configurable resource, it can contain substitution variable references to any component-scoped variable that is accessible to the containing component.
The <resource> element has the following attributes: