MasterBindingsFile and SettingsFileGenerator Automation

Topics: Bindings File, Settings Management and SSO, General Questions, Tips and Tricks
Feb 22, 2011 at 7:59 PM

I am in the process of writing a utility that fully automates the process of taking the BindingInfo.xml file that is exported from BTSAdmin and automagically generating the MasterBindings.xml and associated SettingsFileGenerator.xml files.  I have a semi-automatic process now that allows me to create a new MasterBindings file from scratch in about 2 minutes start to finish.  (1.75 minutes of manual editing)  Variable names are automatically generated based on the application name, port identifier, and tag.  I have a couple quirks to work out here regarding how <Filter> tags are handled but I digress.  My question is actually related to the SettingsFileGenerator.xml file.  My current process creates a text file with the raw xml needed for each row in this file, and then I manually copy this xml into the SettingsFileGenerator.xml file from within Visual Studio or Notepad++ (to access the raw xml)  then update the ss:ExpandedRowCount to reflect the addition of the rows I add.  My attempts at automating this insertion of rows has been very frustrating and futile.  My question is two fold,

1.) How is the BTDF or xml-preprocessor reading these settings from the SettingsFileGenerator.xml file?  Are they using LINQ to XML or XDOM or something else?

2.) Would BTDF be able to read the SettingsFileGenerator.xml file if I were to create a raw xml file that was not compatible with Excel?  I understand that Excel is most likely being used to make it easier to hand edit but oddly enough, at least for me, it makes it significantly harder to edit in an automatic fashion.

 An example schema would be as follows:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Settings">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Header">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="NameColumn" type="xs:string" />
              <xs:element name="DefColumn" type="xs:string" />
              <xs:element name="DevColumn" type="xs:string" />
              <xs:element name="IntColumn" type="xs:string" />
              <xs:element name="StgColumn" type="xs:string" />
              <xs:element name="PrdColumn" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element maxOccurs="unbounded" name="Setting">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="NameColumn" type="xs:string" />
              <xs:element name="DefColumn" type="xs:string" />
              <xs:element name="DevColumn" type="xs:string" />
              <xs:element name="IntColumn" type="xs:string" />
              <xs:element name="StgColumn" type="xs:string" />
              <xs:element name="PrdColumn" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Any feedback/answers you have would be very beneficial in wrapping up this utility.  Sorry for posting to so many topics but I just wanted to make sure there was enough exposure.

Thank you,

Coordinator
Feb 22, 2011 at 8:27 PM

Hi, that sounds like a useful utility.  Once you have it perfected, maybe you'd consider contributing it for a future release?

You can take a look at this code to see how the spreadsheet is read during export.  Some of it uses direct XML access (XPathDocument) and some uses the OLE DB driver, depending on the file type.  Of course, it is much simpler reading vs. writing to SpreadsheetML.  You may be able to insert relatively easily using the OLE DB driver, so that would be worth a look.

Here are a couple of references that may be useful:
http://msdn.microsoft.com/en-us/library/bb226687(v=office.11).aspx
http://msdn.microsoft.com/en-us/library/bb226693(v=office.11).aspx

Thanks,
Tom 

Mar 31, 2011 at 4:29 PM
Tom,
I finally go the utility perfected. Thank you so much for your guidance and I'm sorry for the delayed response, but our project got really busy there for a while. Can you send me an email privately? I have some things to discuss with you regarding the sharing of the utility but it can not be done in the public forum.
Thank you,
Ron



On Tue, Feb 22, 2011 at 2:27 PM, tfabraham <notifications@codeplex.com> wrote:

From: tfabraham

Hi, that sounds like a useful utility. Once you have it perfected, maybe you'd consider contributing it for a future release?

You can take a look at this code to see how the spreadsheet is read during export. Some of it uses direct XML access (XPathDocument) and some uses the OLE DB driver, depending on the file type. Of course, it is much simpler reading vs. writing to SpreadsheetML. You may be able to insert relatively easily using the OLE DB driver, so that would be worth a look.

Here are a couple of references that may be useful:
http://msdn.microsoft.com/en-us/library/bb226687(v=office.11).aspx
http://msdn.microsoft.com/en-us/library/bb226693(v=office.11).aspx

Thanks,
Tom

Read the full discussion online.

To add a post to this discussion, reply to this email (biztalkdeployment@discussions.codeplex.com)

To start a new discussion for this project, email biztalkdeployment@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com