New blog started

June 1, 2009

Dear friends,

I have started a new blog at http://aniwebdiary.blogspot.com. That will be the blog where I will start posting henceforth.

Ani


Open SharePoint Link List Item in new window

April 29, 2009

One of the frequently asked questions from SharePoint developers, “How to open Links from Links List in a new window?”.

There are lots of way that we can find doing some simple googling:

1. Directly update the List Schema file. But this is only applicable if this need to be done for all the applications. Otherwise this is not a best practice.  reference 1 reference 2
2. Create a new style for the Content Query web part to use by modifying ItemStyle.xsl reference
3. Using the Summary Links web part instead.  This web part will allow you to designate how each link opens up (in a new browser or the current one).
4. Using some tricks with javascript. But the reference that follows required additional effort for end users. reference
5. Using dataview webpart. reference

If any of the above metho doesn’t suit your taste, and in case you are a JavaScript fan, there is an easy process to acheive this:

Step 1: Open the page where you have added the Links webpart.
Step 2: Add a “Content Editor Web Part” to the page.
Step 3: Move the “Content Editor Web Part” below the Links webpart.
Step 4: Edit the “Content Editor Webpart” from corresponding “Modify Shared Web Part”.
Step 5: Do either of the following activities:
             a. Copy and paste the JavaScript code below and paste it to Content Editor’s “Source Editor….”.

<script language=”javascript” type=”text/javascript”>
     var tbl = document.getElementsByTagName(‘table’); 
     for(var i = 0; i < tbl.length; i++)
     {
      if(tbl[i].getAttribute(“Summary”) == “Links”)
      {    
       var anc = tbl[i].getElementsByTagName(‘a’);
       for(var j = 0; j < anc.length; j++)
       {
        anc[j].setAttribute(‘target’, ‘_blank’);
       }
      }
     }
      </script>

             b. Create a separate .js file with the JavaScript code above and upload the file in a Library. Next add the path of the .js file to the Content Editor Web Part’s “Content link” textbox.

That’s all. Using this process, you can add the javascript to a particular page, or even to the master pages. But this javascript code should always appear after the Links webpart (as mentioned in Step 3 above).


SharePoint Membership Webpart

March 30, 2009

This out-of-box webpart displays your site memberships. In other words, it will list all the sites where you have memberships.

The basic criteria to get the membership feature to function correctly are
as follows:

- You need to have an SSP created and all your sites need to be associated
with it.

- Having access to a site and being a member of the site are two different
things. The users need to be part of the site’s Members group.

How to confirm: If you navigate to the site you want to show up in your membership web part, then go to Site Actions / Site Settings / People and Groups. Click on Actions and Setup Groups. Once in this screen, insure that you are in the group that is listed in the section called Members.

How to setup: If you do not have a member group, you can create one by navigating to the site, Clicking on Site Actions / Site Settings / People and Groups / Actions / Setup Groups.

Site Memberships are all sites in which you are explicitly included in the “~Members” group for the site (where ~ is your site name).  Other users who are also explicitly included in the ~Members group on those sites are suggested as your colleagues.  This information is collected by a WSS profile synchronization timer job.

- You need to have a Office Search full crawl scheduled and at least 1
successful full crawl completed. The population of user memberships is also closely tied to the full SharePoint crawl schedule. After each addition/deletion of memberships, we must execute a full crawl.

- the membership functionality does not work with AD Groups (I know… it’s silly). Each user has to be explicitly added to the Members group within the site.

Once you have all these components in place, the membership web part should
function correctly.

Note: There are couple of additional configurations which need to be performed. Although I have never faced any issues without these configurations, still I am mentioning them in case it helps somebody.

- In order for the Membership functionality to work correctly, you need to make sure the users are clicking on the “Set as default My Site” link in the top right corner of the My Site screen. Until they do this, the membership functions will not work.

- You are using Office 2007, then only you will be able to use this webpart to it’s fullest.


MOSS out-of-box Usage Report

February 22, 2009

The Site Usage Reports that MOSS provide can be useful for site admin in determining the Usages of the Site. If you haven’t got any other tools for tracking site usage, these Reports can be useful.  But the only problem is that the information they present is not really explained anywhere.

Few days back one of my Client was asking me to explain the Report, but I had some tough time to do that. I searched a lot for any proper documentation from Microsoft, but didn’t helped me out. After couple of day’s searching, I finally able to explain my Client about the figues that is getting displayed in the Reports. Thanks to Mark Arend’s Blog @ MSDN. He has really explained the logic in a well documented attachment with his post.


Show detailed error message in SharePoint

February 21, 2009

Exceptions that are caught by SharePoint are generally displayed in a friendly error message instead of a detailed error message with stack trace.

To display the full exception needed for debugging make the following changes to your SharePoint site’s web.config file (Inetpub\wwwroot\wss\VirtualDirectories\[respective Port Number]\web.config).

·         Find:   <SafeMode CallStack=”true” />
·         Replace with: <SafeMode CallStack=”false” />

·         Find:   <customErrors mode=”On” />
·         Replace with: <customErrors mode=”On” />

·         Find:   <compilation debug=”false” />
·         Replace with: <compilation debug=”false” />

Reproduce the problem and the true exception will be displayed.

Application pages beneath _layouts have a separate web.config file that needs updated to enable more detailed error messages.

Open \Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\web.config

Add the following XML block immediately after the <configuration element.

<SharePoint>
<SafeMode CallStack=”true”>
<PageParserPaths></PageParserPaths>
</SafeMode>
</SharePoint>

·         Find:   <compilation debug=”false” />
·         Replace with: <compilation debug=”true” />

Note: Always remember to disable debug mode before deploying a production application or conducting any performance measurements. If debug mode is enabled, the performance of your application can suffer a great deal.


Host header site collections

January 7, 2009

What is host header-based site collection?
A host header-based site collection is a site collection that allows you to specify a separate domain-name on the site collection level. Given that Microsoft recommends a maximum limit of 20 Web Applications on a farm, the ability to use site collections as the entry point is very significant (expanding the potential total number of sites on a single farm into the thousands). Rather than having single domain-name for single web-application, we can have multiple domain names under a single web application.

Note: In Windows SharePoint Services 2.0, this was known as “Scalable Hosting Mode”.

How to create a host header-based site collection?

Suppose we are going to create 3 site collections under a single web application [http://www.ani.com].

web-app

Creating Site Collections from Central Administration does not support the creation of host-named site collections. We have to create new site using STSADM command only.

First we need to create a Web Application(in case, it doesn’t not exist).For instance, let’s say we have created a Web Application, [http://www.ani.com]. It is not always necessary to have a domain name for this Web Application. This even works with the form [http://ServerName: PortNumber].Next we need to execute one of the STSADM command as given below:12-hive

·         Create Site (without mentioning database)

stsadm -o createsite -url http://www.hostheader.com -ownerlogin DOMAIN\username -owneremail admin@ani.com -sitetemplate STS#1 -hhurl http://www.ani.com

·         Create Site in New DB

stsadm -o createsiteinnewdb -url http://www.hostheader.com -ownerlogin DOMAIN\username -owneremail admin@ani.com -sitetemplate STS#1 -hhurl http://www.ani.com -databaseserver sqlsrv.mydomain.com -databasename WSS_Content-HHSite1

Note: “sitetemplate” is optional.Also, you can use either -hostheaderwebapplication or -hhurl for the switch, both work, but currently (with SP1 installed) if you do a stsadm -help createsite it comes back with -hostheaderwebapplicationurl as the switch.

There would be a warning message as below, but you can ignore that.

warning

At this stage you can view the Site Collection from Central Administration:

site-coll

Next we need to add the domain name in couple of places:

1. IIS (Start -> Run -> inetmgr)

Right Click over your WebSite and click “Properties”.

iis1

Then Click on “Advanced…” and add an identity as below, click OK twice to close all popup.

iis2

2.      Hosts (C:\WINNT\system32\drivers\etc)Open the file using Notepad and add an entry as below: (Please take a backup before doing the changes)

hosts

Note: This is not required in case you are doing this in a Production Environment and DNS is already mapped.


That’s all. Now you can open the site collection using the URL [www.hostheader.com].

Similarly you can create multiple site collections with unique domain-names (like “feeds.ani.com”, “admin.ani.com”) for each of them.

What are the advantages of using host header-based site collection?

1.      Reduced number of Web Applications and hence properly organized.

2.      Increased Performance

3.      It saves cost. Rather than purchasing a large block of IP addresses, you can purchase a smaller block of addresses. You only need to use one address from this block for a whole collection of sites. Individual sites are identified by host headers — the Web server reads the header in the incoming HTTP request and directs the request to the appropriate site.

4.      Host headers now work with SSL-enabled sites. With the introduction of Windows Server 2003 SP1, it became possible to use host headers for addressing SSL-enabled sites.

What are the disadvantages of host header-based site collection?

1.      You cannot manage the site collection’s access mapping like you can a web application. As a matter of fact, AAM has no idea that the site collection has a host header.

2.      Host-named sites are only available through the default zone. Users who are configured to authenticate through alternate zones cannot access host-named sites.

3.      You cannot search the host header site that uses both HTTP and HTTPS (see KB927919). Each individual host-named site collection can be either HTTP or HTTPS exclusively. You can obtain search results over both protocols by creating one Web application for HTTP and one for HTTPS. If we want the host-named site collection to be searchable over HTTPS, we have to put it in the HTTPS Web application.

4.      We need to create separate “Search Content Sources” for each Site Collections. It will not be added by default to the Source named “Local Office SharePoint Server sites”.


Hello Friends!

December 28, 2008

After spending so many years in IT, finally I am starting my journey in one of the popular term in Web today, “BLOG”. This is my first day and I’m really excited for this. I hope I will continue with this and add my experiences on a regular basis. I would like to use this space to share my personal views, experiences, knowledges as well as some technical knowhow that I will gather from my day-to-day experieces.

I would also like to have your feedback/comments/views with every posts. That would really help me to move forward.

Thanks,
Ani