Maintenance on larger installations part 1: Resetting security

For one of our customers we are upgrading their Content Management Solution to another level. Problems found in the pevious versions in Sitecore are resolved after an upgrade and now we’re busy creating a stable base so Sitecore can be the base for all company-wide internet publications and the intern goup of developers is able to build their own solutions.
For the reason written down above, we had to decide to redesin the workflow and start at 0 with a clean security model. As you don’t want to reset your security for all domains(if you want to use Sitecore.Configuration.Factory.GetDomainNames() as domain-source in the PageLoad below) and Sitecore does not allow you to reset everything with just a sinle click, I’ve written some code:

private void Page_Load(object sender, System.EventArgs e)
{
Sitecore.Context.SetActiveSite(“shell”);

using(new SecuritySwitcher(Sitecore.Context.Domain.GetUser(“Admin”)))
{
ResetSecurity(Sitecore.Context.ContentDatabase.GetItem(“/sitecore”),new string[] {“sitecore”}, true, true);
}
//Sitecore.FieldIDs.Security;
//Sitecore.FieldIDs.InheritSecurity;

}
private void ResetSecurity(Item rootItem, string[] domains, bool inheritSecurity, bool recursive)
{
if(rootItem != null)
{
rootItem.Editing.BeginEdit ();

Response.Write(“Reseting Security for ” + rootItem.Paths.FullPath + “<br />”);
RemoveDomainSecurity(rootItem.Fields[Sitecore.FieldIDs.Security], domains);

Response.Write(“Settings Inherit Security to ‘on'”);
rootItem.Fields[Sitecore.FieldIDs.InheritSecurity].Value = “1”;

Response.Write(“Finished resetting.<br /><hr />\n”);
Response.Flush();

rootItem.Editing.AcceptChanges();
rootItem.Editing.EndEdit();

if(recursive && rootItem.HasChildren)
{
foreach(Item childItem in rootItem.Children)
{
ResetSecurity(childItem, domains, inheritSecurity, recursive);
}
}
}
}

private void RemoveDomainSecurity(Sitecore.Data.Fields.Field securityField, string[] domains)
{
SecurityField myField = securityField;
foreach(string domain in domains)
{
SecurityAssignment[] assigments = myField.Assignments.Select(domain);
foreach(SecurityAssignment securityAssign in assigments)
{

securityAssign.Clear();
Response.Write(“Resetting rights ” + securityAssign.Rights.ToString() + ” for Domain ” + securityAssign.DomainName + ” and the Entity ” + securityAssign.EntityID.ToString() + “<br />”);
Response.Flush();
}
}
}

It quite recommed to backup your master database before you use the stuff above ;).
Your access viewer for your Access Viewer for the editor will look like this:

When you login as an Editor after resetting your client, you’ll receive a Nullpointer when opeing the Content Editor. Nice error handling ;).

First screenies Sitecore 5.3

Finally, there are screenshots available for Sitecore 5.3. This new generation of Sitecore development, which is based on the .NET Framework 2.0, introduces lots of new functionality requested by partners and customers, based on the experiences the past year of Sitecore 5 usage and development. .NET 2.0 also brings the ability for the core development team to expand the functionality with the new intergration in SQL Server 2005. Next to it, the API will be restyled, using Generics and Nullable types, to make a even better abstract Framework.

Here are screenshots I’ve seen:


The new IDE: Sitecore XPath tester


The new editor, screenie 1


The new editor, screenie 2

I’ll keep you guys informed. The sources of these screenshots are just the blogs of Jakob Christensen and Lars Nielsen.

GoudenGidsDivisie.nl

For one and a half week now, GoudenGidsDivisie.nl is online. Our last Sitecore 4 production which has start in November 2005.
LECTRIC’ Team Sitecore Lead Engineer Patrick, has decided to use Sitecore 4 because because of proven stability with big, advanced sites. Next to it, content isn’t managed in an active way, it will be collected using a feed from another site. Yeah Ruben, we know, this will cause penalties in Google!

Well know, describing the site:
What is/does/contains the site?
GoudenGidsDivisie.nl is a site of the second football league in the Netherland. The site does contain information about teams, player, games, seasons, subseasons, sponsors, topscorers, and, and, and… Inbitial the site is designed for IE and Moz, both are stgill supported altough Moz does not render everything the way it should be.

How do you collect this huge amount data?
Well that the nicest part of the full website. The Window Service which is running on the database server. It does read variabel feeds continiously. The feeds are provided by Voetbal International. We store the colected data in a SQL-Server database. Sometimes we join a little or have written some intelligent Stored Procedures, but most of the time VI has already given us the process-data :).

Uhmm, so you actually don’t use Sitecore?
Definitelly wrong! We needed a basis to place all the 300+ layouts in ;). Therefor we used Sitecore in a different way then we did before. Sitecore is in the GGD-website, the red-line.
For example, look at this url:
http://www.goudengidsdivisie.nl/clubs/club/team.aspx?cid=464
90% of this all is handled by Sitecore. But you have to connect to a database, so sometimes you’ve to use the QueryString. This could be resolved by creating a dataprovider for Sitecore. But that would be a bit overkill and very complex for the amount of data stored inside the database.
You definitelly should look at the Breadcrumb in the link above. In one word brilliant :).

Allright, it looks good, I suppose you have made this website, Alex?
Uhmm.. well.. uhm.. thank you for the compliment, butt uhmmm… Well to be honnest. I’m affected in the whole process but 75% of the site is created by Patrick and Alfred, two of my collegues. I’m responsible for the Windows Service(Patrick has also written some of the ‘FeedProcessors’) and the general Sitecore structure(the way of creating controls, building pages, etc, most templates and masters are amde by Patrick/Alfred).
Another collegue who deserves a compliment is Wouter. Wouter didn’t write anything in Sitecore before, so we gave him a cool job to start. Wouter did create the Poll-module(with a little help ;)). Used his hand to fine-tune a lot and was responsible for most of the testing of the site.
Hans and Leonne were responsible for the customer-contact and internal project management.

Altough it can be improved a lot, I’m really proud of this site. In the near future, we’re going to expand the Windows Service and the website-functionality.

In Memoriam: Jan Jacobs

Last monday, we (LECTRIC) just came back from Chatel in France. From the wednesday till the saturday, we had some brilliant days in the snow.
The monday became a black day in the history of LECTRIC. In the morning the terrible news arrived at our office in Zaltbommel.

Jan Jacobs our Senior Adviser / Account Manager Jan Jacobs has left us the thursday before.
In Memoriam

Our toughts are with the family and relatives of Jan.

Jan, we will miss you.
Rest in peace.

-Alex

IE7, Modal dialogs, Feedback and SDN5 Problems?!

One of the main differences in IE7 is the way modal dialogs are implemented. For example: in all the dialogs is the addressbar displayed. It’s launched in another way(it goes trough a different security pipeline). Mostly it has the same properties a popup. But.. there’s more! You can resize them without any problem and last but not least, you never got that problem again that everything is locked because there’s a hidden modal dialog. IE7 will change the tabicon. For more information about modal dialogs click here.


The publishing dialog of Sitecore 5.1.1.11

By the way, the IE-team does give feedback in chatsessions. You can find the shedule of those chats here. Can we do those sessions with Ole and Runi for Sitecore too…? 😉

SDN5 isn’t right rendered by IE7. I guess Alexey Rusakov has made SDN5 and he should shame himself! 😛
I found this in their HTML:

Now my searchbox in IE7 looks like this?!


Only 1 line of the box appears