Tuesday, March 30, 2010

Developer Dashboard

A new capability to debug and deep analysis is named "Developer Dashboard". Actually it gives the much information about the rendered page, once this is 'ON' the developer can see ->
  1. Time taken to render by each method in page life cycle
  2. information about page, current user, page status etc
  3. Time taken by database queries
  4. Time taken by web part to render [each web part]
The command to enable Daveloper Dashboard is -
stsadm -o setproperty -pn developer-dashboard  -pv ondemand
[The -ov options are On, off, Ondemand]
after the command is completed successfully a small icon on top left [next to currentlyLog in user] will appear.

The informtion on bottom of page is - This informtion can be used for deeper
analysis of performance.


Cheers for debugging !!

Wednesday, March 24, 2010

Document Set, Knowledge Managment And MetaData


I was just going through knowledge management options with SPS 2010, I find some very basic steps to create a KM store within minutes [of course you should have taxonomy or atleast some thoughts in ready :) ]

Document Set and Meta Data service plays a important role in KM management. So let;s have a one liner of both of these -

Document Set -> Obvious from name documents can be grouped within one set, can be created from base content type 'Document set'.

Meta Data Service -> Another service given by SPS 2010, helps in adding meta data with documents. Since this is a service, term set defined in one service can be consumed by different web applications in different FARM altogether.

So below is the idea for KM in sps 2010 [The first step is optional, you can directly start from CA]-

  • Choose on source web app [from thsi web app you can easily modify content type]
  • Goto CA -> ManageService Application
  • Select the Manage ServiceApplication proxy. The UI will look like [Fig-1]

  • After creating term set, goto Site->Site Settings->Galleries -> Site Content Type
  • Create New contet type with base type as 'DocumentSet'.
  • Goto Document Library, from advanced settings, enable content type.
  • Now come to document upload of Document Library, you will see 'DocumentSet' right there !!.

In part 2 we will see KM from these information.

Thursday, March 11, 2010

ASP.net Integration with SharePoint 2010


from Couple of days I was trying to integrate asp.net application into SPS 2010. The integration was simple, but the glitch was the asp.net files were written in asp style, those pages were written in early days of .net. So I did we appraoch to this problem, below are some technical points in this direction -

Some how we need the old story , .aspx pages and corresponding dll deployed to bin or GAC.

For this simple requirement, we created new project of type 'web application' [this ensures out put as dll], deployed it to bin and added entry in <safe control> in web.config. [I was getting can not load type as not registred as safe, after struggling with this stupid error, I created simple console application, used reflection and cheked out what are the classes in this namespace, once done, the code was running like anything]

now comes the tricky part, how to integrate the pages, I tried importing them to contentDB using SPD [nothing worked]
Then used features to deploy the pages and worked like charm :)
The integration done :)

Few more technical points in this journey -
  • Added each page within master page.
  • used ContentPlaceHolderMain for displaying the pages.
  • When integrating frame and iframe gave some problems.
  • controls were accessible using document.getElementById(), rather then document.formname.elementName.[even within window.opener]
  • Since the controls were simple html control need not to use &lt%=.ControlID%&gt
  • have to remove runat="server" from &ltForm&gt
Hope this will help you if you are trying something similar on these lines :)

Tuesday, March 9, 2010

V4.0 master page with just placeHolder


Today I created very basic master page i just has required placeholder, since I could not find it over net I thought let's post it, may be some body else will find it usefull :) below is code -
<%@ Master Language="C#" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="MUISelector" src="~/_controltemplates/MUISelector.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html lang="<%$Resources:wss,language_value%>" xmlns:o="urn:schemas-microsoft-com:office:office" runat="server" dir="<%$Resources:wss,multipages_direction_dir_value%>" __expr-val-dir="ltr">
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
<meta name="GENERATOR" content="Microsoft SharePoint"/>
<meta name="progid" content="SharePoint.WebPartPage.Document"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Expires" content="0"/>
<SharePoint:RobotsMetaTag runat="server"/>
<title id="onetidTitle"><asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"/></title>
<SharePoint:CssLink runat="server" Alternate="true"/>
<SharePoint:Theme runat="server"/>
<SharePoint:CssRegistration Name="minimalv4.css" runat="server"/>
<SharePoint:CssRegistration Name="layouts.css" runat="server"/>
<SharePoint:ULSClientConfig runat="server"/>
<SharePoint:ScriptLink language="javascript" name="core.js" OnDemand="true" runat="server"/>
<SharePoint:CustomJSUrl runat="server"/>
<SharePoint:SoapDiscoveryLink runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
<SharePoint:SPShortcutIcon runat="server" IconUrl="/_layouts/images/favicon.ico"/>
<SharePoint:SPHelpPageComponent Visible="false" runat="server"/>
<body onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
<form runat="server" onsubmit="if (typeof(_spFormOnSubmitWrapper) != 'undefined') {return _spFormOnSubmitWrapper();} else {return true;}">
<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />
<WebPartPages:SPWebPartManager id="m" runat="Server"/>
<SharePoint:FormDigest runat="server"/>

<asp:ContentPlaceHolder ID="SPNavigation" runat="server">

<div >

<asp:ContentPlaceHolder id="PlaceHolderHelpButton" runat="server">

<asp:ContentPlaceHolder id="PlaceHolderWelcomeMenu" runat="server">

<asp:ContentPlaceHolder id="PlaceHolderDeveloperDashboardLauncher" runat="server">


<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">

<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />

<asp:ContentPlaceHolder id="PlaceHolderPageSubTitle" runat="server" />

<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server" />
<div id="maincontent">
<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />
<div style="display:none;">
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderNavSpacer" runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" runat="server" />
<div id="DeveloperDashboard">
<SharePoint:DeveloperDashboard runat="server"/>