0 Replies Latest reply on Feb 23, 2012 12:51 AM by kevinyeandel

    XML over http /xquery etc

    kevinyeandel

      Hi

       

      Just installed FB4 yesterday, can't find a simple set of procs or suitable links to examples.

      I've been using OpenLaszlo and want to switch to FB. Frankly I'm bogged down with FB's "data aware" stuff and emphasis on simplicity.

       

      I have a complex xml hosted on a local Tomcat thus via http://127.0.0.1:8080/instrumentation/logs/test.xml

      This XML is generated from Windows Remoting using PowerShell and is not a fun read and I put a sample below. This XML is updated every minute or so.

       

      What I want to do is pull values from it into fields in custom components inside custom components and can't decide on a simple approach and need some guidance.

       

      I think what I am asking is

      1. Best approach. HTTPService sounds good?

      2. How to run an XQuery against a data source.

      3. How to get the data into a control - this is entirely read-only stuff. I dont want data-aware stuff.

       

      I wouldnt yet know how to use data aware controls but would be interested to know how to get from the XML, e.g. disk size etc.

      e.g. in OL I use:

      text = logsadts1.xpathQuery('adts1:/Objs/Obj/MS[1]/Obj[1]/MS[1]/U64[2]/text()');

      canvas.mydoc.adts1.adts1disksize.setAttribute('text',text);

       

      Can someone give me some headstarts on how best to approach this in FB4?

       

      Many thanks

      Kevin

       

       

       

       

      <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">

        <Obj RefId="0">

          <TN RefId="0">

            <T>Deserialized.System.IO.FileInfo</T>

            <T>Deserialized.System.IO.FileSystemInfo</T>

            <T>Deserialized.System.MarshalByRefObject</T>

            <T>Deserialized.System.Object</T>

       

          </TN>

          <ToString>D:\DocumentumApps\CTS\logs\CTS_log.txt</ToString>

          <Props>

            <S N="Name">CTS_log.txt</S>

            <I64 N="Length">29072771</I64>

            <S N="DirectoryName">D:\DocumentumApps\CTS\logs</S>

            <S N="Directory">D:\DocumentumApps\CTS\logs</S>

       

            <B N="IsReadOnly">false</B>

            <B N="Exists">true</B>

            <S N="FullName">D:\DocumentumApps\CTS\logs\CTS_log.txt</S>

            <S N="Extension">.txt</S>

            <DT N="CreationTime">2012-02-20T13:50:32.6370386+00:00</DT>

            <DT N="CreationTimeUtc">2012-02-20T13:50:32.6370386Z</DT>

       

            <DT N="LastAccessTime">2012-02-20T13:50:32.6370386+00:00</DT>

            <DT N="LastAccessTimeUtc">2012-02-20T13:50:32.6370386Z</DT>

            <DT N="LastWriteTime">2012-02-22T16:35:06.0146004+00:00</DT>

            <DT N="LastWriteTimeUtc">2012-02-22T16:35:06.0146004Z</DT>

            <S N="Attributes">Archive</S>

          </Props>

       

          <MS>

            <S N="PSPath">Microsoft.PowerShell.Core\FileSystem::D:\DocumentumApps\CTS\logs\CTS_log.txt</ S>

            <S N="PSParentPath">Microsoft.PowerShell.Core\FileSystem::D:\DocumentumApps\CTS\logs</S>

            <S N="PSChildName">CTS_log.txt</S>

            <Obj N="PSDrive" RefId="1">

              <TN RefId="1">

                <T>Deserialized.System.Management.Automation.PSDriveInfo</T>

       

                <T>Deserialized.System.Object</T>

              </TN>

              <ToString>D</ToString>

              <Props>

                <S N="CurrentLocation"></S>

                <S N="Name">D</S>

                <S N="Provider">Microsoft.PowerShell.Core\FileSystem</S>

       

                <S N="Root">D:\</S>

                <S N="Description">New Volume</S>

                <Obj N="Credential" RefId="2">

                  <TN RefId="2">

                    <T>Deserialized.System.Management.Automation.PSCredential</T>

                    <T>Deserialized.System.Object</T>

                  </TN>

       

                  <ToString>System.Management.Automation.PSCredential</ToString>

                  <Props>

                    <Nil N="UserName" />

                    <Nil N="Password" />

                  </Props>

                </Obj>

              </Props>

              <MS>

       

                <U64 N="Used">10511863808</U64>

                <U64 N="Free">21697241088</U64>

              </MS>

            </Obj>

            <Obj N="PSProvider" RefId="3">

              <TN RefId="3">

                <T>Deserialized.System.Management.Automation.ProviderInfo</T>

       

                <T>Deserialized.System.Object</T>

              </TN>

              <ToString>Microsoft.PowerShell.Core\FileSystem</ToString>

              <Props>

                <S N="ImplementingType">Microsoft.PowerShell.Commands.FileSystemProvider</S>

                <S N="HelpFile">System.Management.Automation.dll-Help.xml</S>

                <S N="Name">FileSystem</S>

       

                <S N="PSSnapIn">Microsoft.PowerShell.Core</S>

                <S N="ModuleName">Microsoft.PowerShell.Core</S>

                <Nil N="Module" />

                <S N="Description"></S>

                <S N="Capabilities">Filter, ShouldProcess</S>

                <S N="Home"></S>

                <Obj N="Drives" RefId="4">

       

                  <TN RefId="4">

                    <T>Deserialized.System.Collections.ObjectModel.Collection`1[[System.Management.Automation .PSDriveInfo, System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]</T>

                    <T>Deserialized.System.Object</T>

                  </TN>

                  <LST>

                    <S>C</S>

                    <Ref RefId="1" />

       

                    <S>A</S>

                    <S>Z</S>

                  </LST>

                </Obj>

              </Props>

            </Obj>

            <B N="PSIsContainer">false</B>

       

            <S N="VersionInfo">File:             D:\DocumentumApps\CTS\logs\CTS_log.txt_x000D__x000A_InternalName:     _x000D__x000A_OriginalFilename: _x000D__x000A_FileVersion:      _x000D__x000A_FileDescription:  _x000D__x000A_Product:          _x000D__x000A_ProductVersion:   _x000D__x000A_Debug:            False_x000D__x000A_Patched:          False_x000D__x000A_PreRelease:       False_x000D__x000A_PrivateBuild:     False_x000D__x000A_SpecialBuild:     False_x000D__x000A_Language:         _x000D__x000A_</S>

            <S N="BaseName">CTS_log</S>

            <S N="Mode">-a---</S>

            <S N="PSComputerName">ukxxxxxxxxxxx.com</S>

            <G N="RunspaceId">ecf51218-4fe3-40ac-984c-cd79392f9850</G>

            <B N="PSShowComputerName">true</B>

       

          </MS>

        </Obj>

      </Objs>