Have specific ports only appear in a specific environment

Topics: Bindings File, Settings Management and SSO
May 9, 2013 at 4:07 PM
I have a need to have one specific FTP receive port only appear in the Prod environment (the other environments only use a FILE port for testing). I could put the entire xml for the port into the settings spreadsheet, but it's a large port with a dozen receive locations which would make it pretty unwieldy. I'm hoping there's a better way that I'm just not aware of.
Coordinator
May 13, 2013 at 6:24 AM
You can add a setting (row) in the SettingsFileGenerator.xml Excel workbook named (for example) IncludeFTPPort and in all but the Production column put the value #undef -- literally. In the Production column put True. This will allow XMLPreprocess.exe to handle the logic when processing your master bindings file. #undef says that the property should be undefined at runtime.

If you have the property RequireXmlPreprocessDirectives in your .btdfproj, make sure it is set to True.

Then you can edit your PortBindingsMaster.xml and surround your FTP send port with an #ifdef like:
<!-- #ifdef IncludeFTPPort -->
  <!--
  <SendPort Name="FTPSendPort" etc="...">
  </SendPort>
  -->
  <!-- #endif -->
Please see the XMLPreprocess documentation for more info.

Thanks,
Tom
May 13, 2013 at 10:22 PM
Thanks. That worked perfectly.

I thought it would be something like that, but couldn't figure out the exact syntax.

Also, thanks for all your work on the BTDF. It's come in very handy.
Coordinator
May 14, 2013 at 4:25 AM
Great, glad to hear it. Thanks for the positive feedback -- it's always great to hear!

Tom