XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

Using XML to Configure Groove
by Brian Buehling | Pages: 1, 2, 3

Open Software Description File: XMLExample.osd

The XMLExample.osd file shown below is used, when the injector file is processed, to deliver the tool descriptor file (XMLExample.xml) to the user account injecting the tool. The instructions to complete this task are provided within the content of the first SOFTPKG element. The tool descriptor file is identified by the CODEBASE element, and the processing instructions are provided by the content of the Implementation element, namely the Install and Factory elements. Once the tool descriptor file is copied into a user account, it can be added to a shared workspace.

This file is accessed a second time when users add the XML Example tool to a shared workspace for the first time. The second SOFTPKG element is used to locate the tool template file (XMLExample.tpl). Tool templates contain information about the application components that make up the tool. Consequently, they are parsed and imported into the Groove environment rather than just copied like tool descriptor files. However, the instructions for this processing are contained within the content of the Implementation element.

Groove OSD File -- XMLExample.osd

<g:Document Name="XMLExample.osd" xmlns:g="urn:groove.net">

<!-- NOTE: Case sensitivity is important for directory/file names -->
<SOFTPKG NAME="net.dakotasystems.Groove.XMLExample.
XMLExample_XML" VERSION="0,0,0,0">
  <TITLE>XML Example</TITLE>
  <IMPLEMENTATION>
    <LANGUAGE VALUE="en"/>
    <CODEBASE HREF="http://www.dakotasystems.net/Groove/
XMLExample/XMLExample.xml"/>
    <g:Install Type="Copy" TargetDir="$GROOVEDATA$\XML Files"/>
    <g:Factory Name="Open" Type="Temporary XML Document" 
      Filename="$GROOVEDATA$\XML Files\XMLExample.xml"/>
  </IMPLEMENTATION>
  <DEPENDENCY>
    <SOFTPKG NAME="net.dakotasystems.Groove.XMLExample.
XMLExample_TPL" VERSION="0,0,0,0">
      <IMPLEMENTATION>
        <LANGUAGE VALUE="en"/>
        <CODEBASE HREF="http://www.dakotasystems.net/Groove/
XMLExample/XMLExample.tpl"/>
        <g:Install Type="Import To XSS" 
          DatabaseURI="$TEMPLATESURI$" 
          DocumentName="XMLExample.tpl"  
          SchemaURI="$DEFAULTSCHEMA$"/>
        <g:ComponentURLProvider ProgID="Groove.TemplateParser"
          DatabaseURI="$TEMPLATESURI$" 
          DocumentName="XMLExample.tpl" 
          Argument="XMLExample.tpl" 
          DocumentType="Template"/>
        <g:Factory Name="Open" 
          Type="XML Document" 
          DatabaseURI="$TEMPLATESURI$" 
          DocumentName="XMLExample.tpl"/>
      </IMPLEMENTATION>
    </SOFTPKG>
  </DEPENDENCY>
</SOFTPKG>

</g:Document>

Those familiar with the OSD NOTE, submitted to the W3C by Microsoft and Marimba in 1997, will notice that, although similar, Groove's implementation of OSD differs slightly as it allows for finer granularity; it identifies software components, not just software packages.

Descriptor File: XMLExample.xml

The descriptor file shown below provides all the necessary information to register the XML Example tool in the Groove environment. Not only does this file contain basic tool metadata, like as name, description, author and version, but it also points to the OSD file that stores the location of the tool template, which is accessed when a tool is first added to a shared workspace.

Groove Descriptor File -- XMLExample.xml

<g:Document Name="XMLExample.xml" xmlns:g="urn:groove.net">
  <g:TemplateDescriptorList>
    <g:TemplateDescriptor
      Name="XML Example"
      LongName="XML Example"
      Category="\groove\starter"
      Description="XML.com Groove Example"
      Author="Brian Buehling"
      HelpAbout="Created by Dakota Systems Inc., Copyright 2001"
      ReleaseDate="July 2, 2001"
      Version="0,0,0,0"
      Type="Tool"
      ResourceURL="http://www.dakotasystems.net/Groove/XMLExample/
XMLExample.osd?Package=net.dakotasystems.Groove.XMLExample.
XMLExample_TPL&Version=0&Factory=Open"/>
  </g:TemplateDescriptorList>
</g:Document>

Tool Template: XMLExample.tpl

The tool template shown below defines each of the components that make up the XML Example tool. These components are COM objects that implement Groove's IGrooveComponent interface, and they represent the building blocks of all Groove tools. Groove components are either provided as part of the standard platform, like the ones in this example, or developed independently. In either case they have to be explicitly defined in each tool template. The XML Example tool defines a ViewContainer, HTMLLayout, and Static component named YourViewContainer, YourLayout, and GrooveLabelComponent respectively.

Groove Tool Template -- XMLExample.tpl

<g:Document Name="XMLExample.tpl" xmlns:g="urn:groove.net">
<g:ToolTemplate DefaultToolDisplayName="XMLExample" 
  Name="XMLExample.Tool" TemplateDisplayName="XMLExample">
  <g:ViewInfo Lifetime="Limited"/>
  <g:ComponentGroup DefaultView="YourViewContainer">

  <g:Component Name="YourViewContainer">
    <g:ComponentResource URL="http://components.groove.net/
Groove/Components/Root.osd?Package=net.groove.Groove.ToolComponents.
GrooveCommonComponents_DLL&Version=0&Factory=ViewContainer"
      FingerprintID="Groove"/>

    <g:PropertyList Version="1">
    <g:Property Name="Background">
      <g:BackgroundStyle Style="SectionBackground"/>
    </g:Property>
    </g:PropertyList>

    <g:ComponentConnections>
      <g:Connection ConnectionID="0" Name="YourLayout"/>
    </g:ComponentConnections>
  </g:Component>

  <g:Component Name="YourLayout">
    <g:ComponentResource URL="http://components.groove.net/
Groove/Components/Root.osd?Package=net.groove.Groove.ToolComponents.
GrooveCommonComponents_DLL&Version=0&Factory=HTMLTableLayout"
       FingerprintID="Groove"/>

       <g:PropertyList Version="1">
         <g:Property Name="Layout">
           <g:PropertyValue>
             <TABLE CELLPADDING="2">
               <TR>
                 <TD HEIGHT="30" WIDTH="100%">
                    GrooveLabelComponent
                 </TD>
                 <TD/>
               </TR>
            </TABLE>
           </g:PropertyValue>
         </g:Property>
       </g:PropertyList>
    </g:Component>

    <g:Component Name="GrooveLabelComponent">

      <g:ComponentResource URL="http://components.groove.net/Groove/
Components/Root.osd?Package=net.groove.Groove.ToolComponents.
GrooveCommonComponents_DLL&Version=0&Factory=Static" 
       FingerprintID="Groove"/>

      <g:PropertyList Version="1">
        <g:Property Name="Style" Value="Normal"/>
        <g:Property Name="HAlignment" Value="Center"/>
        <g:Property Name="BreakType" Value="WordBreak"/>
        <g:Property Name="Label" Value="XML Example Tool"/>
        <g:Property Name="FontStyle" Value="LabelText"/>
      </g:PropertyList>

    </g:Component>
  </g:ComponentGroup>

</g:ToolTemplate>
</g:Document>

Pages: 1, 2, 3

Next Pagearrow