Facility Control

 View Only
  • 1.  XML Usage

    Posted 05-18-2014 22:47
    Is there any way to modify the order that the variables are displayed in the XML? I built something that has the to a lot of global variables being driven by user input and reading from another xml but I did all of the actually work before declaring the the variables that I actually need my Xpression to read. So instead of putting my ball and strikes varaibles, which are numbered 0X001 and 0X002 by the way, at the top of the xml I have to scroll through all the xml and datalinq to something in the middle.

    On a related note, is there any ability to update an xml source? Like read the season stats of a team, modify them in game and then save over the original for season statistics? Or is there any push for this feature or reading/saving directly from a more user friendly CSV file?


  • 2.  RE: XML Usage

    Posted 05-19-2014 14:14
    Hi Daniel,

    I'll address your variable ordering question in this post, and the xml file writeback in another.

    If you use version 6.1 of DashBoard and 5.4 or later of XPression, you can use the streaming method of sharing state with XPression. I made a video on how to do this: PanelBuilder 302 that's accessible from the DashBoard U part of our website.

    This should address the "I can't find my variables" problem though migrating to this method will require you to refactor your app.

    Something that may work, but I've never tried is to use a code editor such as notepad++ to simply move the declaration of your variables in the xml file that accompanies your grid file.

    Hope this helps,

    John

    #DashBoard


  • 3.  RE: XML Usage

    Posted 05-19-2014 14:29
    Ok - to the question of writing back XML files.

    This is something that's supported in DB 6.2 Beta which is available for download for windows only at the moment. You can use this function call in ogScript:

    var success = ogscript.saveToFile('[path]', '[data]', [overwrite]);

    function callback(success, sourceFilePath, exception)

    {

    overwrite, if true will cause any existing file to be overwritten. I don't know what happens if it's false and there's an existing file. It may throw an exception, or it may just append. I'll experiment with this.

    data is either a string, or byte array that you want to write to the file, OR (and this is the good bit) an XML document object, such as created by the ogscript.parseXML() method.

    I think this is just what you need - let everyone here know if it helps!

    John

    #DashBoard


  • 4.  RE: XML Usage

    Posted 05-19-2014 19:37
    John I tried the restructuring with notepad because it looked simple enough in principle but the order was changed back as soon as the dashbaord grid was updated. My Dashboard project is a little big and unwieldy right now to port it all over line by line to a different one. I will have to download the beta tonight and try to get the write over working. Will the beta open my existing .grid without any problems?

    #DashBoard


  • 5.  RE: XML Usage

    Posted 05-19-2014 19:46
    the beta should open your existing grid file with no problems, Daniel. I'm sorry the moving the xml around approach didn't work.

    John

    #DashBoard


  • 6.  RE: XML Usage

    Posted 05-20-2014 13:41
    You will also need to make sure your *.grid file is not open in DashBoard when you edit it in Notepad++.

    You could also restructure the XML document without leaving DashBoard y going into edit mode, double-clicking one of the elements on the screen, selecting the root of your *.grid file from the tree on the left, and selecting the "source" tab on the right.

    #DashBoard