Thursday, October 22, 2009

Closing thoughts from the SharePoint conference

I am sitting in the last session, and I have to admit- I am a little bit afraid of SharePoint 2010. There is just so much more, that it makes the step from SharePoint 2003 to 2007 seem small in comparison. I think we should thank the SharePoint product team for an enormous effort to get all this new stuff in - and give us some very complex stuff to work with.

I am looking forward to doing search solutions, writing visual web parts, developing better event handlers (post synchronous events!), designing in sharepoint designer and then moving the design to visual studio and more and more and more.

If you get access to the presentation videos - make sure you listen to Mike Ammerlaan's presentation titled "Architecture guidance for building applications in SharePoint 2010" - not sure how much of that will be reviewed during the beta period (starting next month) but this was THE best and most important presentation in the conference - giving us thumb rules of what to use when, and some key pointers to making decisions on what to use in different development scenarios. Thanks Mike!

Finally, there are things I am dissapointed with - like a continued lack of support for custom fields in office, and no exciting new field controls. But the good overweighs the bad. I will have a think about what I have seen in the next two weeks, and then start blogging again - from TechEd Europe.

For now - I am going to see the grand canyon, visit Munich, and have a week's vacation in Israel with my family. Be patient, and more posts will come in tow to three weeks. If you are coming to TechED and want to chat - see you in Berlin in the Ask The Experts booth!

Wednesday, October 21, 2009

What I like and dont like about the new BDC (the BCS)

To get one thing clear - when BDC came in MOSS2007 I was very excited about it. I really thought it was great...until I had to do a real life project with it.

No, I am not talking about the pains I went through to create an application definition (this was before the BDC metaman or the tool that Microsoft released a bit later) - I am talking about how the BDC integration to sharepoint was so limited.

Every single customer who had a problem that I wanted to solve using BDC had the exact same requirements that I couldnt give them using BDC:

  1. We want it to work in office
  2. We want it to be a multiple item selection

There is no way in MOSS2007 to achieve both in BDC. You can develop a custom field type that will allow multiple selections from BDC information, but you cannot use a custom field type in Office. And the built in BDC column type only allows single selection.

That makes me sad.

In 2010, the "BCS" is much improved. It makes me even more excited about what I can do with it. It has "external lists" - which are fancy web parts that make the BDC data appear to be as if it is in a sharepoint list- including filtering, adding items, editing items and so on (not full functionality of a list though). There are two designers for the applications - no more XML! just use sharepoint designer or visual studio and create application definitions easily. Heck, in VS2010 you can create the connector to the LOB system in the same project as the application definition model - and refactor stuff later. This is EXCITING and GREAT stuff. Not to mention the object model, the (much) better support for item level security and so on.

But it still does not solve the problem I described above - the BCS column type is still a single lookup.

I was hoping that Microsoft would introduce better support for custom field types in Office 2010, but that is not happening either, so there is no oppertunity for me to develop a custom code to do that.

This makes me even sadder.

Can everyone please join me in asking Microsoft to

  1. Release a better BCS field type before RTM of as part of SP1 and make BCS perfect
  2. Redesign how custom fields are supported in office applications for SharePoint 15

Meanwhile, I will enjoy the cool new features.

Tuesday, October 20, 2009

Joke of the day from SharePoint conference 2009

quote: "if I don't need to dispose objects in the client object model, and it can do whatever you can do in the server object model, I am going to use it on the server!"

Ishai comments: good joke - do not take seriously please...

Update: it turns out you do need to dispose of them (when using them in .Net applications)

Upgrading custom developed solutions to SharePoint 2010

I am sitting in the presentation by KwizCom who are telling about their expirience with upgrading their products and web parts to SharePoint 2010. This is exactly the kind of session I came here to hear - get real life expirience from real life senarios.

Shai Petel is a huge expert in SharePoint development - his presenation is focused on what you need to do Today to make your current projects be ready for the upgrade.

He suggests to train the developers to use Ajax, JSON, silverlight, visual user controls (which I have to admit - it has been ages since I developed a web interface with a designer!).

He also suggests that if you want your solution to be hosted in the cloud, try to limit the solution scope to a site collection level. He did not explain, but I am guessing this is because of sandboxing restrictions.

Shai also encourages you to make sure you use the ASP.NET web part class for your web parts. He explains that the WSS web part class is supported for backward compatability, but does not recommend it.

Shai also recommends working on windows 2008 R2 and running hyper-v machines as your development environment. I don't agree - windows 7 is a (almost) perfect operating system, you can run moss on it, and using Sun VirtualBox (free, and open source) you can create 64bit virtual machines - and from my expirience on my laptop - win2008 just doesnt run as fast.

Now to upgrading a solution. Shai stresses that you should use the same namespacec and assembly evidence - this will allow sharepoint to recognise your solution during the upgrade.

Shai talked about upgrading his "sharepoint list forms extensions" - he showed how the solution looked like in 2007 - both in the screen (new links in list settings and in list forms) and in the code - showing a solution (connected to source safe? who uses source safe these days? or maybe I misread what I was looking at?). He then showed what he added in the 2010 version for the same solution - explaining how in 2007 they couldnt use WSP packages for the solution (due to limitations of the WSP infrastructure) and how now they are using WSP (due to improvements - mostly around version management - see further information below).

Shai opened a new empty VS2010 project, and built the structure for the project that you want, and then migrated his old code into the new project. Then, using a designer in visual studio, defined what features (from the old solution) should be deployed by the solution. He suggested it takes up to 4 hours to do that on a big and complex project.

He then showed how he added new code (or, rather, XML definitions) to replace old custom actions with new ones that would put the custom actions he had in the tool bars into the ribbon instead.

At this point Shai's Virtual machine crashed (working on pre-beta version - this is happening to many speakers here I guess. this is the second presentation in a row that I see this happening to) so he continued with his powerpoint and concluded that with a project that DIDNT use VSEwss (visual studio extensions for wss3) is pretty simple - create new project in VS2010, import existing files, set up the features (using a designer) and add what ever you need.

With projects that were created using VSeWSS need to be opened using a tool that comes with visual studio 2010.

To upgrade an existing WSP package - there is an import wizard in VS2010 that allows you to select which part of the solution you want to import, and it imports it into a new VS2010 project - all except the code. So it does give you the feautres and images and so on, and puts them in the new project structure that VS2010 needs.

About versioning support in packaged solutions - Shai explained that this was missing in 2007 - and is now available. I had many headaches with WSP packages versioning - it is very hard to mark a version number in a package - you have to keep updating a web.config file to make sure sharepoint uses the new version if you change the version of the dll. Shai suggested the same method I have been using - store the version number on a file that is deployed with the package instead. An "about" page can show the user what version is deployed on the server.

Shai then explained that he recommends deploying solution resources into a folder marked with the version number - for example : "_layouts/mysolution2.0.0.1" - this will make sure the solution can be hosted - and then upgraded just for one customer that uses the server, while other customers use the old version - the resource files were not overwritten (remember the assembly in such scenarios is sandboxed - so not in the GAC but rather in SQL and is unique per site collection - which allows this kind of trick).

The new user interface for managing solutions in a site collection (sandbox) will show you if there is an upgrade available for a solution. Us developers can specify that a solution can be updated, and then sharepoint will show that to the users. I expected something more sophisticated - something like how most applications today do upgrades, but I need to get my hands on this feature before I can comment on it fully.

To summarize - good presenation (if a bit rushed and mis-titled) and exciting things ahead!

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?