Common Tools between Custom Config's

781
6
09-11-2012 10:40 AM
WarwickAttree
New Contributor
Hi, any ideas on how to have a set of common tools / Widget Group/s to be loaded from a single XML so that this can be shared between a number of custom Config.xml's ?

We have a number of config.xmls for various divisions, and each time a new tool is added or tweaked, then have to manually change all the config files for the new tool.
Would like to call a common tools section from each config file so to lower the maintenance aspect...

Thanks
Tags (2)
0 Kudos
6 Replies
MikeMartin
New Contributor III
You can create a commonwidgets directory and then change the widget xml and swf path to it. For example, I have an apps directory in which each of the FlexViewer apps sit. There is also a commonwidgets directory in the apps directory. Using the eSearch widget as an example, the code in the config file is:
<widget label="Search for HUCs" left="80" top="80"
                icon="../commonassets/images/m_search_right.png"
                config="../commonwidgets/eSearch/eSearchWidget_HUCs.xml"
                url="../commonwidgets/eSearch/eSearchWidget.swf"/> 
0 Kudos
WarwickAttree
New Contributor
You can create a commonwidgets directory and then change the widget xml and swf path to it. For example, I have an apps directory in which each of the FlexViewer apps sit. There is also a commonwidgets directory in the apps directory. Using the eSearch widget as an example, the code in the config file is:
<widget label="Search for HUCs" left="80" top="80"
                icon="../commonassets/images/m_search_right.png"
                config="../commonwidgets/eSearch/eSearchWidget_HUCs.xml"
                url="../commonwidgets/eSearch/eSearchWidget.swf"/> 


Thanks, but not quite, I need to pull in a Widget group to all the Custom configs, if there are 14 Configs, a bit of a pain to copy & paste the group to 14 different apps...
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Warwick,

   The icon, config, and url are just expecting a url to the file location so instead of using a relative url just use a full url that points to a custom virtual directory on your web server that hosts all your common config files. Seems pretty simple and straight forward, or am I missing something...
0 Kudos
WarwickAttree
New Contributor
Robert, yes at a widget level that is true...
As I said, I have 14 different config files for various sections requiring various assortments of layers to be loaded...
If I need to update a Widget group
Eg <widgetgroup label="Tools" icon="assets/images/GeoprocessingTool32.png">      
           <widget�?�..1�?�
<widget�?�..2�?�
<widget�?�..3�?� etc

I then need to copy this change to the 14 different config files�?�
I am looking for an Include type statement that can pull in a xml file of the widget group, on the fly.
This would then place the group in the config file and then I would only need to update the widget group in one place�?�

Make sense ?

Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Warwick,

   OK, that makes sense. There is no such capability though. What you are wanting would require some serious reworking of the ConfigManager.
0 Kudos
RhettZufelt
MVP Frequent Contributor
Have not done exactly this (yet), but it should be pretty simple to have a python script iterate through the list of 14 config files and find the block of text between <widgetcontainer layout="float"> tags and replace it with a the widgetcontainer block from your "template" config file.

Then, whenever you make changes, just run the script (or automate it) and the updates are made in one swoop.

R_
0 Kudos