Presented by Zach Rosenfield, Program Manager, Microsoft He's starting with a basic (VERY basic) introduction to Powershell. <zone out> </zone out> Oooh, nice, you have tab-complete in PowerShell, I never noticed that J Guess I don't need to zone out quite yet! If you use Start-Process it starts to prompt you for the parameters it needs. CmdLet is a script block in the form of a verb-noun pair. Now he's going over the history of SharePoint powershell. SharePoint v1/v2 SharePoint 2007 SharePoint 2010 Performance of operations compared to STSADM is much better. 12 hours compared to 30 minutes on enabling a feature on sites and subsites in a Farm Two kinds of commands You must load the Powershell snap in for SharePoint The rest of the presentation is all about demos, just going to type notes about highlights that catch me. Nice, he's scripted his entire PowerShell demo in a Powershell script, no typos J -whatif is an important parameter, this lets you check what your command is going to do without actually executing it. [object]PipeBind – This is a unique identifier for an object. You can give anything that's unique to the object and it can find it if it's of that object type. They've worked on adding a LOT of examples to the cmdlets, very nice indeed. Correlation in errors will be very useful, you can search logs based on the ID and find out all relevant events that relate to that error. One line commands that do not store objects to variables, it will auto-dispose the items. Use Start-SPAssignment to start a monitor that watches what objects you are assigning to a variable. When you are finished with the variables/objects, the Stop-Assignment will dispose of all the items that were caught. Must be careful because anything that is called, it will store them all in memory. You will get a warning if that does happen. Another way is to create a local collector by not specifying –global. Ooooh man, check out out-gridview, let's you create a dynamic graphical grid, it looks NICE. Here's another nice one, he's demonstrating how you can create a site in a specific database. Ooh nice, there's also a cmdlet that allows you to move site collections between content databases. In the beta it warns you about IISReset, in RTM it won't need to be done. You can do this live, the site is set to read only during the move. Nice, he's showing a script that will take an existing cmdlet, and puts a wrapper around it so you can extend an existing cmdlet with your own functionality. When doing remote actions, you have to get the credentials that you can pass into scripts. NICE, it pops up a dialog box to get your credentials. -AsJob lets you submit a remote script block, and let it run in the background so you can submit other commands. You access it by using Get-Job. Oh man, another cool tool Out-gauge creates a live graphic object on the screen. PowerGadgets is another cool tool he's using, he's generating graphs on the fly from the scripts. Very good session, some great stuff for both SharePoint 2010, and I learned some new things about PowerShell.
The End is Near….
Well, at least as far as the SharePoint 2009 conference is concerned. I have to say that the conference has been a great experience. With the exception of just 2 of the sessions I attended, there has been awesome information presented and demonstrated. Now it's just a matter of being patient until we can start using it J Just getting settled in for the first session of the day after breakfast, and today is going to be a LONG one. We have 3 sessions with no breaks in between running until lunch which is at 1:15 today. It's an evil plan that got us used to lunch at 11:45, now they bump it up on the last day!!! Won't even go into trying to get sugar free stuff for meals, that was a separate adventure of its own. I do have a few questions I want to get answered in the first session, which is PowerShell and SharePoint Administration.
Open XML development for Office 2010 and Beyond
I started to attend this session, but it didn't have anything about development or SharePoint. It seems like this was mis-labeled, he talked about how Office 2010 implemented Open XML to support backward compatibility with Office 2007. Not at all what I expected.
SharePoint Deployment Packaging
Two different deployment configurations, Default (Activates), No Activation. Fully customizable along the entire chain of the deployment. A configuration is a set of steps and the action for each step, there are also pre and post deployment commands can be attached to any configuration. You can only have on active deployment per configuration per project, cannot be chained. There is built-in conflict resolution Customizable through the SharePoint Project Item Extensions Basically it's a rollback like an MSI that fails. Demo of the basic steps, showing a graphic of how all the pieces of the Deployment fit together. Feature explorer shows you a nice window that allows you to add/remove and change the properties of a feature, and set other properties. You can also set dependencies for the feature here. You can still edit the raw XML, with a nice dual pane window that allows you to merge with the auto-generated xml. Will not work at all with 2007, because it will only work with a 2010 template. Package explorer is similar to the feature explorer, except of course it deals with a package. There is an advanced tab that you can add extra assemblies to the package. Someone asked if you can import your existing WSP's into VS2010, Mike Morton (lead for the Visual Studio team) said 'Possibly', which of course made everyone laugh. He's really not sure if it's possible. Great question about how do you deploy to production? Need to create your own deployment scripts, just need to replace the steps in dev. For production they FTP WSP's to a folder in production, then a service monitors the location and then performs the steps needed to retract and deploy correctly. There is a SharePoint command context that lets us to run 64-bit commands from Visual Studio without any issues. WHEN are they going to upgrade Visual Studio to 64-bit?????? Creating a deployment command/step There are three parts to a deployment command, the actual commands, adding the steps, then adding the steps to the configuration, and all this must be in a VSIXProject. There is a quirk, you must set the output directory of your package to be the directory of the VSIXProject directory. You can create and manage a configuration all from code as well. When creating a VSIX project, the framework must be 4.0, the same with the SharePoint commands project. Well, first time I've seen it, but he was able to crash the Visual Studio 2010 Beta 2
Sharepoint and Linq
Todd Bleaker is presenting, so this should be a great session. He's not going to be doing much deep diving, more of an overview of all the possible ways to access data from SharePoint. http://SharePoint.mindsharpblogs.com/todd/spc Nice diagram of the data technologies showing the different layers, along with their typing and if they are client or server side. Client Technologies Server Technologies Focusing on the Lists and Queries in SharePoint. He's going to work with three different lists Very nice feature he's touching on, SharePoint now supports both cascading deletes and restricting deletes. Validation and Uniqueness are now supported on Lists and Columns. Automatic large query throttling – They by default only return 5000 items, super-users can retrieve 20,000 items. This is set on a by site basis. Developers can override the settings as well. He's now doing demos of all the above things. Very nice, you can now display columns of a list you've created a lookup for in the child list. VERY NICE. Cascading deletes put not just the original item you're deleting, but also the children records as a unit. When they are restored they all come back as a unit. Wow, you can now edit the default edit, view pages right from the ribbon, that's going to save some real time and frustration. Pagination will now apply to what data is retrieved from the database. Client OM Unified object model across all clients, javascript, .Net and Silverlight. Again it's a subset of the Server OM. The requests to the server are all batched together before they are sent to the server in one request. He used the Yahoo tree view, because it's totally on the client side. Reference for REST API's http://msdn.microsoft.com/en-us/library/cc907912.aspx Javascript client om limitations. Can only work on the server relative url it is in. Nice setting in Internet options that lets you turn off the FEED view for RSS feeds. LINQ To SharePoint Use SPMetal to create proxies, or create it in the IDE. Lots of code examples, I like J Todd has so much energy, it always makes the presentations exciting. There's a great slide at the end describing the best time to use each of the different object models and the data access methods.
Between sessions
Just waiting for our next session to start in about 10 minutes, and so far I have to say I've really enjoyed the conference. At first I was concerned about exactly which sessions I was going to see, but then I saw how the videos were being done, so I'll be able to watch the entire conference later. The only thing I'd really miss would be the Q&A at the end. But with it being a beta still and the amount of information I'm already gathering it's not too much of an issue. It's a little bit funny to walk the halls between sessions and see these clumps of geeks camped out at every single power outlet, and the others are wandering aimlessly looking at their PDA's and phones. I can definitely notice a drop off in my bandwidth on my iPhone while I've been at the conference. Even though I've got a great 3G signal, there's just not enough bandwidth with 7400+ geeks, of which probably 50% have iPhones and are using them CONSTANTLY for tweeting, blogging etc. I've enjoyed the blogging features of Word, being able to take notes with the Wi-Fi off and then uploading it when they are ready is awesome.
SharePoint BCS Deep Dive
BCS – Everything that is involved in external data and being able to extract it and provide it in the SharePoint environment Business Connectivity Services See presentation for a good slide about the components involved in the BCS Important point, the BCS runtime is now on the client side as well, but it is very transparent. Ability to offline data on the client now because of this. BCS Investments Search now does all the security trimming up front, so it doesn't require an extra hop when searches are done that have results from BCS data. Index will now search through documents that are exposed in the BCS applications. It will provide a link to the external document where search items were found. Now doing a demo on creating a BCS project that accesses a flat file, this has really become simplified in 2010. He just mentioned that he's never looked at the XML created for this demo in all the times he's run it, applause ensues J Ohh man, they made a change to the connection of web services, it now creates a proxy for you so you don't have to provide the special things needed for BCS connections Improvements in the BCS Runtime More demo on the Object Model Dispatcher component on the client is the only non-symmetrical piece in the BCS You can schedule retrieval of data for the client so they always have the latest set of data. Deep dive now Admin OM Demo of admin tasks Data Integration Extensibility BCS Offline support Ugg, he went to fast, there's another bullet point in the presentation Conflict resolution See the slides, he's not really adding a lot and I really can't keep up trying to copy it down. Supports Versioning, that's really nice. Batching and Bulk API's is another really nice feature. ARRRGGG, code on Slides. Of course a great point that I absolutely love, the number of times he's actually had to edit XML is almost none, huge improvement in the tools. Just realized something else, the batching and bulk API's allows you to work with very large sets of external data. Mmmm, there's also throttling based on number of connections, payload size, Timeout period. Nice support for Powershell now to read and modify settings. Out of the box adapters are available for SAP, Seibel, and Oracle. But it does require BizTalk, that's where the adapters are actually coming from.
Workflows with Visual Studio 2010
Only workflows with 3.5, not compatible with framework 4.0. SharePoint is not in cycle with the Framework releases. SharePoint Designer can now create a reusable Workflow template that can be saved as a WSP that can be imported into Visual Studio. It is one way from SharePoint designer into Visual Studio, you can't take it back out and use it in SharePoint designer again. There is something called SPWebConfigModification that looks like you can add entries to the web.config programmatically. You can use the server explorer in Visual Studio and the new SharePoint server view to navigate to locations on the site by right clicking and selecting 'View in Browser'. Important point when your importing workflows, you can't import just the workflow, there is only a template for creating an import project that imports all of it to a new project. This is good, he's discussing how you can give users SharePoint designer to create workflows, then when they submit them you can import them into Visual Studio and validate them before they are used. You can provide them extra actions by building them in Visual Studio that will then show up in SharePoint designer. Nice uses for Workflows now that they can be associated just with a Site: Site Workflows When you create a workflow, when you select the type of workflow to create you cannot change it. So a list workflow is always a list workflow, and a site workflow is always a site workflow and never the twain shall meet. He demonstrated how he created a workflow that creates a task when someone wants to have a blog. Once he approves the task, it runs the custom activity that creates a new sub site and applies the blog template. Shows that you can use Site Workflows for administration tasks. EDS – External Data Exchange allows modeling of communication to a workflow. It implements interfaces for how to communicate to workflows and out of workflows. Allows for simpler communication to the workflow from ASPX pages, or an application that doesn't require extra work. Workflow runtime handles storing the state of the workflow after a message is sent out. When a message is returned to the workflow, the WF runtime restores the workflow from storage and then passes the message to the workflow. Important note, you will still need the instance id of the workflow to pass messages back in. OOoh, just saw a new navigation feature on 2010. There's a little folder that shows you the breadcumb in tree format, VERY slick! Lots of demos, and it's kind of tricky figuring out what is new and what is carried over. The communication functionality and the Site Level workflows really add quite a bit of power to workflows. Like he said, there's not really any one gee whiz feature in workflows, they've just added some nice pieces that make it much easier to develop workflows and more flexibility. Workflow 4.0 is not an incremental update, it's basically a re-write. Summary:
SharePoint Development Best Practices
Presented by: Kirk Evans, Architect Evangelist, Microsoft, blogs.msdn.com/kaevans Chris Keyser, Best Practices Team, Microsoft, blogs.msdn.com/chriskeyser More of a focus of best practices they learned in 2007, and how it will be applicable to 2010. Packaging Basically use WSP's for all deployments. It's actually a CAB file. Has everything needed for the deployment, and allows you to add and delete it from the Config DB. This then allows the administrator to deploy and retract on all web front ends. Also when a new front end is added it automatically get's deployed. Also allows the deployment to be done separately and scheduled later in the evening. Gives the administrator a warning if something is getting installed to the GAC. Development Environment You should always develop on a stand-alone server, preferably a single developer per server. Use a build and CI server. You don't want to work in a shared environment due to IIS Resets. Debugging is also an issue, if someone hits a breakpoint, then that will stop everyone else on the machine. Metal install Virtualization Boot to VHD Application Lifecycle Management WSP doesn't get checked into TFS. There is a build definition for the project, and under the process tab there will be a section called 3. Advanced there's an option called /p:IsPackaging=true. This will cause it to generate the WSP. The nightly build is what creates the WSP and puts it in a drop folder with date labeled folders. More information http://msdn.microsoft.com/dd552992.aspx this is the SharePoint application lifecycle management resource center Testing Unit Testing Do More of it. They release code every two weeks, and then gather feedback. Unit Testing can be done in any development process, it's not unique to Agile or Extreme development. Unit Testing – The Code is doing what the developer intended it to do. Should run against a substitute for the real system. Acceptance Test – The Code meets the business users requirements. Effeciencies come later in the cycle, there is a cost up front, but during integration both at the end and during development you have fewer problems. Integration Testing – Operates against an actual real system. Patterns help isolate code to improve testability. By isolating the code you can test it successfully without a lot of extra effort. MVC is a good example of a pattern that facilitates testing. Need to look at the presentation video, at this point he demonstrates how to do a unit test with TypeMock. It's a very good example, he takes code that's monolithic and shows how to refactor it to the MVC pattern. He used XUnit to perform write the tests. Nice new refactoring tools in VS 2010. Load Testing What: Allows you to identify performance bottlenecks and memory leaks. How: Use Visual Studio and Team System Web Test. Watch the video for the next part. Defensive Coding Avoid long debugging sessions by coding defensively. Examples: Important point, if you do dispose something that does not need to be disposed, it can cause stability issues with the site. Use SPDisposeCheck to be sure. The code analyzer in Visual Studio is FXCop. SPDisposeCheck will catch things that the code analyzer will not catch. Oooh, there's an add-in for SPDisposeCheck!!!
Creating Office 2010 Add-Ins using SharePoint as a data source
There are new extensibility in Office 2010 that supports SharePoint 2010. Office Business Applications – Extend the capabilities of Office Why use them? Agenda Once again there's a template in Visual Studio 2010 for creating a Word Add-In Project It's using WPF to build this add-in, he's adding a stack panel with a button list box and some text blocks that will be bound to data. He's adding this WPF to the task pane and it's all done through code with about 8 lines, pretty nice. What's new in accessing lists in SharePoint? Client OM is new Unified object model across all clients Subset of the Server OM He's set up tow lists category and course, and the courses list has a relationship to the category list. Adds a new class called course, this will be used for data binding. Once again it just has properties with getters and setters. Add references to the SharePoint Client Object Model, the client.dll and runtime.dll. In the original WPF add in, wire up the control to SharePoint. Adding a property to store all the courses using course class. Sheesh, he had a snippet with only 5 lines of code, I thought 'Wow, that's pretty lightweight'. It looks like the typical (for SharePoint 2010) you get a context, loading it first, then executing the query to retrieve the information. Load the Lists on the site, and retrieve the data again. Then find the list we want to access and again load and retrieve the data. Then it binds it to the list box. Now he's going to do the same thing with ADO.NET Services. Thought this was about retrieving SharePoint data??? He's using the same user control, ahhh, and he's using the ADO.NET Services to access data from the SharePoint list by just using the URL for the REST. Nice wizard, it shows you all the lists that are available to use. This looks to me like a much better method, a lot less code compared to the Client Object Model with the same results. Basically it only needs to use 3 lines of code, compared to probably around 20-25. He adds a drop down to the control, and he's going to allow the user to filter the courses by category. Adds another data context to access the category list, then populate the drop down. Pretty standard fare, just getting the data very loosely coupled using REST. Using some LINQ to filter the data as well, yeah, yeah, I can hear Ryan already telling me about how useful LINQ is. J It is running just a bit slow, so now he's going to improve the performance by bringing back the courses and their categories instead of making separate round trips. That's it for the integration, now he's going over Deployments Aspects of a good deployment Simple Installation process Two ways Click Once deployment are your standard ones, nothing really special about it. Ok, the WSP was pretty cool, you push it out to the site as the default document, then when a user creates the document it installs the Add-in. It does require setting a trusted location in Word to allow it to install though. Wow, that was short, 30 minutes short exactly. Surprising considering the other ones had to rush and still had trouble finishing.