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

Revision as of 12:52, 13 December 2007 by Unnamed Poltroon (Talk)

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.

XML File Context Provider Settings

In the configuration for the IDAS registry, there is a setting called "ContextIdsList", which is a list of contexts. The configuration for an XML file context is illustrated below:


<Setting Name="ContextIdsList" Type="htf:list">   <!-- The IDAS registry setting that defines the list of context IDs -->
   <Setting Name="urn:XMLFILE" Type="htf:map">
      <Setting Name="ContextId" Type="xsd:string">urn:XMLFILE</Setting>      <!-- This defines the Context ID.  The name must be a valid URI -->
      <Setting Name="ContextTypes" Type="htf:list">                          <!-- This is the list of context types this context supports -->
         <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 -->

      <Setting Name="XmlFileName" Type="xsd:string">/srv/www/htdocs/mydata.xml</Setting>   <!-- Name of XML file that holds the data -->
      <Setting Name="XmlFileAdminUser" Type="xsd:string">admin</Setting>                   <!-- Name of user to create if the file must be created -->
      <Setting Name="XmlFileAdminPassword" Type="xsd:string">adminpassword</Setting>       <!-- Password of user to create if the file is created -->
   </Setting>
</Setting>

File Format

The XML file context provider detects when the file has been edited outside of IDAS (using a text editor for example), and automatically refreshes its data for IDAS. 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:

<?xml version="1.0" encoding="UTF-8"?>
<Context>

   <!-- The context provider needs to know the attribute IDs for three attributes: user name, password, and card key hash -->

   <UserNameAttrID>http://www.eclipse.org/higgins/ontologies/2006/higgins#userName</UserNameAttrID>
   <PasswordAttrID>http://www.eclipse.org/higgins/ontologies/2006/higgins#password</PasswordAttrID>
   <CardKeyHashAttrID>http://www.eclipse.org/higgins/ontologies/2006/higgins/higgins#cardKeyHash</CardKeyHashAttrID>\

   <!-- Digital subjects are defined by the DigitalSubject element.  The SubjectType attribute specifies the type of the digital subject -->

   <DigitalSubject SubjectType="http://www.eclipse.org/higgins/ontologies/2006/person#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. -->

      <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>
   </DigitalSubject>
</Context>


See Also

Back to the top