This project has moved and is read-only. For the latest updates, please go here.

Master Bindings - Managing Empty Values in the EnvironmentSettings file

Topics: Bindings File, Settings Management and SSO, General Questions, Server Deployment, Tips and Tricks, Visual Studio Integration
May 9, 2011 at 2:49 PM
Edited May 9, 2011 at 2:50 PM

Hi all !

I am dealing with the following situation, in some environments, some values of my environmentSettings for that environment are empty. the problem is when I deploy my app for such environment I am getting an error because in the resulted PortBindings.xml file a empty atributte is generated, then while setting up the bindings to the deployed application, an error is raised!

How can I deal with this problem ? the sintax of the IFDEF supports the adding of some conditional clause ? as follows:

<!-- ifdef ${ _xml_preprocess} -->

<!-- if empty(${ _xml_preprocess}) -->

<!-- <serverAddress>${FTPServer}</serverAddress> -->

<!-- endif -->

<!-- else -->

<serverAddress>localhost</serverAddress>

<!-- endif -->

any help with this is welcome !!!

thanks

Julian R. Berlin


May 9, 2011 at 3:58 PM

Hi Julian,

You can definitely do that.  The documentation for XmlPreprocess is on the home page here, and you can use any valid syntax in your Deployment Framework files.  You may need to set the property <RequireXmlPreprocessDirectives>true</RequireXmlPreprocessDirectives> in your .btdfproj for the conditionals to work.

Thanks,
Tom

May 9, 2011 at 4:40 PM

Hi Tom !! thanks a lot for your answer!

In which section can I take a look to the supported grammar ? auxiliary functions ?. I downloaded the examples but I didn't find anything of I really need. with the clause

ifdef ${ _xml_preprocess} -->

can I check the the content of a given variable defined in the spreeadsheet ?

thanks!

Julian

May 9, 2011 at 5:54 PM

You can use something like this to check if a specific variable is defined:

<!-- #if defined("DoServerCheck") -->

The XmlPreprocess home page has a horizontal menu just below the CodePlex horizontal menu that has a bunch of documentation.  Not all of it is in an intuitive location -- the #if defined came from the "What's New" page, for instance.

Thanks,
Tom

May 17, 2011 at 2:06 PM

Thanks a lot !!! it worked out !!

Julian