Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

XML File CP Configuration

{{#eclipseproject:technology.higgins}}

Configuration

The XML File Context Provider uses an XML file for configuration. The general format of this XML file is defined here: Higgins XML Component Configuration. This configuration is expected to be part of an XRDS document as described here: Higgins Context Discovery Components.

It may also be included in the settings for the IdAS registry. In the configuration for the IdAS registry, there are several settings that must be specified. These are illustrated below (see inline comments for explanations). The settings map that ends up being passed into an instance of the XML file context provider is defined under the ContextIdsList setting, under the particular context ID that is for the XML file context provider - in this case, it is the "urn:XMLFILE" setting under the "ContextIdsList" setting. The other settings illustrated here are for the IdAS registry so it can know how to find a context ID and then what factory to use to instantiate the right context provider for that context ID.

<!-- Settings that will be passed into the context factory instances -->
<Setting Name="ComponentSettings" Type="htf:map">
<Setting Name="XMLFileContextFactory" Type="htf:map"/>
</Setting>
<!--
Java factory class for instantiating the XML File context provider. It has no special settings (see above)
-->
<Setting Name="XMLFileContextFactory"
Type="htf:classinstance">org.eclipse.higgins.idas.cp.xmlfile.NonsharedContextFactory</Setting>
<!--
List of factories supported by the IdAS registry
-->
<Setting Name="ContextFactoryInstancesList" Type="htf:list">
<Setting Name="XMLFileContextFactory" Type="htf:map">
<Setting Name="Instance" Type="xsd:string">XMLFileContextFactory</Setting>
<Setting Name="ContextTypes" Type="htf:list">
<Setting Name="XMLFileContextType" Type="xsd:string">$context+xmlfile</Setting>
</Setting>
</Setting>
</Setting>
<!--
The IdAS registry setting that defines the list of context IDs. In this list, we have shown a context ID that uses the XML File context provider
-->
<Setting Name="ContextIdsList" Type="htf:list">
<Setting Name="urn:XMLFILE" Type="htf:map">
<!--
This defines the Context ID. The name must be a valid URI
-->
<Setting Name="ContextId" Type="xsd:string">urn:XMLFILE</Setting>
<!--
This is the list of context types this context supports. The setting name XMLFileContextType will associate it with the factory that is defined above
-->
<Setting Name="ContextTypes" Type="htf:list">
<Setting Name="XMLFileContextType" Type="xsd:string">$context+xmlfile</Setting>
</Setting>
<Setting Name="ContextUris" Type="htf:list">
<Setting Name="DefaultContextUri" Type="xsd:anyURI">urn:XMLFILE</Setting>
</Setting>
<!--
These are the settings that the XML File Context Provider cares about. These settings are passed into the context provider when a new context is instantiated.
-->
<!--
Name of the XML file that holds the data
-->
<Setting Name="XmlFileName" Type="xsd:string">/somedir/somefile.xml</Setting>
</Setting>
</Setting>

File Format

The XML file context provider detects when the XML file has been edited outside of IdAS (using a text editor for example), and automatically refreshes its data for the provider. It is anticipated that some users will find a text editor to be the easiest method for making changes to the data, although the IdAS update methods are nearly all supported. The file format is very simple. It is illustrated below (see the inline comments for explanations):

<?xml version="1.0" encoding="UTF-8"?>
<!-- The <Context> element defines the context -->
<Context>
<!--
Entities are defined by the <Entity> element. The EntityType attribute specifies the type of the entity
-->
<Entity EntityType="http://www.eclipse.org/higgins/ontologies/2006/higgins#Person">
<!--
Attributes are defined by the <Attribute> element. The AttrID attribute specifies the type of the attribute. The DataType attribute specifies the data type for the attribute values. Note that the context provider determines if an attribute is simple or not by the DataType attribute. These are basically the well known types defined in the idas.spi.ITypedValue interface. Any data types other than these will be considered to be complex types.
IMPORTANT NOTE: There are three attribute IDs that have predefined meanings. These are as follows:
http://www.eclipse.org/higgins/ontologies/2006/higgins#userName. This is the attribute whose value will be the entity ID that gets returned. It is also used in conjunction with the password attribute when a context is opened using the username/password credential type.
http://www.eclipse.org/higgins/ontologies/2006/higgins#password. This is the attribute where the user password is stored (if any). This is used in conjunction with the user name attribute when a context is opened using the username/password credential type.
http://www.eclipse.org/higgins/ontologies/2006/higgins#cardKeyHash. This is the attribute where information card key hashes are stored. Card key hash values are used to open contexts using the self-issued credential type.
-->
<Attribute AttrID="http://www.eclipse.org/higgins/ontologies/2006/higgins#userName"
DataType="http://www.w3.org/2001/XMLSchema#string">
<!--
Attribute values are defined by the <AttributeValue> element. Simple attribute values are stored directly in the element. Complex attribute values will have a sequence of nested <Attribute> elements
-->
<AttributeValue>admin</AttributeValue>
</Attribute>
<Attribute AttrID="http://www.eclipse.org/higgins/ontologies/2006/higgins#password"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>adminpassword</AttributeValue>
</Attribute>
</Entity>
</Context>

See Also

Back to the top