Archive

Archive for January, 2011

Installing SharePoint 2010 in Windows 7 (64 bit)

January 8, 2011 6 comments

Installing SharePoint 2010 in Windows 7 (64 bit)

Many people faces problem in installing SharePoint 2010 Server in windows 7 because it doesn’t directly support it and you will get error about operation system while attempting to install. But there are certain steps which can guide you to install SharePoint 2010 in your machine. I hope you know how to install SharePoint 2007 in windows 7. Don’t afraid, it is not the prerequisites for the installation of SharePoint 2010. However, if you need it you can see it here. But that tweaks doesn’t work for 2010. So you must follow some steps to run SharePoint 2010 in your Windows 7 (64 bit) machine.

1)      Install the following update.

2)      Extract the installation files from the setup using command d:\Software\SharePoint10\SharePointServer /extract:d\SharePointServerFiles. In my case source directory is d:\Software\SharePoint10 and target directory is d:\ SharePointServerFiles.

3)      In the target directory find the config.xml a following d:\ SharePointServerFiles \files\Setup\ and add the following line of text in configuration node <Setting Id=”AllowWindowsClientInstall” Value=”True”/>. Now your configuration file would be something like below:

<Configuration>
	<Package Id="sts">
		<Setting Id="LAUNCHEDFROMSETUPSTS" Value="Yes"/>
	</Package>
	<DATADIR Value="%CommonProgramFiles%\Microsoft Shared\Web ServerExtensions\14\Data" />
	<Package Id="spswfe">
		<Setting Id="SETUPCALLED" Value="1"/>
	</Package>

	<Logging Type="verbose" Path="%temp%" Template="SharePoint Server Setup(*).log"/>
	<!--<PIDKEY Value="Enter Product Key Here" />-->
	<Setting Id="SERVERROLE" Value="SINGLESERVER"/>
	<Setting Id="USINGUIINSTALLMODE" Value="1"/>
	<Setting Id="SETUPTYPE" Value="CLEAN_INSTALL"/>
	<Setting Id="SETUP_REBOOT" Value="Never"/>
	<Setting Id="AllowWindowsClientInstall" Value="True"/>
</Configuration>

4)      Now, it is the time to install the prerequisite installer files.  First install filter pack in the path d:\ SharePointServerFiles \PrerequisiteInstallerFiles\FilterPack\ FilterPack.msi.  Now install following components:

  1. Microsoft Sync Framework
  2. SQL Server Native Client
  3. Windows Identity Foundation (Windows6.1-KB974405-x64.msu)

If you have Visual Studio 2010 installed in your machine then you may not have to install previous two components.

5)      Now, turn on the windows features for IIS for the components as shown in figure (AT LEAST, please). Type ‘optionalfeatures’ in run and enter to open windows features.

Fig continue:

6)      Now run setup.exe from ‘d:\ SharePointServerFiles’ to get installation wizard and choose Standalone installation to install all on one developer workstation.

7)      After the end of installation you need to run the configuration wizard. But before that you need to install some hotfix for SQL Server. Install SQL Server 2008 KB 970315 x64. You need to request the hotfix and Microsoft will send you in email the link and password that required for extraction. Note that you must install this hotfix to avoid the exception while configuration wizard is creating configuration database.

8)      Now, you can run your configuration wizard to configure SharePoint in your machine. Don’t panic; it takes time. Good luck.

Issues

1. I can open the Central Administrator site but links are not enabled in Central Administration -> Application Management -> Manage Web Applications. You cannot create new web application and extend existing oneL.

Sol: Make sure you have Windows Identity Foundation installed. Get it from here.  Now do not directly open the central admin site but first open Internet Explorer as administrator and open central admin page. Now, if still it is not working, you would like to use 64-bit IE (Same happened in my case). Furthermore, you can disable UAC to enable link but it is not good practice to disable UAC just for SharePoint.

NOTE: If you have any issue, feel free to post it.

Builder Pattern in C#

January 6, 2011 Leave a comment

Builder Pattern

Full code can be downloaded from here.

Introduction

GOF definition –“Separate the construction of a complex object from its representation so that the same construction process can create different representations.” Builder pattern focuses on constructing a complex object step by step and returns the product as the final step. It creates one of the several targets.

Motivation

The most common motivation for using Builder is to simplify the client code which creates the complex object. The main advantage will be client can still make the object but without knowing what actually is happening inside. Consider an example of creating different vehicles like car, motorcycle and bus. What builder helps us to simplify here is giving the client the complete vehicle with the only information about what is the type.  Client does not need to worry how the different vehicles are being created.

Architecture

Builder contains the abstract interface for building the product. And there will be different ConcreteBuilder which has the different implantations of creating product. Director contains the instance of the Builder and constructs the product according to the Builder instance. Product is our final output which we need to create.

Code

I have created the sample program which demonstrates the way to develop the different rules similar to the Microsoft Outlook. Full code can be downloaded from here.

Builder abstract class

</span>

abstract class RuleBuilder

{

protected Rule _rule;

public Rule Rule { get { return _rule; } }


public abstract void SetDescription();


public abstract void BuildCondition();


public abstract void BuildAction();


}

Product class


class Rule

{

IDictionary<string, string> _properties;


public Rule(string name)

{

_properties = new Dictionary<string, string>(0);

_properties["name"] = name;

}


public string this[string key]

{

get { return _properties[key]; }

set { _properties[key] = value; }

}


public void Show()

{

Console.WriteLine("------Rule {0}------", _properties["name"]);

Console.WriteLine("Description: {0}", _properties["description"]);

Console.WriteLine("Condition: {0}", _properties["condition"]);

Console.WriteLine("Result: {0}", _properties["action"]);

}

}

Director class


class MailManager

{

public RuleBuilder RuleBuilder { set; private get; }


public void CreateRule()

{

RuleBuilder.SetDescription();

RuleBuilder.BuildAction();

RuleBuilder.BuildCondition();

}

}

Note the RuleBuilder instance in MailManager. We can omit it with parameter in CreateRule method. I did above code so as to follow the class diagram.

Output

——Rule Move Rule——

Description: Move the mail from one folder to another

Condition: When new mail arrived with title ‘xyz’

Result: Escape inbox and copy mail to ‘abc’ folder

——Rule Delete Rule——

Description: Delete the mail with specific condition

Condition: When new mail arrived with title ‘xxx’ OR mail arrived from address xxx@hotmail.com

Result: delete it

Conclusion

Builder is a type of Creational pattern like Factory but it gives us more control in each step of construction process. It is not a widely used pattern but it is an important one. Whenever we need to create different objects with some set of operations then we must think about Builder.

Categories: .net, Design pattern
Follow

Get every new post delivered to your Inbox.

Join 33 other followers