Installing SharePoint 2010 in Windows 7 (64 bit)


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. No need to worry, 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 one.

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.

2. Exception in Database Configuration step:  An exception oftype Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown. Additional exception information: Failed to call GetTypes on assembly Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Could not load file or assembly ‘System.Web.DataVisualition, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

Sol: The reason of this exception is the configuration doesn’t find the Chart Controls. Download it and install and re-run the configuration.

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

Advertisements

Builder Pattern in C#


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.

Bridge Design Pattern in C#


Bridge

Download full code from here.

Introduction

GOF definition: “Decouple an abstraction from its implementation so that the two can vary independently.” Bridge uses encaptulation, aggregation and use (probably) inheritence to separate responsibilities into different classes. This pattern is useful when both the abstraction as well as what it does often vary.

Motivation

Consider a situation that we have a different type of switch mechanism which has different implementation of ‘On’ and ‘Off’. For instance, Computer has different type of powering on/off mechanism than that of lamp. In this case we can use the implementation in a single class using if…else but what if we need to add those mechanism for water pump, mobile, vehicles. Then our code will be ugly if we continue to do the work using if…else. The Bridge design pattern proposes refactoring these issues by using two orthogonal hierarchies – one for independent abstractions, and the other for dependent implementations.

Architecture

This class structure shows that the Abstraction is completely separated from the implementation which can vary independently. Abstraction contains the instance of the implementor. In fact Abstraction behaves as wrapper of implementor but can have its own set of logic. Here I have shown only one refined abstraction but it can be many also according to the need of the logic.

Code

Complete code can be downloaded from here.

Here, I will give you the very simple example of the Bridge pattern which uses the one RefinedAbstraction and two different concrete implementations which defined the On/Off mechanism for Computer and Electric Lamp.

AbstractSwitch


abstract class AbstractSwitch

{

public AbstractSwitch(bool initialSwitchState)

{

_switchState = initialSwitchState;

}

public virtual bool On()

{

return _switchImplementation.On();

}

public virtual bool Off()

{

return _switchImplementation.Off();

}

public virtual void ShowInformation()

{

_switchImplementation.ShowInformation();

}

public SwitchImplementation SwitchImplementation

{

get { return _switchImplementation; }

set

{

_switchImplementation = value;

if (_switchState)

_switchImplementation.On();

}

}

private bool _switchState;

private SwitchImplementation _switchImplementation;

}

Notice the SwitchImplementation instance and it’s uses in methods in AbstactSwitch class.

Abstract Implementation


abstract class SwitchImplementation

{

public abstract bool On();

public abstract bool Off();

public abstract void ShowInformation();

}

Our every concrete implementation will extend the SwitchImplementation instance.

Conclusion

Unlike Adapter which makes things after designed Bridge makes things work before they are. Note that Bridge is designed up-front to let the abstraction and the implementation vary independently.

Observer Pattern in C#


Observer Pattern

Download code from here.

Introduction

Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. It is a subset of publish-subscribe pattern. We use observer as a view in MVC pattern. C# is very much suited for this language with the power of events and delegates.

Motivation

We always need loose coupling between objects. Observer pattern promotes loose coupling. Subject doesn’t depend on the observer but they are registered/unregistered to the subject.

Consider the football game in which all players (as well as linesman/referee) need to move and take position according to the position of the ball. There must present some sort of mechanism which send message to all observers about the position change activity of the ball. Yes, observer pattern is the useful one.

Architecture

Subject is the one which register/unregister the observer and notifies the observers about the state. Observers have reference of subject and get updated as subject changes. Note the comment ‘foreach o in obserers’ which implies all registered observers get updated.

Code

Full code can be downloaded from here.

I created the simple example of Observer Pattern with the concept of football game. I have used event for registering/unregistering observers. I have used events for registering/unregistering observer.

I created an IPerson interface which is our observer. It is the one which is registered to the subject.


public interface IPerson

{

void UpdatePosition();

Position Position { get; set; }

}

And our subject is the Ball abstract class. It is abstract because I think I can extend it to any other balls like FootBall, VolleyBall etc. It has the AttachObserber and DettachObserver functions which registered and unregistered the observer. Whenever there is change in the position of the ball, it uses Notify function to notify all registered observers.


public abstract class Ball
{
public Ball(double size, string color)
{
_size = size;
_color = color;
_persons = new List(0);
}

public void AttachObserver(IPerson person)
{
_persons.Add(person);
_positionChanged += person.UpdatePosition;
}

public void DettachObserver(IPerson person)
{
_positionChanged -= person.UpdatePosition;
_persons.Remove(person);
}

public void DettachAll()
{
foreach (IPerson p in _persons)
_positionChanged -= p.UpdatePosition;
_persons.Clear();
}

public Position Position
{
get { return _position; }
set
{
_position = value;
Console.WriteLine("Current football position: {0}, {1}", _position.XPos, _position.YPos);
NotifyPlayers();
}
}

public void NotifyPlayers()
{
if (_positionChanged != null)
_positionChanged();
}

private Position _position;
private double _size;
private string _color;
private List _persons;
private NotifyBallObserverEventHandler _positionChanged;
}

Conclusion

Observer defines a much decoupled interface that allows for multiple receivers to be configured at run-time. Mediator pattern also provides the mediator object which encapsulates the communication between objects. But observer provides the different mechanism where all observers get updated when subject changes.