What if you want to enable a column only if the user has permissions?
Now you might have worked with Item Level permissions but what when you wanna show the record to all users but just disable a COLUMN to particular users.
For e.g. for a SharePoint library which contains infopath form you want to display all forms to all users but only let few users EDIT them.
All this is done in SharePoint designer. Convert your ListView to Data view and then follow the steps below:
Create new site column (hyperlink) in DataView:
<a href="http://yourinternalsite/_layouts/FormServer.aspx?XmlLocation=http://yourinternalsite/subsite/FocusReports/{@FileLeafRef}&OpenIn=Browser">Edit</a>
And add the following code to the column created above:
Show/Hide Edit column based on security (read only users will not see the column)
<xsl:if test="ddwrt:IfHasRights(4)">
Isn't it simple !
Enjoy programming !!
Sunday, November 30, 2008
Saturday, November 1, 2008
MOSS - Group Items with Item Count
Many times you might have been asked to change the SharePoint Library views with new columns, calculated columns etc. This technique explains how you can group the items based on a column and provide the item count under that group in the header.
So essentially something like this:
+ Project: XYZ (15 items)
+ Project: ABC (25 Items)
Its pretty simple to achieve the grouping but a small trick to display the item counts.
First open your site in SharePoint Designer and go to the Page view (mostly in the /POages directory)
Then right click on the ListView and convert to DataView.
Go to DataView Properties-->Groupby-->Collapse header
Then in the name column enter the following:
<xsl:value-of select="$fieldvalue" > : <xsl:value-of select="count($nodeset[*[name()=$fieldname]=$fieldvalue or ($fieldtype!='isodatetime' and @*[name()=$fieldname]=$fieldvalue) or ($fieldtype='isodatetime' and ddwrt:GenDisplayName(string(@*[name()=$fieldname]))=$fieldvalue) or (not(*[name()=$fieldname] or @*[name()=$fieldname]) and $fieldvalue = ' ')]/@ID)" />
--------- BANG !!! There you go... as easy as it gets
So essentially something like this:
+ Project: XYZ (15 items)
+ Project: ABC (25 Items)
Its pretty simple to achieve the grouping but a small trick to display the item counts.
First open your site in SharePoint Designer and go to the Page view (mostly in the /POages directory)
Then right click on the ListView and convert to DataView.
Go to DataView Properties-->Groupby-->Collapse header
Then in the name column enter the following:
<xsl:value-of select="$fieldvalue" > : <xsl:value-of select="count($nodeset[*[name()=$fieldname]=$fieldvalue or ($fieldtype!='isodatetime' and @*[name()=$fieldname]=$fieldvalue) or ($fieldtype='isodatetime' and ddwrt:GenDisplayName(string(@*[name()=$fieldname]))=$fieldvalue) or (not(*[name()=$fieldname] or @*[name()=$fieldname]) and $fieldvalue = ' ')]/@ID)" />
--------- BANG !!! There you go... as easy as it gets
Thursday, August 7, 2008
Friday, July 18, 2008
Worth Noting ----- ASP.NET MVC Preview 4
I blogged earlier regarding MVC new release and I finally tried ASP.NET MVC Preview 4 today at a high level..... still need to dive deep in !
Here are few things worth noting
Here are few things worth noting
- ComponentController is removed and now you can use Html.RenderAction<> instead of Html.RenderComponent<> e.g. Html.RenderAction
(x=>x.BlogList()) - Html.SubmitButton - is removed and went into a different namespace... Microsoft.Web.Mvc
- MembershipProvider is in built in this preview BUT only the FormsAuthentication is taken care of (and not the FormsAuthenticationAdministration class) so you get automatic creation of all user account classes (login, changepassword, register etc) but the admin functionality is still missing....hoopefully in the next preview we get those !
Here are few links to articles for ASP.NET MVC Preview 4:
- Guru Gu explains here
- Scott Hanselman explains some Ajax features
- Rob Conery gives some insight for ComponentController being deprecated
- Matt again gives some info for using RenderAction
- Some New Finds
***BTW TROY GOODE is releasing a new version of MVC Membership toolkit for Preview 4 tomorrow and next week with some enhancements below:
- 1st Release tomorrow will contain removal of the front-end controller & views (which are now part of the default MVC project template) as well as switching over to the new [Authorize] and [HandleError] attributes.
- The 2nd release next week will focus on improving the administrative interface for managing users using the new MS Ajax goodness.
Entity Framework Beta 3 With .NET 3.5 SP1
If anyone has run into issues with the new 3.5 SP1 and ADO.NET EF they know what I'm talking about. The other day I upgraded my system with .NET 3.5 SP1 to run Dynamic Data samples. What I get in return is multiple errors while editing or adding tables to my EDMX file which did not make any sense (one of those wierd non descriptive errors). Finally after lot of "struggle" I could trace the issue.... I had to uninstall my Entity Framework Beta 3 and .NET 3.5 SP1 and then reinstall .NET 3.5 SP1 onto my machine.... not forgetting to restart my machine couple of times.
Bottom Line: Unistall any version of ADO.NET Entity Framework on your box and then install .NET 3.5 SP1 or else you'll see all thos erros I talked earlier
This post will help anyone with similar issues and avoid having them spend half a day on investigating the issue with no clue.
*****BTW Dynamic Data for MVC Preview 4 has been release today and I am testing at this moment... keep checking and I'll keep everyone posted of the new release.
Bottom Line: Unistall any version of ADO.NET Entity Framework on your box and then install .NET 3.5 SP1 or else you'll see all thos erros I talked earlier
This post will help anyone with similar issues and avoid having them spend half a day on investigating the issue with no clue.
*****BTW Dynamic Data for MVC Preview 4 has been release today and I am testing at this moment... keep checking and I'll keep everyone posted of the new release.
Labels:
Ajax,
asp.net 3.5,
asp.net mvc preview 4,
mvc membership,
preview 4
Wednesday, July 16, 2008
Here ya go ---ASP.NET MVC Preview 4 -- CodePlex
So its finally here.... CodePlex MVC Preview 4 for ASP.NET
I blogged earlier about some new features for MVC release.
Its been released few days earlier than the ASP.NET Team release. I am going to use and test this new preview and blog about the new features and changes:
Includes: Membership Provider, AccountController, Error Handling, Output Cache.
I blogged earlier about some new features for MVC release.
Its been released few days earlier than the ASP.NET Team release. I am going to use and test this new preview and blog about the new features and changes:
Includes: Membership Provider, AccountController, Error Handling, Output Cache.
Labels:
Ajax,
asp.net 3.5,
asp.net mvc preview 4,
mvc membership,
preview 4
Tuesday, July 15, 2008
ASP.NET MVC Preview 4
ScottGu finally made it official after a long break (he was busy with his new born)... Preview 4 is relasing end of this week
Its a real good improvement with error filter, authorize filter,AccountController, and caching.
The authorize filter is more like declarative security model which lets you use attributes and filter actions(method) and classes based on your role. AccountController uses built in Asp.Net Membership provider and manage user credentials. You can also use your own custom logic and replace user account class with AccountController class.
Error Filter lets you display a friendly error page/response in case of exceptions.
One can also specify specific exception types like SQLException, NullReferenceException etc.
***ASP.NET Dynamic Data support will be included in MVC by end of Summer ***
Very cool high level features to use with ASP.MVC. The next previews will contain form validation, wizards to automatically create views and test class correspoding to a Controller. WAIT and Keep checking on my blog for upcoming releases.
Its a real good improvement with error filter, authorize filter,AccountController, and caching.
The authorize filter is more like declarative security model which lets you use attributes and filter actions(method) and classes based on your role. AccountController uses built in Asp.Net Membership provider and manage user credentials. You can also use your own custom logic and replace user account class with AccountController class.
Error Filter lets you display a friendly error page/response in case of exceptions.
One can also specify specific exception types like SQLException, NullReferenceException etc.
***ASP.NET Dynamic Data support will be included in MVC by end of Summer ***
Very cool high level features to use with ASP.MVC. The next previews will contain form validation, wizards to automatically create views and test class correspoding to a Controller. WAIT and Keep checking on my blog for upcoming releases.
Labels:
Ajax,
asp.net 3.5,
asp.net mvc preview 4,
mvc membership,
preview 4
Thursday, May 29, 2008
ASP.NET MVC Preview 3
Preiview 3 has been released for the ASP.NET MVC framework.
Scott Gu gives details here
Scott Gu gives details here
Sunday, April 13, 2008
Gacutil for Remote Machine
First version of Gacutil remote has been released. It manages a remote computer's GAC even if it has no gacutil. It has following features:
Relies on psexec
Requires administrative priveleges on the remote computer
Installs / uninstalls an assembly to a remote computer
Retrieves whole GAC
Error Handling and Custom identity impersonation are missing in this release.
http://tinyurl.com/6d6gnw
source: Codeplex
Relies on psexec
Requires administrative priveleges on the remote computer
Installs / uninstalls an assembly to a remote computer
Retrieves whole GAC
Error Handling and Custom identity impersonation are missing in this release.
http://tinyurl.com/6d6gnw
source: Codeplex
Friday, April 11, 2008
Nice Deployment utility
A Great utility from Ted Pattison:
STSDEV is a proof-of-concept utility application which demonstrates how to generate Visual Studio project files and solution files to facilitate the development and deployment of templates and components for the SharePoint 2007 platform including Windows SharePoint Services 3.0 (WSS) and Microsoft Office SharePoint Server 2007 (MOSS). Note that the current version of the stsdev utility only supports creating projects with the C# programming language.
http://tinyurl.com/5kzqxr
STSDEV is a proof-of-concept utility application which demonstrates how to generate Visual Studio project files and solution files to facilitate the development and deployment of templates and components for the SharePoint 2007 platform including Windows SharePoint Services 3.0 (WSS) and Microsoft Office SharePoint Server 2007 (MOSS). Note that the current version of the stsdev utility only supports creating projects with the C# programming language.
http://tinyurl.com/5kzqxr
Manager Approval WF
SharePoint sequential workflow built in Visual Studio 2008, written in C#. Builds upon the Approval workflow sample from the MOSS 2007 SDK to extend the out-of-the-box Approval workflow template. It uses a custom InfoPath Association form that contains all the functionality of the original, PLUS it also asks for the name of a User type column in the target list. At run-time, the workflow will attempt to retrieve the SharePoint user object from that column, look up that user's manager in Active Directory, and use the manager as the Approver. If a manager is not found, it uses the default Approver list specified in the Association form.
http://tinyurl.com/5w5ndz
Source: Codeplex.com
http://tinyurl.com/5w5ndz
Source: Codeplex.com
SharePoint Content Migrator
ContentMigrator is a Windows Forms application with powerful features for tagging and uploading multiple documents to SharePoint libraries. Written in C#, the application utilizes the SharePoint Object Model and is intended to run on a server in a SharePoint farm. You simply select a site collection, document library and content type, select your files and apply metadata tags.
http://tinyurl.com/6b3lnx
Source: Codeplex.com
http://tinyurl.com/6b3lnx
Source: Codeplex.com
Timer WebPart released
Countdown timer web part with auto-refresh capability. Uses WSPBuilder to deploy the web part as a feature.
http://tinyurl.com/5w8emf
Source: Codeplex.com
http://tinyurl.com/5w8emf
Source: Codeplex.com
Thursday, January 3, 2008
Subscribe to:
Posts (Atom)