Friday, May 29, 2009

Form Based Authentication (FBA) in Sharepoint

The default authentication in sharepoint is Active Directory. In cases when you have a internet portal where your user is mainly from internet, you might consider to use Form based authentication. This is not an uncommon scenario.



The good news is, it is possible to leverage on the existing ASP.NET Membership provider in .net framework 2.0 onwards. The next question will be HOW TO do it ...



1. Create membership provider database by executing [aspnet_regsql.exe] from [C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727]



2. Give a name for the database, it is always better not to use the default name to avoid conflict of database, and continue the wizards to create the tables, stored procedures needed for membership providers



3. After you created the database, you need to add your first user. There are two ways:

a. Execute



declare @now datetimeset

@now= GETDATE()

exec aspnet_Membership_CreateUser '/', 'userlogin','password','','email@somewhere.com','','',1,@now,@now,0,0,null



b. Use VS to modify the ASP.NET Web configuration


4. Append three sections in web application web.config

<>

< name=" FBAConnectionString " connectionstring=" Data Source=.;Initial Catalog= MOSS_FBA;Integrated Security=True ">

< / connectionStrings >

< defaultprovider= " FBAMember ">

<>

< connectionstringname= " FBAConnectionString " enablepasswordretrieval=" false " enablepasswordreset=" true ">

requiresQuestionAndAnswer=" false "

applicationName="/"

requiresUniqueEmail="false"

passwordFormat=" Hashed "

maxInvalidPasswordAttempts="5"

minRequiredPasswordLength="1"

minRequiredNonalphanumericCharacters="0"

passwordAttemptWindow="10"

passwordStrengthRegularExpression=""

name="FBAMember" type="System.Web.Security.SqlMembershipProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" /> < / providers >< / membership >


< mode=" Forms ">

< / authentication >

<> <> < key="FBAMember" value="%"> < / PeoplePickerWildcards >


5. Make the same changes in web.config for central admin

6. Central Admin --> Application Management --> Site Collection Owner, Add the user that you created in step 3

7. Central Admin --> Application Management --> Authentication Providers , you should see two entry. Click on the default zone.

8. Change the authentication to 'FORM' and update the Membership provider name:
9. You should be able to login now.

Wednesday, May 27, 2009

Sharepoint 2007 Boundaries (limitation)

It is always important to understand the limitation or boundary of the system. For example, you cant be creating item in the list without any limit.

Check it out from here

It provides you a better idea on how to plan your system

Sunday, May 24, 2009

Sharepoint content publishing

One of the key feature in sharepoint is about content publishing, which means it provides you the flexibility to separate authoring and publishing environment.

Then you may ask one question. HOW TO DO IT !!!

It is very simple, just follow the steps below:

On Target
1. Create a new web application in target.
2. Create a empty site, preferably using
stsadm -o createsite -url http://targetSiteUrl/ -ownerlogin yrLogin -owneremail yrEmail
--If you dont use blank site, you are expected to see error
3. Then you should go to central admin --> Operation --> Content Deployment Settings to turn on "Accept incoming content deployment jobs"

On Source
1. Go to central admin --> Operation --> Content Deployment Paths and jobs
2. Create new path
3. Create new job
4. Execute the job

One very important notes !!!
If you have feature deployed on the source, MAKE SURE YOU HAVE IT INSTALL IN TARGET AS WELL before the deployment started.

Some basic readings that you might want to start off before you perform publishing deployment
1. Basic Idea
2. Basic Walkthrough
3. Pre-deployment
4. Best Practice

Friday, May 22, 2009

Sharepoint Timer Error

After you deploy the solution file and when you try to deploy the solution, you see the following error message.

You should check your [Windows Sharepoint Service Administration] if it is activated. !!! After you activated the service, make sure you run the command below to execute the timer job directly instead of wasting your time to wait for sharepoint to pick up the job.

STSADM –O execadmsvcjobs

The timer job for this operation has been created, but it will fail because the administrative service for this server is not enabled. If the timer job is scheduled to run at a later time, you can run the jobs all at once using stsadm.exe -o execadmsvcjobs. To avoid this problem in the future, enable the Windows SharePoint Services administrative service, or run your operation through the STSADM.exe command line utility

Wednesday, May 20, 2009

List Deleting event

Surprise to see this, but I'm going to disappoint you. Sharepoint does not provide any list deleting event. In fact, there is no event for list creation, deletion events.

One possible workaround that i found from sharepointking is to make use of itemDeleting events.

When list is deleted, itemDeleting event will be triggered. And the ListItem id will be 0.

Monday, May 18, 2009

How to activate a feature when site is created

If you have a feature that can only be activated in web level and you need the feature to be activated when the site is created, then you might need to read the following.

The key word is feature stapler, which allows you to tight a feature that you need to activate to a site template.

In summary,
1. you create a new feature that set the scope to "farm" level
2. in the element.xml, you create


FeatureSiteTemplateAssociation Id="2B3451F0-BC93-41A4-9FAD-3A81861D651A" TemplateName="STS#0"/
2B3451F0-BC93-41A4-9FAD-3A81861D651A : feature to be activated when site is created
STS#0 : STS is the template name, and 0 is the configuration ID in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML

Refer to http://sharepointmagazine.net/technical/development/introduction-to-sharepoint-feature-stapling-part-1

Saturday, May 16, 2009

How to change the bloodly PAGES when you create publishing page in page library

If you realize when you use page content type, regardless of where the document library is location, the path is always pointing to PAGES folder, it makes your path become very ugly in the URL..

www.yoursite.com/site1/pages/myPage.aspx
www.yoursite.com/site1/pages/myPage2.aspx

Below article highlights on how to customize this behaviour. Instead of using the default createPage.aspx, we will change it to something else. And make modification from there.

Before you start, one point to take note, YOU MUST ADD THE FOLLOWING NAMESPACE IN THE NEW PAGE ELSE YOU WILL SPEND HOUR ON DEBUGGING

Import Namespace="Microsoft.SharePoint.Publishing"


<%@ Import Namespace="Microsoft.SharePoint.Publishing" %>

http://blogs.msdn.com/syedi/archive/2008/07/18/why-should-one-save-publishing-pages-in-pages-list-always-in-moss-bend-it.aspx

Tuesday, May 5, 2009

List Template Id's

850 Page
100 Generic list
101 Document library
102 Survey
103 Links list
104 Announcements list
105 Contacts list
106 Events list
107 Tasks list
108 Discussion board
109 Picture library
110 Data sources
111 Site template gallery
112 User Information list
113 Web Part gallery
114 List template gallery
115 XML Form library
116 Master pages gallery
117 No-Code Workflows
118 Custom Workflow Process
119 Wiki Page library
120 Custom grid for a list
130 Data Connection library
140 Workflow History
150 Gantt Tasks list
200 Meeting Series list
201 Meeting Agenda list
202 Meeting Attendees list
204 Meeting Decisions list
207 Meeting Objectives list
210 Meeting text box
211 Meeting Things To Bring list
212 Meeting Workspace Pages list
301 Blog Posts list
302 Blog Comments list
303 Blog Categories list
1100 Issue tracking
1200 Administrator tasks list

Sunday, May 3, 2009

6 pillars of MOSS

Before anyone starts to do / sell sharepoint. The person should understand the 6 pillars of MOSS.

1. Collaboration
2. Portal
3. Search
4. Content Management
5. Business Process
6. Business Intelligence

1. Collaboration
How does your organization share information ? In shared folder or riding on a custom built web page. With MOSS, you can have a better knowledge management by leverage on Wikis, Workspace, Forum and etc. These are out of the box feautes provided by MOSS.

2.Portal
Any enterprise should have a one corporate website to deliver information to the employee. Apart from the information delivering, MOSS can seamlessly integrate with various systems like SAP, oracle to make MOSS a one stop website for everything. For example, if you are using Oracle Siebel CRM to store your customer information, you dont have to login to Siebel system to see your customer list. You can view them from MOSS page.

3. Search
If you have tons of information and it is not accessable, these information will become useless. It is important to be able to search information with just a few clicks. And this feature is provided out of the box from MOSS.

4. Content Management
In this fast pace environment, how fast you response to the opportunity is the key differentiator for your competitors. With MOSS you can manage your website content as easy as a few clicks.

5. Business Process
Typical enterprise environment will need forms submission and workflow for approval. MOSS is built to integrate with various MSFT office products including Infopath, which allows you to fill in information and ready for submission. And form submission, workflow (both standard and customized build) can be activated to perform the tasks that is needed. For example, for leave application, employee can fill in the pre-designed form in infopath. After the form is submitted, approval workflow can be triggered for manager approval.

6. Business Intelligence
How do you capitalize your data is to gain a bigger market share is very important. With MOSS, you can integrate with SQL Reporting services easily (SSRS), you prepare report in various formats. On top of that you can also leverage on the datamining feature in SSRS.

Good Startup for MOSS

You will find very interesting MOSS related topic here, to avoid tons of words to start with, this is a very good material from MSFT for beginner.

2007 Office System: How Do I? (ScreenCasts)

Office 2007 Partner Technical Readiness Training Presentations

After seeing these videos, you should have a better understanding on MOSS