Document Set Creator Web Part

May 9th, 2013 No comments

When working with content types we all can agree that the user interface that SharePoint provides is not the most intuitive one. Specifically when creating a new document set! The problem is that the document set is a complicated concept for the end users to digest. The complexity of SharePoint user interface for working with document sets adds to this complexity!

Complexity makes your SharePoint solutions seem too hard and casts doubt regarding how practical they are.

Imagine a page the shows a list of content types, their approval tasks, and maybe some other web parts. The add new item link provided by the List View web part does not allow users to create Document Sets. The way to work around this is to click somewhere on the list view to get the ribbon menu to show up, then click on New and select the Document Set from the drop down. That would be so many clicks, and for sure the end users wont like it!

Solution: To make life easier you can create a single click button to do this instead. This button is simple and intuitive to use. The solution is to takes advantage of SharePoint client side object model (CSOM) to create a new item. The screenshot below shows this button on a Web Part page.

docsetbtn1

Here is the main code for the Web Part.

<style type=”text/css”>.ms-uploadbtnlink { width: 300px; }</style>
<div style=”width: 100%” align=”center”>
<div class=”ms-uploadbtnlink”>
<button onclick=” javascript:NewItem2(event, ‘<%= DocSetDetails %>’);return false;” type=”submit”><nobr>
<img alt=”Upload a Document” src=”/_layouts/Images/uploaddoc.png”/> &#160;<span><%= ButtonLabel %></span></nobr>
</button>
</div>
</div>

In the code behind the Document Set Details are created and passed into the NewItem2 function.

DocSetDetails = “” + SPContext.Current.Web.Url + “/_layouts/listform.aspx?ListId=%7B” + List.ToUpper().Replace(“-“, “%2D”) + “%7D&PageType=8&RootFolder=” + rootFolder.Replace(” “, “%20”) + “&ContentTypeId=” + ContentType;

Highlighted are the List ID (ListId) and Content type (ContentType).

It’s possible to create this solution using a content editor web part or directly injecting the JavaScript code in the page, but the point is to develop it once and reuse many times over, so instead of changing the html and dealing with url encoding and IDs, create a Web Part with a tool part that allows you to select the list and the content type you want to use.

docsetbtn2

You can download this Web Part from Codeplex : https://docsetter.codeplex.com/

Categories: SharePoint 2010, SharePoint 2013 Tags:

Now Available for Pre-Order:Professional SharePoint 2013 Scorecards, Dashboards, and Visualization

March 22nd, 2013 No comments

SP2013ScorecardIt’s very exciting to finish yet another book project on SharePoint 2013 with more emphasis on methodologies and business strategies you need to know for using balance scorecards, information dashboards, and data visualization.

The book has been divided into two sections. The first half of the book explains the basics of reporting and data gathering techniques. The second half shows how to actually create eye-catching, effective solutions with the tools available in SharePoint 2013.

  • Provides an overview of Business Intelligence (BI)
  • Explains how to import your data into a common data model and deliver data to business users by creating a semantic layer
  • Addresses self service BI with Excel and PowerPivot and reporting solutions with Access Services and Visio Services
  • Walks you through creating SharePoint 2013 BI solutions using Azure
  • Looks at creating score cards and dashboards using PerformancePoint

You can pre-order this book here.

Categories: General, SharePoint 2013 Tags:

Introduction to SharePoint 2013 App Development

January 10th, 2013 3 comments

I am speaking in East Toronto .NET User Group this coming Thursday. If you are around please come say hi.

Title: Introduction to SharePoint 2013 App Development

Apps are these new beasts in SharePoint 2013 that offer a lot of exciting new opportunities for developers. This session will provide an overview of the new developer features for Office and SharePoint including apps, the new cloud app model, development tools and when to use apps versus full trust solutions.

Date: Thursday, January 17, 2013 from 6:30 PM – 8:30 PM

Event Agenda
6:30 – 7:00 Socialize and refreshments
7:00 – 8:30 Presentation

Location
Pickering Central Library
Auditorium (2nd floor)
One the Esplanade
Pickering, ON L1V 6K7
905-831-6265 or 1-888-831-6266

Categories: SharePoint 2013 Tags:

Interesting Difference Between “View Only” & “Read” Permission Levels

October 26th, 2012 5 comments

As the saying goes, the devil is in the details! This meant to be a note to self, but I thought it might be helpful for some of you too. Here we go:

If John has “Read” permission level to a document named sales.docx, John is able to search and find this document and view it either in Office Web App on the server (in the browser), or in Office client on his computer.

If John has “View Only” permission level to sales.docx, John *can* browse to the document library and see the document, however John cannot open the document in Office Word client on his computer.  Lucky John, if Office Web App is installed, John is able to see the document online. Ok, I get it! John has “View Only” permission level and this level doesn’t have “Open Items” permission (See the product documentation here). So far so good…

Interesting part is here –> If John has “View Only” permission level to sales.docx, he is not able to find it using search.  Furthermore, if he types the URL of the document in the browser address bar (http://SharepointSite/doclib/sales.docx), he receives an Access Denied error. Now, I don’t get it! John has “View Only” permission level. He should be able to find the document via search, and see it using Office Web app just like how he’s able to do so when he browses to the document library and clicks on it!

This leads to two different security access behaviors:

  1. If a user has “Read” permission level to a document, they can always find the document using search or browser and open it in the browser or their Office client app.
  2. If a user has “View”Only” permission level to a document, they can only find and open the document in the browser. In that case, Search doesn’t show the document!

Conclusion: Looks like “Open Items” permission plays an important role in search security trimming on the core search result. This makes people with “View Only” permission level ( With No “Open Items” Permission) not to be able to search for the documents they are already authorized to view. Obviously, you can go ahead and change the OOTB View Only permission level , but then again, that’s not “View Only” permission level anymore!

Make sure you are aware of this difference when planning your site permissions.

Filtering Out Disabled Users

October 25th, 2012 No comments

Not sure if you noticed this, but in SharePoint 2013 when you setup a sync connection you can exclude disabled users by just clicking on a checkbox.

 

 

 

 

 

 

 

Given that, you no longer need to setup a filter like what you did in SharePoint 2010 ( see my blog post here):

 

 

Categories: SharePoint 2010, SharePoint 2013 Tags: