SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[11.3.279 Pro] - Export settings to XML

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[11.3.279 Pro] - Export settings to XML
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post [11.3.279 Pro] - Export settings to XML Reply with quote
Is there a quick and simple way (a button? or a hotkey?) that would export the settings (contents of the sqlassist.sas) to an .XML file to a predefined path with a predefined name (by predefined I mean defined somewhere in an .ini file or in the settings). I'm contemplating about giving a try to plugin development we discussed some time ago here, but I'm willing to settle for a slightly less sophisticated (but still quick and not overly inconvenient) solution if it takes considerably less amount of time to implement it.

I mean if it could be done by executing a simple command-line call with some switches or options, and it wouldn't take the time and effort to learn how to create plugins, make the usual mistakes, fix the bugs while creating other ones, and then having to fix those too :), I'd be quite happy with that.

EDIT: the only thing I've found in the User Guide regarding this topic is
Quote:

Add the following command to each SQL Assistant user's logon script:
"C:\Program Files (x86)\SQL Assistant 11\SQLAssist.exe" /merge:<export>
Replace the <export> placeholder with the full file path and file name of the export file. If the
export file name or path includes space characters, you must enclose the entire /merge:<export> parameter value in double-quotes

on page 603. But that only merges the settings, and I need exporting and importing (replace) besides being able to merge.
Wed Nov 11, 2020 7:55 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Reply with quote
To the best of my knowledge, there is no simple built-in one-click method or hot key for exporting to a predefined XML file. If you don't need a particular kind of XML formatting, you can use many existing scripts available on the internet to convert SQL Assistant's settings file to XML. Google for "powershell convert ini to xml" From a plugin witch you can associate with a hot key you can run powershell or other command with parameters that will do the conversion for you and save it wherever you need it.

Another way of getting the settings file present wherever you need it is creating a symbolic link to the file
https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/


The file sharing and merging feature is designed for supporting centralized maintenance of code snippets, formatting rules, etc... that can be shared with a team as well as be stored in a source control system. For example a script can be run on login to download newer versions from github or other repository and save to a local folder, then run the /merge command to merge it with the local settings.
Thu Nov 12, 2020 3:41 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post Reply with quote
I've tried converting the .sas to many things (XML, YAML, TOML, JSON, carousel, wooden barrel, whatever) but none of them worked out very well. Most of the stuff couldn't be reverted, eg. I could convert the .sas to YAML or JSON but the reverse operation failed with the message that the source was invalid. I guess that was because .ini does not allow newlines in values so you used \x0e\x0b instead and most of the converters I tried online were completely perplexed by the presence of those unusual "characters".

The only thing that was marginally better was converting it to XML, but as it was, no formatting was applied of any sort and the result was, well ugly. The reason I wanted it to convert into XML because your method did replace those \x0e\x0b pairs with newlines and while it was not quite pretty, it was at least readable, and I could compare it to the one saved in the repository.

My current workaround is that I search-replace each occurrence of \x0e\x0b with \x0e\x0b\n and store that in the repository. The comparison app I use is able to handle those characters and this way I can compare the current with the repo-saved one and see the changes. And if I have to restore something I can just do the search-replace in reverse. And who would have thought the whole stuff can be done in just 3 lines of Python code :) I'm not exactly "gifted" when it comes to PowerShell.
Sat Nov 14, 2020 5:46 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.