Sitecore Swamp

Dive in the Sitecore Swamp

NAVIGATION - SEARCH

Source Code Version Control - Branching Strategies

Branch strategies:
Main only


This is the most simple and easy maintain branching strategy, which can later evolve to other branching strategies.

Considerations
  • Without branching, labels need to mark development and release milestones.

Development Isolation


Release Isolation
Development and Release Isolation
Servicing and Release Isolation
Servicing, Hotfix and Release Isolation
Code Promotion
Feature Isolation

Sitecore Version History


REFERENCE:
  1. Kiran Patil: http://sitecorebasics.wordpress.com/2014/04/20/sitecore-cms-version-history/
  2. John West :  http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2011/05/Sitecore-ASPNET-CMS-Version-History.aspx
  3. Kim Hornung : https://www.blogger.com/feeds/36416442/posts/default

Welcome to BlogEngine.NET 3.1

If you see this post it means that BlogEngine.NET is running and the hard part of creating your own blog is done. There is only a few things left to do.

Write Permissions

To be able to log in, write posts and customize blog, you need to enable write permissions on the App_Data and Custom folders. If your blog is hosted at a hosting provider, you can either log into your account’s admin page or call the support.

If you wish to use a database to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.  If you are interested in using Microsoft SQL Server, MySQL, SQL CE, or other databases, please see the BlogEngine docs to get started.

Security

When you've got write permissions set, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change password, create new users and set roles and permissions. Passwords are hashed by default so you better configure email in settings for password recovery to work or learn how to do it manually.

Configuration and Profile

Now that you have your blog secured, take a look through the settings and give your new blog a title.  BlogEngine.NET is set up to take full advantage of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.  Be sure to fill in your author profile to take better advantage of this.

Themes, Widgets & Extensions

One last thing to consider is customizing the look and behavior of your blog. We have themes, widgets and extensions available right out of the box. You can install more right from admin panel under Custom/Gallery.

On the web

You can find news about BlogEngine.NET on the official website. For tutorials, documentation, tips and tricks visit our docs site. The ongoing development of BlogEngine.NET can be followed at CodePlex where the daily builds will be published for anyone to download.

Good luck and happy writing.

The BlogEngine.NET team

json2csharp

http://json2csharp.com/

[

   {
      "firstname":"Jeff",
      "lastname":"Wang",
      "boys":[
         {
            "firstname":"Daniel",
            "lastname":"Wang"
         },
         {
            "firstname":"Brandon",
            "lastname":"Wang"
         }
      ],
   }
]

=> 

public class Boy
{
    public string firstname { get; set; }
    public string lastname { get; set; }
}

public class RootObject
{
    public string firstname { get; set; }
    public string lastname { get; set; }
    public List<Boy> boys { get; set; }
}

Querying items in Sitecore

http://firebreaksice.com/options-for-querying-items-from-sitecore/

Sitecore Query

Sitecore Query is probably the most commonly used approach as its the standard way to query content. Sitecore-certified developers likely all know Sitecore query as a starting point. An easy way to help build up your queries correctly is to use the XPath builder in the Developer Center.

Unfortunately, Sitecore Query has performance issues depending on how you build your queries. Creating very specific queries has a performance hit because the query magic built into Sitecore has to do more checks on each item. A recommended practice when using Sitecore Query is to make your queries as generic as you can and use .NET to loop over the results and filter them further.

Let’s consider the following type of query and how it can be adjusted. Say you want to retrieve all items at a specific path of a certain template type where each item has specific field values. A good approach would be to not include the check for the field values in the query, but filter the results using C#. So for example, let’s find all Employees under the About section and filter them with C# based on some field criteria. The example below makes a fairly generic Sitecore query and uses LINQ to filter the results:

1
2
3
Item[] allEmployees = db.SelectItems("query:/sitecore/content/home/about/*[@@templatename='Employee']");
 
IEnumerable<Item> employeesWithNames = allEmployees.Where(item => item.Fields["First Name"].Value != "" && item.Fields["Last Name"].Value != "");

The lines of code above will: (1) get all immediate children of template “Employee” under the “about” item, and (2) will use LINQ to loop over each resulting Sitecore Item and will check if both the “First Name” and “Last Name” fields are not empty strings. The resulting IEnumerable<Item>now contains only Employee items with those fields filled in. The above code is fairly useless but it shows how you can use LINQ to filter your general result sets as opposed to writing a long Sitecore Query to be very specific.

One important thing to note is that a self-or-descendant selector (i.e. //*) is not recommended. This performs a recursive query down all subitems and will cause performance issues. It is recommended that both front-end code and template field queries not use self-or-descendant as they can slow down the front-end of the site or even the content editor itself.

It’s also important to note that special characters in queries need to be escaped with a hash, for example, a hyphen in a query will break the parser and needs to be handled by being wrapped in #.

This query will not work:

1
/sitecore/content/home/about-us/*

This one will:

1
/sitecore/content/home/#about-us#/*

Fast Query

Fast Query is very similar to Sitecore Query but it is more restrictive on what you can query with, however is performs faster than a reulgar Sitecore query. Fast Query is recommended to retrieve many more items than a Sitecore query. The prefix for a fast query is “query:fast:”. Fast queries are actually translated directly into SQL statements and executed on the database, so there are limitations. I recommend you read the Fast Query doc on the SDN.

Lucene Search

My experience with querying Sitecore with Lucene is fairly new, but is the result of Alex Shyba’s work at Sitecore with Lucene. Alex has created a great toolkit called the Advanced Database Crawler to make it easier for developers to setup and query Lucene with some pretty simple C#. The best way to get started using Alex’s toolkit would be to watch his video series on sample search scenarios and configuration settings. In the future I will publish a summary of my findings with this new tool and the things I’ve learned while using it.

Determine How You Should Query Sitecore

Below is a table of recommended approaches to querying Sitecore based on the number of items in the result sets. Note that the web.configsetting Query.MaxItem affects the number of items that a Sitecore query can return. Say if you want to return 150 items from a Sitecore query (not recommended), you’d need to adjust the setting. The higher this number is, the more you can get back from your Sitecore queries which means the worse your app can perform because of these large queries.

Query ApproachResult Items
Sitecore Query100 items or less
Fast Query1000 items or less
Lucene Search1000+ items

RestSharp - a smarter RESTful service client

var request = new RestRequest("ShoppingBasket") { Method = Method.POSTRequestFormat = DataFormat.Json};
request.AddBody(basketLineItem);
var response = _client.Execute(request);
POST /api/ShoppingBasket HTTP/1.1
Accept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml
User-Agent: RestSharp/104.4.0.0
Content-Type: application/json
Host: 101.2.171.213:8100
Content-Length: 80
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

{"CustomerId":"123456","ProductId":0,"ProductName":0,"Quantity":0,"UnitPrice":0}