Useful SharePoint 2007 WebParts or Features on Codeplex – Part 1

Im Rahmen dieses Posts möchte ich heute im Part 1 einer kurzen Reihe nützliche und in meinen Projekten eingesetzte SharePoint Features und WebParts vorstellen, die auf Codeplex frei runtergeladen werden können.

SharePoint 2007 MultiView Web Part

Mit dem MultiView WebPart können Sie Daten dynamisch aus verschiedenen Ansichten oder aus verschiedenen SharePoint-Listen sowie Bibliotheken basierend auf bestimmten Bedingungen anzeigen.

Quelle: codeplex.com

What is MultiView ?
The MultiView webpart allows you to display data dynamically from different Views or even different Sharepoint Lists or Libraries based on certain conditions.

Currently it supports two types of Conditions.
a) Group Membership – You can show a particular View based on the Group Membership of the Current User
b) QueryString – You can pass a parameter(parameter name:ViewCase) in the QueryString to specify the particular View to Show
You can also combine both the criteria to create a more exotic condition.

It should work on both WSS and MOSS though we have done extensive testing only on WSS

What are the Benefits of MultiView ?

The MultiView sorts out a number of problems with the default Sharepoint Views and allows you to display multiple views in a single page easily

a) You can change the data displayed based on the user who is logged in. We use this extensively to show a different view based on whether a client
or a team member is logged in.

b) You can show different pieces of data on the same by changing the QueryString. We use this in pages like Issue Lists where we can display multiple views of the same issue list on the same page. This if done with the Normal Sharepoint Views would require multiple pages.

c) You can pass runtime values to the MultiView using the querystring or the config(explained later). This allows you to decide Views or even lists at run time. This means that on the same page you could show data from List1 to one user and Data from List2 to another user.

d) The MultiView has a header and footer. This allows you to put instruction or images above or below the View. In a normal scenario you would have to put Content Editor Webparts for the same.

e) All the data of the MultiView is stored in a XML format in a config list. This allows easy handling of MultiViews across the site. We sometimes have 25-30 MultiViews in a site and it is very convenient to manage them through one list

f) In WSS if you have a webpart which shows a view, everytime you change the view you have to update the Web Part. This is not a problem in the MultiView

g) The biggest advantage of MultiView for lazy people like me is that you can copy,paste the xml data and create a new MultiView very easily. In Sharepoint it is a pain to go and update properties of each and every webpart individually.

Examples:

MultiView for an Issue List to show three views
This example uses the ViewCase parameter to show different Views of the IssueList to the user

http://<ServerName>/<SiteName>/SingleView.aspx?ViewCase=Custom-Status

http://<ServerName>/<SiteName>/SingleView.aspx?ViewCase=Custom-Page

http://<ServerName>/<SiteName>/SingleView.aspx?ViewCase=Custom-Reviewer

XML for the above MultiView

<root>
<Case ViewCase=’Custom-Reviewer‘>
<Header>
<![CDATA[<Table border=0 width=100%><tr><td valign=’center‘><img src='{ExtranetServer}/{iconpath}/issues_revwise.png‘ align=’absmiddle‘ /> <strong><Font color='{ChromeColor}‘ size=’2′>Reviewerwise Issues/Suggestions</Font></strong></td><td align=’right‘ valign=’center‘>{MistakesSingleViewHeaderLinksSet}</td></tr></table>
<Table border=0 width=100%><tr><td bgcolor='{ChromeColor}‘ height=’1′></td></tr></table>]]>
</Header>
<List>Mistakes</List>
<View>{ViewCase}</View>
<Title></Title>
<ViewType>Html</ViewType>
</Case>
<Case ViewCase=’Custom-Status‘>
<Header>
<![CDATA[<Table border=0 width=100%><tr><td valign=’center‘><img src='{ExtranetServer}/{iconpath}/issues_statwise.png‘ align=’absmiddle‘ /> <strong><Font color='{ChromeColor}‘ size=’2′>Statuswise Issues/Suggestions</Font></strong></td><td align=’right‘ valign=’center‘>{MistakesSingleViewHeaderLinksSet}</td></tr></table>
<Table border=0 width=100%><tr><td bgcolor='{ChromeColor}‘ height=’1′></td></tr></table>]]>
</Header>
<List>Mistakes</List>
<View>{ViewCase}</View>
<Title></Title>
<ViewType>Html</ViewType>
</Case>
<Case ViewCase=’Custom-Page‘>
<Header>
<![CDATA[<Table border=0 width=100%><tr><td valign=’center‘><img src='{ExtranetServer}/{iconpath}/issues_pagewise.png‘ align=’absmiddle‘ /> <strong><Font color='{ChromeColor}‘ size=’2′>Pagewise Issues/Suggestions</Font></strong></td><td align=’right‘ valign=’center‘>{MistakesSingleViewHeaderLinksSet}</td></tr></table>
<Table border=0 width=100%><tr><td bgcolor='{ChromeColor}‘ height=’1′></td></tr></table>]]>
</Header>
<List>Mistakes</List>
<View>{ViewCase}</View>
<Title></Title>
<ViewType>Html</ViewType>
</Case>
</root>

MultiView for a List to show two views based on the logged in user

Incase the User belongs to a Group GroupCS

Incase the User belongs to a Group GroupBS – Note the change in Links

XML for the above MultiView

<root>
<Case Group=“GroupCS“>
<List>Tasks</List>
<View>CS View</View>
<Title>All Process Steps</Title>
<Footer><![CDATA[<b>This is footer html</b>]]></Footer>
</Case>
<Case Group=“GroupBS“>
<List>Tasks</List>
<View>BS View</View>
<Title>All Process Steps</Title>
</Case>
<Default>
<List>Tasks</List>
<View>CS View</View>
<Title>All Process Steps</Title>
</Default>
</root>

For more information and examples check the readme.doc file in the download

Readme.Doc

Über Erik Neumann
IT Consultant, MCP, MCTS, MCITP, ecspand your SharePoint! http://www.ecspand.de

Schreibe einen Kommentar

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s

%d Bloggern gefällt das: