Tuesday, January 24, 2012

More... link in Content Query Webpart

Following requirements achieved  using content query web part with combination for XSL style sheet
1. More link to navigate all items
2. Add New item link to add new item and should open in a dialog window
3. Each item has to be hyperlinked and should open in a dialog window
Snapshot of final output
clip_image001

Implementation Details
Achieved by creating custom XSL template, and associated to Content Query web part
We can reuse this template with minor changes. Hope this template will save your time while implementing these kind of solutions
<xsl:template name="moreArticles" match="Row[@Style='moreArticles']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="SafeImageUrl">
<xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
<xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="LinkTarget">
<xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
</xsl:variable>
<div id="linkitem" class="item">
<xsl:if test="string-length($SafeImageUrl) != 0">
<div class="image-area-left">
<a href="{$SafeLinkUrl}" target="{$LinkTarget}">
<img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" />
</a>
</div>
</xsl:if>
<div class="item bullet link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<!—following line of code for open item in dialog window-->
<a href="/departments/it/KnowledgeBase/_layouts/listform.aspx?PageType=4&amp;ListId={@ListId}&amp;ID={@ID}" onclick="EditLink2(this,ctx.ctxId);return false;" onfocus="OnLink(this)" target="_self">
<!--<a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">-->
<xsl:value-of select="$DisplayTitle"/>
</a>
<div class="description">
<xsl:value-of select="substring(@Description,1,200)" disable-output-escaping="yes" />
</div>
</div>
</div>
<xsl:if test="count(following-sibling::*)=0">
<div>
<!—following line of code for more link-->
<p align="right"><strong><a><xsl:attribute name="href">/departments/it/knowledgebase/pages/MoreArticles.aspx</xsl:attribute>More KB Articles...</a></strong></p>
<!—following line of code for Add New Item link-->
<p align="left"><img src="/PublishingImages/kbImages/addImg.png" alt=""/><strong><a><xsl:attribute name="onclick">javascript:NewItem2(event, &quot;/departments/it/knowledgebase/_layouts/listform.aspx?PageType=8&amp;ListId={8386e5d5-f918-4c9c-9e70-c39943dcbc70}&amp;RootFolder=&quot;);javascript:return false;</xsl:attribute> <xsl:attribute name="href">/departments/it/knowledgebase/_layouts/listform.aspx?PageType=8&amp;ListId={8386e5d5-f918-4c9c-9e70-c39943dcbc70}&amp;RootFolder=</xsl:attribute>Add New KB Article</a></strong></p>
</div>
</xsl:if>
</xsl:template>

Custom Site map provider


SharePoint provides global navigation display multiple level of navigation with some limitations

Scenario:
clip_image001
In the above screen Corporate is sub site. And IT, HR, Admin and Corporate Matter are the document libraries. We need one more level of menu with folders of each library.
We can’t achieve this scenario by increasing the StaticDisplayLevels to 2 in the Global navigation menu in the master page.
We take custom site map provider approach to achieve the functionality
1. Create notepad file and name it as CustomSiteMap.sitemap
2. Open the document create nodes like :
<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
<siteMapNode title="" url="">
<siteMapNode title="Corporate" url="/Pages/Corporate.aspx">
<siteMapNode title="IT" url="/Lists/IT/AllItems.aspx">
<siteMapNode title="Hydra" url="/Lists/HR/AllItems.aspx"/>
</siteMapNode>
<siteMapNode title="HR" url="/Lists/HR/AllItems.aspx"/>
<siteMapNode title="Admin" url="/Lists/admin/AllItems.aspx"/>
<siteMapNode title="Corporate Matters" url="/Lists/cormatter/AllItems.aspx"/>
</siteMapNode>
</siteMapNode>
</siteMap>

3. Save the file in 14hive/_Layouts/<CustomSiteProvider>/
4. Open targeted applications’ web.config file find for <providers> tag
5. Make this entry : <add name="CustomGlobalNavSiteMapProvider" siteMapFile="/_layouts/ CustomSiteProvider / CustomSiteMap.sitemap" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
6. Save and close the web.config
7. Open targeted application master page in SP designer
8. Try to simulate following snippet
<SharePoint:AspMenu
ID="TopNavigationMenuV4"
Runat="server"
EnableViewState="false"
DataSourceID="topSiteMap"
AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true"
UseSeparateCss="false"
Orientation="Horizontal"
StaticDisplayLevels="1"
MaximumDynamicDisplayLevels="3"
SkipLinkText=""
CssClass="s4-tn" Width="1024px">
</SharePoint:AspMenu>
<SharePoint:DelegateControl runat="server" ControlId="CustomXmlContentMapProvide" Id="topNavigationDelegate">
<Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="CustomGlobalNavSiteMapProvider"
id="topSiteMap"
runat="server"/>
</Template_Controls>
</SharePoint:DelegateControl>

9. Publish the master page.
10. Browse the application, and we can see custom global navigation

Sunday, October 23, 2011

Announcement Summary View

To make announcement data in summary view

1. Append following additional ParameterBinding tabs

<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,idHomePageNewAnnounce)" />
                            <ParameterBinding Name="MoreAnnouncements" Location="Resource(wss,MoreAnnouncements)" />
                            <ParameterBinding Name="ByText" Location="Resource(wss,2000)" />

2. Update BaseViewID=0

3. Replace entire viewFields with following tags

<FieldRef Name="LinkTitleNoMenu" Explicit="TRUE"/>
                                    <FieldRef Name="Body" Explicit="TRUE"/>
                                    <FieldRef Name="Author" Explicit="TRUE"/>
                                    <FieldRef Name="Modified" Explicit="TRUE"/>
                                    <FieldRef Name="Attachments" Explicit="TRUE"/>

Tuesday, September 6, 2011

SP2010 installation on windows7

Failed to start the database service MSSQL$OfficeServers

Go to “regedit”, browse thru “HKLM_Local_Machine/Software/Microsoft/Shared Tools/Web Server Extensions/12.0/WSS/”. Then change the value of attribute named “ServerRole” from SINGLESERVER to APPLICATION.

Tuesday, May 10, 2011

Planning for Internet Presence Site



Internet facing site scenario

Stages:

1.      Evaluate business problems and choose MOSS

2.      Plan the site

3.      Plan how the site will be maintained

4.      Plan and deploy underlying infrastructure

5.      Build the site and deploy

6.      Configure operations

7.      Maintain and modify the site

8.      Maintain infrastructure

Scenario Data

Business Needs


Authenticated Users

Developers -1, Tester -1, Authors – 10 authors and editors, 3-5 web
designers and graphic artists

Corpus Size

Anticipate corpus size

Document sizes and amount of changes

Average document size: 10 KBNumber of
documents published per publishing cycle: 20 average, up to 45
Percentage increase in number of documents
expected over three years: 5% per year

Visits per day

Average 1.5 million per day

Peak : 2.5 million per day

Days of peak usage : Quarterly and year end closing announcements

Performance

Acceptable time for first page load for local area users on broadband
connection :2 sec




Server farm
topologies


Integration farm

Single farm / Virtual server

Authoring farm

2 front end web servers and Cluster DB server

Production farm
(failover farm identical)

3 front end web servers, 1 serving queries, 1 application server,
Clustered DB servers



Hardware and Software


Authoring Farm

Clustered DB servers

4 3 GHz or faster processors16 GB RAM
minimum recommended
15 GB hard drive
(holds corpus: 1,000,000 10 KB documents)
Windows Server 2003 R2 Enterprise x64
EditionSQL Server 2005 Enterprise Edition

Front End Servers

Dual 3 GHz or faster processors4 GB RAM minimum recommendedAvailable disk space to hold the index of at
least .34 * the size of the corpus, plus room for the binary large object
(BLOB)
cache — approximately 20 MB.
Windows
Server 2003 R2 Enterprise x64 Editio
n

Production farm
(Failover farm identical )

Clustered DB servers

4 3 GHz or faster processors16 GB RAM15 GB hard drive (holds corpus: 1,000,000 10 KB
documents)
Windows Server
2003 R2 Enterprise x64 Edition
SQL
Server 2005 Enterprise Edition

Front End Servers

Dual 3 GHz or faster processors4 GB RAM Available
disk space to hold the index of at least .34 * the
size of the corpus,
plus room for the BLOB cache — approximately 20 MB.
Windows Server 2003 R2 Enterprise x64 Edition

Index server

Dual 3 GHz or faster processors4 GB RAM Available disk space to hold the index of at
least .34 * the size of the corpus

Integration Farm

Single server. 4 3 GHz or
faster processors16 GB RAM500 GB disk spaceWindows Server 2003 R2 Enterprise x64 EditionSQL Server 2005 Developer EditionVisual Studio 2005 Team Edition for
Developers







Scenario Roles


Role

Team

Definition

Solution Architect

Solutions

Leads in the specifications of solution’s design and implementation

Program Manger

Solutions

Writes the solution’s specifications and helps manage the solution
creation and deployment process

Program Manager

Core IT

Writes the infrastructure related to hosting the site and helps
implement and test the infrastructure

Content Manger

Solutions

Responsible for the site’s content and Signs off on major content
decisions

Designer

Solutions

Responsible for designing and creating site artifacts (Master Pages,
Style sheets and graphics)

Developer

Solutions

Responsible for developing software customizations

Tester

Solutions

Responsible for testing software customizations , also responsible verifying
the content in staging environment

Service Manager

Core IT

Manages all Sharepoint IT services, responsible for service supporting
the internet presence site

IT Administrator

Core IT

Responsible for centrally administrating sharepoint
services, including new service supporting for internet presence site

IT Operator

Core IT

Responsible for operations related to site such as backing up and
restoring site and managing content deployment jobs reports

Author

Solutions

Authors content for site

Editor

Solutions

Edits content and approves publication

Business Decision Maker

Marketing

Senior manager ultimately responsible for success of the internet
processing site; sponsors the entire project




Wednesday, April 20, 2011

IIS FAQ

1. Identify application pool identity in IIS7
A: Run command tool with administrtor account, navigate to C:\windows\system32\inetsrv>appcmd list WP

2. Identify application pool identity in IIS6
A: Run command tool , navigate to C:\windows\system32>cscript iisapp.vbs

3. What is application pool?
A: App pool isolates the worker process(W3wp.exe) execution. Each separate worker process provides a process boundary so that when an application assigned to one application pool, problems in other application pools do not affect the application