My Latest Findings

The long awaited next version of SharePoint is finally out in Customer Preview. Microsoft seems to be heavily pushing the Office 365 platform to rapidly enable customers to test the new platform. Of course I find it better to get the full version on my hardware so here are the links to both the SharePoint 2013 (.img) installation download and the Office 2013 offline (.msi) inastallation download:

http://sharepoint.microsoft.com/en-us/Preview/sharepoint-requirements.aspx

https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=f2648d40-84ce-4556-8545-93d52a3253f2&lcid=1033&ci=393

Expect more posts in the near future now that the NDA is lifted on SharePoint 2013.

I’ve been in the RDP program for a while, hence the limited blogging here. Now that the gates are open, more will be posted here. Stay tuned!

Requirements for SharePoint 2013:

Software Requirements

Windows Server 2008 R2 Service Pack 1 or Windows 8 Server

Prerequisites

  • Windows Identity Foundation v1.1
  • Microsoft Information Protection and Control Client
  • Microsoft WCF Data Services
  • Windows Management Framework 3.0
  • Application Server Role
  • Web Server (IIS) Role
  • Microsoft .NET Framework 4.0
  • Update for the .NET Framework 4 (KB2468871)
  • Microsoft SQL Server 2008 Native Client
  • Windows Identity Foundation (KB974405)
  • Microsoft Sync Framework Runtime v1.0 (x64)
  • Windows Server AppFabric

Database Servers

Microsoft SQL Server 2008 R2 (Service Pack 1) 64bit or Microsoft SQL Server 2012 (64bit)

 

I have been preparing the next release of my re-usable VM for SharePoint 2010 development that is used by all the developers at Orangutech. I decided to add a few extensions that would make development tasks easier and found quite a few interesting ones so I figured I would list them here. Hope you will find these useful in enhancing your productivity.

Here are the extensions:

Visual Studio 2010 SharePoint Power Tools
Templates and extensions that provide a sandboxed Visual Web Part together with enhanced support for sandboxed compilation to help you develop SharePoint solutions even more productively.
Mavention SharePoint Assets Minifier
Installs custom tools for minifying SharePoint assets such as JavaScript and CSS files.
CKS – Development Tools Edition (Server)
The SharePoint 2010 Visual Studio 2010 Extensions project (CKSDEV) is a collection of Visual Studio templates, Server Explorer extensions and tools providing accelerated SharePoint 2010 development based on Microsoft’s new SharePoint 2010 development tools.
Free Taxonomy Editor For SharePoint
Dotspine provides you a graphic modeler to easily design and populate taxonomy tree. Then you can export them as XML files to be proceeded by PowerShell and target SharePoint 2010.
caml.net.intellisense
Provides enhanced IntelliSense support for the Collaborative Application Markup Language (CAML) used by SharePoint.
SharePoint Timer Job Item
A SharePoint project item for creating timer jobs that have an associated configuration screen in Central Administration
MP.SPDevExt
The MP.SPDevExt Visual Studio 2010 Extensions project is a collection of Visual Studio item templates used to expedite the SharePoint 2010 development. It contains following item templates: Custom Field Type, Sandbox Solution Validator and Sandbox Workflow Action
Silverlight SharePoint Web Parts
An extension for adding Silverlight web parts to SharePoint features.
Visual Studio 2010 Productivity Power Tools
(Not specifically SharePoint) A set of extensions to Visual Studio Professional (and above) which improves developer productivity.
Web Standards Update for Microsoft Visual Studio 2010 SP1 (CSS3, HTML5)
(Not specifically SharePoint) Adds CSS3 support and updates the HTML5 intellisense and validation including new JavaScript API’s
LINQ to SharePoint DSL Extension for Visual Studio 2010
This new feature is an extension to Visual Studio for modeling LINQ to SharePoint entities directly in VS2010. With this tool, it’s become possible to add a new kind of item in a VS project, that we name a LINQ to SharePoint schema.
CodeMaid
(Not specifically SharePoint) CodeMaid is an open source Visual Studio extension to cleanup, dig through and simplify our C#, C++, XAML, XML, ASP, HTML, CSS and JavaScript coding.
Imtech Create Page Layout Content Type Extension
Installs a Content Type Extension that allows you to generate a Page Layout from an existing Content Type.
PowerCommands for Visual Studio 2010
(Not specifically SharePoint) PowerCommands 1.0 is a set of useful extensions for the Visual Studio 2010 IDE.
 

Here is a very complete article written by Damon Armstrong on ItemUpdating and ItemUpdated event receivers firing twice on SharePoint 2010, and how to work around this issue.

http://www.simple-talk.com/dotnet/.net-tools/managing-itemupdating-and-itemupdated-events-firing-twice-in-a-sharepoint-item-event-receiver/

 

If you need to set up a testing environment for retention policies in SharePoint 2010 and you decide to create a retention stage that looks like the following:

Declared Record + 1 Day      Move to Recycle Bin

You will notice that the retention policy does not run as expected. This is normal behavior because there are two timer jobs that need to run sequentially to achieve the desired result and by default both these timer jobs are set to run on a weekly schedule. These are the timer jobs that need to be run:

  • Information management policy
  • Expiration policy

To allow for your short-term retention policies to work properly, you need to change their schedule to run daily:

  1. Go to Central Admin
  2. Monitoring
  3. Review job definitions
  4. Look for “Information management policy” and click it
  5. Change the radio button in the Recurring Schedule to Daily and set the time to run at midnight:
  6. Click OK
  7. Look for “Expiration policy” and click it
  8. Change the radio button in the Recurring Schedule to Daily and set the time to run at 2 AM:

You can also use the Run Now button in both these timer jobs to test documents that should already have been disposed of.

 

Programmatically declaring and undeclaring records can be useful in case you need to modify dates or metadata to trigger retention.

An example of this would be: Multiple court case documents sitting declared as records in a record library, with document disposition rules that trigger disposition 3 years after the case resolution date.

There is no way you could have put in the case resolution date prior to the completion of litigation and the documents need to be in the record center to prevent tampering with.

You could build an interface in a web part or _layouts page that allows a user to input the case resolution date and the code behind will

  1. undeclare all the records about this case
  2. add the resolution date
  3. redeclare the record.

At this point disposition rules would kick in and dispose of the document after the required time period.

 

The code used to declare and undeclare the records is as follows:

You need to add the following namespace:

using Microsoft.Office.RecordsManagement.RecordsRepository;

Then you need the following bits of code to run against all the documents that match the selected court case:

SPSecurity.RunWithElevatedPrivileges(delegate()
{
	using (site = new SPSite(siteurl))
	{
		using (spWeb = site.OpenWeb(webguid))
		{
			list = spWeb.Lists[listguid];
			if (list != null)
			{
				item = list.Items[itemguid];
				//Checking whether the item is a record or not
				if (item != null && Records.IsRecord(item))
				{
					Records.UndeclareItemAsRecord(item);     //undeclares the item as a record
					//UPDATE ITEM HERE
					Records.DeclareItemAsRecord(item);     //declares the item as a record
				}
			}
		}
	}
});

Update:

I just found an MSDN article that identifies anotehr option to updating records programatically. It makes use of the Records.BypassLocks method which is called using the following block of code:

using Microsoft.Office.RecordsManagement.RecordsRepository;

SPSecurity.RunWithElevatedPrivileges(delegate()
{
    Records.BypassLocks(myListItem, delegate(SPListItem item)
    {
        //Perform any action on the item.
    });
});

Hope this code will be helpful to you. Let me know in the comments or via Twitter.

There is more to come soon. Stay tuned!

 

Orangutech’s CEO Writes About WPC Experience

On March 26, 2012, in SharePoint, by matdesmarais
0

Orangutech’s CEO, Mike Maadarani, has just blogged about his personal experience attending the Microsoft World Partner Conference. He shares the positive impact it had on our company. Check out the article here:

The Positive Impact of WPC on Our Business, by Mike Maadarani

 

I just ran into an issue at a client site that was very puzzling. I happened to find the solution here while browsing for something else:

http://tprashanth.wordpress.com/2012/02/01/taxonomy-field-values-are-not-visible-for-users-other-than-site-administrators/

Essentially, the issue is that the documents were being tagged with managed metadata values by users that had contribute level access to the site, SharePoint was not returning any error message, ULS logs were also clear. The document properties would save and if the user went back to view the properties of the document, the values were blank.

The same exercise from a site collection administrator account did not behave like this.

The solution to this problem as described in the blog post was to add the NT AUTHORITYAuthenticated Users as read permission in the TaxonomyHiddenList.

The contributor level users were tagging the documents properly but when displaying the values, their account could not retrieve the list item in the hidden list hence the blank values.

Thank you Prashanth.

 

SharePoint 15 (vNext) will introduce yet another class: SPFileRightsManagementSettings. This class represents the Information Rights Management (IRM) settings for file downloads in Microsoft SharePoint Foundation. It will allow control of the following properties:

Name Description
AllowPrint Gets or sets a value   indicating whether the viewer can print the document.
AllowScript Gets or sets a value   indicating whether the viewer can run script on downloaded document.
AllowWriteCopy Gets or sets a value   indicating whether the viewer can write on a copy of the downloaded document.
DocumentAccessExpireDays Gets or sets the number of   days before a downloaded document will expire.
GroupName Gets or sets the group name   (email address) to which the permission applies.

 

This will allow for further granularity on the access permissions of SPFiles. The ability to control what a user can do like printing, running scripts, or modifying a downloaded copy of the document will definitely be of value in the future. Also having the ability to expire a document at a specific time will aleviate the need for custom workflows to remove content on expiration.

More to come as I uncover new information on SharePoint 15. Stay tuned!

 

 

Further investigation in the API technical documentation reveals the existance of a class named MdsCompliantAttribute in the Microsoft.SharePoint.WebControls namespace. This value indicates whether the script, style, and field registrations of a class are compliant with the Minimal Download Strategy (MDS) framework. There is not a lot of documentation about this Minimal Download Strategy framework other that it being very similar to Ajax asynchronous loading.

The similarity to Ajax is hinted at with the following remark in the details of this MdsCompliantAttribute class:

This custom attribute class should only be applied when all registrations—such as scripts and styles—are performed through the SPPageContentManager class methods. All controls that render inside an AjaxDelta control must either have this attribute or be in a whitelisted assembly for which all controls are compliant.

Further details on the SPPageContentManager class indicates the following note:

Manages all the resource content that may be registered on a SharePoint page, including script files, inline scripts, style files, inline styles, and hidden input fields. Spweb Ensures that the content can be either appropriately placed on a fully-rendered HTML page or correctly transmitted to a browser in the case of a partial page load.

Hopefully this MDS framework will allow for faster load times for the end users by reducing the amount of full page refreshes required while browsing around. AjaxDelta seems to indicate loading the destination’s required files asynchronously but only the ones that are not loaded in the current page. Again, this is supported by the partial page load indication and the Delta word attached to Ajax.

More to come in other parts of this series.

 

I was flipping around the SharePoint 15 Technical documentation on the API… I found a few interesting tidbits in there:

There seems to be a lot of references to an “SPApp” class. This SPApp seems to make reference to actual apps (read webparts that are self contained like Apple/Android/WinPhone7 Mobile Apps) that would run on the SharePoint 15 platform.

Further investigation bring up a new method in the SPWeb class to LoadAndInstallApp() which is described as: “Uploads and installs an app package.” Which returns a Microsoft.SharePoint.Administration.SPAppInstance that references the instance of the created application.

An SPAppInstance represents an SPApp object installed to a specific SPWeb site.

The SPAppInstanceStatus represents the lifecycle status of the SPApp and contains the following members:

Member name Description
InvalidStatus An internal product error has occurred.
Installing The app instance is in the process of installing.
Canceling The app instance was installing, but was cancelled, and is   now uninstalling.
Registering The app instance is in the middle of a transaction   registering tasks for a state transition.
Uninstalling The app instance is uninstalling.
Installed The app instance is installed.
Uninstalled The app instance is uninstalled.
Upgrading The app instance is upgrading.
Initialized The app instance has been created, but not yet installed.
UpgradeCanceling The app instance was upgrading, but has cancelled.
Disabling The app instance is disabling.
Disabled The app instance is disabled.

 

So these apps would be loaded at the SPWeb level… but where do they come from??

The Microsoft.SharePoint.Administration.DatabaseProvider.PackageSource enumeration seems to provide the answer with the following sources list:

Member name Description
InvalidSource An internal product error has occurred.
StoreFront The package is from the marketplace.
CorporateCatalog The package is from a corporate gallery.
DeveloperSite The package is from a developer site.
ObjectModel The package is loaded via an object model.
RemoteObjectModel The package is uploaded via CSOM.

 

The documentation indicates there would be apps coming into SharePoint from a marketplace (aka App Store), a Corporate catalog (internal gallery that departments could reuse the apps) or from a developer site.

There are a lot of other documentation on these SPApp classes like SPApplicationCredentials, SPAppCatalog, AppManagement.SPAppPrincipalInfo, SpAppDeployment etc…

There will be more coming as I discover new exciting details on the next version of SharePoint.