Tuesday, October 13, 2009

Tutorial: Writing your own OMS report

For those of you who haven't noticed, Chris Bushnell, a Technical Writer at Sitecore, has written a tutorial describing how to create a Sitecore OMS report based on a profile key.

Check it out here:

Creating an OMS Profile Score Report

Great work, Chris!

Monday, June 15, 2009

Why use "dynamic" sources in the packager?

Here's a little bit of advice that many people may not be aware of:
  • Use dynamic sources whenever possible when you create Sitecore packages.
If you're like me, your first instinct is to use static sources ("add items statically..." or "add files statically..."). That's because it seems easier to choose which items or files to add. It turns out, however, that dynamic sources, while a little harder to create, offer one great advantage; when you create a new package "From Existing...", the package new package will "re-run" the dynamic query to choose items. To understand the difference, consider this case:
  1. You create a package with all items under the "Home" item in the package.
  2. Install the package on a clean site.
  3. Delete most of the items and create a bunch of new items under Home.
  4. Create a new package "From Existing..." (an option in the New drop down menu).
    • If, in step 1 you used "static" sources, the new package will NOT include the new items under Home.
    • If, in step 1 you used "dynamic" sources, the new package will include the new items under Home.
Thus, using dynamic sources allows you to recreate a new package when you've made lots of changes very easily, where as you almost need to start from scratch with static sources. Hope this helps a few people out there!

Friday, October 3, 2008

CMS 6: Allow on User Overrides Deny on Role

OK, I suppose it could be fair to accuse me of being, perhaps, a tad bit on the quiet side with respect to my blog recently. Oh, all right, for the last year or so.

My apologizes.

I can give loads of excuses, but really, I just haven't had much to say. There are many excellent Sitecore bloggers who've done a much better job than I could at bringing forth interesting information.

Perhaps I could have mentioned that we have passed the 2000 certified developers mark (which happened a little while ago), but given that my last post mentioned that we had passed the 1000 mark, I was afraid that doing so would make my blog seem repetitive.

In any case, I do have a little tidbit today that I thought might interest some of you.

In Sitecore CMS 5, our security model had a simple rule:

Deny always overrides Allow

It was one of those simple, clean rules that's easy to explain, but that generally caught people off guard during training, when we asked new developers, "If Audrey is explicitly ALLOWED Write access to item X, but is also a member of the Author role, which is explicitly DENIED Write access to item X, do you think Audrey will be able to change the item or not?"

When you know the rule, the answer is simple, deny always overrides allow, therefore Audrey does not have Write access.

Alas, many people, perhaps even a majority of people, found this confusing. They thought that explicitly allowing Audrey Write access should override the denied access applied to a role.

Well, in Sitecore CMS 6, we've listened to these people and changed the rule. Sadly, this makes the rule a little more complex, but we think people will like it anyway. The rule is now:

Allow set on a User overrides Deny set on a Role, but Deny set on one Role will override Allow set on another Role.

It's still pretty simple, if you ask me.

Enjoy!

Thursday, September 6, 2007

Over 1000 Certified Sitecore V5 Developers

I’m proud to announce that today we certified our 1000th Sitecore V5 developer (and our 1001st and 1002nd).

The number of certified developers is increasing worldwide at an average rate of about 70 developers a month. What's more, about 30% of our certified developers go on to become certified in our API as well (what we call Level 2 certification).

Thanks to all our dedicated Sitecore training centers and instructors for their help in reaching this milestone!

All our certified developers have filled out evaluation forms at the end of training and the results are overwhelmingly positive, especially in their praise of our high quality Sitecore instructors.

If you haven't attended Sitecore training yet, visit the Training section of our website to learn more about the training courses available near you!

Monday, July 23, 2007

Bringing Wizards to the Desktop

It's been a while since my last post, which faithful readers will come to know means that I've been busy doing a lot of writing for my day job at Sitecore. I want to take a second to point out a couple of quiet releases we've made recently. In particular, the Extranet and the Wizard modules.

Now, those of you who have subscribed to the Downloads RSS Feed have probably already noticed these, but I want to point out a couple of special features about both of these.

  1. Desktop Wizards - with source code!

    Both these modules provide full featured wizard style interfaces that run automatically after the package installation and are available via the Sitecore "start" menu.

    What's so cool about that?

    Well, for one thing, the Extranet wizard allows you to add a login form to all the items based on a set of templates in a few clicks. Doing this manually is straight-forward, but after you've opened a template, then opened its corresponding standard values, then opened the Presentation tab, then opened the Layouts drop list, then selected the Edit button, then selected the Add button, located the login form sublayout, typed in the placeholder, and finally selected the OK button on all open dialogs a few times, you realize that this can get tedious if you have to do it for 20 templates.



    With the Extranet configuration wizard, the effort required for 1 template is just a few clicks, and for each additional templates just add a click or two more.

    This is great, of course, if you want to add a protected area on your website (and the Extranet module saves you days of work if you do, plus it's free!).

    Even more importantly, however, we provide the source code and detailed documentation explaining how its all done!

    And, you guessed it, that's not all!

    The wizard module provides you a nice, clean, easy to understand, minimal yet functional, sample wizard that you can use as the starting point for your own configuration wizard (or any other kind of wizard that you want to create). And once again, it's free, the source code is provided, and the documentation explains everything you need to know.

    If you've been thinking about extending the Sitecore Desktop but haven't known where to start, the Wizard module is just what you're looking for!

  2. Starter Kit Plug & Play

    Another great thing about both these modules is that they know when they are being installed in a site that has been developed using a Sitecore Starter Kit. That means that the installation program knows what placeholders exist and therefore can position the login form and other functionality automatically.



    This is a great advantage for those of you who are leveraging a starter kit to shorten development time so that you can increase value for your customers.

    Our vision is to continue this approach for all our modules eventually.

So if you want to get a glimpse of the future, and perhaps to start contributing to the future yourself, have a look at these two free modules!

As always, we look forward to your feedback and ideas for improvements. Please don't hesitate to contact me if you have either.

Wednesday, June 13, 2007

Issue with Starter Kit CSS on IE 6.0 and Safari

Torben Brams noticed that the Starter Kit help site has a cosmetic issue on some pages. Basically, any page throughout the starter kit that displays a menu and content column (no sidebar) and displays a sub-item overview drops the content under the menu on IE 6.0 (as shown below).

I verified this and retested the in Safari and found that it also has some issues with these pages.

To fix the IE 6.0 problem, I changed the #menu-and-content-sublayout-content width from 770px to 750px.

To fix the Safari problems I added a width of 95% to .subitem-overview. This has the side effect of making contact subitems in the sample site appear as a list of locations, rather than a table, but this is more consistant after all.

We will place this under known issues in the starter kit release notes, but you, as a reader of my blog, knew it first :o).

You can download the updated starterkit.css here, if you have already starter working with the starter kit.

Monday, June 11, 2007

Modifying the WebEdit Menu

The Rev. 070531 release of the starter kit improved the WebEdit floating menu. The changes, as described by the Release Notes, are as follows:

  • Unnecessary commands (such as Workbox, Publish, and Switch to Preview) removed from the WebEdit Floating Menu.
     
  • Change Password command added to the WebEdit Floating Menu.
     

Making such changes to the WebEdit menu is very simple. You don't need to work behind the scenes at Sitecore to make similar changes to your own site. This post describes how it was done.

  1. You need to start by logging into the Desktop user interface.
     
  2. Next switch to the Core database (this is where the Sitecore user interfaces are defined).
     

     
  3. Now open the Content Editor, locate the /sitecore/content/Applications/WebEdit/Toolbar item, and open it to reveal its children.
     
  4. To remove commands from the menu, simply delete them.
     
    Or, if you want to be more sophisticated, you can use security settings to decide which roles or users should be able to "Read" the command. Sitecore already does this by assigning Read access for Delete command to the Sitecore Client Authoring role.
     
  5. To add your own command, copy one of the other commands or create a new item based on the /sitecore/templates/Toolbars/Toolbutton template.
     
    To create the Change Password field, we set the following values:
    • Click: security:changepassword
    • Header: Change Password
    • Icon: Network/16x16/key1.png
    • ID: Change Password
    • Tool tip: Open the Change Password wizard.

"Right! OK, that seems very simple," I hear you say, "but I want to create a command to do something else, like offering sorting commands or calling my own method."

Good point. Knowing how to create one specific command is just a bit of trivia. What you really want to know is how to create any command, right? Teach a man to fish, and all that.

Creating General Commands

In order to create general commands, you need to know how Sitecore interprets the various field values and how you can choose appropriate values for what you want to achieve. Let's take them one at a time, shall we?

  • Click
    To find an appropriate value to place here, it helps to be a bit of an explorer, especially if you want to provide a command that already exists elsewhere in the user interface.
     
    A good approach is to locate the functionality you want to mimic. This will provide clues for how to implement the functionality in the WebEdit menu (or anywhere else, for that matter).
     
    For the Change Password feature, for example, we know that this functionality already exists in the Control Panel, on the Preferences page, and sure enough, under the /sitecore/content/Applications/Control Panel/Preferences item, we find a Change Password item with a Click field. We just copied the values for this field into the Click field in our new WebEdit Toolbutton.
     
    If you want to call your own code when someone clicks on the method, rather than some code that Sitecore has provided, then you'll want to add a command element to the [SitecoreRoot]/Website/App_Config/Commands.config. This is how the security:changepassword value works. In fact, if we have a look in the commands.config file, we'll find this line:
     
    <command name="security:changepassword" type="Sitecore.Shell.Framework.Commands.ChangePassword,Sitecore.Kernel"></command>
     
    This tells Sitecore to call a the Execute method of the Sitecore.Shell.Framework.Commands.ChangePassword class, which has been built into the Sitecore.Kernel.dll. If you wanted to call your own class, say MyCompany.MyNamespace.MyClass, you'd create an Execute method in that class that accepted a single parameter (here's an example method signature):
     
    public void Execute(Sitecore.Shell.Framework.Commands.CommandContext CommandContext)
     
    Then add whatever code you like. Most likely, of course, whatever code you like is most likely out of the scope of this post.
     
  • Header The header field holds the text displayed for the button. No magic here. Just type whatever you like.
     
  • Icon
    Sitecore provides thousands of "themed" icons. By "themed" I mean that we provide them in multiple standard sizes, such as 16x16, 24x24, 32x32 and so on.
     
    When I want to find an icon, I use the Windows File Manager to view the [SitecoreRoot]/Website/sitecore/shell/Themes/Standard folder and its subfolders. The icon files are grouped into various sub-folders, like Business and Network, which roughly describe the kind of images you'll find. Under each sub-folder is an additional set of sub-folders which correspond to the size of the icons it contains. I use 32x32 and turn on View Thumbnails when searching for useful icons.
     

     
    By default, whenever Sitecore requests an icon, you can provide a relative path, like networks/32x32/key1.png, rather than typing the full path starting at /sitecore.
     
  • ID
    Just provide something unique here.
     
  • Tool tip
    This is optional. It just provides flyover help for the command.

There are other fields as well, but most of them are self-explanatory. If you're not sure what one does, though, just experiment a little. If you change one field at a time, you can usually work out on your own what a field does just by looking at its effects on the WebEdit menu.

But then, you may be wondering, how do I "publish" my changes? No need, as soon as you save your changes, you will have updated the WebEdit menu. You can even run WebEdit while viewing the Core database, you don't have to switch back to the Master database every time you want to test something.

Of course, don't forget to switch back to the Master database once you are done!

That's it for this post. I hope you found it informative!