Sitecore CMS and everything related RSS 2.0
 Monday, June 23, 2008

Fast Query is an exciting Crestone feature that is usually off the marketing radar. It is a subset of Sitecore Query that executes with SQL speed, meaning fast.

While it's not as expressive as Sitecore Query, you can still retrieve items using item paths, IDs or names, field values and parent/child relationships, which is what people need 80% of the time. The performance gain is outstanding - think writing an SQL query instead of going through all the items using the Sitecore API.

How to Use the Fast Query?

Much like standard Sitecore Query before, you can use Fast Query either in field sources or in the API. To indicate that that your query must be executed in the "fast" mode, prefix it with "fast:" :

image

The API way:

Sitecore.Context.ContentDatabase.SelectItems("fast:/sitecore/content/home/*");

Note that relative queries starting from a specific item are not supported, you cannot use fast query in item.Axes.SelectItems.

So What Queries are Supported?

  • Only child and descendant axes are supported. For example you cannot search for a parent of a specific item or following-sibling.
  • The following special attributes are supported: @@id, @@name, @@templateid, @@masterid and @@parentid.
  • String comparison is converted to SQL LIKE operator.
  • Functions are not supported, contains() is replaced by string comparison which behaves like SQL LIKE.
  • Subqueries are not supported. i.e. the following query won't work: //*[../@name='Home']
  • It is not possible to query from a context item, only the whole database.

(More on query syntax in the original Crestone beta forum post by Dmitry Kostenko)

How to Test?

The XPath Builder works great with Fast Query. Open Developer Center, select Tools menu and then XPath Builder. Remember to prefix your queries with "fast:":

image

Performance

XPath Builder actually shows how much time it spent executing the query, so we can see the difference the fast query makes:

Switch the XPath Builder to the core database (it's much bigger than the master in a clean Sitecore installation).

fast://*[@@name = 'Home'] takes 1-2ms.

//*[@@name = 'Home']  takes 350-500ms after the first couple of runs.

New Usage Scenarios

Fast Query enables scenarios that weren't possible before because of the query speed:

In Sitecore 5 we have a shared source "My Locked Items" module that has to use caching and subsequently cache invalidation to get a list of items locked by the user with a decent performance.

In Crestone we have a built-in Locked Items application, that does pretty much the same but was trivial to make, because all it has to do to get the list of items locked by the user is to run the following query:

Database.SelectItems("fast://*[@__lock='%sitecore\\Admin%']"

The Crestone version of the RSS module will also use the fast query to retrieve items while building the feed, which will hopefully make generating feeds per-demand more feasible.

Summary

It doesn't get much simpler: the new query is fast, use it to make your sites more responsive or to provide better features which you couldn't implement before.

 

Update: As of June 14th, 2008, the fast query is considered an experimental feature in Sitecore 6.0. It's recommended that you test the results of the query first - in some situations it's possible that queries relying on parent-child relationships can return results that are slightly out of date. This is likely to be fixed in the following versions of Sitecore.

Monday, June 23, 2008 4:29:36 PM (FLE Standard Time, UTC+02:00)  #    Comments [2] -
Sitecore | Crestone
 Thursday, June 12, 2008

After the Carousel, Slider and Visual list field types, I've decided to take a pause to work on the  quality and make an actual release. This includes all of the housekeeping well-behaved Sitecore fields should do, bugfixes (thanks for the feedback, really) and documentation.

What's changed:

  • Carousel and Visual list can be used outside of the media library. They will default to using the content item icon, but it's also possible (and expected) to supply an image field name to take the image from. Same works for item titles. See the documentation for configuration examples
  • All fields now properly indicate their changed state to Sitecore, which results in timely "Do you want to save the item" prompts
  • All fields also support readonly state - if the item is protected, or the user does not have write permissions, the field will be rendered in readonly state ("grayed out")
  • Carousel and Visual list fields support link checking
  • Production and Items Only (development) packages and package projects are included.

It's time to call it a Beta - see the Field Types trac site for downloads.

The goal is to apply more polish and make a quality release when the time Crestone ships, so that the fields can be used right away.

Some tickets are already piling up for the next release. If you have ideas for new field types - send them in, or contribute.

Thursday, June 12, 2008 12:51:46 AM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore | Crestone | Open Source
 Sunday, May 25, 2008

RSS module trunk is shaped up to support Crestone. The module no longer requires web.config to be modified after the installation, packages are updated, and the project structure is changed to match rest of the modules more closely.

After some surface testing the module appears to work fine on Crestone, the updated Crestone beta should do.

Trunk development has moved to Crestone;  Visual Studio 2008 is required to work with the project. Use Sitecore5 branch for the stable Sitecore 5.3.x version.

From the feedback, accumulated during the module lifetime, these are the goals I see for the next version:

  • Update the module to work with Crestone (almost there, needs more testing)
  • Simplify feed creation, configuration and troubleshooting - ease of use.
  • Add more extensibility points, to allow partners to better fit the module to their needs without modifying the module itself.

What do you think?

As always, packages, source code and updates are available at the trac site.

Sunday, May 25, 2008 8:11:00 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore | Crestone | Open Source
 Saturday, May 24, 2008

Another field type is up and running: introducing Visual List, allowing to maintain a list of images (or any items, in future) in a very simple and visual way. The field allows editors to select any number of images from a specified source, and supports drag-and-drop reordering.

Good usage scenarios for this fields include maintaining a list of banners to rotate on the page, a list of product images, etc. An advantage over using a set of subitems to achieve the same functionality is editor experience: no not having to switch items saves a lot of editing time, and its easy to see all selected items at once.

visuallist

The Outercore fieldtypes project, which now includes Carousel, Slider and Visuallist fields, has moved to Sitecore shared source repository, so no more download links in the blog.

Use the project trac site to view or update the documentation, download the source, file tickets or watch the updates. I'll continue to post update summaries in the blog.

Bug reports, new field type ideas are welcome.

Contributors are most welcome, of course, mail me to become one.

Saturday, May 24, 2008 4:35:58 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore | Crestone | Open Source
 Saturday, May 17, 2008

The Crestone beta update was made available on Friday (requires beta forum access).

Apart from numerous fixes and tweaks, it should be able to run both Carousel and Slider fields.

Have fun, and let us know how it feels.

Saturday, May 17, 2008 1:23:53 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore | Crestone
 Wednesday, May 14, 2008

Continuing with additional field types for Sitecore: introducing Slider.

Slider is a fairly simple control, that currently only supports numeric values. To set up the field, you need to define minimum and maximum values, and an optional list of allowed values.

Here is what you get with Source= Min=0&Max=200&Values=1, 5, 10, 15, 25, 35, 100, 200

image


(if you're reading this through rss reader, you might not see the flash movie above)
 
The field shares the same project with the Carousel, named Outercore Fieldtypes. It also requires Crestone and will not run on the beta build. I'm still putting the updated package online, which also includes Carousel fixes, just in case.
 
Download package (includes source code). Use FieldTypes Trac site for downloads.
Wednesday, May 14, 2008 12:38:46 AM (FLE Standard Time, UTC+02:00)  #    Comments [3] -
Sitecore | Open Source
 Tuesday, May 13, 2008

I've pushed RSS module updates to the shared source repository. These are some small tweaks that were made after the latest release (i.e. what is available on the SDN). From commit logs:

  • Scheduled command to update RSS feeds in database
  • Ability to use $(dataFolder) macro when defining disk location for xml feed
  • Fixed bug with dates not being converted to UTC, which is required for ToString("r") to work properly
  • Added 'Date Field' field - possibility to specify which field should be used to get the publication date of the item

Future plans include conversion to Crestone and Visual Studio 2008, and some Crestone-specific tweaks.

Tuesday, May 13, 2008 10:46:13 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore | Open Source
 Monday, May 12, 2008

A little weekend project to add more field types to Sitecore's arsenal: introducing Carousel.

What you hopefully see below (once the flash loads) is a "Carousel" field type, with a source set to a media library folder. User can select one of the thumbnails, or, if there are more items than can be fit in the available space, scroll to see more . The field value is an ID of the selected item, as you would expect.

 
Possible enhancements include multi-selection support, ability to work with regular (non-media) content items, better customization (how to get image and text) - the feedback is welcome.
 
The field requires Crestone and will hopefully run on the beta build. It's in a rough alpha shape, only tested in IE7, but hey, the CMS is in beta too. Ideally I'd like to move it to our shared source repository once it matures a little.

Download package (includes source code). Use FieldTypes Trac site for downloads.
Monday, May 12, 2008 1:05:55 AM (FLE Standard Time, UTC+02:00)  #    Comments [3] -
Sitecore | Open Source
 Wednesday, April 23, 2008

I'd take Consolas over Courier New any time. Turns out it is available for a free download, so having Vista or Office is not a requirement.

If you're still using Courier New in Visual Studio because you haven't tried anything else - give Consolas a try.

In Visual Studio: Tools -> Options -> Fonts and Colors

image

Wednesday, April 23, 2008 6:52:47 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Visual Studio
 Friday, January 25, 2008

“Haml is a markup language that‘s used to cleanly and simply describe the XHTML of any web document, without the use of inline code. Haml functions as a replacement for inline page templating systems such as PHP, ERB, and ASP. However, Haml avoids the need for explicitly coding XHTML into the template, because it is actually an abstract description of the XHTML, with some code to generate dynamic content.”

Basically Haml is a domain specific language for XHTML. Unlike Velocity, which can be used to output any text data, Haml focuses entirely on xhtml output — and does it well.

Instead of:

  
<h2><%= ViewData.CategoryName %></h2>
<ul>
    <% foreach (var product in ViewData.Products) { %>
      <li>
        <%= product.ProductName %>
        <div class="editlink">
          (<%= Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID })%>>
        </div>
      
    <% } %>
  </li></ul>
  <%= Html.ActionLink("Add New Product", new { Action="New" }) %>

You can do this:

%h2= ViewData.CategoryName
%ul
  - foreach (var product in ViewData.Products)
    %li
      = product.ProductName 
      .editlink
        = Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID })
        = Html.ActionLink("Add New Product", new { Action="New" })

(It does look like python, doesn't it?)

Do we need it?

Andrew Peters has created a NHaml, .NET port of Haml made as an alternative view engine for ASP.NET MVC.

I assume it wouldn't be too hard to take it apart and create a Haml rendering type for Sitecore as a downloadable extension. Is this something you find interesting? I love its clarity and wrist-friendliness, and it should be much easier to type online using Developer Center or even Content Editor.

The downside is that you'd lose intellisense in visual studio, but personally I'm much more annoyed by visual studio trying to format my <% %> code the way it thinks i like it. And yes, it's yet another templating engine.

 

* Haml reference

Friday, January 25, 2008 5:52:07 PM (FLE Standard Time, UTC+02:00)  #    Comments [0] -
Sitecore | Web development
Archive
<June 2008>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345
Blogroll
 Alex de Groot
Few words about SiteCore from Holland
 Alexander Shyba
Sitecore Support
 Anders Dreyer
Anders Dreyer on Sitecore Development
 Jakob Christensen
Sitecore Core Development
 Lars Fløe Nielsen
Lars's ramblings about development and business processes
 Ole Thrane
Sitecore API
 Runi Thomsen
Runi Thomsen Sitecore Toughts
 The Sitecore Experience
The Sitecore Experience
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Alexey Rusakov
Sign In
Statistics
Total Posts: 199
This Year: 49
This Month: 3
This Week: 0
Comments: 0
Themes
Pick a theme:
All Content © 2008, Alexey Rusakov
DasBlog theme 'Business' created by Christoph De Baene (delarou)