sharepointking

Just another WordPress.com site

Monthly Archives: November 2008

MOSS & SEO (Search Engine Optimization) – Sharepoint Site in Google Search Result

Refer below article: SP1 for sharepoint is require to enable Crawling on your sharepoint web application to put your site into search result ranking in case of windows authentication

In more,When Office SharePoint Server 2007 was released, it was not able to crawl content that was secured with forms authentication. In Service Pack 1, SharePoint Products and Technologies include the ability to set special crawl rules that describe cookie-based authentication so those sites can be crawled

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

Best example of SEO on sharepoint site : http://www.hawaiianair.com/Pages/Index.aspx

Hope above information will help you to make your sharepoint site crawlable.

User roles and permission checking programatically: Security

SPWeb web = SPContext.Current.Web;
//****************************************

// Validate the page request to avoid any malicious posts

if (Request.HttpMethod == “POST”)

SPUtility.ValidateFormDigest();
//**************************************** // Get a reference the roles that are // bound to the current user and the role // definition to which we need to verify // the user against

SPRoleDefinitionBindingCollection usersRoles = web.AllRolesForCurrentUser; SPRoleDefinitionCollection roleDefinitions = web.RoleDefinitions;

SPRoleDefinition roleDefinition = roleDefinitions[“Full Control”];
// Check if the user is in the role. If not // redirect the user to the access denied page

if (usersRoles.Contains(roleDefinition)) {

//******************************* //Check if post back to run //code that initiates the page

if (IsPostBack != true) {

//write your logic here

}

} else {

Response.Redirect(“/_layouts/accessdenied.aspx”);

}

Enable AJAX In SharePoint

Problem:
One-time ajax postback works, subsequently, it will fail.

Solution:
Add below block into your webpage Script block will solve above problem:

_spOriginalFormAction = document.forms[0].action;
_spSuppressFormOnSubmitWrapper=true;

_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;

Item level security on SharePoint List Programatically

Properties to set item level security is already in SharePoint object Model. Following is the
SPList have properties to set item level security: SPList.ReadSecurity and SPList.WriteSecurity

E.g.
SPList spList = SPContext.Current.Web.Lists[“Vaibhav Blog List”];
spList.ReadSecurity = 2;
spList.WriteSecurity = 4;
spList.Update();

In more, below will help you to understand more:

ReadSecurity
1. SPList.ReadSecurity = 1 stands for Read Access: Specify which items users can read “All items”
2. SPList.ReadSecurity = 2 stands for Read Access: Specify which items users can read “Only their own”
WriteSecurity
1. SPList.WriteSecurity = 1 stands for Edit access: Specify which items users can edit “All items”
2. SPList.WriteSecurity = 2 stands for Edit access: Specify which items users can edit “Only their own”
3. SPList.WriteSecurity = 4 stands for Edit access: Specify which items users can edit “None”

Cheer!!

Hide Quick Launch using Content Editor Webpart : Javascript

Follow below steps to hide quick launch using JAVASCRIPT:

Hide the Quick Launch in a Content Editor Web Part (CEWP).
1. Edit the page.
2. Add Content Editor Webpart to a Web Part Zone.
3. Select Edit – Modify Shared Web Part
4. Under Appearance, change title to Hide Quick Launch.
5. Under Layout, check the Hidden option.
6. Click the Source Editor button and add the following markup.

.ms-navframe {display:none;}

Generate Top Navigation Menu for MOSS : Powershell

Follow steps mention on below article.http://www.codeplex.com/wsstopnavdsl

Imprtant point to keep in mind:

After creating top navigation using powershell script if you will try to execute .ps1 (powershell script file extension) you may get below error:

If you get above error then follow following article this will solve above certificate related issue:

http://www.hanselman.com/blog/SigningPowerShellScripts.aspx

In more, You may get server is busy following error:

To solve above error. do IIS Reset and run above same commend quickly after that.
Enjoy!!!

How do you restrict access to AD (Active Directory) information in a hosting environment

=================Question / Case=================================
The scenario is this, we want to host a couple of sharepointsites for our customers our WSS farm. But how can we restrict access for one customer to another customers information in the AD (Active Directory).

That is when person A at Company A wants to add a member to his site i dont want him to see the account for person B of company B in the AD.

One solution would be to host several Active Directory but that is not preferable from a management point of view.

So is there any way to restrict specific users to see information from a parallel OU´s(Organization Unit) in the AD (Active Directory)?
==================ANSWER ON ABOVE PROBLEM==================

You have to create separate site collection for each Customer and create subsites pertaining to the customer. After you create site collection then you have two ways you can restrict people from people picker

1. Search only within a site collection

Run the following stsadm command for the site collection stsadm -o setproperty –url http://server/sites/CustomerA –pn peoplepicker-onlysearchwithinsitecollection –pv yes

2. Search only within an AD OU Search only within a site collection

Where, CustomerA is the site collection name Search only within an AD OU Run the following stsadm command for the site collection Stsadm –o setsiteuseraccountdirectorypath -path “OU=CustomerA,DC=Company,DC=com” –url http://server/sites/CustomerA

This operation is new in SP1. Only one OU path can be specified per site collection.

Webpart Connection : Nice article

Important articles to know about what is webpart connection and how it is working:

http://www.codersource.net/published/view/336/webpart_connection.aspx
http://msdn.microsoft.com/en-us/library/ms178187.aspx

Number of columns limitation for each type of field:

I can’t create another column of a certain type
Windows SharePoint Services specifies limits for the number of columns of a certain type that you can create in each list or library. The following table lists the limits by column type.

Column Type
Maximum Number

Single line of text AND Choice (Drop Down Menu or Radio Buttons)*
64

Multiple lines of text AND Choice (Checkboxes (allow multiple sections))*
32

Number AND Currency*
32

Lookup
16

Yes/No
16

Calculated
8

*In rows marked with an asterisk (*), the number given is the total for all columns of both of the types in the row combined. For example, you can create 16 Number and 16 Currency columns, or 30 Number columns and 2 Currency columns, but not 32 Number columns and 32 Currency columns