Wednesday, December 12, 2012

Programmatically Create a Web Part Page with a Web Part in Sharepoint 2010

Error occurred in deployment step ‘Activate Features’: Object reference not set to an instance of an object


SharePoint 2010 PopUp Dialogs Errors

SharePoint 2010 PopUp Dialogs



The Ribbon Tab with id: "Ribbon.Read" has not been made available for this page or does not exist. Use Ribbon.MakeTabAvailable()

Last day I was working with few web parts and I had got the error. I had created two pages in ‘site pages’ library. Let’s say one is parentpage.aspx and another is childpage.aspx. There was a web part added in the parentpage.aspx. In that web part I had a button and on the click event of the button I tried to show the childpage.aspx in modal dialog. So I was trying to show a child page inside parent page using SharePoint client modal feature. And I had come up with the error. Let’s dig a bit deeper into the problem.

How to add Web Part page

There are two types of pages (web part page and non-webpart page) you can add in SharePoint. If you just click add page from ‘Site Pages’ library as shown in the image below, the page will be added is non-webpart page.

If you want to add web part page then you need to go to ‘Site Actions’ => ‘More Options’ => ‘Page’ and then select ‘web part page’.

I had created web part pages and then I tried to show the page in the modal dialog. And it worked!! So the error was coming up since I was trying to show non-webpart page in the modal dialog.

Solution

So the conclusion is that if you want to show a page in modal dialog taking advantage of SharePoint Modal Dialog API, then you need to make sure that the page you want to show in modal dialog is derived from Microsoft.SharePoint.WebControls.LayoutsPageBase or the page is web part page. So to get rid of the error make sure you have been using WebPart page or your page is inherited from Microsoft.SharePoint.WebControls.LayoutsPageBase







Monday, December 10, 2012

SPQuery Samples


SPQuery for Retreving Basic Data i.e Text Field


#region SPQuery for Retreving Basic Data i.e Text Field  
// Geting the Site Collection Reference  using (SPSite curSite = new SPSite(http://hpkportal))
{
/// Geting the Web Application Reference
using (SPWeb curWeb = curSite.OpenWeb())
{
// Declaring the SPQuery fields
SPQuery curQuery = new SPQuery();
curQuery.Query = " SharePoint 2010 ";

/// Seting the RowLimit will increase the performace of the Query
curQuery.RowLimit = 100;
SPList myList = curWeb.Lists["CustomListName"];
SPListItemCollection items = myList.GetItems(curQuery);
foreach (SPListItem i in items)
{
string CategoryTitle = i["Title"].ToString();
}
}
}
#endregion


SPQuery for Retreving Date Time Field


# region SPQuery for Retreving Date Time Field

/// Geting the Site Collection Reference
using (SPSite curSite = new SPSite(http://hpkportal))
{
/// Geting the Web Application Reference
using (SPWeb curWeb = curSite.OpenWeb())
{
// Declaring the SPQuery fields
SPQuery curQuery = new SPQuery();
curQuery.Query = " + DateTime.Now.ToString(yyyy-MM-ddTHH:\\:mm \\:ssZ) + ";
/// Seting the RowLimit will increase the performace of the Query
curQuery.RowLimit = 100;
SPList myList = curWeb.Lists["CustomListName"];
SPListItemCollection items = myList.GetItems(curQuery);
foreach (SPListItem i in items)
{
DateTime CategoryCreatedDt = Convert.ToDateTime(i["Created Date"].ToString());
}
}
}
#endregion

 SPQuery for Retreving Yes No Field

#region SPQuery for Retreving Yes No Field
/// Geting the Site Collection Reference
using (SPSite curSite = new SPSite(http://hpkportal))
{
/// Geting the Web Application Reference
using (SPWeb curWeb = curSite.OpenWeb())
{
// Declaring the SPQuery fields
SPQuery curQuery = new SPQuery();
curQuery.Query = " 1 ";
/// Seting the RowLimit will increase the performace of the Query
curQuery.RowLimit = 100;
SPList myList = curWeb.Lists["CustomListName"];
SPListItemCollection items = myList.GetItems(curQuery);
foreach (SPListItem i in items)
{
byte CategoryType = Convert.ToByte(i["AreYouDone"].ToString());
}
}
}

#endregion

Friday, December 7, 2012

Create a List Definition in SharePoint 2010 using Visual Studio 2010


In this demonstration, I am going to create a list definition using Visual Studio 2010. For the demonstration purpose, I am going to create a list definition for storing expenses, once deployed, the list definition can be used to create lists to store expenses. The list definition will define a list template that inherit from custom list and add columns expensedate and amount.



Open Visual Studio, Go to File -> New project, In the Template selection dialog, choose List Definition as the template type.

Give a proper name to your List Definition project. Make sure the .Net framework selected is 3.5 as SharePoint 2010 is built on .Net framework 3.5.

Click OK button, once you entered all the details.

In the next dialog you need to choose the SharePoint portal you need to use for debug. Also you need to specify whether it is a farm solution or sand boxed solution. Enter your SharePoint portal address and Click Next

Click Next once you are done



Now Visual Studio will bring you the List definition settings dialog. Here you can define the title for your list definition and choose a base list to inherit from. I choose my base list as “Custom List”. In addition to this you can decide whether to include a list instance when deploying this feature. Since I want to check my list definition, I selected “Add a list instance to this list definition” option. Click finish button, once you are done









Click Finish button once you are done with this step.



Visual Studio will add a default feature to your project and add a list definition. In the solution explorer the project will look similar to the following. I published an article for developing a SharePoint 2010 feature using Visual Studio, to read that article click here.







Let me explain the files exists under the List Definition



Elements.xml – this file defines the list template and fields such as name, display name, type etc. The properties specified in this file will be displayed in the Create Page, when you create a list template from this file.



Let us examine the Elements.Xml file. See the snapshot of the elements.xml file

The complete reference for Elements file for List template can be found in the below URL



http://msdn.microsoft.com/en-us/library/ms462947.aspx



The type identifier must be unique within the feature, but need not be unique across all feature definitions or site definitions. So make sure when you have multiple list templates in the same feature, you made them with different type attributes. It is also recommended to create Type value greater than 10000. For my List Instance I assigned the Type attribute with a value of 10001.



After Modifications, the List template file looks as follows.

Notice that, I just updated the Type attribute, but depending on your needs you may add other attributes.

Now I am going to add fields for my List template. As I mentioned initially, I will have only 2 fields date and amount. Refer this link to under stand more about Field element http://msdn.microsoft.com/en-us/library/ms437580.aspx

When you define a field, you need to specifiy a guid as ID enclosed in braces{}. To create a Guid, do the following steps.

From visual Studio menu, select tools, then select create guid

The Create Guid dialog will appear as follows

I have added the following fields to List Template.





Make sure for each field you create you use unique guid. Now I want to create a content type that includes these fields. When you define a content type, you need to define an ID for the content type. This is a bit tricky. Refer the below article to under stand more about content type ID.

My content type should be a sub of item content type, so I am going to use the following rule to create my list content type id.

System

Item

prefix

Hexadecimal GUID
0x

01

00

4FDDEDBF38D14332A625BCBC60F1667A

(for hexadecimal guid, I create a guid from visual studio and then removed braces and hyphens)

So my content type id is 0x01004FDDEDBF38D14332A625BCBC60F1667A

Add the following content type tag just above the ListTemplate start tag.












The definition is very straight forward. See the tags where you add the reference to previously created fields.

Find the snapshot of Elements.xml file after the above items added.

Now you have defined fields, content type and list template. Now you need to link your list definition to content type. You need to perform this in the schema.xml file. Open schema.xml file, by default it will look similar to the below snapshot.

Now you need to replace the element with the below







Now copy all the tags from Elements.xml and paste in between and . This is a duplication of work but you need to do this. After replaced, the Fields tag will look as follows.




StaticName="ExpenseDate" Name="ExpenseDate" Group="Expense Columns" />


StaticName="Amount" Name="Amount" Group="Expense Columns" />



Now you need to add the field references to view fields. There will be multiple tags, you can add field references in all or atleast in the View with BaseViewID=1, as this is the default view. See the snapshot of default view in the schema.xml file

In between ViewFields add the below markup.





See the snapshot of schema.xml after made the changes.

Now you are done with the list definition. Now you need to modify the List Instance to use the template you just created. Open the elements.xml file under the List Instance 1, the snap shot of default Elements.xml is as follows.

You need to change the TemplateType to the Type attribute you mentioned in the List Template, i.e. 10001. Also you can modify the list title, url etc. Also you can add initial data to the list instance so that the data will be inserted to the default list instance on feature activation.

Place the below xml inside tag for inserting initial data







travel expense

01-01-2011

20.00





your expense title

01-01-2011

10.00







See the snap shot of List Instance 1 after all changes were made.

Now we are ready to deploy the List defenition. Right click the project and click on deploy.

If you made everything correct, visual Studio will successfully deploy the list definition. Now you can find one list instance created in your SharePoint site. Open the list instance, you will find the data already inserted to it.

When you create new item in SharePoint, you will find the expense template.

Wednesday, December 5, 2012

Increasing the List View Threshold Value for particular SharePoint List

In my Previous Project one of my customers wanted me to increase Default Value for the List View Threshold to 8000, but for specific List but not for entire SharePoint Web Application.


Increasing the List View threshold value for Web application is fine. But for specific list .

We can achieve this task using SharePoint Power Shell.

$WebApplication = Get-SPWeb http://abc:12345

$List = $WebApplication.Lists["Employee"]

$List.EnableThrottling = $false

$List.Update()

In SharePoint List Properties, we have property Called “EnableThrottling”.

By setting it to false, it allows to Bypass default Value for the List View Threshold value.

Power Shell


Power Shell

Windows PowerShell is New Command line Shell mainly designed for System Administrators. In the SharePoint Context PowerShell are supersedes for the STSADM commands.

Major Difference between STSADM commands and Power Shell is that, STSADM commands accepts text input and returns text output. But Power Shell are built on Microsoft .Net Framework which accepts frameworks objects as input and returns framework objects as output.

Power Shell cmdlet`s are nothing but build in commands which are written in C# or VB.
The following cmdlets are available for SharePoint Server 2010:

• Access Services
• Backup and recovery
• Databases
• Enterprise content management
• Excel Services
• Features and solutions
• General
• Import and export
• InfoPath Services
• Logging and events
• Performance
• PerformancePoint Services
• Search
• Secure Store Service
• Security
• Service application
• SharePoint Foundation 2010 Search
• Site management
• State service and session state
• Timer jobs
• Upgrade and migration
• User Profile Service
• Visio Graphics Services
• Web Analytics
• Word Services
• Workflow management



Tuesday, December 4, 2012

Pre-Requisites SharePoint Foundation 2010 Installers in offline mode

The following are steps to install the pre-requisites SharePoint Foundation 2010 Installers  in off-line mode.


1. Extract your SharePoint Installer

• go to the ‘C:’ drive of your SharePoint machine, and create a new folder. Let’s call this folder ‘SharePointFiles‘.

• Copy/Paste your downloaded exe in this folder.

• Open a command line prompt and navigate to this folder ‘cd c:SharePointFiles‘

• In the cmd, enter ‘SharePointFoundation /extract:c:SharePointFiles‘ (the first term is the name of the downloaded exe, in my case the SP Foundation 2010 one)

• The command in the previous step will extract everything to your folder ‘c:SharePointFiles‘

• Now you should also see the executable: PrerequisiteInstaller.exe which will allow us to install the prerequisites.

2. Download your prerequisites

This is a list of items , we have to download for the installation of a -recent- Windows 2008R2 machine:

a. Microsoft SQL Server 2008 Native Client

b. Hotfix for .NET Framework 3.5 Service Pack 1 KB976462)

c. Windows Identity Foundation (KB974405) for Windows Server 2008 R2 / Windows Server 2008

d. Microsoft Sync Framework v1.0

e. Microsoft Chart Controls for Microsoft .NET Framework 3.5

f. Microsoft Filter Packs

g. Microsoft SQL Server 2008 Analysis Services ADOMD.NET

h. Microsoft Server Speech Platform

i. Microsoft Server Speech recognition language for English

j. SQL Server 2008 R2 Reporting Services Add-in for Microsoft SharePoint Technologies 2010


3. Create a PrerequisiteInstaller.Arguments file

• The next step is to create a PrerequisiteInstaller.Arguments.txt file in the SharePointFiles folder. This file will contain arguments, which will be used by the PrerequisiteInstaller executable.

• Each component required by the PrerequisiteInstaller will have its own argument. This argument has a name, and a location where the installer can be found. In our case, we will create a list of arguments for all required components combined with the location of that particular installer.

• In the PrerequisiteInstaller.Arguments.txt file, add the following commands: (All in one line, with only a space between each separate argument)

a. /Unattended /IDFXR2:C:SharePointFilesPrerequisiteInstallerFilesWindows6.1-KB974405-x64.msu /SQLnCli:C:SharePointFilesPrerequisiteInstallerFilessqlncli.msi /ChartControl:C:SharePointFilesPrerequisiteInstallerFilesMSChart.exe /Sync:C:SharePointFilesPrerequisiteInstallerFilesSynchronization.msi /adomd:C:SharePointFilesPrerequisiteInstallerFilesSQLSERVER2008_ASADOMD10.msi /Speech:C:SharePointFilesPrerequisiteInstallerFilesSpeechPlatformRuntime.msi /SpeechLPK:C:SharePointFilesPrerequisiteInstallerFilesMSSpeech_SR_en-US_TELE.msi /ReportingServices:C:SharePointFilesPrerequisiteInstallerFilesrsSharePoint.msi

• Note: Because I’m on a 2008R2 machine, I use the arugment ‘IDFXR2′ instead of ‘IDFX’. Be sure to change this if you’re on a 2008 machine!


4. Run the prerequisites installer

• The only step left is to install the prerequisites.

• You can run ‘PrerequisiteInstaller.exe’ manually by double-clicking on it, or using the command line

• Because the file PrerequisiteInstaller.Arguments.txt is in the same directory, the installer will use this file for its own arguments and thus install the prerequisites in an offline mode.

• You’re done!

5. Troubleshooting

• It can be possible (like it was in my case) that the installation using PrerequisiteInstaller.exe did not complete. In my case, it was because there were some arguments missing in my arguments file.

• There are log-files available who can tell you what went wrong. You can find this log-files in folder: ‘C:Users{user}AppDataLocalTemp‘

This is automated process for installing prerequisites in off-line mode using the PrerequistiesInstaller.Arguments.txt or we can also install all Prerequisites manually from specified folder.

Importing Crawled ,Manged Properties from MOSS 2007 to MOSS 2010

Importing Crawled properties & Managed Properties from MOSS 2007 to Moss 2010

Import the crawled and managed properties to XML using Codeplex Utility tool names as "SSSPPC 1.1.1.1"

This tool will generate the following XMLs.
1.output_contentsources.xml
2.output_crawledproperties.xml
3.output_managedproperties.xml
4.output_searchscopes.xml

Use the following Power Shell Script to Import this Crawled & Managed Properties to MOSS 2010.

Function Import-SpSearchManagedProperties([string]$SearchServiceApplication,[string]$FileName){

[System.Xml.XmlDocument] $xd = new-object System.Xml.XmlDocument
$file = resolve-path("output_managedproperties.xml")
$xd.load($file)
$nodelist = $xd.selectnodes("ManagedProperties/ManagedProperty")
$searchapp = Get-SPEnterpriseSearchServiceApplication $SearchServiceApplication
#Create Crawled Propreties
#foreach loop started for creating managed
foreach ($Node in $nodelist) {
$Name = $node.getAttribute("Name")
$type = 1
$ManagedType = $node.getAttribute("ManagedType")
switch ($ManagedType)
{
"Text" {$type = 1}
"Integer" {$type = 2}
"Decimal" {$type = 3}
"DateTime" {$type = 4}
"YesNo" {$type = 5}
"Binary" {$type = 6}
}
if ($managedproperty = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $searchapp -Identity $Name -ea "silentlycontinue")
{
$managedproperty.DeleteAllMappings()
$managedproperty.Delete()
$searchapp.Update()
write-Host "Managed Property Already Exist" -ForegroundColor yellow
}
$managedproperty = New-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $searchapp -Name $Name -Type $type
$managedproperty.EnabledForScoping = $true
$managedproperty.PutInPropertyBlob = $true
$managedproperty.update()
write-Host "New Managed Property Created" -ForegroundColor yellow
$Mappings = $node.selectnodes("CrawledProperties/CrawledPropertyInfo")
foreach ($Mapping in $Mappings){
$CrawledPropset = $Mapping.getAttribute("PropSet")
switch ($CrawledPropset)
{
"0b63e343-9ccc-11d0-bcdb-00805fccce04" {$category="Basic"}

"2edeba9a-0fa8-4020-8a8b-30c3cdf34ccd" {$category="Business Data"}

"28636aa6-953d-11d2-b5d6-00c04fd918d0" {$category="Internal"}

"aa568eec-e0e5-11cf-8fda-00aa00a14f93" {$category="Mail"}

"a373e438-7a87-11d3-b1c1-00c04f68155c" {$category="Notes"}

"d5cdd505-2e9c-101b-9397-08002b2cf9ae" {$category="Office"}

"00110329-0000-0110-c000-000000111146" {$category="People"}

"00130329-0000-0130-c000-000000131346" {$category="SharePoint"}

"d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1" {$category="Web"}

"" {$category="XML"}

"" {$category="Tiff"}
}
#$category = Get-SPEnterpriseSearchMetadataCategory –Identity $categoryvalue -SearchApplication $searchapp
$CrawledPropertyName = $Mapping.getAttribute("Name")
$CrawledPropertyVariantType = $Mapping.getAttribute("VariantType")
if ($crawledproperty = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $searchapp -Identity $CrawledPropertyName -ea "silentlycontinue")
{
$crawledproperty.DeleteAllMappings()
$crawledproperty.Delete()
$searchapp.Update()
}
$crawledproperty = New-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp -Category $category -VariantType $CrawledPropertyVariantType -PropSet $CrawledPropset -Name $CrawledPropertyName -IsNameEnum $false
$cp = get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp -Name $CrawledPropertyName
if (($managedproperty -ne $null) -and ($cp -ne $null))
{
New-SPEnterpriseSearchMetadataMapping -SearchApplication $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty
write-host "Crawled property is mapped with Managed Property"
}
else
{
Write-host "Cannot create managed or crawled property for null values"
}
} # seconf for -loop
} # first for loop closing
write-host "Done"
} #final closing bracket

Import-SpSearchManagedProperties "ContentQuerySSA" "CustomManagedProperties.xml"

Importing BestBets from CSV file - Search Center Site


Importing BestBets from CSV file

function Import-SearchKeywords($SiteUrl, $CSVFilePath,[switch]$RemoveOldKeywords)

{
#Fetching search service application
$ssap = Get-SPEnterpriseSearchServiceApplicationProxy -Identity "Sample Search Service Application"
write-host $ssap
#Defining the object for the keyword
$keywords = New-Object Microsoft.Office.Server.Search.Administration.Keywords($ssap, $SiteUrl)
write-host $keywords

#Assigning all keywords to a member variable
$allKeywords = $keywords.AllKeywords
write-host $allkeywords

#Reading current date stamp
$date = Get-Date
write-host $date

#Remove all previous keywords from the site collection if chosen
if($RemoveOldKeywords) {
$keywordsArray = @()
$allKeywords
ForEach-Object {
$keywordsArray = $keywordsArray + $_.Term
}
$keywordsArray
ForEach-Object {
write-host "Deleting keyword:"$_
$allKeywords[$_].Delete()
}
}
#Import CSV file
$csvData = Import-Csv $CSVFilePath
ForEach-Object {

#Create keyword
write-host "Importing keyword:"$_.BestBetKey
$bestbetkeyvalue = $_.BestBetKey
$BestBetKey = $allKeywords.Create($_.BestBetKey,$date.AddHours(0))
#$BestBetKey.Definition = $_.Definition
#Create synonyms
$synonymArray = @()
$synonymArray = $_.SynonymRing.Split(";")
$synonymArray
ForEach-Object {
write-host "Creating synonym"$_ "for keyword" $BestBetKey.Term
if (($_ -ne $null) -and ($_ -ne "")) {
try
{
$BestBetKey.Synonyms.Create($_)
}
catch
{
write-host "Synonym already existed"$_
}
}
}
#Create best bets
$bestBetColumn = $_.BestBetTitle
$descriptionColumn = $_.BestBetAbstract
$urlColumn = $_.BestBetURL
if (($bestBetColumn -ne "") -and ($urlColumn -ne ""))

{
try
{
write-host "Creating best bet"$bestBetColumn "for keyword" $BestBetKey.Term
$BestBetKey.BestBets.Create($bestBetColumn,$descriptionColumn, $urlColumn)
}
catch
{
}
}
#Update keyword with best bets
$BestBetKey.Update()
}
}
Import-SearchKeywords -SiteUrl http://abc:34842 -CSVFilePath C:\FinalCSV.csv –RemoveOldKeywords



The mystery of the missing SharePoint “I Like It” tag

So I recently had to troubleshoot an issue where the ability to Tag internal objects in SharePoint 2010 was missing as well the ‘I like it’ button was missing.

What I thought was really weird is that if you went thru the steps you could tag external sources.  

In the end it came down to a few check marks but I’m going to go thru all the different steps that we took so that you can see how the different components can break.


SharePoint was setup with a Parent Farm and Child Farm, we were consuming Search, Managed Metadata, User Profile and had plans for others although we weren’t there yet.

Once we discovered that we couldn’t tag we started to look at the parent farm and wasted a lot of time before figuring it out, here is what I would suggest you look at to help you save time:

The first place you should always look is of course the proper way to enable/disable this social functionality and that is by going thru the following steps.

1.Open Central Admin for the Parent Farm and go to Manage Service Applications
2.Select the User Profile Service Application and click Manage
3.Then click on Manage User Permissions
4.Insure your user has at least ‘UseSocial Features’ preferably by a group but can be explicitly as well.

  The next place to look is the Managed Metadata Service Applications in the parent farm, our Web App Pool Account needs to be able to access both these services. You can verify this thru the following steps:

1.Open Central Admin for the Parent Farm and go to Manage Service Applicatio



2.Select the Metadata Management Service Application and select Permissions
3.Insure your Web App App Pool account has at least Read and Restricted Write to be able to tag


The final place I would look and what was the resolution in my case is with the Managed Metadata Service Connection (or Proxy). You need to make sure that the child farm has the correct settings on the MMS Proxy,

1.Go to Central Admin
2.Then Manage Service Applications
3.Then insure that "This service application is the default storage location for keywords" and "The service application is the default storage location for column specific term sets." both have check marks as per this snip it

 

Tuesday, November 6, 2012

PowerShell Script Create/Configure Access Service Application

function AccessSACreationScript()

{

$saAppPool=read-host "Enter the Application Pool Name for the Access Service Application Configuration" `r`n

write-host "Application Pool Name Entered is :" $saAppPool `r`n


$saApp = Get-SPServiceApplicationPool -Identity $saAppPool -EA 0


if($saApp -ne $null)

{

Write-Host "Valid Application Pool..." `r`n
$serviceName=read-host "Enter the Service Name for Access Service Application :" `r`n
write-host "Access Service Application Name Enterd is :" $serviceName `r`n
$TempServiceName = Get-SPAccessServiceApplication -identity $serviceName -EA 0
if($TempServiceName -ne $null)
{
write-host "Access Service Application Already exist with this Name :" $TempServiceName.Name `r`n
}
else
{
New-SPAccessServiceApplication -Name $serviceName -ApplicationPool $saAppPool -Default
write-host "Access Service Application Created successfully with Name :" $serviceName `r`n
}
}
else
{
Write-Host "Entered the In-Valid Application Pool Name/No Application Exist with this Name." `r`n
}
}
AccessSACreationScript

Monday, November 5, 2012

Steps to install the SharePoint 2010 Pre-Requisites in Off-line Mode

1. Extract your SharePoint Installer


• Go to the ‘C:’ drive of your SharePoint machine, and create a new folder. Let’s call this folder ‘SharePointFiles‘.

• Copy/Paste your downloaded exe in this folder.

• Open a command line prompt and navigate to this folder ‘cd c:SharePointFiles‘

• In the cmd, enter ‘SharePointFoundation /extract:c:SharePointFiles‘ (the first term is the name of the downloaded exe, in my case the SP Foundation 2010 one)

• The command in the previous step will extract everything to your folder ‘c:SharePointFiles‘

• Now you should also see the executable: PrerequisiteInstaller.exe which will allow us to install the prerequisites.

2. Download your prerequisites

This is a list of items , we have to download for the installation of a -recent- Windows 2008R2 machine:

a. Microsoft SQL Server 2008 Native Client

b. Hotfix for .NET Framework 3.5 Service Pack 1 KB976462)

c. Windows Identity Foundation (KB974405) for Windows Server 2008 R2 / Windows Server 2008

d. Microsoft Sync Framework v1.0

e. Microsoft Chart Controls for Microsoft .NET Framework 3.5

f. Microsoft Filter Packs

g. Microsoft SQL Server 2008 Analysis Services ADOMD.NET

h. Microsoft Server Speech Platform

i. Microsoft Server Speech recognition language for English

j. SQL Server 2008 R2 Reporting Services Add-in for Microsoft SharePoint Technologies 2010

Note : I have already downloaded following prerequisites to \\cocxogspwfe20\e$\Software\SharePoint\Foundation\SPInstallPrerequisites folder

3. Create a PrerequisiteInstaller.Arguments file

• The next step is to create a PrerequisiteInstaller.Arguments.txt file in the SharePointFiles folder. This file will contain arguments, which will be used by the PrerequisiteInstaller executable.

• Each component required by the PrerequisiteInstaller will have its own argument. This argument has a name, and a location where the installer can be found. In our case, we will create a list of arguments for all required components combined with the location of that particular installer.

• In the PrerequisiteInstaller.Arguments.txt file, add the following commands: (All in one line, with only a space between each separate argument)

a. /Unattended /IDFXR2:C:SharePointFilesPrerequisiteInstallerFilesWindows6.1-KB974405-x64.msu /SQLnCli:C:SharePointFilesPrerequisiteInstallerFilessqlncli.msi /ChartControl:C:SharePointFilesPrerequisiteInstallerFilesMSChart.exe /Sync:C:SharePointFilesPrerequisiteInstallerFilesSynchronization.msi /adomd:C:SharePointFilesPrerequisiteInstallerFilesSQLSERVER2008_ASADOMD10.msi /Speech:C:SharePointFilesPrerequisiteInstallerFilesSpeechPlatformRuntime.msi /SpeechLPK:C:SharePointFilesPrerequisiteInstallerFilesMSSpeech_SR_en-US_TELE.msi /ReportingServices:C:SharePointFilesPrerequisiteInstallerFilesrsSharePoint.msi

• Note: Because I’m on a 2008R2 machine, I use the arugment ‘IDFXR2′ instead of ‘IDFX’. Be sure to change this if you’re on a 2008 machine!

Note : I have already created PrerequisiteInstaller.Arguments.txt file in \\cocxogspwfe20\e$\Software\SharePoint\Foundation\SPInstallPrerequisites folder

4. Run the prerequisites installer

• The only step left is to install the prerequisites.

• You can run ‘PrerequisiteInstaller.exe’ manually by double-clicking on it, or using the command line

• Because the file PrerequisiteInstaller.Arguments.txt is in the same directory, the installer will use this file for its own arguments and thus install the prerequisites in an offline mode.

• You’re done!

5. Troubleshooting

• It can be possible (like it was in my case) that the installation using PrerequisiteInstaller.exe did not complete. In my case, it was because there were some arguments missing in my arguments file.

• There are log-files available who can tell you what went wrong. You can find this log-files in folder: ‘C:Users{user}AppDataLocalTemp‘

This is automated process for installing prerequisites in off-line mode using the PrerequistiesInstaller.Arguments.txt or we can also install all Prerequisites manually from specified folder.

Wednesday, January 11, 2012

How to Create Custom SharePoint 2010 Page Layouts using SharePoint Designer 2010

You’re working with the Enterprise Wiki Site Template and you don’t really like where the “Last modified…” information is located (above the content). You want to move that information to the bottom of the page.

Option 1: Modify the “EnterpriseWiki.aspx” Page Layout directly.

Option 2: Create a new Page Layout based on the original one and then modify that one.




We’ll go ahead and go with Option 2 since we don’t want to modify the out of the box template just in case we need it later on.

How To:

Step 1

Navigate to the top level site of the Site Collection > Site Actions > Site Settings > Master pages (Under the Galleries section). Then switch over to the Documents tab in the Ribbon and then click New > Page Layout.


Scenario:

Step 2

Select the Enterprise Wiki Page Content Type to associate with, give it a URL and Title. Note that there’s also a link on this page to create a new Content Type. You might be interested in doing this if you wanted to say, add more editing fields or metadata properties to the layout. For example if you wanted to add another Managed Metadata column to capture folksonomy aside from the already included “Wiki Categories” Managed Metadata column.



Step 3

SharePoint Designer time! Hover over your newly created Page Layout and “Edit in Microsoft SharePoint Designer.”




Step 4

Now you can choose to build your page manually by dragging your SharePoint Controls onto the page and laying them out as you’d like…




How to Create Custom SharePoint 2010 Page Layouts using SharePoint Designer 2010
June 8th, 2010 § 38 Comments

Becky Bertram has a nice post on how to create custom SharePoint 2010 Page Layouts via Visual Studio but my googling didn’t yield any walkthroughs on how to do this via SharePoint Designer. So let’s take a crack at this…

Scenario:
You’re working with the Enterprise Wiki Site Template and you don’t really like where the “Last modified…” information is located (above the content). You want to move that information to the bottom of the page.

Option 1: Modify the “EnterpriseWiki.aspx” Page Layout directly.

Option 2: Create a new Page Layout based on the original one and then modify that one.



We’ll go ahead and go with Option 2 since we don’t want to modify the out of the box template just in case we need it later on.

How To:

Step 1


Navigate to the top level site of the Site Collection > Site Actions > Site Settings > Master pages (Under the Galleries section). Then switch over to the Documents tab in the Ribbon and then click New > Page Layout.



Step 2

Select the Enterprise Wiki Page Content Type to associate with, give it a URL and Title. Note that there’s also a link on this page to create a new Content Type. You might be interested in doing this if you wanted to say, add more editing fields or metadata properties to the layout. For example if you wanted to add another Managed Metadata column to capture folksonomy aside from the already included “Wiki Categories” Managed Metadata column.



Step 3

SharePoint Designer time! Hover over your newly created Page Layout and “Edit in Microsoft SharePoint Designer.”



Step 4

Now you can choose to build your page manually by dragging your SharePoint Controls onto the page and laying them out as you’d like…



Step 5

Alright, so you’ve copied the contents of the EnterpriseWiki.aspx Page Layout and now it’s time for some customizing. I found the control I want to move, so I’ll simply do a copy or cut/paste to the new spot.



Step 6

Check-in, publish, and approve the new Page Layout. Side note: I like to add the Check-In/Check-Out/Discard or Undo-Checkout buttons to all of my Office Applications’ Quick Access Toolbars for convenience.



Step 7

Almost there! Navigate to your publishing site, in this case the Enterprise Wiki Site, then go to Site Actions > Site Settings > Page layouts and site templates (Under Look and Feel). Here you’ll be able to make the new Page Layout available for use within the site.



Step 8

Go back to your site and edit the page that you’d like to change the layout for. On the Page tab of the Ribbon, click on Page Layout and select your custom Page Layout.



Finally , Output will be like this .......

Sharepoint 2010

sfsff