Thursday, June 23, 2011

Plan for User Accounts – complete SharePoint installation

We have two different approaches towards SharePoint installation such as Standalone installation and Complete installation. Standalone installation is meant for a single server installation scenario where we install everything on a single machine. While Complete installation here refers to farm level installation of SharePoint by separating out the concerns and accessed remotely in the same network infrastructure.

For a complete installation we should draw clear plan around the approach, here the plan for User accounts stands as a critical one among the various requirements. As we know it is desired to have different user accounts for accessing different resources in a network in an efficient manner. So I thought this is the right time to jot down an introduction to various User accounts as follows

SETUP ACCOUNT:

Setup account is the one which is used to run the SharePoint preparation tool, installation and configuration wizards, to create root file structure, assign rights to different accounts etc. It is preferred to be a Domain Admin or member of the Administrator group with SQL Login, security admin and dbcreator roles.

SERVICE ACCOUNTS:

For a single server environment, the network service/local service accounts will work fine for all SharePoint’s services. But when it comes to Farm level installation, it is preferred to have different accounts for various services. So here we have the following Service accounts to be considered as follows

Farm Account: It is the account used by all SharePoint servers in the farm to access the farm’s configuration database and run SharePoint specific services. This is created during the installation of SharePoint. Also it is the SharePoint Timer Service account and application pool identity for Central Administration.

Search Account: This account act as the owner of the Search database and responsible for managing the SharePoint Search.

Index Account: This is known as another owner of the Search database, content access account, crawler, gatherer, and indexer.

Content Database Account: This account act as the owner of the Content database of a web application.

BDC Account: This is used by SharePoint to pass data back and forth between a user, SharePoint and an external data sources using Business Data Connectivity Service. It supports Claims-based authentication.

Sandboxed Code Service Account: It is used by SharePoint to manage solutions that are deployed in a “sandboxed” fashion, not to whole farm but to a single site collection.

So we summarized about the various User accounts to be considered while doing a Complete Farm level installation of SharePoint.

Wednesday, June 22, 2011

Working with Macro Parameters – Razor approach

As we know we can supply values for parameters on Macros. When we insert a macro onto a template, we are prompted to supply the values for the parameters. Here I would like to show you that we can also do this in a Razor script as well.

Let’s say we have a Razor script file called “WelcomeMessage.cshtml” created under the Scripting files and we have a corresponding macro called “Welcome Message Macro”. The duty of our Razor script here is to display a Welcome message. Well, we have set a macro parameter called “AttendeeName” which accepts a name when inserted on a template. Now we need to modify our welcome message to display as “Welcome [AttendeeName], have a nice time here!!!”. Here in the given message [AttendeeName] should be replaced by the value assigned as a macro parameter.

This can be easily implemented in Razor script. In order to implement this, we need to make use of the following syntax in Razor scripts as follows

@Parameter.AliasName (please note this is not case sensitive)

So in our scenario, the whole Razor script would be as given below

Welcome @Parameter.AttendeeName, have a nice time here !!!

So guys have fun with Razor :-)

Access Property Data in Umbraco – Razor approach

In my last post I had discussed about Razor in Umbraco. Now let me share more about the implementation part of Razor in Umbraco. As we know Razor can be used in scenarios where we had used XSLT.

Here I would like to use Razor syntax to access document property data in Umbraco. We have a variable called @Model in Razor which is equivalent to the $currentPage in XSLT. Similarly we can use Razor to access all the properties like .Name , .Url ,.Level , .Id etc using @Model. Also we have option to access the custom property associated with a document type.

We can write Razor syntax in two modes i.e. Inline Razor approach or dedicated approach. Inline Razor approach is the style of writing the Razor syntax in line with the HTML snippets inside a template. While dedicated Razor approach refers to the style of writing Razor snippets separately under the scripting files. Then we associate this to a Macro and insert it onto the template.

Let me write a Razor snippet to access the property data in Umbraco, it will display the Name and Url of the page.




Now similarly we can access the Custom properties as well. Let’s have the following code snippet which access a Custom property called “myProperty



So we have learned a bit on how to access property data using Razor syntax. I believe all C# folks would like this approach as they can do the similar things as fast as it is done in XSLT approach.

Saturday, March 19, 2011

Razor in Umbraco

As you know Razor is the ASP.NET view engine. I have already posted an introduction to Razor in my blog. Now let’s talk about the concept of Razor in Umbraco. Umbraco team has considered Razor in their version 4.6 onwards and it’s robust in version 4.7 of Umbraco.

We already knew the importance of XSLT in Umbraco as we use it for creating the lists, navigations, breadcrumbs and iterating through the Umbraco nodes etc. Razor is optimized around HTML generation in a code focused approach. Razor can be used in scenarios where we can use XSLTs. We can exploit the skills of .NET developers with Razor as it works well with C# or VB knowledge. The Razor source code has extension either .cshtml/.vbhtml. We can use Razor scripting either in template via Macro or directly inside the HTML templates inside Umbraco.

Lets brief the advantages of using Razor scripting is as follows

  • Compact, Expressive and Fluid
  • Easy to learn
  • Not a new language
  • Works with any text editor
  • Great intellisense in Visual Studio.

We can use Razor scripting in Umbraco either as inline scripts, we can access Umbraco property data, work with macro parameters, list sub pages from current page, list subpages by level etc. You can watch for more posts in Razor with Umbraco in coming days.

For further information please visit the http://umbraco.com/help-and-support/video-tutorials/umbraco-fundamentals/razor/introduction-to-razor-in-umbraco

Thursday, January 20, 2011

Create a Custom HTTP Handler

We know that all ASP.NET requests are mapped to corresponding HTTP handlers based on the file extension requested in the request. Also we have seen couple of HTTP handlers out of the box provided by ASP.NET such as Page handler (.aspx) , Usercontrol handler (.ascx), Webservice handler (.asmx) etc.

In order to build some additional handling functionality, we are requested to build some custom HTTP Handlers. We can implement two types of handlers basically by overriding the respective interfaces. We have IHttpHandler and IHttpAsyncHandler to create custom synchronous and asynchronous handlers respectively. The interfaces require us to implement ProcessRequest method and a property called IsResusable. ProcessRequest method is used to perform the logic to handle the request and IsReusable property can be set to true or false to decide whether to pool the handler for reuse.

Now let’s walk through on the steps required to create a Custom handler

· Create a Class Library Project. (in my case its “MyCustomHTTPHandler”) in Visual Studio 2008/2010.

· Add a class called “MyHandler.cs” and inherit from IHttpHandler. Make sure to add System.Web.dll reference.

· Now implement the method ProcessRequest and IsReusable property as well.

We can add necessary code logic inside the ProcessRequest to perform custom actions. We are now done with the coding. Now we need to add reference in Web.config for the handler under section in IIS 6.0 and in IIS 7.0/7.5. Also we need to configure it in IIS as well.

Here in this example you can add the following entry onto the web.config as follows

<add verb="*" path="*.sample" validate="false" type="MyCustomHTTPHandler.MyHandler"/>

So when a request comes for a resource with .sample extension, this referred handler gets fired.

You can download the source code for this sample from the following location. Click to download

Wednesday, January 19, 2011

Register Custom HTTP Handlers

We comes across scenarios where we need to build Custom HTTP handlers, ASP.NET calls this HTTP Handler in order to serve a specific request for resources that have a particular extension. Registering a HTTP Handler depends with the versions of IIS. All of us might have looked at the Web.config file which contains the sections and .

Let’s walkthrough on registering the handlers in IIS 6.0 & earlier versions and IIS 7 & later versions. Basically section is used for IIS 6.0 settings and is used for IIS 7.0 and later ones. Again for IIS 7.0 we have two different cases as the settings are different for Classic mode as well as integrated mode.

HTTP Handler for IIS 6.0:

We need to add the handler reference under the section under section.

The task is not yet completed yet as you need to configure the same in IIS as well. Here you can see that if a request comes for any file with extension .MyFileExtension , it gets route to the MyFile class placed inside the App_Code folder.

HTTP Handler for IIS 7.0:

The main difference in adding handlers in IIS 7.0 is that you need to add the reference under the section in the config file. Again here we come across two different scenarios as depends how IIS is running in Classic mode or Integrated mode.

Here scriptProcessor refers to the actual path to the aspnet_isapi.dll file.

· If we are running IIS in Classic mode, you need to enter the reference in both sections like and section as well.

· If we are running IIS in Integrated mode, you need just to enter the reference only in section alone. But here you have to place the reference under the section.


Tuesday, January 18, 2011

uCommerce - e Commerce Platform for Umbraco

uCommerce is a fully featured enterprise level e Commerce solution powered with Umbraco content management features. It’s really cool and builds an excellent e Commerce system within short time. It is fully integrated with Umbraco content management system that it helps to create an excellent e commerce solution to the users. We can easily configure the same within Umbraco itself.

uCommerce foundations provide the basis for an e-commerce solution. Each foundation addresses a specific need for providing a full e-commerce solution to your clients. Foundations in the box include a Catalog Foundation, a Transactions Foundation, and an Analytics Foundation.

uCommerce ships in two editions

· Starter Editions

uCommerce Starter Edition is targeted for the smaller shops, which require less flexibility and features out of the box.

· Pro Editions

Pro Edition is targeted at high-end stores, which requires support for support multiple stores, multi currency, differentiated pricing, multiple catalogs, and more.

Following are the excellent features with uCommerce. Let’s have a glance at the same

· Catalog foundation:

As we know that catalog capabilities is a key element for any e Commerce application. Here Catalog foundation handles all tasks related to publishing products to store. It supports most of the features for a e Commerce application out of the box.

· Transaction Foundation:

Transaction foundation handles all tasks from persistent baskets till check out flows. It has full support for all Payment providers.

· Integrated with Membership:

uCommerce is completely integrated with the Umbraco membership system.

· Analytics Foundation:

Analytics foundation provides the features required for implementing an Analytics solution out of the box. It has a rich reporting features out of the box and very easy to add custom ones as well.

· Commerce XSLT Library:

Commerce XSLT library provides an opportunity for Umbraco developer to easily build a user friendly Store sites.

· Foundation API:

uCommerce exhibits the vast functionalities via its rich API set. It helps developers to integrate the API very easily to build nice applications.

If you would like to know more details on uCommerce, please check the website http://www.ucommerce.dk/

Installing ASP.NET MVC

Installing ASP.NET MVC Before we dive deep into the ASP.NET MVC, let’s install it our development machine. This is very straight forwa...