Click here to Skip to main content
15,886,362 members
Articles / Programming Languages / Visual Basic

Visual SourceSafe Journal Monitor Service

Rate me:
Please Sign up or sign in to vote.
4.94/5 (12 votes)
27 Jan 200412 min read 151.9K   853   59  
VMS is a windows service developed in .Net that monitors a Microsoft Visual SourceSafe (VSS) database. Customized alerts may be sent based on the defined filters.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

	<configSections>
		<section name="alerts" type="VMS.Framework.Config.Alerts,VMS.Framework"/>
		<section name="users" type="VMS.Framework.Config.Users,VMS.Framework"/>
		<section name="database" type="VMS.Framework.Config.Database,VMS.Framework"/>
		<section name="datastore" type="VMS.Framework.Config.DataStore,VMS.Framework"/>
	</configSections>

	<appSettings>
		<!--
		Location of Journal file.  This can be on your
		local computer or a network share.  Make sure that
		this service has permission to see the file!
		-->
		<add key="JournalPath" value="C:\Program Files\Microsoft Visual Studio\Common\VSS\journal.txt" />
		
		<!-- 
		Number of minutes to wait before checking 
		the journal file for changes 
		-->
		<add key="Interval" value="1" />
	</appSettings>

	<!--
	Time zone is the number of hours offset.  EST = -5 GMT
	Daylight savings time is not taken into consideration.
	If a user does not appear within the users list, then the default
	time zone will be applied to the time that there client recorded the check in.
	-->
	<users dateFormat="MM/DD/YY" timeZone="-5">
		<user name="username" dateFormat="MM/DD/YY" timeZone="-5" />
	</users>

	<!--
	It is possible to store data in 3rd party data stores.  
	This program comes with both Xml and SqlServer.
	As you change data stores, you may have to change 
	each filter in your alerts as well.
	-->	
	<datastore type="VMS.DataStores.Xml, VMS.DataStores.Xml">
		<property name="Path" value="C:\journal.xml" />
	</datastore>
	
	<!--
	Alerts timezone helps identify when timezone the fixed time applies to
	within each alert.
	-->
	<alerts timeZone="-5">
		<!--
		Multiple services may be setup in addition to email, if you so choose
		to program the code to do so.  one idea would be to send instant
		messages to your users when a file is deleted from the project.
		-->
		<service type="VMS.Services.Smtp, VMS.Services.Smtp">
			<!--
			Leaving server blank sends through local machine.
			If username and password are specified, then service
			makes attempt to login to smtp service.  You can even
			use an normal internet service provider email account
			to send email!
			-->
			<property name="Server" value="mail.yourdomain.com" />
			<property name="Username" value="username" />
			<property name="Password" value="password" />
			<property name="SenderAddress" value="username@yourdomain.com" />
			<property name="SenderName" value="Your Name Here" />
<!-- DEMO ALERT: Structure Change -->

			<!--
			deliverCycle represents number of minutes to wait after
			last email was sent before sending another email.
			-->
			<alert deliveryCycle="5">
				<!--
				Filter is specified in an external file as an SQL query.
				If text appeared within the filter element, the template
				file would be ignored in favor of the text.
				-->
				<filter>
				Path LIKE '$/Visual SourceSafe Monitor/%'
				AND Logged > @LastAlerted
				AND EVENT IN('deleted','destroyed','purged','added','moved','restored')
				</filter>
				<!--
				If you want to send emails in text, just don't specify
				the format, or just change it to Text.  otherwise, set
				it to Html for html formatted emails.
				-->
				<property name="Format" value="Html" />
				<!--
				Subject is delivered as the subject of an email message
				-->
				<message subject="Visual SourceSafe - Structure Change">
					<!--
					header - top of message
					item - odd rows of items
					alernateItem - even rows of items
					footer - bottom of message
					
					template attributes may reference external text 
					files on your system.  any existing text within
					each element will override the template file.
					-->
					<header template="Templates/headerStructureChange.htm" />
					<item template="Templates/item.htm"/>
					<alternateItem template="Templates/alternateItem.htm"/>
					<footer template="Templates/footerStructureChange.htm" />
				</message>
				<!--
				The first recipient will appear in the "TO" address.
				each additional recipient will be blank carbon copied
				so that recipients will not know who this email was 
				sent to.  This is useful for very large lists to prevent
				a lot of spam from going around the office.
				-->
				<recipient name="Your Name Here" address="username@yourdomain.com" />
			</alert>
			<!-- Daily Report -->
			<alert  fixedTime="3:00 AM">
				<filter>
						Path LIKE '$/Visual SourceSafe Monitor/%'
						AND Logged > @LastAlerted
				</filter>
				<property name="Format" value="Html" />
				<message subject="Visual SourceSafe - Daily Report">
					<header template="Templates/headerDailyReport.htm" />
					<item template="Templates/item.htm"></item>
					<alternateItem template="Templates/alternateItem.htm"></alternateItem>
					<footer template="Templates/footerDailyReport.htm" />
				</message>
				<recipient name="Your Name Here" address="username@yourdomain.com" />
			</alert>
			<!-- VSS Journal Style Daily Report -->
			<alert fixedTime="3:00 AM">
				<filter>
						Path LIKE '$/Visual SourceSafe Monitor/%'
						AND Logged > @LastAlerted
				</filter>
				<property name="Format" value="Text" />
				<recipient name="Your Name Here" address="username@yourdomain.com" />
				<message subject="VSS Daily Report">
					<header>The following activity has occured.
</header>
					<item>
{2}
Version: {3}
User: {5}	Date: {1:D-5}  Time: {1:t-5}
{4}
Comment: {7}

					</item>
					<footer>Please get the latest version of your project from Visual Source Safe.</footer>
				</message>
			</alert>
		</service>
		<!-- Microsoft Instant Messenger Service -->
		<service type="VMS.Services.Msim, VMS.Services.Msim">
			<property name="Username" value="username@yourdomain.com" />
			<property name="Password" value="password" />
			<alert deliveryCycle="1">
				<filter>Path LIKE '$/%' AND Logged > @LastAlerted</filter>
				<!--
				If you know how to create your own format string, you may
				do so by setting the X-MMS-IM-Format property.  It will
				override all other format properties.
				-->
				<property name="X-MMS-IM-Format" value="FN=MS%20Sans%20Serif; EF=B; CO=ff; CS=0; PF = 22" />
				<!--
				FontName can be any font that you have on your operating system.
				-->
				<property name="FontName" value="MS Sans Serif" />
				<!--
				Determine style of message by setting Bold and Italic
				properties to true or false
				-->
				<property name="Bold" value="True" />
				<property name="Italic" value="False" />
				<!--
				Use 6 hex digits to specify color in RGB format.
				-->
				<property name="Color" value="00ff00" />
				<!--
				Character sets:
				ansi, default, symbol, mac, shiftjis, hangeul
				johab, gb2312, chinesebig5, greek, turkish
				vietnamese, hebrew, arabic, baltic, russian
				thai, easteurope, oem
				-->
				<property name="CharacterSet" value="ansi" />
				<!--
				Font Family: 
				dontcare, roman, swiss, modern, script, decorative
				-->
				<property name="FontFamily" value="dontcare" />
				<!--
				Font Pitch: default, fixed, variable
				-->
				<property name="FontPitch" value="default" />
				<!--
				Align: right
				default = left
				-->
				<property name="Align" value="left" />
				<recipient name="Your Name Here" address="lmoten@csc.com" />
				<message>
					<item>{2} {4}
</item>
				</message>
			</alert>
		</service>
	</alerts>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
If you got this far, you are probably interested in who exactly I am and are eager to pick some knowledge out of my head.

I am a programmer - no doubt. I grew up with an Atari 400 using BASIC and PILOT and saving my programs to a casset tape. Over the years, I would rush to the library looking for books with source code of computer games in them that I could create with basic. After long hours of coding, I would save, then load, and then spend the next few days figuring out where I made a mistake - and even the book for that matter! What I'm trying to say is, you got to learn by doing. Don't give up, and always get help from someone else - wether it be source code, a book, or actually communicating with them on a one-on-one relationship.

I'll admit it - I'm a book worm. I have a shelf full of red books (if you know what I mean), and tons of other shelves of other books. I can't recommend just one, but I have found that Wrox is the best for me. After that, I have O'Reilly and Sams in third.

As far as source code goes, I have my own personal site with source code (and lots of working demos), and other sites that I post code to.

Ok, so we are down to contact info. I have ICQ. If you need the number it is 364308. Pretty low eh? I've been a die hard at this computer stuff for years on end. I even ran my own BBS and was a SysOp on many other BBS's in the Pittsburgh area when the Internet was still known as a toy called "the information super highway".

Ok, I'll close with that and let you go on your way. If you see my code - please vote. If it is bad, put up some feedback letting me know. And if you want to see more to me then just code (I'm an artist too), then just visit my web site.

Comments and Discussions