Changing URLs from config.json files?

4197
5
Jump to solution
06-10-2016 03:37 PM
Ravichandran_M_Kaushika
Occasional Contributor

dear Readers,

thanks a lot for the support and suggestions.

We have deployed our working application to a dev server.  Sooner, we have to give the contents to the production support team to which we will not have access.

the services consumed (feature n map) are visible - but the place where the web map needs to be created is not accessible to us.

Questions:

1. itemId (web map id) is on the json - is it possible to modify in js file before the map is launched?

2. same for the feature layers listed in json files?  example editor widget (out of the box from esri)/

any suggestions for handling this would be appreciated.

regards

ravi.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Ravi,

In the eSearch widget the layers are inialized in the _initLayerSelect function. So if you were to change the urls in the postCreate function before they are used in the _initLayerSelect function that should work. To change them would be as simple as looping through the this.config.layers array.

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Ravi,

  Are you using a web map? If so will the production machine not have access to this web map for some reason? If the edit widget is using a layer from the web map and the production server has acess to the web map then again you should be fine.

Ravichandran_M_Kaushika
Occasional Contributor

Robert,

thank you for the reply. We are using web map to get all the UI, widgets, webmap on portal, and all feature layers to get started.

We have 'wrapped' Visual Studio 2013 around the whole web map code folders. Since we are a VS shop, we have configured the project to generate the whole deployable website from the build/publish MyProjWebsite option.  We have also figured out to debug JS from the visual studio session.

Under Project --> My Properties --> Property page, In that set "Specific Page" textbox  to "MyProjectVirtualFolder/Default.aspx" - this page was modified using init.html as a starting point. Default.aspx page is created to look like init.html. , this Default.aspx page hands over all captured security n authority credentials and web.config values as var objects to init.js and the behavior is very similar to the web app builder generated app after the init.js is called.

Question re-phrased:

1. all URLs needed for custom widget has been moved to the web.config; read as a config variable in default.aspx.cs, then transferred into a js variable and consumed in the webapp builder based code.

2. In Your enhanced Search widget, there is a place to insert the Feature server Service/0 and that gets inserted into the config.json file. We need to know a way to intercept json config values before they are loaded into the JS files.

3. Same thing applies for itemId value - needs to be intercepted and changed to what is present web.config.

thanks once again Robert for your help and full fledged support to all users.

regards

ravi.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ravi,

  You are in new are doing something I have not tried or heard of others trying. Sorry I can not be of much help here.

0 Kudos
Ravichandran_M_Kaushika
Occasional Contributor

Robert,

good morning. I didn't want to sound sophisticated with all these detailed explanation.

Simpler version of question is:

In that enhanced search tool, if you want to disable or change the feature layer url, is there a way to do it at runtime using some if else javascript condition?

regards

ravi.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ravi,

In the eSearch widget the layers are inialized in the _initLayerSelect function. So if you were to change the urls in the postCreate function before they are used in the _initLayerSelect function that should work. To change them would be as simple as looping through the this.config.layers array.

0 Kudos