Groups | Blog | Home
all groups > sql server notification services > october 2004 >

sql server notification services : Help with DOS Scripts


Amit Reddy
10/27/2004 3:57:09 AM
Hi

Thanx Joe and Shyam. Working in XML is not a issue for me, Iam comfortable
in XML\XSL\XPATH. Just that when I was working with the samples, the samples
just keep asking you to run the DOS cmd scripts, without explaining what they
do in detail. When I run the samples all we do is keep changing the setting
in the SetProjectVars.cmd, I cant figure out how these settings picked up
when you build the APPlication in Studio. Also can somebody shed light on
these scripts what do they mean, like %NSEXEPATH%, I know its some path, but
is it a variable which gets replaced when executed , Iam not fimiliar with
DOS, so I really cant figure out what do these DoS scripts do and how, If I
had to make my own, how do I make them.

I totally agree the NS is a g8t product, but building it is so cumbersome,
why do u want a developer to write DOS commands to make the NS apps work,
this could have been easily abstracted from the developer, by providing some
easy to use tool, probably I will write one suc tool, once I understand this
stuff, it is difficult for me to work with it.

I have seen the Books written by you guys, but these are yet not available
in the Indian market.

Thanx once again for the help!!!!!!!
Let me try working with it....

Thanks
Amit
MarkSW
1/13/2005 12:05:06 PM
The basic idea is this:

..cmd file creates environment variables that are availabled to all scripts
subsequently run from that command window as long as that command window is
open.

These are captured for use by the command line (as in the examples)
nscontrol through use of the %VAR% syntax. This is the DOS syntax for using
the current value of the environment variable.

In turn, whatever you pass in on the command line is made available to the
NS config.xml file, like so:

nscontrol create -in %CONFIG_FILE_PATH%%CONFIG_FILE%
EventProviderPath=%EVENT_PROVIDER_PATH%

Here "EventProviderPath" is the NAME of the variable that will be available
to the config.xml. It's VALUE will be the value from the command line for
the environment variable EVENT_PROVIDER_PATH. It's value will be inserted
into the config.xml by using the syntax %EventProviderPath% in the
config.xml. Like so:

<Parameter> <Name>_EventProviderPath_</Name>
<Value>%EventProviderPath%</Value>
</Parameter>

Now, the config.xml has a <Parameters> block of which the above is a
<Parameter> element. All of these are in turn available to the rest of the
config.xml and the ApplicationDefinitionFile.xml under the name used in their
<Name> element, in this case _EventProviderPath_.

Finally, you insert the value of this variable into the .xml configs with
the same %% sytax. Here is the value above being used in my ADF file:

<AssemblyName>%_EventProviderPath_%EventProvider.dll</AssemblyName>

Yes, this is a bit confusing. But once you get it it's great because you
can factor all deployment- and app-specific values into an initial .cmd
script and then parameterize your command line batch files and NS XML configs
to use these variables.

Recapping, the basic flow is:

..cmd file -> command-line .bat file -> config.xml -> adf.xml

Hope this helps.

- Mark


[quoted text, click to view]
AddThis Social Bookmark Button