SharePoint Saturday Brisbane 02-June-2012

In little more than 3 more days, we'll be meeting up again in SharePoint Saturday Brisbane! 

I'll be presenting again on the Developer track on how to build custom webservices within SharePoint, and consuming them using JavaScript AJAX. 

On the side, I've been having a lot of fun with KnockoutJS, Client Object Model, REST and even building a Single Page Application for SharePoint on codeplex. 

There's a bunch of InfoPath people and solutions that I'd love to meet and see again.

Overall, I'm looking forward to meeting all the SharePoint people up in Brisvegas and geeking out for a whole day!

There are some talks of having a dedicated time where we can answer lots of questions from the attendees - so if you have any curly problems within your SharePoint, bring your question along and we'll try to help out.

One final reminder:

02 June 2012.  Register http://sharepointsaturday.org/brisbane/default.aspx

SharePoint in a single page, now with List Item edit

 

Here's the latest screenshot from this project on http://spaspa.codeplex.com

 

 

I've put in buttons that allows you to edit a list item, and that drops the item into edit mode.

Here I'm modifying the Title field.  When you hit Save, it will commit the changes back to SharePoint.

Twitter Bootstrap UI turns out to be really good at guessing screen sizes and adapt.  Here's the page in landscape mode.

image

VS.NET 2008, VSeWSS 1.3 and SafeControl

Oh VSeWSS how I've NOT missed you. 

I was compiling an old solution package for SharePoint 2007, this solution has 6 web parts but the WSP package's manifest only has SafeControl lines for 4 of them.  Somehow, it is discriminating against my newest 2 additions to the family.

In VS.NET 2010, the settings for whether a web part feature should be included in SafeControl is off the WSP Package view.  It automatically adds the current DLL, as well as giving us an option to add more additional assemblies (via the special package solution designer).

image

 

In VS.NET 2008 and SharePoint 2007, the way it determines whether or not to include a Web Part when it generates the manifest file seems...  almost, bizarre and magical.

 

This is how it works

  1. During packaging, VSeWSS reads the DLL to determine if there are web parts within it that needs a SafeControl line.
  2. When it finds them, it modifies a temporary file that it uses during packaging, under project\bin\Debug\solution\manifest.xml
  3. The packaging process than packs up everything under \solution\ into a WSP file, and the manifest file is stored within the WSP file.
  4. What's confusing, is that VSeWSS is not reading the right DLL that's compiled from this project, instead, if you have an older copy of the DLL in the GAC, it will actually read the GAC version over your newly built DLL.

    The end result, is that you think you are crazy and you don't understand why it's arbitrarily deciding to add 4 SafeControl lines, but not all 6.

 

Fix

The fix is pretty simple, if you manually deploy the DLL to the GAC first, then repackage again, it'll pick up the additional web parts within the DLL and add them to your SafeControl list.

 

Why have I never seen this before

If you are deploying to the local machine for testing, you actually may not even see this error - since when you deploy the currently built solution to the local machine it also puts the new DLL into the GAC. 

SharePoint Single Page Application day 4

Did a bit of clean up and finally I've got what I can call the first awesome screen shot.

This is a Single Page Application deployed to SharePoint, and talks to SharePoint via the Client Object Model as well as the REST interface.

The page does not Postback.  It always talk to SharePoint via AJAX.

 

So far:

  • Package 1 ASPX page in a solution package
  • Reference jQuery, Knockout
  • Layout using Twitter's Bootstrap
  • Grabs lists via Client Object Model
  • Grabs list items via REST interface
  • The darn thing is beautiful

 

To come next:

  • CRUD for list items
  • Document download
    • Document upload?
  • List paging
  • Use different icons for lists and document libraries on left navigation
  • A favicon
  • An actual Title for the page
  • Site navigation (this will do post back - since we'll be navigating between say http://server/ to http://server/publishing/ ).
  • Quick search / filter
  • An interesting picture thumb-nail viewer

 

Check it out on http://spaspa.codeplex.com/ and let me know what you think!

SharePoint 2010 as a Single Page Application (teaser)

What is a Single Page Application?  Essentially, an application disguised as a single web page.  Like the official "Twitter" web application.  You click, things happen, data is loaded and released asynchronously, layouts are arranged and displayed.  Like magic.

On a crazy Thursday afternoon I had the mad idea of building a Single Page Application on top of SharePoint.

This is a sneak preview of my work so far on this goal:

 

The story so far

  • Everything in a SharePoint farm solution
    • Deploys to /_layouts/JL-SPA/SPA.aspx - one single page!
  • UI layout using Twitter Bootstrap - what you see above is based on the Fluid example template
    • Twitter Bootstrap is based on Less.js
  • UI binding using Knockout.JS
  • Additional glue with jQuery
  • Reading from SharePoint via OOTB REST service API
    • The list of libraries from my current site is returned and bound to the list on the left (see above picture).  I call it a mini success in setting up the scaffolding.  Will continue another day.
  • Exposes _spPageContextInfo object
  • Expose SP.ClientContext objects/scripts

 

This is the entire project so far:

image

 

Still to come

  • UI for lists
    • Sorting for lists.
    • Determine columns for lists.
  • UI for viewing items
  • UI for editing items
  • ?  Add SPServices?  There are some pretty useful workflow use cases in this library.

 

Call for help!

I think I might be out of my mind on this one.  If you want to join in and hack some JavaScript, yell out and help me out! 

Great opportunity to learn some really cool technology and have a lot of fun!