Tuesday, October 20, 2009

SharePoint 2010 Web Parts and WiKi pages

Wiki web parts - are new and do not have web part zones. You can add the web part in the text. This will allow us to give an option for the end users to create a page without an underlying page layout.

This works with hidden zones - which is where the web parts are actually stored but the location of the web part is marked in the wiki content using place holders. During rendering the webpart contents are moved to the in line location after rendering. Maurice just showed what happens if you retract a solution that had the web part that was added to a wiki page. The page was then refreshed - and no crash - the web part just disappeared from the page. however, when you go to the maintnance page (add a "?contents=1" to the page url) you can see there is an "error web part" on the page. It still doesnt tell you what that web part used to be - which is something I expected Microsoft to improve from 2007.

Also, Maurice showed a bug that is with the current version and he is not sure if it is going to be fixed - when you delete an error web part, the div with the web part ID remains in the content of the wiki page - not visible, but it is making the page heavier, and messier.

To add a web part to wiki pages using code, you add the web part as usual (using the web part manager) and then you change the text for the wiki to include a div that links to the GUID of the web part.

SharePoint 2010 - No more reasons for WSS web parts

I am now in the session presented by Maurice Prather - a web part guru who used to be in Microsoft working on sharepoint in the past. He is now discussing my favorite topic- how to develop and deploy web parts in sharepoint 2010. News - WSS web part are phassed out. How is this different than 2007? they already said that in the past - the framework still gives the wss web part the same benefits - caching, better communication options and WSPC.

How is it possible to stop using the WSS web part class? the answer is that in asp.net web parts will now have more functionality available to them such as:

  1. Versioning of web parts in pages - if you make a change in a web part in a page - and then revert the page to old version of the page, the web part will be versioned with the page.
  2. Ajax
  3. Client object model
  4. Cross site scripting safeguards
  5. sandboxed solutions (I wrote about that yesterday)

So I don't see a solution for caching - you should implement the native ASP.NET cache.

WPSC will still exist for WSS web parts - so you can still do client side collections with it. But - now that you can do it with ajax, there is no reason why to use a WSS web part.

Monday, October 19, 2009

Training SharePoint 2010 Developers

And my friend Shay Petel is asking a serious question - when doing sharepoint training - do you start with sandboxed solutions so that you can use them during the course, or do you only get to them after teaching people how to develop web parts and other solutions using the standard WSP deployment mechanism? This is a big question that us trainers need to tackle. This whole developer training for sharepoint is going to blow out of proportion for us in the next year - from being a 5 day course for sharepoint 2007, I think we are going to need a 10 day course in 2010, and that may not be enough.
That said, I think that things like visual web part development significantly reduce the training time required - since asp.net developers will not have a problem with the learning curve any more...

SharePoin 2010 - Sanboxed solutions

Thanks to Scott Hillier the speaker

Runs in a separate process, added to a site collection level gallery.

User code service: SPUCHostService.exe
Worker process : the actual process SPUCWorderProcess
Proxy : SPUCWorkerProcessProxy - exposing a subset of the sharepoint services. If not exposed, you cannot use it in the sandboxed solutions. This includes all the enterprise stuff - including BCS and search and so on. So do not plan to use sandbox with those objects.

Remember - anything in a sandbox will run a lot slower than if it is not. So sandboxing has several limitations - the one mentioned above (some assemblies are not available if you are sandboxing) and the significant slowdown of the solution. This means that while deploying solutions to hosted web sites will be simpler, it also means you will slow the environment down.

I also like the soution validation - where you can write conditions in code that will be checked when the solution is uploaded - and then allow or prevent the solution from being deployed.

Resource monitoring - you are getting information about CPU, Memory, SQL, Exceptions, critical errors, hanlders, threads and more.

Workflows & Site Templates and debugging projects in SP2010 and VS2010

I like the option to design workflows in Visio, load them and design them further in SharePoint Designer 2010 and then export that into a Visual Studio project (since only VS integrates with source control).

You can save a site as template - which gives you a WSP (say good bye to STP) file that has all the objects. Visual studio then can load that WSP and show you designers to edit the WSP.

When you debug a project using F5, only the project marked as startup gets deployed. The other projects in the solution do not get deployed unless you manually deploy them. And by "manually" I mean you right click them and select deploy (like with WSP builder!).

Visual studio - allows you to package, retract per project, has a special sharepoint browser that shows you the objects in a sharepoint site - much better integration.

Highlights - new in SharePoint 2010 for Developmers?

  • [Like]Web Part developer dashboard (will require sts command to be activated in the public beta) . As I said, it showss what SQL queries were executed, and you can click on the query to get more information of what was going on.
  • [Like]Visual web part development
  • [Like]Sandboxed solutions - you can upload a WSP to sharepoint - no STSADM command. it sits in the database - and someone with privilages can than use the code in the WSP - but it runs in a sandbox while sharepoint monitors the resources that it uses. Nothing is deployed to the file system (so you can version items properly, and you dont have to worry about multiple front end servers). Instead of using the sharepoint dll, the sandboxed solutions use a proxy dll. You can get logs from the proxy service that look at what the solution does.
  • [Like]debug web parts - when you "run" the solution, it automatically opens the "create page" dialog in the site you designated, so you can create a new page, and add the web part to it. Breakpoints will automatically break (because the code gets attached correctly to the processes). To do this, the VS solution is actually built and deployed before the debugging.
  • [Like]Linq for sharepoint - simply add a reference to the sharepoint linq dll, and
  • [Like].webpart files are the same format as 2007
  • Bussiness Connectivity Services - replaces the BDC.
    • [Like]This will have read\write.
    • [Don't Like]The sharepoint field types that expose the information were not upgraded, which means that a BCS column still will not allow multiselect.
    • [Like]Designer for the application definition in both VS2010 and SharePoint Designer 2010
  • [Like]Relationships between lists - you can prevent deletions or cause cascading deletions. However, no cascading inserts... but I guess this is where custom solutions come in.
  • Lookups to multiple columns
  • [Like]List query throttling - preventing views from showing too many items - this will be dynamic - each view evaluates on the fly and if a view is going to display more than a specific amount it can be blocked.
  • [Like]All views are XSLT views - not CAML (CAML can still be used) - this will make it a lot simpler to customize list definitions!
  • [Like]column validation - you have a new setting for columns, where you can write a forumla (excel style) and a message to show the user if the formal does not evaluate. FANSTATIC. Shame it only supports cecrtain types of fields.
  • [Like]REST API and client object model- need I say more? Client object model will allow you to connect to a site using a "ClientContext" object, that is instanciated with a site url parameter. REST, in case you don't know, allows you to get information from sharepoint using just URL's - and you get back an XML. So no more developing web services, now your client side code (javascript or different clients) can get the information just by building a URL, performing a http request to it, and getting back XML of the results. I have talked about this in the past in the blog about how you can do this in sharepoint 2007 - specifically how to get list and site information for an infopath form without using web services (there is a file called owssvr.dll in the _vti_bin virtual folder that gets you information from lists and sites), but in 2010 it will be a lot better integrated (and documented), not to mention the javascripting will have proxies built in and development will be easier. Note - when using the REST API using a .net application do not forget to set the credentials to the REST object. I wish MS would instantiate the object with the default credentials from the cache - that would save some lines.
  • [Like]After Synchrounous events in the event handlers! yay!
  • [Like]site scoped events
  • [Like]Workflows - integration with Visio (interesting...)
  • [Like]Upgrading code - MS provides assembly redirect for most of the sharepoint dll machines. This means that code that you wrote in 2007 has a good chance of working in 2010! This enables upgrades of a portal to be more smooth. It is still unclear to me how custom site definitions will be migrated.
  • Application life cycle management - generally better with TFS - no other mention of what is better so far.

News from the SharePoint Conference 2009 (part II)

I almost forgot - most exciting news is that November is public Beta time!

News from the SharePoint Conference 2009

Well, the show is on. The key note was done and I am sure a lot of people will start blogging like mad, so I will make an effort to contribute my thoughts. Unfortunately, this will be in more of a "thought of a day" (or "thought of a session") style - until I get time off my feet to write complete reviews of what I saw and what I think. But stay tuned as I do have a lot to say and tell you in the next few weeks, as I travel around the world to learn what is new in sharepoint
For now - some exciting tidbits:

  • SP2010 will support XHTML and WCAG standards
  • SP2010 will run on Vista and Windows7 for development!
  • SP2010 will have cross-farm content types for managing your taxonomy!
  • The replacement for BDC will finally allow you to do what you always wanted - show external databases as if they were sharepoint lists (including CRUD opperations)
  • When adding a web part to the page (page is in edit mode) you get a panel showing you the loading times for different lifecycle parts of the web part, the stack trace and the SQL commands sharepoint did for the web part, and how long each one took!
  • Web parts now have a visual editor in VS2010 - no more writing the UI in code
  • Client side model? I can't wait for that session to start...

Sunday, October 11, 2009

Selected pictures view does not work in Citrix

I wonder if anyone else can replicate this. My customer uses citrix to allow remote people to log in and use the intranet. When logged in, using IE8 through citrix, the "selected pictures" view in picture libraries doesnt work.
You go to a picture library, select a few pictures and then in the view selector you select the "selected pictures" view, and you get a view that shows you all the pictures, and does not show the checkboxes (some style issues there).
This is happening with a non-customized sharepoint site, and when you access the same list from a desktop on the network (so, not through citrix) there is no problem.
Anyone seen this? anyone solved this?

Wednesday, September 16, 2009

Retrieving the COM class factory for component with CLSID {3D42CCB1-4665-4620-92A3-478F47389230} failed

A code I was running against user profiles failed with the error: "Retrieving the COM class factory for component with CLSID {3D42CCB1-4665-4620-92A3-478F47389230} failed due to the following error: 80070422."
The reason was that the search service was disabled on the server, and since adding user profile properties that are indexed requires the search service, this error is understandable (although not very user friendly).
solution is obvious - start the search service.