Jump to content
Monkeybreadsoftware

Split XML for DDR into files for GIT

Recommended Posts

Monkeybreadsoftware

 

SplitDDR.jpgDid you know you can use XML functions in MBS FileMaker Plugin to split your Database Design Report XML files into smaller XML files and put them in a GIT repository?

First you can use FM.RunDatabaseDesignReport function in our plugin to trigger FileMaker to create a DDR by script. Or you use AppleScript for GUI scripting as you can see in this older blog post: Automate creation of Database Design Reports in FileMaker. For FM.RunDatabaseDesignReport, here is an example line:

MBS( "FM.RunDatabaseDesignReport"; 1 /* XML */; "/Users/cs/Desktop"; 0; "Anlagen.fmp12" )

First parameter is 1 to enable XML. Second parameter is folder path, but that is ignored on Windows or macOS Catalina, so please manually make a XML first and point to desktop, so you have always the same folder. Next parameter allows to not open the file and last parameter is to select which files to use for DDR.

Once you have a XML, you may want to split it to put it in version tracking. We got a sample script for next plugin for you. We use Text.ReadTextFile to read the XML file, then use XML.SubTree to get the XML. We loop over all the XML nodes with XML.NodeNames, use XML.SubTree again to get the part and write it to a new XML file. This gives you all the XML files on the top level on the right picture.

Next we did walk over layouts, scripts, tables and themes to write individual files for each item. This includes calling a script for each type to walk over the nodes and write them in files. If there is a group, we can create a folder and call the script again with output going to the new folder. To pass arguments we use JSON to pass XML block and path.

Once you regularly start to write those XML files automatically for all your databases into folders and check them in to GIT or any other version tracking, you can keep track of changes on the databases over times.

The file Split DDR.fmp12 will be included with next 10.4pr1 in a few days. Please do not hesitate to contact us with your questions.
 

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • WE NEED YOUR DONATION NOW

    WE have helped 100,000's of people for many years, now we need your help!!!! Your Donation is Needed to Keep Us Online! Covid 19 and isolation!!!! Without Your Help We Are Gone After 23  Years!



    3% of donation goal reached.
    Donate Sidebar by DevFuse
  • Images

×
×
  • Create New...

Important Information

Terms of Use