Page 1 of 1
Sharing Queries
Posted: 21 Dec 2020 05:12
by shoshk
My husband and I are both using FH and (mostly) working on the same project. Note: we never open the main project file at the same time. I generally work on a copy of the project.
I would like to automate sharing queries, using an external program which automates backups/mirroring on our computers.
Can I bypass the import query function of fh and simply copy files into the ProgramData->Calico Pie->Family Historian->Queries directory?
Also, can I rename queries by renaming the filename in the Queries directory?
Obviously, this would all be done with the greatest of caution.
Thanks,
Shosh
Re: Sharing Queries
Posted: 21 Dec 2020 08:22
by Mark1834
Yes, both queries and plugins can be copied between PCs, and the lists that come up in FH are simply listings of files in the relevant folder. There is no internal registration process.
Re: Sharing Queries
Posted: 21 Dec 2020 09:20
by shoshk
Thank you Mark.
Re: Sharing Queries
Posted: 21 Dec 2020 11:37
by tatewise
See KB
Synchronising Family Historian between 2 PCs at the bottom under Synchronising Your Configuration and Other Data where it suggests Link Shell Extension or Windows Directory Junctions for ways to include customised Queries, Text Schemes, or any other folders within the Dropbox/Google Drive/OneDrive folder.
Re: Sharing Queries
Posted: 23 Dec 2020 14:54
by shoshk
Mike,
I think I finally understand how to use links.
If I understand correctly, I can copy the contents of the program data folder to, say, dropbox. Then delete the original program data folder and create a symbolic link to the dropbox folder. I could choose to do that for individual folders (say queries) as well.
Is that right?
Are there any potential gotchas?
Shosh
Re: Sharing Queries
Posted: 23 Dec 2020 15:10
by tatewise
The gotchas are the ones mentioned in
Link Shell Extension and
Windows Directory Junctions namely re-installing FH may require the links to be recreated and some cloud storage utilities do not fully support the links.
Re: Sharing Queries
Posted: 27 Dec 2020 14:53
by mjashby
There's a small utility program here -
https://github.com/imDema/FreeMove - which has been designed to help with moving existing user data folders to a new location and auto-creating folder links to avoid problems with software which expects (and continues to expect) files to be stored in specific locations. It's only designed (currently) to manage the movement of complete folders.
I've done some limited testing and it seems to work exactly as described and any changes can be easily reversed
Mervyn
Re: Sharing Queries
Posted: 27 Dec 2020 15:33
by shoshk
Mervyn, that looks interesting.
However, since I'm only setting up one directory at the moment, I think I'll stick with the tried and true manual method. I'm a little afraid of using and unknown person's code and taking a security risk.
Re: Sharing Queries
Posted: 29 Dec 2020 20:39
by Mark1834
I’ve now got this set up to sync custom queries, plugins and fact types between desktop and laptop. The master copies are in a dedicated OneDrive folder, with hard links (directory junctions) set up in the two ProgramData folders.
With it this way round, syncing is immediate and fully automatic.
Re: Sharing Queries
Posted: 29 Dec 2020 20:54
by shoshk
Mark,
I got my custom queries set up today using symbolic links. My husband are now sharing the same queries on our desktop systems. Seems to be working so far.
I haven't yet upgraded our laptops to v7, but will set things up there as well once I'm certain that there's no reason to keep v6 around any longer. I discovered one problem already that was easily solvable because I was able to refer to my v6 installation. I'm in no hurry to upgrade the laptops. We're not planning any trips these days that would necessitate using them.
Plugins are a bit more problematic, since we can't share the same directory. I don't want him to "see" plugins that I'm working on until I'm sure they work. I'll probably set up a directory on dropbox which will contain stable versions of plugins to which he can link. That will make it easy to update when I release new versions.
Hadn't thought about sharing fact sets. Now that you mention it, it seems like another good candidate for sharing.
Shosh
Re: Sharing Queries
Posted: 29 Dec 2020 22:08
by tatewise
You can share any useful customisations using that technique, and here are some ideas to ponder.
Whereas Standard Queries cannot be customised, the Standard Fact Set and Standard Diagrams, Reports, etc, can
So maybe need to include some Standard folders as well as Custom folders?
What about Diagram Text Schemes and Icons?
Regarding development Plugins, I'm sure you could lookup
fhGetContextInfo("CI_PROJECT_FILE") and test the username after
C:\Users\... which if his then abort the Plugin. Alternatively, use Lua
os.getenv (varname) where varname could be COMPUTERNAME or USERNAME etc. i.e. standard Windows SET variables.
Re: Sharing Queries
Posted: 30 Dec 2020 05:36
by shoshk
Regarding plugins...
The main problem for plugin sharing is the case where I am working on an existing plugin. In some cases (say, I'm fixing a bug), I can take the plugin "out of use" for him (which is your suggestion), but in others, there's no reason why he can't continue to use the plugin. This would be the case where I'm adding a new feature. I believe that it will be easiest to have a development/testing environment (my ProgramData->Plugins directory) and a production environment (a shared directory on dropbox). My husband's desktop and our laptops will link to the shared directory.
Sharing reports... That's definitely another candidate for a share folder.