Sitefinity SimpleImageSelector to return Url of image instead of Guid

It's been quite a while but I've found something to blog about!

I've been working with Sitefinity for some time now and one of the things that I've struggled with, and I'm not the only one is something that should be simple.  See, all I want to do is be able to choose a picture from one of the libraries within Sitefinity and be able to display it via the GUID it returns or the path of the URL.  I want to do this from my user control or a custom control.

Well, it turns out that this is not built in, at least I've not been able to get anything working correctly until I found this post and was able to get it to work.  However, I want to store the relative URL of the image so I made a small change to make it return the URL instead of the GUID.

To make the change, in the SimpleImageSelectorDialog.js file, on line 43, change the original line:

var selectedValue = this.get_imageSelector().get_selectedImageId();

to the new line:

var selectedValue = this.get_imageSelector().get_selectedImageUrl();var selectedValue = this.get_imageSelector().get_selectedImageUrl();

Of course, save and recomple the project and now it will return the URL instead of the GUID of the image from the choosen Album.


How to re-create Default Domain Group Policies in Windows Server 2003

Having inherited some rather strange Group Policies on our Windows Server 2003 server, we wished we could just go back to the default policies.  We figured out how to do it but it is not recommended unless you have no choice.  After trying to get some permissions corrected and finding them so messed up, we decided it was less of a problem to blow them away then continuing to deal with what we had been in the past. 
Please use this with caution and a full understanding of what it will do to your domain!
To reset the Domain Controller Default Group Policy, do the following:
1.       On all Domain Controllers, issue: net stop ntfrs at a commend prompt.
2.       On one of the Domain Controllers, at a command prompt issue: dcgpofix and answer ‘Y’ to all prompts.
3.       If you have an Exchange Server, add Exchange Enterprise Servers to permissions by going to the group policy, (gpmc.msc), computer configuration ->Windows Settings -> Security Settings -> Local Policies -> User Rights Assignments, check to ensure policy is defaulted with all permissions.   To work with exchange, in the same location, locate the “Manage Audit and security log” and add “Domain Name\Exchange Enterprise Servers” to the permissions. (You could re-run the exchange setup with the “/Domainprep” switch to do the same thing.)
4.       To ensure the files are not overwritten, on the same machine that you ran dcgpofix , edit the following registry key to make the authoritative file server when replicating: At a command prompt, type regedit, navigate to “HKLM\SYSTEM\CurrentControlSet\Services\NtFrs\Parameters\BackUp\Restore\Process at Startup” and modify the “burFlags” setting the value to “D4”. (D4 sets the authoritative machine, setting the other machine or machines to D2 will force them to replicate from the machine with the D4 setting.) On the other Domain Controllers, edit the same key and set the value to “D2”.
5.       On all machines, issue: net start ntfrs  This should start replication and all Domain Controllers should have an entry in the “Application Log” indicating success. You can manually test the replication by creating a new text file under “C:\window\SYSVOL\sysvol\Domain Name\Policies” which will be replicated to the other machines. (Replace Domain Name with the name of the domain)
6.       Check the replication by going to “AD Sites And Services”, -> Sites -> Servers, under each server -> NTDS Settings, in the right pane, right-click and choose “Replicate Now”. This should be indicate that it is successful.
We had very few problems  after running this process.  It was just better than were  we were.

Working with WF, WCF and attending TechEd 2007

Wow, it has been a while since I have blogged!  I've moved half way across the country to Orangeburg, SC about 40 minutes southeast of Columbia, SC.  Orangeburg is a small town and I went to work for a small private university called Claflin University.  The job is good but has many challenges.  Last week I attended TechEd 2007 and the INETA User Group Leadership meeting on Saturday.  Things have changed over the last year, it looks like a new landscape and I have been feeling like I have fallen behind.  I talked to many people and inquired about what they are doing and discovered that they are just as far behind so I left feeling like it was the right time to catch up.  It felt good to take the time to concentrate on the new items and discover what the new possibilities are.

I've been concentrating on WF (Windows Workflow Foundation) and combining it with WCF (Windows Communications Foundation).  There are vast improvements over previous communication capabilities, WCF is fun and for the first time in my programming career, easier to understand and most importantly, easiest method of changing the communications method to support another method of delivery.

In speaking with some other individuals at TechEd, some believe that Workflow will probably not make the adoption level needed to keep it alive.  I have been reflecting on it and I would have to say that I disagree.  I think Workflow will make it and stay alive and it looks like it takes on greater emphasis in "Orcas" to be released later this year.  I've been exploring WF for some time now and I'm going to get a small project started using it.  I'll blog about my experiences and challenges with implementing this project.

Stop the 'Show all files' solution and learn the wonderful world of 'My Project'.

It is a lot of fun, discovering all the new things in Visual Studio 2005.  My chosen language is VB and there is a lot to discover and understand.  I love every minute of it, though one thing seems to bother me.  I've been reading through one of my subscribed list servers and was struck by a suggestion on how to solve a problem.  It isn't really a problem, it is just done differently.  The problem was how to implement the version information in a VB project.  The suggested solution was to click the 'show all files' and then change the file.  I witnessed a similar suggestion to a question posed by a stuck presenter during a presentation.  The suggestion was to click the 'show all files' in the project view window.

I was puzzled the first time this was suggested.  I have explored the new way of opening the 'My Project' item and filling out the information in the 'form' format.  I much prefer this as my typing ability often leads to misspellings or typo's in the raw xml format.  When this was suggested a second time, I began to wonder.  Do they not know that you can 'open' the 'My Project' item?  Did they explore it at all?  I do not know but it is clear to me that this is my preferred way of dealing with all the 'Project' related items, like versioning, compiling, etc.  If you are unfamiliar with this, the just double click the ‘My Project’ object in the solution view.  Then change away without dropping down to the raw xml files.

It Depends!

I’ve been busy.  Don’t ever seem to have enough time to write about my current projects.  Time seems to fly when you are having fun.  It started when I was at TechEd 2005, manning the INETA booth.  I was approached by a guy who asked me if I was a User Group leader.  I responded that I was and he introduced himself as an employee of Red-Gate Software.  He told me that if I did a presentation utilizing the Ants Profiler, he would give me one and provide one as a giveaway during our meeting.  I took the information down and didn’t think about it for a couple of weeks.  It stuck in the back of my mind because as I write code, VB.Net is my preferred language, I found myself wondering what would be faster, the equal sign or the .Equals keyword.   How was I to tell?  I contact Red-Gate Software and sure enough, they provided me with a copy and I agreed to do a presentation.  This set me on a long path that at times, drove me crazy and sometimes pulling my hair out. (I have only a little left!)


So what is faster, the “equals” keyword or the equals sign when comparing strings?  Does it still hold true if I use integers?  This was the start of many weekends of testing using the Ants Profiler.  I found it easy to use and easy to profile code.  The results astounded me and I found that everything I believed was not always true.  After spending several weekends with the product, I’ve developed a very basic philosophy.  Never believe anyone who tells you, “This is always faster than that.”  Profiling code using this product makes me say, “It depends!”  Nothing is set in stone and using strings instead of integers will often produce different results.


I plan to publish some code and examples to prove my point.  Now that VS 2005 is available and I have it installed, I will be checking the new version against the old version and see if any optimizations have taken place.

Starting a second project to finish the first project.

Ever start one thing and end up tearing everything apart and rebuilding it up to accommodate the first thing you started?  We are getting ready to implement Cisco’s Clean Access product and it was obvious we needed to improve the network structure and minimize the broadcast domains.  So on Friday night at 5:00pm, we are rebuilding and restructuring the entire network.  New routers, switch configurations and all new IP addressing formats.  We figure there are about 1200 devices which will need new addresses, luckily we use DHCP and it should be a few hundred which need static addresses.  It’s going to be a long weekend, and then we get to start the next week implementing Clean Access.  Well, at least my programs will run faster and without congestion on the network.  Think I’ll notice the improvements?  Think my end users will?  NOT!  They’ll wonder what was accomplished!

At least I can remember where to find the answer.

How did we ever manage all those little things we can never seem to remember?  It is always the little things, we should be able to remember but we just can’t.  It is not complicated or difficult, just some sort of mental block.  For instance, I can never remember the exact construction of a connection string for SQL Server.  It is not particularly hard or difficult but I can never seem to remember the exact sequence depending on how I want to connect.  I remember the server name and the database, but that is about all I can remember.


Luckily, not all of my brain is hampered by a mental block.   I can at least remember where I need to go to find my answer to this little problem.  Thank God for the people who maintain , the place I frequent at the beginning of almost every new project.  I’d be in trouble if I had to remember connection strings in my head.

The move to 64 bit.

We have decided it is time to take the plunge on 64 bit servers.  Every summer we buy new servers to support our objectives for the next academic year.  This year we are buying Intel 64 Xeon processors and the 64 bit Opteron processors.  We are looking forward to working with the machines and can't wait to put 64 bit applications to work.  Our first struggle is whether or not to go with the new dual core processors or stay with multiple processors.  For us, it came down to getting a dual processor and leave room for a second dual processor if required later in the year.

I'll blog more about our experiences after we have put them in place, stay tuned.

Ever have one of those nagging questions that you just can't find an answer to?

Ever have one of those nagging questions which should be easy to google for and sovle?  It should be simple but everyone you talk to, even when I have asked the experts at Tech Ed 2005 can't answer.  A puzzled look appears on their face  and they know there is an easy answer but can't quite remember how to do it either.  Don't you just hate those kind of questions?  It is not really important enough to spend money on it and research it, but it sure be nice if you found the one property that needed to be set and all would be right with world.

You have a Windows Forms MDI application.  You open a child window in the MDI parent and it opens exactly where you expect, the upper left corner.  Then you open a second and it cascades down 1 position, just as expected. You do the same with a third child window, and a fourth.  They all cascade down and to the right, really nice and pretty.  You then close each one until all four are gone.  Not hidden, but closed and references released

Now you decide to open a new child window, and the darn thing opens in the fifth cascading position!  Ugh!  It opens in that position even though none of the other windows are open.  Why does it not open in the first position again?  What is the property that needs to be reset so it starts at the top right most position?

To Incorporate a .Net User Group?

This is our current question.  Our user group, has been struggling to grow and prosper.  We suffer from lack of structure and firmly assigned positions.  We are just a group of interested users trying to make a group go.  We have the unique distinction of being the only user group in the state of Kansas.

After attending the INETA User Group Leaders Summit at TechEd 2005 in Orlando, I have become more convinced than ever that our group needs to incorporate to give us structure and a lasting foundation on which to build.  Others, I'm sure, will argue that this is not needed, that it can happen without this overhead.  But in my experiences from talking to them, I can't help but get a feeling in my gut of an untold reasons for not pursuing organized structures.  We want to keep our membership free while offering the highest quality of speakers and presentations.  We have needs as we grow and expenses, being a 501c3 corporation will remove a barrier to corporate sponsorship and give credibility to our group. 

I will blog about our journey and whether it is worth it.

Finding users in the Active Directory

One of the frustrating things I find in my daily work is finding someone in Active Directory to change some information.  I find it frustrating that I can't assign a shortcut key to instantly bring this up to exactly the point where I can type in a name to find an account.  It is just one of those things.

I could write my own, but then I'd have so much work into it, I'd feel like I should sell it.

I call it, the “loss of the love of the game.”

It is frustrating to be working in the academic field and be a computer professional and developer.  It is a wonderful time to be in the computer field, great operating systems, competition driving innovations, and new thoughts for software development, new products all around and many excited and talented individuals willing to share everything for just the thrill of sharing.  I have been in the computer field for about 25 years and I can’t think of a better, more thrilling time to be in this field.  Some call me crazy, but we can do so much in a short period time for such little money, with much more on the horizon.


What I find frustrating is the lack of dedication to the field of computers by professors who love to teach but have lost the love of being on the leading edge.  I can best describe it as a “loss of the love of the game.”  The game is keeping current and being proud to be on the leading edge of technology.  I have been in classes and talked with students who are frustrated when they figure out that the professor has not been keeping up with the latest trends yet representing themselves and the classes that they teach as cutting edge.  A football coach who has lost the love of the game is given the boot because the team reflects the loss and loses all the time.  So why is this not the case in academics?  It is certainly true of athletics but never of academics.  The same professors are allowed to continue to teach the same old way against the same old technologies even though the technology has been deprecated.


I have come to realize that professors are professors first and foremost because they love to teach.  They teach computers because it is something that interests them but not enough to keep up with the new technology.  I know it is tough to stay up with the new trends but if you want to survive, professors must stay up.  Students expect it and most importantly, they want it.  It doesn’t have to be easy to learn, it is the student’s job to want to learn and be willing to put the time in, and it is the professor’s job to teach it in a way which makes it learnable and keep up with the latest trends.


I am somewhat torn between sympathizing with the professor and blaming them.  On one hand, the money allocated to them for furthering their own learning is often limited or non-existent.  But on the other hand, many others are in the same boat and yet they manage to learn the new trends.  Nobody is as broke as a college student, yet they all seem to have the latest computers and software.   Why not the professors?   Where has the “love of the game” gone?