Joy, frustration, excitement, madness, aha's, headaches, ... codito ergo sum!
This is just a test comment... ;-)
Pretty cool stuff. I helped design a "transparent prevalence" engine that sits on top and automatically builds the command objects when using a contextbound objects (might be in there now). Still, I prefer a solid relational DB, but it is fun for experimental stuff. --Jesse
Jan, Sounds like a sweet project. I myself wanted to take a look at it but there were no files to download and evaluate. Also, I know a manager @ Cox Communications who would love this. He wants to automate the builds of all of his projects. Is there anyway I could look at it. Regards Mathew Nolton email: mnolton@cybral.com
More about Hippo.NET : Jan Tielens' Bloggings
Hippo.NET, sounds like a killer tool! : Paul Gielens Blog
So would the loop variable still be valid after the loop completes, or is the variable out-of-scope outside the loop? For Each item As Customer In CustomerCollection ' Do Stuff Next Is item valid here? Also, what if the outer scope also has an item variable, like this? Would this be a compile-time error? Dim item As Integer ' Do Some Stuff For Each item As Customer In CustomerCollection ' Do Stuff Next
So would the loop variable still be valid after the loop completes, or is the variable out-of-scope outside the loop? -> The variable is out-of-scope outsite the loop. Also, what if the outer scope also has an item variable, like this? Would this be a compile-time error? -> Yes, this would result in an compile error.
Looks excellent. A minor point. In the second screenshot it says builded. It should be built.
Hi, I have created the same Macro for C# on http://www.reflectionit.nl/Macro.aspx. There are also some other macros for adding try/catch/finally blocks and using blocks. The SortCode marco might be a bit buggy. Regards, Fons
ShowUsYour-Blog!
More on VS.NET macros : Chad Osgood's Blog
Cool Macros Snipped : ShowUsYour-Blog!
Macro-economics : Jimski's Blog
I've also added some comments about this to my blog if you are interested in reading them at http://www.addressof.com.
VERY slick! That one is going in my library :)
Don't forget to add a second dataset with the column schema matching your xml elements. Then you can merge the two. AND don't forget caching the results so as not to put too big a burden on the rss server :)
I've not used the SoapExtension class before, but I have done encrypted web services with Web Service Enhancements (WSE). You can download it and read articles here: http://msdn.microsoft.com/webservices/building/wse/default.aspx It's not quite as easy as just adding encrypt:=EncryptMode.Response) to the message, but it follows the WS-Security spec and should interop with other implementations. -Dustin
When testing SoapExtension, do not use IE (because it uses the GET protocol), create a simple client in vs.net (it could be console app) and test (that will use SOAP protocol)
Jan Tielens' Bloggings
This is nothing compared to the type of completion you can get from shells like bash under linux or cygwin, but it's definitely something. I wonder why it isn't turned on by default though (remembering the key is a pain)... See ya, Dumky
You can use TweakUI to add this, and it's enabled by default in WinXP.
congrats! I'm getting married on the 18th of July. Wes
Gefeliciteerd, Jan! I married on May-30th, 2002, and I can honestly say: it's great. :) As a tip: I created a website where every guest of our wedding could upload his/her pictures. This was a big success, others could now fast and easy see other people's pictures about the wedding. If it's not too much work, I'd surely do that (make it protected with a username/password of course :))
You went from Overpelt to Brussels... guess I could attended as well.
Attributes!
Which attributes ;-) Thx Jan
Hi Jan. I'm one of the guys at Microsoft who works on the Power Toys. I wanted to let you know a little bit about the PowerToys effort. I promise that we didn't work on these projects to displace third party tools. I actually think that all of the commenting tools you mention have their plusses and minuses. And at the moment some are more polished than the one our team released. One of the motivations included giving people samples from Microsoft for extending the shell. You can never have too many samples. Another is that we just thought it would be a cool project to work on and provide a forum for other developers in the community to also work on. Actually, we’ve been in contact with the writer of the VBXC tool you mentioned and he has recently joined our workspace project on gotdotnet that allows for other people to modify the code. If your interested feel free to check out our workspaces.. http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=107870 Thanks, josh
A bonus of a lot of the third party tools is that they work in VS 2002 and 2003. The powertoys are just for 2003. It is opensource as you say so I do wonder how hard a 2002 port would be.
Good one!
Nice. Thanks By the way, this only works in VS 2003. In VS 2002 it chokes on ass = Reflection.Assembly.LoadFile(ref.Path) LoadFile is not a member of Assembly.
Jan, This sounds like an interesting little project. Any plans for NAnt support?
You must add at least a little more information for a quick start if you want to be able to catch peoples attention and hold it.
seems like its only for windows XP...
It was my pleasure ;-)
After running the installutil on the server it still didn't show up in the Services list. Can't the server just run as a normal program as well. It's kinda lame that I have to jump thru so many hoops just to try it out.
You should post in the MS newsgroups. It helps a lot. Start threads on forums. Add the site to google. I pimped your tool on a dutch forum (gathering.tweakers.net) in a thread about buildtools. Advertise more through simply PR. :) Look at Eric Smith. He marketed his tool this way and his tool is now one of the most well known ones. (I did the same with LLBLGen, and it works :))
Sorry Jan, I have some problems in vs.NET 2003. I keep getting a "Could not find file "" in the referenced libraries." Even with
Sorry Jan, I have some problems in vs.NET 2003. I keep getting a "Could not find file "" in the referenced libraries." Even with your own example of xmlreader. And in C# and in VB.net
Personnaly I think a service is the correct way to run the server. If the install and the uninstall work, there should not be any hoops just to try it out. Y
Hi Yves, I think you have a small problem with the selection of the Type to be found. My macro is written so that it searches for the type that is typed in front of the cursor. So you don't need to select anything. Just type the name of the type, without a space after it, and call your macro. Let me know if you have any problems, Jan Btw: I'm really looking forward to your blog!
he-he. ass.GetTypes
First of all, congratulations!! I browsed through the article and liked it, but there is one aspect of collection usage which you neglected to mention- serializability. Quite often the collections must be portable enough to be remoted or web-serviced. This type of requirement is often known in advance and should be factored in when choosing/designing data structures.
Thx Addy Thanks for your tip! The next part of the article series will cover building strong typed collections, so Serializability will certainly be mentioned. Jan
What about integration with SourceGear Vault??? We've opted for this instead of VSS...
Well, generating files for still changing projects only online does not help at all.
Great macro, however, I've made to changes. First, the namespace directive is added AFTER existing directives, and second, the macro will check first, whether the namespace is already added: Public Sub AddDirective() Dim text As TextSelection = DTE.ActiveDocument.Selection text.WordLeft(True) Dim t As Type = SearchType(text.Text) If Not t Is Nothing Then Dim keyword, suffix As String Dim line As Integer = text.AnchorPoint.Line text.Text = t.Name Select Case DTE.ActiveDocument.Language Case "CSharp" keyword = "using" suffix = ";" Case "Basic" keyword = "Imports" suffix = String.Empty Case Else Throw New System.Exception("Invalid Language: " & _ DTE.ActiveDocument.Language) End Select Dim alreadyUsed As Boolean = False text.StartOfDocument() text.WordRight(True) While text.Text.StartsWith(keyword) And Not alreadyUsed Dim startpt As EditPoint = text.BottomPoint.CreateEditPoint() Dim endpt As EditPoint = text.BottomPoint.CreateEditPoint() endpt.EndOfLine() endpt.CharLeft() If endpt.GetText(startpt) = t.Namespace Then alreadyUsed = True End If text.LineDown() text.StartOfLine() text.WordRight(True) End While If alreadyUsed Then DTE.StatusBar.Text = "Namespace " & t.Namespace & " is already imported." DTE.StatusBar.Highlight(True) text.MoveToLineAndOffset(line, 1) Else DTE.UndoContext.Open("Add Namespace Directive") text.Insert(keyword & " " & t.Namespace & suffix & vbCrLf) DTE.UndoContext.Close() DTE.StatusBar.Text = "'" & keyword & " " & t.Namespace & _ suffix & "' added to the document." DTE.StatusBar.Highlight(True) text.MoveToLineAndOffset(line + 1, 1) End If text.EndOfLine() End If End Sub
this thing doesn´t work!!!!
this thing doesn´t work
the site doesn´t work the tool doesn´t work i am frustrasted digitald0815@freenet.de
I tried it with one of my .csproj files and got: System.NullReferenceException: Object reference not set to an instance of an object. at Hippo.BuildFileBuilder.Builder.ReadProjectFile(String projectContents) in C:\Visual Studio Projects\Junk\Hippo.BuildFileBuilder\Hippo.BuildFileBuilder\Builder.vb:line 276 at Hippo.BuildFileBuilder.Builder..ctor(String projectContents) in C:\Visual Studio Projects\Junk\Hippo.BuildFileBuilder\Hippo.BuildFileBuilder\Builder.vb:line 233 at Hippo.BuildFileBuilder.Web._default.Button1_Click(Object sender, EventArgs e) in C:\Visual Studio Projects\Junk\Hippo.BuildFileBuilder\Hippo.BuildFileBuilder.Web\default.aspx.vb:line 38
Hey I live in Belgium and I blog. Just venturing into dot net. Hope to blog about it...
I thought that Belgium was barred from TechEd? Supposedly Bill Gates is getting pressure from the US DOD. Well anyway maybe they can all say they were crazy for the day and had stood down. Sort of like the Belgian King did.
Amsterdam is not in Belgium, Don ;) It's the capitol of The Netherlands, you know, windmills, wooden shoes, tulips (and legalized pot and prostitution, the Amsterdam red light district, gays can marry ) I'm happy it's gonna be close to home (I'm in the hague, 45KM's from amsterdam) :) Now I just have to save some cash to pay the entrance fee :)
Would they give free tickets to Uni students? They did for the Devdays in november...One more reason to stay in college :)
Thanks for sharing this! I'm new to .NET and this is an immense help.
If the flight was the only problem, you could just as well have gone this year. We were offering free flights to U2U clients... y
Yeah - that was circulating awhile back. I sent it to my CS professor who was quite a nut about maintainable code and style. I thought it was a lot funnier until I dealt with code that prescribed to a few of the techniques mentioned. Apparently, whoever wrote the code thought this article was not being sarcastic :)
Yup, VMWare rocks - with one caveat. You need a pretty beefy machine. I'm running vmware on a Pentiu III 1 Ghz w/ a half gig of RAM, and it's a little slow. It's a bit snappier on a faster machine, though. If you run vmware, invest in plenty of RAM, and disk space for OS images. I do a lot of release engineer / setup.exe kinda stuff, and tools like this and ghost are extremely valuable.
"Connectix is a product with the same features and is recently bought by Microsoft. I haven't tried it out, so any experiences/comparisons would be appreciated!" Jan: http://www.pcmag.com/article2/0,4149,1134339,00.asp
I had problems installing 9.1 with it. :(
I have always thought VB.NET was missing a programming syntax, on top of a few thousands other things. Glurp!
Wow, what a nice comment Stephane! It's really adding something to the discussion. Thx!
Huh. Forgot about edit and continue, how that for forgetful?? Its my single most important gripe that its not there....
ISerializable
Hi Jan. I've been a long-time fan of VMWare too, and I've been using it for all sorts of things, but recently I've converted to Connectix Virtual PC. My three main reasons are: 1) CVPC doesn't make such a big assault on your machine. There are no additional netwerk adapters that appear after you've installed it, and there are no services that run all the time, even if you're not using it. 2) It allows you to resize the screen of your virtual machines to almost any size you can drag the window to, instead of the "standard" sizes that VMWare allows. 3) On my machine, I'm pretty sure CVPC is faster than VMWare (haven't doen any measurements, it just feels snappier...) Apart from that, they're pretty much alike.
Let me the first of hopefully many to correct you both in that C# has Edit and Continue in VS.NET 2003 (which has been out for some months).
And Visual Assist.NET (http://www.wholetomato.com) adds #1, #3, #4 among many other things. I find it a must have.
Hey, I have an idea...why the fuck don't you just turn C# into VB.NET...that seems to be what you are trying for...
I've installed the current Debian distribution on VMware 4. No problems so far.
Since I am a C# developer with C++ background, please let C# case sensitive! Regarding the With statement, it's hard to convert VB.NET samples to C# because of the missing WithEvents statement.
Hi, i'm trying to implement the same thing but it still doesn't work !!! When there is only the remoting "concept" everything is fine but when I introduced events nothing works anymore !!!! Furthermore, the client application have to be in the same directory as the server... Can somebody help me ? Thanks
It would be nice to have: 1. the build requester in the build loggings. (windows account on client?) 2. A possibility to copy the directory with the dll's from the server to the clients from within Hippo. 3. Does the path has to be set on the server. This requires rebooting of the server. (for the system account in the service to get it) Can it be done in the config file? 4. some errors result in a crash of the client programm. (servfer down) 5. The error you get when the path to nant isnt set on the server could be better. Thanks.
Which reminds me of Joe Reich's tip: http://www.cyphersolutions.com/joe.reich/downloads/tip.jpg
C# is also missing a background compiler, which helps greatly with IntelliSense. VB.NET is missing operator overloading. C# is missing a simple mechanism for late binding. VB.NET is missing unsigned types. C# is missing optional arguments. VB.NET is missing unsafe code. The list goes on and on. And to clarify a previous post, VS 2003 does NOT provide Edit and Continue for VB.NET or C#.
Request: It would be nice if you could update the server code from the client without requesting a build. (You also can do a "get latest version" on the server, but there are no working folders set.) Automatically creating a buildfile for the project and the possibility to manage the main buildfile (add project, move project in buildsequence, comment project, ...) would be nice options. Very minor issues: If you start the Hippo client with a shortcut, and the windowstate is minimized, you regulary get errormessages but everything works. The Hippo buildfile builder (beta version!) always sets references to c:\Windows somtimes this is winnt. I do not think this can be changed in the website. But who knows, maybe sometimes in the client?
The download for 1.2.0 of hippo.net doesn't contain a hippo.server.exe.config file. Is there one available somewhere else? Thanks, Eric
I extracted the files to C:\Hippo, went to C:\Hippo\Server and typed: installutil hippo.server.exe and got the following error: C:\Hippo\Server>installutil Hippo.Server.exe Error dispatching command/test named 'Hippo.Server.exe' Here is the list of valid command/test/option names: +------------------------------------------------- | registerdatapath | registersqlanywherepath | registersqlanywherebinpath | getdatapath | getsqlanywherepath | getsqlanywherebinpath | registersqlanywhereodbcdriver | registeroracleoptions | getoracleoptions | validateschemarepovendorinfo | validateuservendorinfo | validatedbisempty | describelastinstalledschemarepo | initemptyschemarepo | relocateschemarepo | relocateuserdb | convertuserdb | convertschemarepo | copyuserdb | copyschemarepo | clientregisterschemarepo | registerschemarepofromfile | adddbset | dropdbset | renamedbset | copydbset | disconnectuserdb | reconnectuserdb | exportschemarepo | exportoldschemarepo | importschemarepo | exportschemafromuserdb | upgradeschemareposystemversion | upgradeuserdbsystemversion | unlockschemarepo | unlockuserdb | catchuptestdbs | cloneschema | deleteschema | purgedeleteduserdb | restoreuserdbschema | clearstatemachine | setschemarestriction | setrecursionlimit | dropchoicelist | checkin | uncheckout +------------------------------------------------- I'm guessing this is because the download doesn't include a hippo.exe.config file.
Bored??? on your honeymoon??? You are a true geek ;)
Congratulations on the wedding! And Roy's right - leave the books at home. If you're bored, that's sad :)
Which time zone are you in...? It's still July here in the UK. 8-)
http://erablog.net/filters/16633.post
Jan, I actually found your Blog site from reading your article. Yep, like the summary of Collections alot. Explained the difference better than reading 5 times that in a book or working it out for myself reading the .NET reference. thanks, Adam
Definately a cool feature that we need for our projects but sadly not yet integrated with the VSS piece. Any plans to release a beta version packaged together in the near future? The big win of course is that the nANT script is always in sycnch with your project. What about being able to generate a script for multiple projects within a solution, any plans there? This is something we could definately use right now and as long as its fairly solid we'd be willing to demo it and give you feedback. keep up the good work, Scott
Agree fully with Scott. Will the buildfile builder be able to handle multiple project files in a solution? has the object reference bug been fixed yet? If that is this the case it could be very useful tool for our project.
My solution to this when I first ran into it was to write a quick article about it on my ASPAlliance column. You'll note that my first articles at http://aspalliance.com/stevesmith/articles/ are REALLY basic ASP stuff. This is because I was a consultant learning and bouncing around between client locations, so this provided me with a central repository for such snippets that I wanted in my virtual toolbox, and had side benefits of helping others and providing me with great exposure. You might use the articles feature here, your own site, or sign up to become an ASPAlliance columnist and get free space there plus a lot of exposure in the community. Steve
When will the buildfile generator be implemented in Hippo? I would like to try to push my company to using this, but since our project files change frequently, it is not an option to update the buildfile using the leadit website. If it's not going to be included anytime soon, is there a command line generator or are the classes available in cvs to do this?
Most of what I have seen requires a desktop app that uses a web service to get updates. http://www.vb2themax.com/codebox http://www.fmsinc.com/dotnet/SourceBook http://www.artifactsoftware.com http://www.artifactnetwork.com
Is there a .Net1.0 build of HippNet?
http://dotnet.4all.cc/ freeware :>
Imports EnvDTE Imports System Imports System.Collections Imports System.Diagnostics Imports System.Reflection Imports System.IO Public Module TypeFinder Private Class TypeCache Public Shared Cache As Hashtable = New Hashtable() End Class Private Function SearchTypeInAssembly(ByVal typename As String, ByVal ass As Reflection.Assembly) As Type DTE.StatusBar.Text = "Searching for '" & typename & "' " & ass.GetName.Name & "..." If (Not TypeCache.Cache.ContainsKey(typename)) Then Dim t As Type For Each t In ass.GetTypes If t.Name.ToLower = typename Then TypeCache.Cache.Add(typename, t) Return t End If Next Else Return TypeCache.Cache.Item(typename) End If End Function Private Function SearchType(ByVal typename As String) As Type typename = typename.ToLower.Trim.Replace(";", "").Replace(".", "") Dim ass As [Assembly] Dim currentAss As String Dim currentPath As String Dim t As Type Dim p As [Property] 'search in principal assembly ass = Reflection.Assembly.LoadWithPartialName("mscorlib") t = SearchTypeInAssembly(typename, ass) If Not t Is Nothing Then Return t 'search in assemblies in solutions Dim proj As Project For Each proj In DTE.ActiveSolutionProjects 'search in references of current project Dim ref As VSLangProj.Reference For Each ref In proj.Object.References ass = Reflection.Assembly.LoadFrom(ref.Path) t = SearchTypeInAssembly(typename, ass) If Not t Is Nothing Then Return t Next currentAss = "" currentPath = "" 'obtain properties to get assembly associated with project For Each p In proj.Properties If (p.Name = "OutputFileName") Then currentAss = p.Value ElseIf (p.Name = "LocalPath") Then currentPath = p.Value End If If currentAss.Length > 0 And currentPath.Length > 0 Then Exit For Next 'search in the assembly associated with the project currentAss = currentPath + "bin\" + DTE.Solution.SolutionBuild.ActiveConfiguration.Name + "\" + currentAss Dim tempAss As String = currentAss + "2" Try Try If (File.Exists(tempAss)) Then File.Delete(tempAss) End If Catch End Try 'we copy de assembly to be sure that when the compilation will be launch the file could be written File.Copy(currentAss, tempAss) ass = Reflection.Assembly.LoadFrom(tempAss) t = SearchTypeInAssembly(typename, ass) Try File.Delete(tempAss) Catch End Try If Not t Is Nothing Then Return t End Try Next DTE.StatusBar.Text = "Could not find type '" & typename & "' in the referenced libraries. Make sure your cursor is right behind the text or selected!" DTE.StatusBar.Highlight(True) Return Nothing End Function Public Sub AddNamespace() Dim text As TextSelection = DTE.ActiveDocument.Selection If (text.Text.Length = 0) Then text.WordLeft(True) Dim t As Type = SearchType(text.Text) If Not t Is Nothing Then text.Text = t.FullName text.EndOfLine() DTE.StatusBar.Text = "Ready" End If End Sub Public Sub AddDirective() Dim text As TextSelection = DTE.ActiveDocument.Selection If (text.Text.Length = 0) Then text.WordLeft(True) Dim t As Type = SearchType(text.Text) If Not t Is Nothing Then Dim keyword, suffix As String Dim line As Integer = text.AnchorPoint.Line text.Text = t.Name Select Case DTE.ActiveDocument.Language Case "CSharp" keyword = "using" suffix = ";" Case "Basic" keyword = "Imports" suffix = String.Empty Case Else Throw New System.Exception("Invalid Language: " & DTE.ActiveDocument.Language) End Select Dim alreadyUsed As Boolean = False text.StartOfDocument() 'Skip the headers text.WordRight(True, 2) While text.Text.StartsWith("/*") Or text.Text.StartsWith(" *") Or text.Text.StartsWith("//") text.LineDown() text.StartOfLine() text.WordRight(True, 2) End While text.StartOfLine() text.WordRight(True) Dim lineTarget As Integer = text.AnchorPoint.Line Dim correctPlace As Boolean = False While text.Text.StartsWith(keyword) And Not alreadyUsed And Not correctPlace Dim startpt As EditPoint = text.BottomPoint.CreateEditPoint() Dim endpt As EditPoint = text.BottomPoint.CreateEditPoint() endpt.EndOfLine() endpt.CharLeft() Dim currentText As String = endpt.GetText(startpt) If currentText = t.Namespace Then alreadyUsed = True ElseIf (currentText < t.Namespace) Then text.LineDown() text.StartOfLine() text.WordRight(True) Else correctPlace = True lineTarget = text.AnchorPoint.Line End If End While If alreadyUsed Then DTE.StatusBar.Text = "Namespace " & t.Namespace & " is already imported." DTE.StatusBar.Highlight(True) text.MoveToLineAndOffset(line, 1) Else If (correctPlace) Then text.GotoLine(lineTarget) DTE.UndoContext.Open("Add Namespace Directive") text.Insert(keyword & " " & t.Namespace & suffix & vbCrLf) DTE.UndoContext.Close() DTE.StatusBar.Text = "'" & keyword & " " & t.Namespace & suffix & "' added to the document." DTE.StatusBar.Highlight(True) text.MoveToLineAndOffset(line + 1, 1) End If text.EndOfLine() End If End Sub End Module
Nifty and useful especially for middle & backend people (like myself) when they need to design a colorful presentation. Cool!
Thanks for the credits :-) However, I did some more customization some time ago. I will compare it to your new version and maybe suggest some more improvements ;-) Regards, Thomas
Really good macro...I don't know how easy it will be, but is there any way to have it look up namespaces in the same assembly - so, say for instance you defined a struct in say MyProject.Structs and in MyProject.Classes.Test you're typing away and want to use one of the structs in MyProject.Structs, it'd be very useful if the macro could look in there too (or am I missing something and it already does it??)
Umm...ignore me, I see it already tries that...however for me at least (using VS.NET 2003) it fails - seems to get stuck in a specific Assembly and get nowhere else so doesn't find the correct NameSpace
Hi Jan, Other enhancements I have added in my version is to wrap the process in an Undo context, so a single undo will change everything back. simply add this before your changes: Dim CloseUndoContext As Boolean = False If DTE.UndoContext.IsOpen = False Then CloseUndoContext = True DTE.UndoContext.Open("TypeFinderAddDirectiveMacro", False) End If and add this after your changes: If CloseUndoContext Then DTE.UndoContext.Close() Another change I made was to check for the "Option" statement (VB only) and make sure the Imports statement was after that. With the changes that now check for existing namespaces that might not be needed, but worth looking into. Keep up the great work.
From a performance standpoint, your conclusion misses the mark IMHO. Client-side validation is simply not minimal nor trivial. Sure, business logic tiers can do the most sophisticated validation possible and each tier should be responsible for complete error and validation checks. Sure, point by point everything you say before your conclusion is dead on. But to conclude with the phrase "...some minimal trivial validation at the client side..." is to completely miss the consideration every good developer can never forget: performance. A much better way to conclude this excellent post is "... as much validation as the client side can handle...".
Dave You are completely right! I maybe did not speak about performance. But I do think not all validation can be or should be on the client. I'll make some adjustments to my conclusion. Thanks for your reaction!
Especially in a SOA, you'll need some sort of client-side validation. Validate the message against an XSD for example before sending it to the server. If you're using Enterprise Services or Remoting and your entity objects are [Serializable] .NET objects, then you can also work alongside the metadata level by defining some new custom attributes, like public interface IValidatable { // empty. This is just a marker. } [Serializable] public class Customer, IValidatable { [MaxLength(30), NonNull] public String Name; [MaxLenght(35), NonNull] public String Firstname; [NonNull, RegExp("...")] public String SSN; ... } You can then generate a generic routine public ValidationResult Validate(IValidatable obj) { ... } this routine would check for all fields/properties and their custom attributes. It would then extract the current values of these fields and compare them to the definitions. The ValidationResult object works like a collection which contains as many validation errors as found. That is, if FirstName == null and SSN doesn't match the regexp, then ValidationErrors would contain two entries pointing to the FieldDefinition object and to the validation rule which failed. These single ValidationError objects will also contain an human readable message. The ValidationResult would also include some generic Enum value which specifies "Ok", "MightBeOk", "IsNotOk" or whatever ;-) The cool thing is that you can develop different validation routines for server and client while essentially reusing most of the logic. And you can generate some nice documentation by using Reflect - this documentation would then also include all your validation rules. Just an idea, though ... -Ingo
Oh ... you can make it even more flexible if the new custom attributes (like the NonNullAttribute) contain the logic to check the current values. let's say: public class ValidationAttribute: Attribute { public abstract ValidationError Validate(object currentvalue, string fieldname); } public class NonNullAttribute: Attribute { public override ValidationError Validate(object currentvalue, string fieldname) { if (currentValue == null) { return new ValidationError(fieldname + " should not exactly be null."); } return null; } } The generic Validate(IValidatable obj)-method would then in fact first iterate over all existing fields and properties, then iterate over each custom attribute of the given field/property, checks if the attribute derives from ValidationAttribute, and calls Validate() on each attribute, passing the current value and the field name into it. -Ingo
I would turn this upside-down. Given the current platform, by default full validation should be implemented both client-side AND service-side. Of course deviations form this scenario do apply, but each one should be a consious descision. Unless we can build a Palladium style trusted distributed computing environment, there can be no exceptions to full validation on the service-side. You can not trust your clients integrity. Client side there can be lots of reasons to skip full validation, as various trade-offs apply, but the principle should remain: "full validation unless ...".
I am speaking off the top of my head here and this was awhile back... I vaguely remember some issue I was dealing with then the browser didn't support JScript for whatever reason and thus client-side validators weren't rendered out. I assumed, incorrectly, that the validation would automatically be pushed to the server. If I recall correctly, the server-side validation is only done with an explicit call. So, as long as my memory isn't playing tricks on me, that's one more reason why client-side validation shouldn't have too much weight put on it. I think you summed it up nicely - "as much validation as possible on the client-side". It's best for perceived performance to the user and scalability by distributing the (arguably minimal) cost of validation to the client. But, you still shouldn't trust that necessarily. Remember, it's also possible for me to post a malicious HTTP request to the page w/o using your form at all. Your client-side validation doesn't help much there!
For End-2-End .Net apps I tend to put validation code (not strictly business rules) in a DLL and I use that DLL both on the client and on the server. On the server I also check all the business rules. For other client technologies I tend to implement some validation, it depends on the technology and on the time that I have.
Jan, for the record I totally agreed with everything you posted up to the conclusion. I just thought a few adjectives in that conclusion changed the entire meaning of it. Thanks for understanding what I was saying! As for the need for server-side validation, I agree with all thoughts presented here. Tim... yes, malicious HTTP requests must be blocked on the server end. Jan... client-side validatation most certainly doesn't lessen the need for server-side too. Truth is, every single piece of n-tier development should have all validation and error-checking possible. The objective at each tier may be quite different, but the reasoning behind it isn't. Client-side should always be trying to minimize traffic over the wire. Business-side should always be concerned with logic integrity. Database-side should always be concerned with security. Obviously there's more concerns too... data types, invalid keys, transaction rollbacks, even keeping state of what IS valid.
Dave sums it up nicely... so, who are you and do you have a weblog? :) (I'd like to subscribe)
Nope. I believe I'm becoming well-known around these parts since I do NOT have a weblog yet comment! :P I almost started one once but realized I lacked the discipline to post regularly, plus the focus to speak consistantly. Um, I lurk loudly instead!
This is an interesting topic. (Jan,I actually came to your blog to ask you a few offline questions about hippo.net which i will submit to you seperately ). But back to validation. I am currently in the process of creating a Web services framework where I am consulting (a large cable company in the southeast). We are going over security, exception handling, configuration and last but not least validators. Ingo, i was actually approaching the solution in a very similar manner to what you described; however, I was looking hard at creating a base business entity class (for all of my business objects ) that is derived from ContextBoundObject. The advantage of using ContextBoundObject is that I can create attributes (much like you describe, but they implement IContextAttribute). I can then decorate my properties and methods with these attributes. The key thing about ContextBoundObject is that it enables me to intercept the calls to the assignment of a property or method parameter and evualuate the assignment based on my custom attributes. I can then throw an error if they fail validation. What are your thoughts on this everyone? Has anyone done much with this? Mathew Nolton
Jan, I was going through the installation of hippo.net and I noticed a couple of things: 1) Your readme talks about a config file for your server but the zip file does not have one. 2) When I start up the client I get the error Requested Service not found (its probably a configuration issue?). I traced it to the line of code in main.vb If Me.GetRemoteControl.Notifications.Length > 0 Then Any thoughts. email me directly at mnolton@cybral.com Mathew Nolton
Oh man. What a neat macro. (All four) thumbs up.
vb project file has ..\WINNT in the path. Visual studio translates this when different users open the project (i.e. WinXP , Win2k). The buildfile generator uses the ..\WINNT verbatim, instead of checking if it shouls use ..\Winnt or ..\Windows. maybe should use the System.Environment Static properties?
I am having the same issues as Scott... this macro just hangs for me saying it's searching assembly xyz. Cool idea though.
The service had problems accessing a VSS store on a network drive. I had to download the source and copy the code from the service into a form. Once it was running under my username it worked fine. If you have more than one project defined, you should be able to view them all from one client, instead of having to change the Hippo.Client.exe.config file to point to a different project name every time. You should also be able to change the configuration from the client (change the VSS path, username, client directory, etc.)
Sorry Jan.. I think this is a bit premature!
:-( Will Michiel come and talk about something else?
Testing...
The joke is quite funny but worth thinking.
Agree with Adam, It would be really useful if more than one project can run in the client without having to change the config file. Have you any planst to implement this? Bert-Jan
Can only mean good things for Mono, not sure the reporting of 'Mono as a "Linux/Unix" port of Microsofts .NET web services platform' :) .NET does more than web services and Mono runs on more than Linux/Unix :)
Thanks for sharing the information Jan. :)
This is excellent news, there go my savings ;)
Jan, ik wou vanmorgen je artikel "Exposing custom-made classes through a Webservice ..." lezen maar het lijkt verplaatst te zijn. De huidige link is : http://www.codeproject.com/vb/net/leaditwebservicewrapper.asp Met vriendelijke groeten.
Thx!
wow! good posting... I'll have to print this one out (& scratch head)... Ques: any thoughts on exception (error) handling) on this one?
I've come to love the power and flexibility that CodeDom/Reflection.Emit and Reflection can provide as well!
Error handling should be implemented (in my opinion) at, at least, 2 places: 1) When invoking the GetValue method: return (string)getValueMethod.Invoke( tempClassInstance,new object[] {this}); 2) After compilation: CompilerResults results = compiler.CompileAssemblyFromDom(compilerParams, unit); When there are compilation errors, no exceptions are thrown. But you need the results.Errors collection to check if everything went ok. Jan
This is an inefficient way to do this (IL and emit would be far better). However, you need to keep in mind that there is currently no way to unload an automatically generated class from the app domain, so if actually utilize this customization, you are eventually going to run out of memory if you create enough customer objects, regardless of whether they have been garbage collected. Of course, the proper way to do something like this would be to implement a custom format provider or just use String.Format when you were actually making use of the data (probably the best option)... It makes a lot more sense that way anyway and will result in much cleaner code that is easier to manage. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformattingoverview.asp
Jesse Ofcourse the example I showed is quite trival and is only for illustrating how the CodeDom and Reflection can be used. Altough I aggree with your statements, I think that there are limitations with implementing custom format providers. If my sample would be used in real life, the _toString would not be a property of each Customer instance, but it should be in a config. file or something like that, so only a very limited number of assemblies would be compiled in memory. Thanks for your thoughts! Jan
Can you debug the Emitted IL? I guess you can debug it as IL, but that's not what I'd consider exactly convenient, versus debugging C# code. Also, can't you achieve pretty much the same flexibility with regular OO programming and good use of patterns?
I love Skype! I gotta add one of those to my blog.
What about the adware/spyware that Skype could be installing? Their license states that you give them and 3rd parties the right to install unrelated software on your machine without asking you first.
My pleasure...
I think this is a great tool! I was going to manually run source safe batch commands and then run nAnt when my co-worker found this tool (I had found Drago.NET at about the same time). This tool will let each developer run builds on the integrated testing server once they have checked in the code to sourcesafe without having to give them remote/telnet access to the server. A couple of suggestions. The VSS database and login/password should be passed from the client. This would be more flexible and secure. Currently, once someone has access to the port, they can get into the VSS db since all the credentials are on the server. Another suggestion is to support multiple projects. If I have time, I might try and implement these myself. If I am successfull, I'll send you the changes. There are some installation issues, but these have be previously documented and I was able to find the solutions in the forum.
Correction. My last post should say Draco.NET, not Drago.NET
It's very geeky - just beware of the dangers of recursive self-quotations in a stack-based world ;)
Clements Vaster of Newtelligence has already implemented this kind of attribute based validation more than a year ago in their SDK. They call it constraints and have implemented 20 constraints. (with sourcecode) http://staff.newtelligence.net/clemensv/CategoryView.aspx?category=Talks%7CTechEd%20Malaysia
Yes, I'm aware of that! Many examples of the technique that I showed are available on the net. I just used the validation example to illustrate the use of attributes (which was the goal of this article). So I do not want to pretend I "invented" the technique, I just used it to explain attributes.
Sure I did implement this already, but I didn't write an MSDN article. ;)
I have installed Mandrake9.1 and added the line "MII_NOT_SUPPORTED=yes" but the only problem is that I can not find the PC/Net 32 network driver. It is not in the list during install. With the line added, I can get an IP adress but can't go on internet. Is this the driver? or am I doing something elese wrong? thanks, Jerom
I think they goofed.... not there now.
I hope you're watching those MSDN TV videos while *being driven* to work, and not while *driving* to work, Jan ? :-)
Patrick, ofcourse I only listen to them while driving (I do not have a personal driver, but I do know some other Belgian .NET guys who sometimes have one!). But since almost all of the Belgian traffic is standing still most of the time, watching MSDN TV would be possible too! :-) CU Jan
Dewayne Mikkelson and his Radio WebDog, Shadow
good one :)
Good one, if I remember I too saw the same one years back in SAD classes ; )
Funny but true!
Everyone in my office has been cracking up all morning thanks to this! Does anybody have any good spots to pick up more of this type of humor?
very good comic :) So true :)
That's a classic - it's been around for decades and still rings true!
I bought a PCMCIA hard disk for storing even more on my PocktPC... (5GB - 200 €)
5GB! Thats huge... I'm still praying MS will make the webcasts available for Pocket PC. Enjoy the PDC! Jan
great!
Belgian .NET guy with a driver... What a snob. :) Anyway, no more driver for me. Plaster was removed last Monday for my trip to LA. Should have thought about saving some webcasts to my notebook's HD. Then I could view them on the plane...
Have you been spying on our company meetings?
Excellent news ! If only the registration form could work ... well i guess it'll be fixed soon. See you there Jan :)
Is there a target release for integrating the buildfile builder into the build tool?
No there is no date set yet. There are still some issues that need to be solved (e.g. Webservice projects deployment). The best we can do at this point making a suggestion for a build file. Jan
I agree here. I have a 45 minute drive to work and then back home and listen to the .Net Rocks audio and even the .Net Show on my iPaq while driving. It is the only time I would get to listen to the Webcasts. They are very informative. Dave
Jan, I'm with you on that point. It would be nice to have available in download as well. I was a bit disappointed by LiveMeeting, of course it doesn't affect the quality of the webcast but some essential features are missing. Ben
Hippo.NET build is not working correctly. Problems with parsing or reflection.
Can you please post the exact error message and when it occurs on the Source Forge forums (http://sourceforge.net/forum/?group_id=77681) ? Thx Jan
Anyone get this to work? I've tried installing it through VMWare and on a standalone machine. When booting from the disc, it fails, and when trying from within a windows installation the setup screen just sits there for about 10-15 min and then closes.
i wish people in our company would listen to ideas
What? No seatbelt? OSHA will never approve it. :)
It's funny ... but the old one I have from Bell was particularly tuned to the reality that Operations will do their damnest to make anything work. Your "How the Project leader understood it" is what the engineers (or programmers) build, and your "How the Analyst designed it" is what Operations installed. Come on, you have to admit that Operations will try to make it (sorta) work, right? ;-)
This was true for my entire career in the Royal Navy and will still be relevant for years to come!
Can you tell me where I can buy the blueprints for one of these wonderful things?
Beautiful. We need to superimpose the end user in the "How the Analyst designed it" and "How the Programmer wrote it" frames. And how about a frame for "How Senior Management changed the Analyst's design". That could involve placing stocks (i.e. a device consisting of a heavy timber frame with holes for confining the ankles and wrists) on the swing.
Sounds like ALL government sponsored IT projects!!!
This is fairly old. It was originally drawn up with a construction motif....How the architect designed it, etc.....
Ya.........
I'll try to fix my installation with the advice above, I have to admit that setting the network connection on Mandrake 9.1 under VMWare is an assault on the nervous system of a newbie like me.
Ard core never dies.
I Love greg
I love Ben
Hey, Omendata, how did you know that. Now we have to shoot you! I guess we'll have to shoot everyone who read that too. I guess I'll have to start up a project to waste that many people. Let's see, how will I describe this to the project manager...
Yah, some things don't change
Ok, Question... We have been using VPCs here at my company for testing and such, but are having issues trying to log them into the local domain. We have searched all over the web and can't find any posts about anyone else having trouble using the Virtual Switch functionality. You see, our issue is this. We want to set up a VPC with Server 2003 and be able to access it from anywhere on our lan. Well, if we use NAT and try to ping the box we get a response from the Host box and not the VPC box. If we try to use Virtual Switch we can't even get the VPC to obtain its own IP using DHCP. We have tried this on numerous different Host PCs and still the same results. It doesn't even matter what OS the VPC is running, the only way we can get a network connection is using the NAT configuration and of course this will not work if were trying to run the VPC as a 2003 Web Server. This is also the case at my house in my network set up at home. Any ideas? Has anyone else had these issues with VPC? Other than that, the product is awesome!
VPC has had no problems on my machine obtaining an IP from DHCP. Maybe an ipconfig /renew might help? Just grasping at straws...
Well it's quite possible our issue is that we are using 5.2 the Connectix product and not the recently released MS version 2004. We are going to download the 2004 version, and I will keep you all updated.
Nice Tip Jan!
Since you are looking at that, maybe you'd be interested in my own IBuySpy portal modification. I created it mostly because i felt that these portals lacked customization. My portal is almost completely CSS based regarding it's looks! A lot of work still to be done, but you can take a look at it at my website, http://www.stebet.com
You could improve a little bit your stylesheet by specifying directly at the <xsl:for-each> level, that you want to loop on the first 5 items : <xsl:for-each select="channel/item[position() <= 5]"> ... </xsl:for-each> No more need for a nested <xsl:if> ! Hope this helps !
And here's another variant. This one displays all the titles, but only the description for the first title. On all the other titles the description is shown on mouseover. René <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="html" indent="yes"/> <xsl:template match="rss"> <!--Get max 25 articles --> <xsl:for-each select="channel/item[position() <= 25]"> <!-- Build compete A element --> <a> <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute> <xsl:attribute name="target">_blank</xsl:attribute> <xsl:attribute name="title"><xsl:value-of select="description"/></xsl:attribute> <xsl:value-of select="title"/> </a> <br/> <xsl:if test="position() = 1"> <xsl:value-of select="description" disable-output-escaping="yes"/> <br/><br/> </xsl:if> </xsl:for-each> <!-- Show feed description at the bottom --> <br/> <xsl:value-of select="/rss/channel/description"/> <br/> </xsl:template> </xsl:stylesheet>
I noted a similar concern to the ASP.NET team last year when I first saw Whidbey. They are doing lots of good things, but it looks like they are working somewhat in isolation. I never heard back by the way. :)
One thing I'm really curious is how Constraints (at least I think that's what they're called) work in VB.Net?
class declaration should be: public class MyCollection<itemType>:System.Collections.CollectionBase right?
That's right, seems the some tags are left out because of the HTML. Sorry for that. Jan
Jan: Until MS implements your suggestion, you may be interested in WM Recorder: http://www.wmrecorder.com/
It is universal - I first saw a predescessor of this version posted on a wall in a batch terminal room(think punch cards...IBM 360/370) about 1972, in the Waterloo University computer building. It was funny and true then. Communications between (even more) specialists seems to have gotten even more complicated over the years.
I love goats!
But how to do that by configuration file? I tried again and again, the configuration file can't work. the config file is as: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.runtime.remoting> <application> <service> <wellknown mode = "SingleCall" type = "Etone.RegistBiz.RegistTx,RegistBiz" objectUri = "RegistTrans" /> <wellknown mode = "Singleton" type = "Etone.RegistBiz.RegistQry,RegistBiz" objectUri = "RegistQuery" /> </service> <channels> <channel ref="tcp" port="9000" /> <serverProviders> <formatter ref="binary" typeFilterLevel="Full" /> </serverProviders> </channels> </application> </system.runtime.remoting> </configuration> and how can we do that in IIS hosting? Neither program in Global.asax nor configuration file can do that. I am so sad, could you test it and help me?
cool
I like that you are adding new features, though getting binaries isn't high on my list. I would rather see some bug fixes, please. Do you monitor the sourceforge bug list feature? Or forums provided by sourceforge? They are very quiet. :)
Jan, It is very useful samples. Where did you find syntax for it? I am struggling through converting C# sytnax of Generics to VB.NET. Thanks, Maxim
Hi Maxim The C# syntax I found on the net (e.g. from the MSDN site), but the VB.NET syntax I had to "discover" myself. If you have problems, let me know and I'll see if I can help you out! Jan
Actually, the syntax for multiple constraints will be changing, the one in the PDC build was just a preliminary syntax. The new syntax will look more like "Class MyCollection(Of T As {Entity, IComparable})". I really need to get to blogging about this... :-)
Hi Paul, thanks for the information!
Jan, Thanks for the refernce to the article. It does contains wealth of information. Maxim
Paul, I think you should give us some good sample code on this topic. I think It is one of the great feature we are going to have with new release. By the way new syntax looks confusing {} do not really makes sense for VB developers
Sorry I spilled the beans Jan :-). I didn't know juu were just setting this up...
No problem Patrick! Every IT projects need a thight deadline. ;-) cu
yea, this is really really sad, this is the kind of thing that makes me want to ditch .net altogether. I have been struggling for this for a week. EVerything is fine until i try to add events, then nothing works. Does anyone have a SHIM class example in vb.net ??
can you give mo details
What kind of details are you looking for??
Sorry, but I try your solution and it doesn´t work. Do you know what can be happening? My code is: public __gc class MyCertificateValidation : public ICertificatePolicy { public: bool CheckValidationResult(ServicePoint* , X509Certificate* , WebRequest* request, int problem) { return true; }; }; System::Net::ServicePointManager::CertificatePolicy = new MyCertificateValidation(); HttpWebRequest* wrq = static_cast<HttpWebRequest*> (WebRequest::Create(url)); HttpWebResponse* hwr = static_cast<HttpWebResponse*>(wrq->GetResponse()); Stream* strm = hwr->GetResponseStream(); FileStream* fs = new FileStream(fpath,FileMode::Create,FileAccess::Write); BinaryWriter* br = new BinaryWriter(fs); int b; while((b=strm->ReadByte()) != -1) { br->Write(Convert::ToByte(b)); } br->Close(); strm->Close();
Hello Jan, The http://blogs.leadit.be/feeds/befeed.aspx page currently takes too long too load (+- 20 seconds). Do you already use caching for the RSS data?
I am very new at ASP.NET this look as if its what I need to complete my assignment. But I dont know how to trigger it below is my problem. My purpose is to dynamically change all the text description on all the objects and all the DIM that contain Error messages by read a DB table to determine the language by user name and then read a DB table by ASP page and language to get all the objects that needs to be changes. Can I email you my code?
Wow, that's a nice piece of work. Thanks so much!!
Thank you!!
Hi, Your blog contains good info. Keep it up.
ok, since all the help files are in chinese traditional, i'll ask this installation question here-- does CodeLibrary install its own access db engine or does it require something already present on my machine? thanks!
Jan, Did you try modifying stuff that comes out-of-the-box? When I played around with it, I had several things I didn't like: - I couldn't just modify the look of any page I wanted - I often found it hard to find out where I should look for certain things - Once I found out how to create a page with a certain template, I saw it indeed did use the template, but it still contained certain things like the stuff at the top and left. - The template of that page I added couldn't be changed anymore with the webinterface once it was added. Perhaps I tried to use it for the wrong thing: instead of using it as some 'document sharing tool', I wanted to see if I could use it as a base for building webapplications. From my experiences, I came to the conclusion that I shouldn't want to do such a thing. That's why I started with our own tool, which comes has the cool things in SharePoint, but not with the limitations I experienced.
Also Just some FYI, you might not want to put your assembly into the GAC since it would give it FullAccess rights. To have a bit more security you can just install it into the bin directory where sharepoint is installed (usually c:\inetpub\wwwroot\bin). Jeff
No offense, but first life will be great because you can do a lot, out of the box. Then you start that life will be even more great when you... and then A LOT of things come up you only can do with access to the server. I think that still kinda sucks! :)
Considering deployment: You might want to have a go at the Microsoft WPPackaging tool. Get it from http://msdn.microsoft.com/library/default.asp?url=/downloads/list/sharepoint.asp. Should save you a lot of tedious work! Jorg
Hello, my name es David and now I'm studing the SoapExtension. I have a problem and I don´t found the solution. I do a client application that call a webservice. In my webservice I have a class that inherit of SoapExtension and save all the message that my web service receive. The problem is that never execute this class, and I have the correct configuration in a web.config file. (I use Visual basic.net) Where is my fault? There are another option. Thanks for all David
Jan, all the best wishes to you too ! And don't forget, you can help making 2004 an exciting year by giving us more of these great articles of yours... Greetz, Faan
At this point I still don't have any MS reaction... :-(
After HOURS of trying to find a solution to the limiting the number of headlines, there you have it in two lines of code. THANK YOU!
And what about having the possibility to post to WSE Web Service?
Hi Laurant, what do you mean by WSE Web Service? DIME attachements, encryption, security, ... ? Jan
And what about being able to submit rich text to for example a webservice? Last time checked I noticed it sends an XmlNode to the webservice. On the webservice however I could only get a certain bit of the text - if I would submit "hello <b>there</b>", I would only be able to get "hello", as if the rest was never sent. I think there was a workaround for this by doing some scripting. It would be nice however if this kind of trivial stuff would be easier.
> it's a pity that you cannot use > managed code in InfoPath. Jan: You can! http://www.hands-on-labs.com/only4gurus/techlib/pdc/TLS351.ppt http://www.microsoft.com/downloads/details.aspx?familyid=351f0616-93aa-4fe8-9238-d702f1bfbab4&displaylang=en
Yes Jan I mean exactly that!
Thanks Phil for the pointer, I did not realized that there were a project toolkit for Visual Studio. I did use the Word toolkit to build the article publishing on my site but did not know that there were one for InfoPath. Thanks !!!
Phil I don't think the InfoPath Project Toolkit for VS.NET is already available. Please correct me if I'm wrong!
Right :-( They talk about it in the ppt presentation, but I could not find anywhere !
It looks great, i already added your fead to bloglines :) Curious to see future releases :p
very cool - keep it up...
Looks cool! I'll certainly use it whenever possible.
Is that really the SQL code that ObjectSpaces generates? This code doesn't seem like it would work in SQL Server 2000: Declare @r int, @e int; Set @r=@@ROWCOUNT; Set @e=@@ERROR; If @e = 0 Begin if @r = 0 RAISERROR(''No rows effected'',16,1); If @r > 1 RAISERROR(''Change effected %d rows'',16,1,@r); End You need to set @r and @e in the same SELECT statement. Unfortunately, even a SET will reset those values.
What product(s) did you use to capture the the screen shot displayed above?
The new MS FrontPage 2003 provides some features that complements well with SharePoint sites - data views, mods, etc.
A nice way to start the new year with a bang ! I guess this is the first article online that gives an introduction to objectspaces. And great that you use the mapper utility in your examples because this one makes objectspaces much easier to use than writing all this XML manually. My comments are only about the introduction : - There is at least one 'real-world' property that is easier to represent in a relational database than in an OO language : many-to-many relationships. This is easy to represent in an UML class diagram but once one starts coding you'll have to maintain collections on both sides of the relationship. - Real life taxonomies are sometimes difficult to map on current OO models. Like the well known example of geometrical figures : The class of squares is a subclass of the class of rectangles, nevertheless a rectangle has two properties (length and height of its sides) while a square has only one (because these lenghts are equal). Nevertheless, in the current OO implementations a subclass can only extend the number of attributes of its superclass. And this is only one example. - There are other database technologies that allow for an easier mapping with an OO runtime : object databases and XML databases. However, you're right in assuming that these are not widely used. Best greetings, Stefaan
Thx for the positive comments! Garibaldi, I used Paint Shop Pro 7 to capture the screens.
Bill, I copied the SQL from the Query Analyzer of SQL Server 2000. Stefaan, thanks for your comments! How would you implement many-to-many relationships in a relational DB? It would require some additional helper tables I assume, so it would involve quite some coding. I agree that sometimes real life taxonomies are difficult to implement in an OO model: you provide a nice example. But I do think in general OO models can reflect better a real life situation. Btw, did you have a chance to try ObjectSpaces yourself, I'd love to share some thoughts! Enjoy the holiday, Jan
Yep, one uses an association tables for many-to-many relationships with at least the foreign keys of both related entities and possible some extra information about the relationship. And I agree that OO models and an OO centered middle-tier are great for the business applications must of us work on. But when used 'in the full richness of reality' it still has some limitations. And yeah, I played a little bit with ObjectSpaces at home. First without the mapping tool which was really hard because when one makes a mistake in one of the mapping files the error messages of OS are not very informative. Still didn't try the many-to-many relationships though. Would love to play more with this and share thoughts too ! :) Take care, Stefaan
Hi Jan, There is a lot of information to be found in the C# language specification 2.0 draft. It is located at: http://download.microsoft.com/download/8/1/6/81682478-4018-48fe-9e5e-f87a44af3db9/SpecificationVer2.doc As you were not sure whether the syntax of C# is correct, let me assure you it is. The <itemType> you used after IComparable is used only when the interface (or class) itself is also a Generic. Otherwise, you would not include it. BTW, did you also know that you can add constructor constraints as well. The following sample requires the V type to have a default parameterless constructor. In C# multiple constraints are added to a type in a comma separated list. public class SomeDictionary<K,V> where K: IPersistable, IComparable<K> where V: MyBaseClass, new() { // ... } Hope this helps.
Thx Alex!
Does it warn and ask confirmation when deleting records? I've created my own extended datagrid with this functionality, but that's all. If your grid has this + those other thing, I gladly use yours :)
Geert, at this point: no. But if there is any sample coding available on the net that explains this feature, I could include it.
I will send you a mail with my component included. How easy can life be :-)
To garibaldi: in the HTML Help Workshop (default installed with Visual Studio .NET) you will find a Image Editor. With the image editor you can capture screens (to place in your HTML help files or for other use)
Typical IT Project :-)...
I've been trying to use the webservices over SSL and have also been having problems. I only get a problem when I do an iisreset and don't use the webservice straight away. If I start up another site (or if another site gets used before the webservice is called) then the webservice fails with either a proxy authentication error 407 (behind proxy on the development machine) or a "Could not establish secure channel for SSL/TLS" on the external server. I'm using .net 1.0 sp2 with C# and I have an internal webservice calling an external webservice over SSL. The webservice works fine for the most part but it obviously a problem if it happens at all. And I've also tried creating a test certificate and getting the same error with that. Many thanks
Mmm, I don't know what could be the problem... I suggest you post your question in the IIS or ASP.NET newsgroup.
Great stuff, Jan! keep up the good work!
Sweet! Nice work...keep it up!
Really nice Jan.
Or just the following will do the same too: myDataSet.ReadXml("http://msdn.microsoft.com/rss.xml")
Thanks - great help :)
Does this actually work? I have the following... but always get thrown into exception private void Form1_Load(object sender, System.EventArgs e) { System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy(); WebClient client = new WebClient(); try { Byte[] pageData = client.DownloadData("https://www.testdomain.com/"); string pageHtml = Encoding.ASCII.GetString(pageData); textBox1.Text = pageHtml; } catch (WebException x) { textBox1.Text = "enter Webexception"; if (x.Status == WebExceptionStatus.TrustFailure) { textBox1.Text = "trust failure"; } } } Additional information: The underlying connection was closed: Could not establish trust relationship with remote server.
evaluatiuon
How would one use a tree or a datagrid that requires a popup button with the ExtendedDataGridControlColumn? How does one add custon columns to the add editor in the grid so they can be picked at design time; editing registry or xml maybe? Will you provide an EnumColumn and a column that uses the UITypeEditor to do the rendering and editing? I know your code isn't open source but how do you render a control that is associated with a column multiple times in a grid each with different state as you did in your example with the group of radio buttons and the progress bar?
Jarrad 1) Just create a Custom Control and add a TextBox and a Button to it. 2) Check out this article: http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/datagrid.mspx It comes down to creating a custom DataGrid class. 3) Mmm, can you explain a little bit more? 4) Each cell is an instance of the control.
Nice work Jan! ;-)
yukith
I have been getting a "Could not establish secure channel for SSL/TLS" error, as well. The interesting thing is that it only happens on an XP machine running the client app. I install and run the same web service client on my 2000 Pro machine with no problem. The web service is hosted on a 2000/IIS5 machine. We are using a proxy server but both machines access the same one. Has anyone found a solution to this? Thanks.
string assemblyFileName = Assembly.GetExecutingAssembly().GetName().CodeBase; compilerParams.ReferencedAssemblies.Add( assemblyFileName.Substring("file:///".Length)); thanks dude.. the above thing made my life easier.. i had sorted out every thing except the above :) btw im working on a scripting engine in my application which lets the user to execute functions already built in my assembly :) cheers
I used this with a WebClient that wasn't accepting a certificate and it worked fine. Great blog!!!
Jan, Just thought I would point out that the link column's alignment property does not work. Every link column ALWAYS ends up left justified. Is there a way that I can correct this in my application? Other than that, it was very useful! Thanks! Jim
thanks
Yet another case where I am not able to "keep up with the Joneses" ;-)
My (free) ExtendedDataGrid control gets quite some attention and every developer knows that the more people use your software the more bugs will be reported. To organize bug reporting, feedback, feature requests, ... I've created a GotDotNet Workspace: http://workspaces.gotdotnet.com/extendeddatagrid. So if you have something to say about this control; please use the workspace. New releases will be put in this workspace, so you can easily track them by using the RSS feed. Everybody who has contacted my concerning the ExtendedDataGrid: thanks for giving it a try. I'd like to ask you to post the reported bugs in the Bug Tracker. I'm sorry for the hassle.
Good good and again excellent ;-)
'With' and 'WithEvents' are two completely different things! 'With' allows you to reference an object without having to specificy that object each time, eg: With Form1.Controls.TextBox1 .Text = ... .Enabled = ... End With (simple example, but sometimes you have to set a lot of properties on an object multiple levels deep). WithEvents is short hand for [event] += New System.EventHandler([eventHandler])
I've built client-side Crystal reports based on datasets returned from a webservice, but it requires a typed dataset so it doesn't really fit the "generic interface" criteria...and for various reasons it's a pain in the neck, besides...any change to the dataset makes all the datafields disappear in the report, and it breaks when you switch to a different webservice (eg between dev and live).
Dear Jan, thank you very much for your detailed description. Unfortunately I am expieriencing a similar problem like kinsley. Sometimes it works sometimes not. I have a messaging service that calls a https connection sometime 5 times in a row. Every second call fails. I log the access of myCertPolicy in the eventlog and interessing enough it only gets a call 3x2= 6 times for 5 requests to the https service. The certificate of the site is invalid und there is also a password to be transitted via netCredentials. The whole Programm works fine as a console application. Once installed as a service on the same machine it doesnt work. Dotnet 1.0 on windows 2000 KarlHaak@gmx.de I would appreciate help on this
Jan Tielens presents some ideas on how to do reporting in a SOA world and poses the question whether or not there are any other know solutions or products: In the "good old days" of pure two-tier Client/Server programming...
Ingo Rammer is right, that your reporting will be a service, but that is not really the issue is it? In a SOA, your data doesn't necessarily come from a database, or if it does, it's not necessarily your database anyway. You need to mangle all your fragments of data into one homogenous lump, or have at least similar fragments, to be able to use one of the existing database reporting products. Infopath is ok, but it wasn't designed to work with more than a page or two of data, and ultimately it is more geared towards data entry and validation. The other problem you will run into is printing those reports. (in my unfortunately biased opinion)I think that the XSL-FO spec combined with XSLT is a workable solution, but the design tools are still in their infancy.
need product key hope you can help
Jan, Congratulations - I've read every fucking post from 100 guys who claim to know what the hell they are talking about - your solution works like a charm. THANKYOU for posting this info. I hope other people with https+httpwebrequest problems find it.
good
try setting Option Strict On ......
Come On Microsoft, please do make the webcasts avialable for offline viewing. if so, thousands of developers will be benefitted by it. Hope MS Listens to the Community and makes it avaiable for downloading previous webcasts
Thanks Jan, This was a particularly frustrating problem for me There is a KB article 819450 that is pretty close to what I experienced, except that I had .Net 1.1 installed. I could also refresh the page and the request would complete just fine. In addition to the solution you mention, I also nested about 3 Try...Catch blocks to have the request "auto-retry". That way if I mistakenly refreshed the Web Reference, I'd still be covered. (As excited as I am about 2.0, it's really cool to see a non-Whidbey solution, too!) Thanks! Todd
Jan, Thanks for the plug! Our little community of Office System enthusiast continues to grow! Chris
hi,i want to know : Hippo.NET have support .net frmaework 1.0 verson????? my english is pool,sorry!!
Maybe a good remark is also to first create an additional virtual server in IIS so that you can host your WSS sites on that one. Otherwise the default Web site will be used and you will not be able anymore to host 'normal' Web sites (due to the ISAPI filter installed by WSS).
good posting - I am in the midst of WSS deployment and installing default MSDE and not using it is wasteful. Is there a tech note or KB article on deploying it on an external virtual server (in IIS) and *avoiding* the ISAPI filter problem for default (& other) web sites (as mentioned by Patrick)? Thanks.
Thx for the tip Patrick!
Do you have this code in VB somewhere? We're using VB.Net for our ASP.Net pages and I can't get a decent conversion for this
Nice info on WSS, but also the point on IIS 6.0 by Patrick is important. EROL
I wish I had though of Patrick's tip when I installed here. Good job I've got a second server for "normal" sites.
Nice! That's the reason I still like webservices. I don't see people using webservices yet for exchaning information across internet or anything. But building a Winforms client on top of your web interface seems great! Ofcourse, it's a lot of extra work. The web interface, the web service(s) _and_ the winforms client. But after that you've got some great functionality!
Good example. Personally I like to build my own Web services layer around the object model or Web Services of SharePoint itself and not let client applications talk directly to SharePoint via the SharePoint Web Services. If you start for example consuming the Web Services for retrieving the items out of a list, you will start to experience the reason behind it.
Yeah, I know... handling plain XML comming from the Lists webservice can be a royal pain in the *ss (been there, done that). I like the idea of a wrapper web service around them ... let's see if I can find some more time!
At the website of DevHawk, you can also dfind a Sharepoint webpart for RSS... http://www.devhawk.net/prj_SharePointSynd.aspx
Hey folks - this brings up a related question - is there a way to convert an existing MSDE-based WSS site to SQL? The application of this would be great for Small Business Server which uses several instances of MSDE running and is very wasteful on memory. Since SBS has SQL as an option, that the next logical step.
Steve, I haven't dont this myself, but I think you could use the smigrate.exe tool. http://www.microsoft.com/downloads/details.aspx?FamilyID=3df85705-5635-40db-adbe-e13ab8684a60&DisplayLang=en
It seems to me that VB6 nonsense like WithEvents and optional variables just gets recompiled, anyway. I can't see how you can have a concept like delegates and then break it by pretending events are sent by variable name, not by object. And as for optional arguments...i constructed a class in VB and another in C# that had nothing but a constructor which made three assignments. In VB, I made them optional. In C#, I made 8 seperate constructors for each of the possibile ways to call the constructor (which them called the most complete constructor with their own defaults). I compiled them both with the same switches and dependencies...the VB file was 20% larger. Implies to me that it's coding each calling signature as its own individual method. I'll stick with doing it myself, thanks.
vslive is next month right? I have been able to see some of the pre beta 1 bits and they have come along way. I cna't wait to get my hand on them....
I completely agree with you on this! My hope is that these issues get addressed in v3. I suspect with the moving of WebParts to the core ASp.NET 2.0 plumbing WSS will be rearchitected and have some interesting features currently missing! I'm also hoping MS changes the way VS.NET can author to included non-isolated. I'd also like to see the ability to use the AD/AM directory ina FORMS based authentication scenario with WSS. Of course a native RSS/Atom option for all content would also be high on my shopping list for a WSS 2.1 feature! And I too get frustrated with the lack of alert capability on content posted to the main page. They should have included a 'whats new' WebPart which I once saw MikeFit demo in a web cast but it was never posted to www.gotdotnet.com as he mentioned it would be.. etc etc
hey whats up>nothing here...how are you .im good...well i wanted the new version of msn messenger...if i could but it brought me here..
Jan, I'll be staying at the NH Hotel. Arriving Monday afternoon and staying until Thursday morning. I created a thread on the MsBeluxForums (http://www.msbeluxforums.be/) for those wanting to meet, for example at the Geek Fest at the end of day 1. Anyway, I'll be seeing you soon!
I'll be there as well! :p
That's me :) I'll do my best to make intresting posts! ;)
Thanks for introducing me Jan. The Geek Fest at the Developer & IT Pro Days 2004 will be great. No doubt. It's time I'll teach you to party! ;-) About my pizza restaurant: It still in Alpha :)
Jan, Thanks you saved my bacon today, our webservice keeps timing out over this. I had to convert it to VB.NET cause I don't know C-Shizarp. Sample I Used: Protected Overrides Function GetWebRequest(ByVal uri As Uri) As System.Net.WebRequest Dim webRequest As System.Net.HttpWebRequest = MyBase.GetWebRequest(uri) webRequest.KeepAlive = False Return webRequest End Function
Jan, I saw that you have installed it on our sharepoint server. I can only say : it's nice and thanks, it gives us a little bit more functionality. You've done a great job with this.
terrific! Thanks..
They work a treat but I've not found an application for them on my server yet ;o)
Dear Josh, I finally managed to solve my problem an posted a solution in VB under http://www.dotnetforums.net/t80674.html It handles certificate problems, user authentification, asynchron requests and a problem regarding keep alive connections. I hope this will be of some help to you. Karl
A new CMS online book has been published - Building, Deploying, and Maintaining Intranet Sites for the Enterprise discusses how a small team within ...
Thanks
Dear Jan, great webparts. I would like to ask you if I can count on you for developing web parts for my company. In that case please send me your conditions. Regards, José Antonio
In my dealings with customers who have implemented SharePoint, the number one complaint that always surfaces is poor navigation within a site collection. Jan Tielen has created a Navigation web part that is just what the doctor ordered. I've always had this on my list as something to build, but I've just never got around to it. She has also written a very useful MyAlerts web part for use on individual WSS sites. As you may know, the portal and...
It is interesting how open source vs. commercial software is becoming a political issue. But there are ways to approach it. A political party who advocate the humiliation of people (whether admired or loathed, rich or poor) simply show themselves to be immature and unprofessional. I recently joined a University and was amazed at the level of integration Microsoft products have when working together. I can only imagine how this helps organise government institutions. Open source solutions simply aren't at this level yet, and perhaps without a corporate structure organising the teams and projects, will never be.
I share your opinion completely! I really don't get how you can write such statements. And why is Spirit posting that video on their site? Doesn't that show of immaturity? Damn... Well, I'm not going to vote for this political party this spring!
I'll sign a petition if there is one, or have my name added under an Open Letter if it's a good one. I really can't believe they're making such a stupid remarks, and a political party who is involved in humiliating people should have their own laws used against them. Like the recent law that stops funding parties who discriminate. So far for Spirit being a grown up party.
Even better.. They state the example of Munchen in Germany which switched to Linux.:)) Aren't they allready way over they budget?? Yes they are and just because Linux is "free" and "easy" to use. Well except offcourse that installing a printer takes a day on Linux and in XP a minute. But yes I can see the "easy" in use. Shorty
I'll say... this even goes way further. Ever seen the Bert & Steve TV?? (its in dutch) http://www.ideeenfabriek.be/bertenstevetv/index.asp I've added my feedback http://www.ideeenfabriek.be/bertenstevetv/geefmening.asp?iID=6 If software needs to be free, I'll like my daily bread for free too thanks! If not, I'll have no money to buy it. Btw: its clear again that they do not seems to know the difference between Free Sofwtare (as in no license cost), Open Software (as in you can extend it), Open Source (as in you have the zillion lines of code), Open Standards (as in ratified by a offical organisation, btw .NET is a ISO standard => http://msdn.microsoft.com/net/ecma/), Proprietary Standards (COM, JAVA, J2EE) Aaah silly politicians, I wonder if they ever read their own job description; I'm sure it does not state: gotta get on TV a lot, no matter what.
This is sickening at many levels. First, it is sickening to see that these technical decisions are not being made on any form of merit, but purely on false ideological grounds. The companies behind OSS (Novell (Suse), RedHat, IBM, MySQL ...) are pure commercial entities. They are no different than Microsoft or any other software company in that aspect. Surely no-one is suggesting government should take development and maintenance of basic software platform technology “in-house”? Or should they run on stuff that might or might not be available in future depending on some college kid’s “do I feel like it” 3 month support cycle things? Second it is sickening on a business level. The envisioned OSS solutions are equally and sometimes even more expensive even from a pure license perspective (look up the prices for RedHat Enterprise Linux or the Suse equivalent, StarOffice etc., and compare to the MS licensing). The envisioned OSS solutions require far more expensive consultancy and custom development for things that come out of the box in the equivalent Common Off The Shelve (COTS) offerings. The envisioned OSS solutions do not offer the same usability, both in terms of end-user, application developer as well as operational interfaces. The envisioned OSS solutions do not present a better opportunity for local Independent Solution Vendors (ISV's), who's skill set is more in line with commercial offerings. Typical commercial offerings present better performance on equivalent hardware than OSS solutions. OSS offering are generally supported for much less time (typically 1-3 years) than Microsoft solutions (typically 5-7 years) requiring more frequent upgrades with all the associated costs. Both platforms only tend to adhere to defacto market standards in their own fields, and only pay attention to "interoperation" when requested by market forces. Thirdly it is sickening to see these parties so comfortably meddling in affairs in which they have absolutely no expertise. They are willing to risk an entire sector of the economy that has performed exceptionally well in a free market, for the sole purpose of scoring some fringe left votes in the next election. If they are so concerned about the Belgian IT sector, why do they not follow the advice of that same sector? When asked they (Agoria if I remember correctly) unmistakably told the government to butt out and not meddle. Last but not least it is especially sickening that all the extra cash that will be needed for this “coup” in the future will have to be paid by us, through extra taxes that will need to be raised, making our economy even less competitive in future (*). Here’s a guess: Will a future “mauve” coalition let the blue partner score by having them cut expenses through “outsourcing” all of that expensive IT work to some cheap labor market? (*) for those readers not familiar with the Belgian scene, we have extremely high tax regimes already, and a frightening percent of the Belgian workforce is employed directly in government administration. The coup de grace of the socialist/liberal government here is that they declared a “tax amnesty”. While regular law abiding citizens payed almost half of their paychecks in income tax directly to the state government, those who where “less scrupulous” and worked in the “black” economy can now whitewash all there gains over the years by paying a onetime single 6% fine.
I reacted, lets see if it comes up..
Well.. I am gonna vote for SP... this way I can safely download any book, any cd and any movie from the internet! Go for it Spirit! Everything for free! Why pay for intellectual property? And by the way, why do we pay you guys for so much crap?
I would really like to implement this into a project I am working on, but I dont know were to find the web.config file.
Thx for the support guys!
I don't get the point. Linux easy to use and install, well I'm not sure about this. And also, where is the integration like we have with Microsoft products. Jan, let me know, I want to sign also the petition or open letter. And why using an old item about Bill in Belgium ? It has no use. And then the petition. Well I'm not in politics, but I understand Jan (and all the others) very well. Is this what thos politic guys do during the day, time to put some new guys up there.
I can only say this... Goe bezig ^o) ironical offcourse. So if software should be free, then i'll have no job anymore
Brad, you can find the Web.Config in directory that is used for the website/virtual directory in IIS for the SharePoint site.
Jose, I've sent you an email, if you didn't received me contact me (http://weblogs.asp.net/jan/contact.aspx).
Well euh Jan bring the aspx online and we will sign your petition amen. PS going for another round in the "Palieter ?"
SPA-Spirit are those guys who say everything should be free. Just to get more votes, because they surely do know that nothing is for free (even not Linux - and I'm not talking about those ISO's you can download, I'm talking about enterprise level). And if they change everything to Linux, how much will this cost us tax-payers? Last month, a big e-gov project of the Fed failed (another one). How much does that cost? A lot...
Strange that a anti-MS political party is running their site on ASP pages :) according to Gartner (http://www.itweek.co.uk/Analysis/1143712) , the TCO of Linux is more expensive than Windows : When they want to buy 8000 PC's : 41840000 Pounds for Windows 43840000 Pounds for Linux => difference of 2 MILLION Pounds !!!!!! (= 3.5 Million Euros) Nice way to spend our tax money !
It's still broken. I attempted to create a NAnt buildfile from a VSS C# project file and received the same error as Craig Wagner did above. What gives? Dat
Great job, Jan. We'd like to license these for use on our hosting server -- drop me a line with pricing information. :)
This post was very helpful! Thanks!
How do you install these web parts? Just import them? I noticed a dll file ...where does that go?
To deploy them, just put this assembly in the GAC (for example), put the DWP files in the wpcatalog directory of your SharePoint site and add the following node to the SafeControls section of the web.config: <SafeControl Assembly="Leadit.SharePoint.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1a431c1526626774" Namespace="Leadit.SharePoint.Essentials" TypeName="*" Safe="True" />
where does the .dll go? In the same folder as the .dwp files?
You put the dll in the GAC (Global Assembly Cache) or the \bin directory of your directory for the website.
I'm just wondering about the comment from Eric Legault calling Jan "She". Now I used to work with a Dutch guy called "Jan" and a bit later had a long e-mail correspondent with a guy called "Jan" in England who turned out to be a woman. I suspect that Eric has made the same mistake in reverse as surely this Benelux Jan is a man! Sorry not to make a Sharepoint comment but I'm going to look at these on my test sites at work.
Mike, you're right! I'm male :-) But Eric has already corrected this on his site.
The Infopath SP-1 Preview is available for download. How sweet is that news?? I am currently working on designing a solution that utilizes InfoPath, Sharepoint and Web Services to enhance our sales team workflow. So I was hoping that I could get my hands on the service pack as soon as possible since I already knew I could take advantage of some of the new features that were leaked/released a while ago. I have loved InfoPath since I first played with it during the Office System 2003 Beta. However I was always disappointed at some of the things I found that were missing. The release of the reasonably feature rich service pack helps me believe that there is a lot more to come for InfoPath and while it's potential has yet to be truly tapped...but it will. InfoPath & Sharepoint are tools that are ideal for individuals like myself that are obsessed about efficient processes and information sharing. I am now empowered to create the sites, forms, lists, and workflows that I would typically require a developer to implement. Given that we are a development company, there are certainly lots of developers around. However taking one off client work...
Nice. And if you don't want to or can't install .NET assemblies on your (probably hosted) SharePoint site then just use the built-in XML Web Part with a custom XSLT style sheet as shown at http://playground.doesntexist.org ;-) Cheers, Siegfried
Nice part, Too bad the crumbs part shows the c<n>-sites.
What do you mean by c<n>-sites?
E.g. in an url like http://zwaan/C8/Beheer/default.aspx the c8 part shows in the crumbs part... Intranet / c8 / Beheer However the c8 part is not a sharepoint page is there for managing url length. (check http://spsclerics.europe.webmatrixhosting.net/posts/158.aspx)
encroching on my turf ;-) -th
Don't worry about reposting, Jan -- you probably have at least some different readers. I've been meaning to say Great Blog, by the way!
Thx Laura!
That's cool, though I was hoping for something that would discover sites no longer linked anywhere, mainly to discover orphaned sites (like on a dev server). There must be a list of SharePoint sites somewhere in the db, anyone know how to get at it?
I get some error as below. A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.
I'll be there !
I won't miss it! Count me in. :)
I try to come also.
I am having trouble as well. I can't seem to get the web part registered as safe - I've edited the 6 or so web.config files I could find, but no go.
I totally agree! I would love to be able to set up one alert for each of our team's sites. I'd also like to be able to (as an administrator) add alerts for other users.
Many many thanks Jan, all of a sudden my SharePoint site has opened up. Its like springtime has come! What is a breadcrumb though?
Thanks :-) Breadcrumbs: http://psychology.wichita.edu/surl/usabilitynews/52/breadcrumb.htm
Check out these webparts: http://weblogs.asp.net/jan/archive/2004/02/12/72079.aspx
Microsoft has released SQL Server 2000 Reporting Services. What do You think about using it as a reporting engine?
RSS Reader Webpart for SharePoint - The layers of geek required to make this of any interest to ANYONE make...
Before I look at this more closely, is there anything in your opinion that your web part can do that Tim Heuer's can't ? (From your example I can see the more lines of description per item but I'm not sure this is a good thing - can it be amended by a parameter ?)
I have Tim's web part installed and working great. I'll link you tonight when I get home if others need to use the feed. Great effort!
Mike, you can set if you want to see the description or not. Also, you can choose which image you want in front of each post. I don't want to say my reader is better than Tim's! Mine doesn't display a message referring to the creator's site (this could be important in a corporate envirionment) (Tim please don't take this personal :-).
Only 2 days after opening the registration, the session is already full! Way to go, Jan! PS. I'll be there too!
This seems to be the solution for me to, but I'm usin WSE (Web Service Enhancments). Trying the suggestion gives an "Invalid Cast". My webservice is inheriting from Microsoft.Web.Services.WebServicesClientProtocol, it in turns inherit System.Web.Services.Protocols.SoapHttpClientProtocol which is the normal to use for a webservice. Any suggestions?
Hi, Jan I was wondering if you'd be willing to share the source for this. I'm just getting going with WSS web part development and these are exactly the type of things I'm trying to learn to do.
Doh! I see that's what the second file is... ok, ok, nevermind and much thanks.
Mike, just check the links at the end of the post! :-)
I have a project where a vb6 COM PC-based client is calling a webservice created in c$.net It works fine over HTTP. I've read over yours and many other postings about this topic. Your solution assumes a .NET client (I think ?) Is there a similar solution from COM? Thanks very much, -Larry Dim oXMLHTTP As XMLHTTP Dim oDOM As DOMDocument Dim viewNodes As IXMLDOMNodeList sB = "" & "<?xml version=""1.0"" encoding=""utf-8""?>" & _ "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _ "<soap:Body>" & _ "<TestConnection xmlns=""http://abc/pays/"">" & _ "</TestConnection>" & _ "</soap:Body>" & _ "</soap:Envelope>" Set oXMLHTTP = New XMLHTTP oXMLHTTP.open "POST", "https://localhost/abc/pays.asmx", False oXMLHTTP.setRequestHeader "Host", "localhost" oXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8" oXMLHTTP.setRequestHeader "SOAPAction", "http://abc/pays/TestConnection" oXMLHTTP.setRequestHeader "Content_Length", Str(Len(sB)) oXMLHTTP.send sB Set oDOM = oXMLHTTP.responseXML
Larry, yes my solution is for .NET. I don't know how to accomplish this in VB6...
hi
My subsites don't show (everything is on the first level). Level is set to 5. Could it be because of a German Sharepoint Portal?
I am developing a client that consumes a webservice over https. The web server is set up to require client certificate. how should I select the client certificate and provide it to the webservice ? Thanks Andrea
You can use the ClientCertificates.Add method of the proxy class.
terrific stuff... thanks..
ddd
Jeden Tag finde ich neue interessante Artikel und Tools rund um die SharePoint Technologien - man kommt kaum noch nach, alle Ressourcen zu sammeln geschweige denn detailiert auszuwerten. Hier die Highlights:
I have an application which invokes(calls) a webservice (on IIS 5.0 , windows 2K) every 10 seconds. After a long time(about 4 hours),the call to the webservice fails. Do you know how to resolve the problem.
Agree.. I will carbon copy and add my letter to the collection... I used the webcasts to train myself and in-house developers on ASP.NET, and usually like to listen to a few on long flights, which I take often enough to care. Microsoft should enable the dev community to archive these or download them much the same as the .NET show, etc. Especially since they are in WindowsMedia format now anyway.
I used to use Anakrino until a friend of mine showed me Reflector. Overall a much better product.
Sorry, used this in the Portal (where it does not show the structure of subareas). Works fine on Sites.
Could be handy :) Nice work.
OK, I know this can't be very complicated but I'm having trouble getting this to work. I've copied the dll to the /bin directory at the root of my WSS server. I've tried uploading various dwp files and dropping the web part on a page, and each time I get the "Web Part appears to be causing a problem" message. Any ideas?
p.s. I added the control into web.config as well.
Could you provide the exact paths where the .dwp and .dll files should go? For both the GAC and BIN methods too. That'd be great.
Thanks for all this infos.
I'd like to confirm the need for more information about where the GAC is; where the WPCATALOG is and where the web.config file is. Those of us who only use (rather than create) web parts haven't a clue about the locations of these bits - heck I can only guess that the GAC is the Global Catalog, but if so what does the A stand for?
I should perhaps also have said that this newest web part is something that I am sure lots of users are demanding from their WSS site administrators! I know it is something I want to have ready for them. The fact that it is available (as a free web part) may even push the use of WSS rather than STS 1.0 which would be a very good thing (I'm suffering from them not wanting to move).
One limitation with SPSv2, however, is that "Portal Listings" within an area are NOT classed as a list and do not have a list ID - therefore they are not picked up by tools such as this. I definitely recommend NOT using Portal Listings if you wish to interract with the data in any way.
To continue on not being able to get this to work, I've added the control to web.config, moved the .dll into /bin, uploaded the .dwp file via the browser, dropped the web parts onto pages and get a "problem web part" error. Additionally, I can view the following in event viewer: Request for the permission of type Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c failed. Any help/advice would be much appreciated. Thanks!
OK got it figured out. Apparently WSS virtual servers have the lowest security permissions by default, meaning any web part that accesses the Sharepoint object model will fail. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_sp2003_ta/html/sharepoint_wsscodeaccesssecurity.asp
I just put it in the gac and everything was happy.
Nice Info! I too have found the documnetation very limiting. Thanks for this great example. ~Jim
I tried to install it but I got a System.Net.WebPermission exception. MediumTrust is not enough? Then I tried to adapt the wss_mediumtrust.config but then I got "Die Sicherheitsberechtigungen der Assembly leadit.sharepoint.rssreader.dll sind zwischen den Anwendungsdomänen nicht kompatibel." Sorry, can't translate that.
Stephan There are two solutions for your problem: 1) put the dll in the GAC 2) change the source code a little bit and: add the following attribute to the AssemblyInfo.cs file: [assembly:AllowPartiallyTrustedCallers] I'm sorry for the hassle, but I'm planning to release an update with that attribute already in it.
1) is in GAC 2) never compiled a web part, just "normal" .NET apps. Sharepoint libs not found. Do I need to install something?
You need to copy the Microsoft.SharePoint.dll from your server to a place on your local machine. Then add a reference from the web part project to that assembly. If you have further questions, please send me an email through the "Contact" link.
Looking for http://www.leadit.be/buildfilebuilder gives a 404. Can this be downloaded as an .exe from anywhere else? Thanks.
I'm using Sharepoint Services (Not Portal Server) and have installed the web parts in GAC and _WPCATALOG I've also modified web.condig as per instructions, however I can't get the breadcrumbs nor navigation to work. They are available allright, but when I drag and drop them to a page nothing happens. Please advice
You can find it here: http://dotnet.leadit.be/buildfilebuilder/
First of all: really great web parts, dude! Second: I just want to share some experiences I made installing the web parts. I am using Windows Sharepoint Service (WSS) using virtual server configuration. In my case I had to create manually a bin directory under wwwroot and had to copy the dll in there. Also use the web config file directly in wwwroot path. After doing that I was at least able to upload (import) the dwp files. I still don't know where to put these files on the server.
Hi Jan. Glad someone else aggrees on the state of the BizTalk documentation, and thanks to guys like you who share ideas. I tried this last night, and found I had to set the Max Ocurrences and Min Occurences properties for the ns0:Customer node to unbound, and 0 respectivly to get repeating groups. This should be done after stage 6. Cheers, Ayjay...
are user defined macros allowed? I was trying to use %src_filename% (from 2002 documentation) but it is not defined for 2004.
You have been Taken Out! Thanks for the good post.
don't think so Mike...
You rock... Thanks for taking the time to do the polishing...
Thanks. Great example worked like a charm in .NET. There's the same thing similar way to do this in MSXML via COM. wwalseth@ix.netcom.com var xmlServerHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.4.0"); if( bUsingAProxy ) { // set the proxy server name, as provided on the settings screen xmlServerHttp.setProxy( 2, "Your Proxy Server Name", "" ); xmlServerHttp.open( strMethod, strURL, false ); // must occur after the connection is opened. xmlServerHttp.setProxyCredentials( "proxyid", "proxypw" ); } // NOTE: set SSL validation flags after opening, otherwise an exception is thrown... if( bServerHTTP ) { // if SSL, then turn off if( strURL.search( /https:/i ) != -1 ) { var nUnknownCA = 256; var nWrongUsage = 512; // requested URL does not match the certificate URL. Occurs when using a IP address instead of a name. var nHostMismatch = 4096; // NOTE: It appears that the numbers are documented incorrectly, invalid date is actually host mismatch! var nInvalidDate = 8192; var nAllErrors = 13056; // Doesn't appear to work xmlServerHttp.setOption( 2 ) = xmlServerHttp.getOption(2) - nInvalidDate; } } // 30 seconds to resolve and connect, 60 seconds to send & receive var lResolve = 30 * 1000; var lConnect = 30 * 1000; var lSend = 60 * 1000; var lReceive = 60 * 1000; xmlServerHttp.setTimeouts(lResolve, lConnect, lSend, lReceive); // NOTE: disable any server cache or proxy for this item xmlServerHttp.setRequestHeader( 'cache-control', 'no-store' ); // Mimic browser form post... xmlhttp.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" ); // For SOAP and XML posting // xmlhttp.setRequestHeader( "Content-Type", "text/xml" ); // Send the document, process any basic HTTP errors xmlhttp.send( xml ); if( xmlhttp.status != 200 ) { throw new Error( xmlhttp.status, "HTTP Error: " + xmlhttp.status + " " + xmlhttp.statusText ); } if( !xmlRec.loadXML( xmlhttp.responseXML.xml ) ) { throw new Error( xmlRec.parseError.errorCode, xmlRec.parseError.reason ); }
What if I want to keep the same name of a file. For example, if the file on the recieve port is foo.xml I want the send port to send the file as foo.xml. Can this be done?
Very good! solved my problem
I want to use IE Web Control to generate Tree struct of Document. Then, How can I deploy the IE web control?
I want to generate Tree by IE Web Control!!!! please help me, I am crazy!!! My E-mail: defrostcn@yahoo.com.cn
A great trick, thanks !!!
You want to use %SourceFileName% - it's case sensitive.
Hi, I've been trying to install the webparts and I've got as far as being able to see them in sharepoint, but when i try and add them to the main page i get the error : "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe." I've added the code to the web.config file, set the wss security to medium and installed it in the GAC using GACUTIL /i to try and get around this but nothing seems to work. Has anyone else had this problem. thanks in advance.
I installed the Leadit.SharePoint.Essentials successfully using Lead-it SharePoint Essential Webparts 1.1.1.0.msi but now when I am trying to install Leadit.SharePoint.RSSReader using the Lead-it SharePoint RSSReader Webpart 1.0.0.1.msi I am not successful. The installation program goes well and gives no errors and says that the installation was successful. When I open up the website and try to look for the web part I don’t see it. After I examined the wpcatalog folder I didn’t see *.dwp file for this web part. I didn’t see the dll installed in the /Windows/assembly/ folder either. So can someone tell me what is going on here? Tam
Thank you so much! Now why didn't they put that in the documentation???
When I elect to display dates with the feeds, they all display as 1/1/2001
You MUST make sure that the assembly is known to the GAC. It worked for us without setting the wss security to medium. Maybe you have some typo in the web.config?
Yes, works like a charm! For that one webservice that you want secured but no want to pay $400 dollar for every year. Like a charm! Thanks!
Hi Jan, Thanks for the article, just wondering if the code is correct. The line: SetExternalFunctionName(GetType ().Assembly.FullName, "SecurityFunctoids.EncryptionFunctoid", "DecryptString"); refers to the class EncryptionFunctoid, but the class name is DecryptionFunctoid. Also, is there a rererence to the SymmetricEncryption class needed? (Would it be possible to post a ZIP of the project?) I am having a real hard time with custom functoids, are there any pitfalls to watch out for? All the best, Alan
You're right! My mistake... I've used a library containing the encryption stuff. Because it wasn't the goal of my post to explain encryption/decryption i've not posted the code of that. If you're intrested you can send me an email using the Contact link.
Excellent article! I hope that Christophe starts writing more articles and feed the excellent MSDN.BE site. Something to be proud of MS friends!
BizTalk 2004 Custom Encryption/Decryption Functoid (via Jan Tielen)
v.gud
Jan, We are working with Microsoft and the issue of handling exceptions inside pipelines has come up. We are looking for a flexible way to catch errors in flat files where the serializer fails for instance. Any good ideas beyond using MOM to catch the error and then routing it back through biztalk? Shawn
Shawn, you beat me... maybe something for in the newsgroups?
how can I assign the value of %SourceFileName% to a variable in an orchestration?
I'm hoping... :)
Found the answer, place the following in an expression: sourceFileName = IncomingMessage(FILE.ReceivedFileName);
Does anyone have any links to see these in action? Also, does anyone have any links to public sharepoint sites?
Jan, I installed your webpart. Unfortunately, your webpart does not seem to offer a proxy settings configuration as tim's RSS Feed Reader does. Since the Global Proxy settings do not work together with our Active Directory integration, I'm curious, if there is a work around to that issue. Furthermore, I was quite happy with Tims RSS Webpart, but for German news it does not show special characters like ä ü ö ß. Does your Webpart support such. Keep on the good work. Your essentials package is very nice, by the way... Lars
Lars, you're right: proxy settings are still missing. Feel free to download the code and alter it yourself! ;-) Keep an eye on my blog for updates. Regarding the special characters, I haven't tested it myself...
Unfortunately it looks like MOM is the best bet. They really missed it on this part of the exception management. It is so good in the Orchetation portion but pipelines are terrible. Oh well, something custom coming up :)
I face an additional problem. In addition to splitting a message, I want to have envelope fields available in my orchestration, e.g. attribute receiveDate when the envelope contained a root element like <customers receiveDate="...">. Is this possible?
It's great, Jan i've search this trick around the world :) Tanks mgi@cdhsrl.it, italy
This is grat work Jan! I thought that at the start of the blog there might have been an "essentials" component to enable an administrator to easily create "Alert Me" for any other user(s) for particular lists... For example, we want all our new users to have an Alert for Issue Log and Tasks - it's the best way to get them to come back regularly...telling the user to create it does not work that well. Any thoughts?
Julian, in a few hours I'm releasing a webpart that can do this, so keep an eye on my blog!
With C# this work beatifull, but i need something like this in FoxPro 8, some body can help me??
Nice work Jan. I am currently working on an article for MS regarding the creation of custom notification channels (e.g. getting alerted via instant messaging) in SharePoint Portal. The portal has quite another approach to the creation and management of alerts. It would be nice to outline the difference between alerts on the portal and alerts in the WSS sites. If I have the time, I will do a post on it!
I got an email from Jan asking me to comment on his Essentials webparts on his weblog. I really like them because they show what I have been working on. I set up a quick and dirty homepage to use them as a simple status report. I used a default template and just dropped the Navigation webpart, the Whats New webpart, and the RSSReader webpart on to the left side. Simple but satisfying! Since I had recently reinstalled Sharepoint to fix an unrelated problem, I had to reinstall the webparts. So I made sure I had the latest versions and started off with the RSSReader. It looked easy. It had an installer! The bad news is that it finishs with an error. ========= WPPackager install log started 3/26/2004 11:18:39 AM ========= 3/26/2004 11:18:58 AM: Error: Config file: 'd:\inetpub\wwwroot\web.config' for virtual server 'http://companyweb/">http://companyweb/' is missing or appears invalid. Could not apply required CAS settings to this server. 3/26/2004 11:18:58 AM: Error: Could not apply required CAS settings to virtual server 'http://companyweb/">http://companyweb/' during installation of 'Lead-it SharePoint RSSReader Webpart' 3/26/2004 11:18:59 AM: Success: Installation Successfully Completed The good news is that the error does not matter!? The dll is in the GAC. The web.config is configured. The webpart is in the wpcatalog. Once you figure out how to configure your firewall you are set. That was actually quite hard. I decided to put my findings in a second post on my weblog since it is specific to ISA. The installation of Essentials was quite easy if you knew the locations of your wpcatalog, web.config, and GAC. I found that I only needed to restart the sharepoint server to start using them.
I'm looking forward to it Patrick! Thanks for your comments.
It's great work. Since I am new developer in Sharepoint portal server 2003, it helps me a lot to know alert functionalty. Thanks.
Nach CeBIT und vor Summit wieder ein paar Links und Ressourcen zu SharePoint:
Excellent, this is a great we part! It would be nice if you could select more than one name in the drop-down list. It would also be nice if the person did not get sent an email to tell them the alert has been set up, but I suspect this second option is almost impossible.
Rohan, your first request can be done; I'll look into it. But as you state: the second request is impossible without writing directly to the config database (I think).
Jan, I was trying to install the code as other web part, but it's not working. By the