Tuesday, November 30, 2010

SP2010 URL Field Type Enhancement

I've observed a nice feature offered by Microsoft SharePoint team when I was trying to migrate the contents from one server to another. In Sharepoint 2007, you will not get an automatic conversion of existing URL when you are migrating list items among the servers (Header of URL). But in SharePoint 2010 it does.

Observation:

Server 1
I've pointed some of the assets by giving the absolute URL path
I want all those list items to be migrated to another server called Server 2

I've used SPContent Deployment Wizard to do the job.
Amazingly all the URL headers of the absolute path is converted in adherence to Server 2

You may ask whether the above tool does the job for you.
The answer is NO. Because I've checked the latest release note of that tool to see whether it supports that kind of fancy conversion.

My next step is to dig on the same stuff to see whether it accepts relevant URL header when I migrate the list items from one server to another server's sub-sitecollection

I'll come up with the latest note on that.

Stay tuned...

Monday, November 22, 2010

MCTS Sharepoint Developer Certification (70-573)


Recently I have sit for the Sharepoint Developer Examination, which is anticipated unlike Administration Examination, a tough exam by my colleagues, though none of them have not tried at least once :) . Everyone pushed me towards the dead-end for the trial, and I also well prepared on the core API of Sharepoint. Since I have been actively working on Sharepoint for last one year, most of the API is covered through out my tasks, which enabled me to go for a dry run on the new features introduced in Sharepoint 2010 API such as SPListCollection.TryGetList etc.

These are the steps I've focused once I've decided to embark on the Sharepoint bed.
First, I've done some POCs based on the weight of skills to be tested.
Microsoft Preparation Guide

Lets say, TimerJob implementation is included in the preparation list, I've written a simple TimerJob and deployed as Farm Administrator and note down if any issues encountered.
But at the exam, required us to be familiar with the sandboxed solution deployment as well, where as we deploy everything as Farm Administrator. So for the audience, I'm encouraging all you to go through the dual deployment steps and get hold of the stuffs as its a new feature introduced in SharePoint 2010; I meant the SandBoxed solution.

Atlast, outline given by Microsoft is analysed detailed and provided reference on the following blog, which was a worth guide for me.
Guide with References

If any specific clarification neede on the exams, just post me your questions.

Friday, November 19, 2010

Pagination for joint DVWP

As you might see, in sharepoint 2007 and in par with in sharepoint 2010 follow the same method on pagination for the joint list DVWP. If you add a single list, to DVWP and add pagination value, it normally works as expected. But once you link the existing datasource with another list, it automatically removes the pagination from the rendering part, still it keeps the xsl tags in the back-end. So how to enable the out of the box pagination.
Lets say "Category" List and "SubCategory" Lists are there. You are showing Sub Categories for the given Category. But all happens through the webpart. No addition of content type in page layout (Client requirement as they want to use the same layout for different purpose). If you link Category and SubCategory, pagination disappears. so you can't limit the number of SubCategories showing in webpart. In order to resolve that issue...
Obviously you can't enable the pagination by switching on and off, where as you have to write the xsl for the <xsl:template name="dvt_1.commandfooter"> template.
The parameters for the commandfooter template will be the same as default

<xsl:call-template name="dvt_1.commandfooter">
  <xsl:with-param name="FirstRow" select="$FirstRow" />
  <xsl:with-param name="LastRow" select="$LastRow" />
  <xsl:with-param name="RowLimit" select="$RowLimit" />
  <xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
  <xsl:with-param name="RealLastRow" select="number(ddwrt:NameChanged('',-100))" />
</xsl:call-template>

and the template will be implemented like this

<xsl:template name="dvt_1.commandfooter">
<xsl:param name="FirstRow" />
<xsl:param name="LastRow" />
<xsl:param name="RowLimit" />
<xsl:param name="dvt_RowCount" />
<xsl:param name="RealLastRow" />
<xsl:variable name="preNumber" select="$FirstRow - $RowLimit" />
<xsl:variable name="nextNumber" select="$FirstRow + $RowLimit" />
<table><tbody><tr>
<xsl:if test="$FirstRow > 1">

</xsl:if><td>
<a href="/test1.aspx?PageLimit=$preNumber">Pre</a>
</td>

<xsl:if test="$nextNumber <= $dvt_RowCount">
</xsl:if><td>
<a href="/test1.aspx?PageLimit=$nextNumber">Next</a>
</td>
</tr>
</tbody></table>
</ xsl:template>

the parameter binding will be added with one more data as follows

<parameterbinding name="PageLimit" location="QueryString(PLimit)" defaultvalue="1" />

This is to limit the number of rows on the second list of joint view.
Assign the variables as follows

<xsl:variable name="FirstRow" select="$PageLimit" />
<xsl:variable name="LastRow" select="$FirstRow + $RowLimit" />

Call the body as follows

<xsl:call-template name="dvt_1.body">
  <xsl:with-param name="RowLimit" select="$RowLimit" />
  <xsl:with-param name="Rows" select="$Rows" />
  <xsl:with-param name="FirstRow" select="$FirstRow" />
  <xsl:with-param name="LastRow" select="$FirstRow + $RowLimit - 1" />
</xsl:call-template>

Now you are done with your pagination


P.S: This is my first blog post. Add your comments. :)