MOSS eMagazine

105
SharePoint ® eMagazine January 2010 A Software Development Network Publication 2010 Special Dutch Information Worker User Group TM

Transcript of MOSS eMagazine

Page 1: MOSS eMagazine

SharePoint®

eMagazine

January 2010A Software

DevelopmentNetwork

Publication

2010 Special

Dutch Information Worker User Group

TM

Page 2: MOSS eMagazine

SharePoint® eMagazine2010 Special

ColofonDIWUG SharePoint2010 eMagazineJanuary 2010

Publisher:Dutch Information Worker UserGroupPowered by SDNFirst Edition, January 2010

Editors:Marianne van Wanrooij (lead)[email protected] van [email protected]

Special thanks to:Marcel Meijer (review), Remi Caron (review), Joop Pecht (secretary)and all the authors and sponsors!

Design and layout:Barth Sluytershttp://home.12move.nl/barthsluyters/

©2010. All rights reserved. No part of this magazine may be reproduced in any way without prior written permission of Diwug/SDN or the author. All trademarks mentioned in this magazine are the property of their respective owners.

ContentsReady for 2010! 3The SharePoint 2010 Enterprise 5Customizing the SharePoint Ribbon 14Visual Studio extensions or a manually build solution? 20Working With Data in SharePoint Designer 2010 26Sandboxed Solutions in SharePoint 2010 35New ECM features in SharePoint 2010 45Creating new Visual Experiences with Visio Services 52How to guides - Visio Services 55About DIWUG 56A SharePoint User eXperience 63Introduction to the Business Connectivity Services 67SharePoint 2010 Client Object Models 73Understanding Identity in SharePoint 2010 82Happy Together in 2010 86About SDN 87SharePoint 2010 Chart Web Part 89Enrich your SharePoint 2010 portal by integrating SAP applications 96SharePointComic 102

Page 3: MOSS eMagazine

SharePoint® eMagazine2010 Special

Ready for 2010!Editor’s note

Last year SharePoint conference in Las Vegas has been one of the best conferences I’ve ever been. Not only was it great to meet the SharePoint Community whom for a majority I only knew from Twitter, Blogs, FaceBook or other virtual social networks but also the sessions and information shared were from a high quality. That’s where the idea was born to create the very first SharePoint eMagazine. A free magazine for IT-Pro’s, Developers and End (power) Users and optimized to read in eReaders.

Mirjam van Olst (SharePoint MCM and MVP) and myself took the challenge to find authors who are well known in the SharePoint Community, Sponsors who are willing to advertise in this magazine so we could cover the costs and the time to read, review and edit articles next to our busy jobs. Well... the results is this magazine! Over 100 pages with information for SharePoint professionals.

Playing with SharePoint 2010 you can’t help but to get excited about all the new possibilities. Have you looked at Visio Services or the Business Intelligence possibil-ities? It looks very promising! Or have you played with data using the SharePoint Designer. Talking about data, what about the enhancements of the Business Connec-tivity Services (previously known as the BDC). Very awesome! Personally I like the integration of Visual Studio Tools for SharePoint. It’s so easy now to develop, debug and deploy your solutions. But there are so many new things for a developer to look at; the Client Object Model, SandBoxed Solutions, UI Customizations.

“Out of the Box” is a column on how you can create business solutions in Share-Point by configuring functionality (No Code Solutions). Further in this issue we look at Project Management with SharePoint.

All of this and much more you will find in this first issue of the SharePoint eMagazine. SharePoint 2010 has so much to offer, this magazine size could easily be double. Enough for a second edition.. so who knows!

I hope you enjoy this eMagazine as much as we did putting it together and that this will help you getting ready for SharePoint 2010!

Marianne van WanrooijLead [email protected]

This special issue is sponsored bySee page

Getronics 4WinVision 13KbWorks 19Bergler 34Connected Services 44Avanade 62WinVision 72Sogeti 88

Page 4: MOSS eMagazine

Laat informatie voor je werken

Getronicsconsulting.com

Informatie wordt steeds crucialer voor een goede bedrijfsvoering. De eisen van mede­werkers, klanten en partners veranderen voortdurend. Effectief en efficiënt (samen)werken vraagt om bedrijfsinformatie die altijd en overal toegankelijk en uitwisselbaar is. Getronics Consulting levert advies en technische oplossingen, van visie­ en strategie­vorming tot implementatie en beheer, voor het optimaliseren van uw informatievoorziening

Page 5: MOSS eMagazine

SharePoint® eMagazine2010 Special

Performance Point ServicesExcel ServicesChart Web PartVisio ServicesWeb AnalyticsSQL Server IntegrationPower Pivot

Social RelevancePhonetic SearchNavigationFast IntegrationEnhanced Pipeline

Enterprise Content TypesMetadata and NavigationDocument SetsMulti-stage DispositionAudio and Video ContentRemote Blob StorageList Enhancements

Tagging, Tag Cloud, RatingsSocial BookmarkingBlogs and WikisMy SitesActivity FeedsProfiles and ExpertiseOrg Browser

Ribbon UISharePoint WorkspaceSharePoint MobileOffice Client and Office Web App IntegrationStandards Support

Business Connectivity ServicesInfoPath Form ServicesExternal ListsWorkflowSharePoint DesignerVisual StudioAPI EnhancementsREST/ATOM/RSS

The SharePoint 2010 Enterpriseby Sjoerd van Lochem

Microsoft has made a lot of changes and major improvements on SharePoint. This makes SharePoint 2010 better suited for a broader variety of applications within small, medium and large enterprises.

Because of the many improvements, it is quite difficult to create a holistic view.

In this article we will discuss the different applications and improvements, based on a random company which we will call “The SharePoint 2010 Enterprise”. Within this company we will discuss

eight personas who use SharePoint in their daily activities. The personas range from Jack the developer to Huge the end user. These personas will help you to distinguish the different SharePoint

functional and technical areas and can assist you in choosing which areas to explore in more depth.

At the October convention, Microsoft presented the beta releases of Office 2010 and SharePoint 2010 (pronounced SharePoint twenty ten). IT professionals and customers alike described the 2010 release as “super awesome”. They commented: “Microsoft really listened to us”. Microsoft not only increased the breadth of SharePoint, they added many configuration possibilities and improved it’s customizability. This poses a practical dilemma. There are so many things SharePoint has improved on: which areas are relevant for you and where to start your discovery of SharePoint 2010?

To give you a good idea of all those improvements, we will discuss SharePoint 2010 applications within a fictive company, “The SharePoint 2010 Enterprise”. Within our company we distinguish eight personas who we can all relate to. You can use these personas to guide you through relevant improvements and functionality.

Mark, the developerMark is programming SharePoint applications and web parts, extending SharePoint with cool customizations and building deployment packages in the form of SharePoint Features and Solutions. Mark has some experience with SharePoint development, but he finds it time consuming to deliver bug free software for SharePoint.

Page 6: MOSS eMagazine

SharePoint® eMagazine2010 Special

Jack, the consultantAs a consultant, Jack is advising his customer how to use SharePoint. He is building an example by configuring a SharePoint environment, based on out-of-the-box function-ality. Jack has a background in document management. He advices the Management Team on how to use SharePoint and web applications really add value. He sees great possibilities for Enterprise Content Management and reporting applications which are integrated within the companies back end systems, such as MS Dynamics Ax, MS Dynamics CRM and a custom built application which stores information in a SQL database.

Tech Eddy, the application and system ownerThe SharePoint environment of our company is managed by Tech Eddy. He is maintaining a MOSS 2007 environment and his end users are asking for new functionality, better performance, more uptime and more storage. Tech Eddy is using an MS Access database to manage issues and change requests on the SharePoint environment.

Remco, the interaction designer Remco is a capable interaction designer who first had great difficulty in designing and branding SharePoint sites, but he got the hang of it. He is experimenting with web content management functionality, knowledge management, social networking and branding and is attempting to improve on MOSS 2007 possibilities.

Maria, the power userMaria is Bob’s secretary, Bob is the CEO. She has a lot of confidential information, is a heavy user of MS Office (Word, Excel, PowerPoint and Access), and she is responsible for dispersing management information. She has a lot of local MS Access databases which she uses to register meeting attendance and to create large mail merges, based on SharePoint templates.

Huge, the end userHuge is a sales manager who often communicates with customers and colleagues. He shares a lot of information and spends the majority of his time on the road, travelling to and from customers. Huge is not always online, nor always connected, so he tends to print and copy most information on his local laptop. He is mostly struggling to collect all relevant information from the different applications and getting the latest versions without having to invest a lot of time in “techno hassles” and the “applica-tions jungle”. He is a frequent user of Microsoft Excel and Word and just loves the Office Ribbon that Microsoft introduced (just for him?).

His home is closer to his customers, but because he has to collaborate with his colleagues, Huge drives to the office. Wouldn’t it be great if they could both work on a sales document for a customer at the same time?

Bob, the company’s founderThe SharePoint 2010 Enterprise is founded by Bob. His work is his passion and he feels a great commitment to the company and to its people. Bob’s company is doing well, but the economical downfall of last year makes him aware that an increasing amount of employees divert their effort away from the core business. Although these tasks are important, Bob means to steer things up and he wants the employees to keep focused on the customers. Over the past few years, the budget of the IT department grew steadily year after year. The results are good, but could the IT Department be a little more efficient?

Arthur, the IT architectBob has regular meetings with Arthur. Bob is supervising the IT Department, but the heart and soul of the team lies with Arthur. Arthur is a Microsoft architect with integral knowledge of the Microsoft software stack. They talk a lot about where to put their money in future investments. Arthur is convinced that they can save money if the development process will be streamlined more efficiently, the deployment is made easier and when the software would be more scalable and fault tolerant. He

Page 7: MOSS eMagazine

SharePoint® eMagazine2010 Special

attended last month’s Gartner conference, which proved to him that SharePoint 2010 was becoming a dominant Microsoft web platform. He listened and agreed that social media and search will become very important for future enterprise. He will coach Jack and Remco to do some research on both topics.

Mark, the developer.By opening Visual Studio 2010, Mark discovers a lot of cool improvements. First noticeable are the new SharePoint templates which he can use to build SharePoint Solutions (included site definitions, content types and lists) and web parts. Mark is curious and starts a new SharePoint project. He gazes at the SharePoint Explorer. That’s neat, he can browse through the SharePoint environment and just drag, drop and reference all kind of SharePoint resources and artifacts. This will save him a lot of time. Next, Mark is adding a visual web part to the project which allows him to visually design the web part in the same way he is used to develop user controls. InteliSense helps him to speed up his coding and assists him during code writing. As soon as he is finished, he wants to deploy his web part to the central testing environment of SharePoint. By clicking the build and deploy option, Mark notices that VS 2010 is doing its job by retracting and deleting the old solution, copying and deploying the new solution, registering the different components and resetting IIS. Wow, all those cumbersome steps are done automatically by VS 2010!

But oops, Mark has made a mistake in his code and the web part causes a circular reference. Normally, this could crash the SharePoint application. Luckily Mark had configured the SharePoint throttles in order to restrict the resources of the sandbox solution Mark used to limit the processing time and memory usage of his faulty solution.

Tags: Visual Studio 2010, Visual Studio SharePoint templates, Visual Studio 2010 Tools for SharePoint Development, developer dashboard, logging, SharePoint solutions, sand box solutions, LINQ

Jack, the consultant.Jack is advising management in implementing a document management solution. All that valuable non-structured information is just stored on file servers, local hard drives and personal e-mail boxes. Finding, retrieving and re-using information is severely limited by the current situation. Jack tried to implement a document management solution last year, but a study made clear that the company was not ready and the available functionality was falling short. Routing documents to archives, meta dating documents and defining policies was all possible, but the application felt not yet mature. But with SharePoint 2010 it will be a whole new ball game. Advanced document routing for supporting much more complex file plans and routing scenarios; document sets in order to form an entity which consists of multiple documents (for example: a loan application, which consists of a loan form, income statement and general terms); expiration policies; centralized management of hierarchical taxnomies and folksonomies and retrieval of records, even if the file name or file location has been altered. By using the Business Connectivity Services, documents can be linked to clients and backorders. This year, Jack has a good chance to make a real start with document management. Maybe he can even use the new search, social networking and meta dating facilities to start on a brand new knowledge management project to organize user groups for each market the company operates in?!

Last year, IT focused on getting the back end systems’ processes right. This year, Jack prefers to shift the focus and reap the benefits of those smooth business processes. The company has a lot of different systems and the users spend a lot of time combining information from those different systems. Jack wants to make a portal which will give the users insight by presenting the business with financial information and reports. By using composites, Jack wants to present the Sales department with a map of the sales area where all the resellers are drawn onto this map. Each reseller could be presented with a bar of indicators visualizing the sales volume of each reseller. By selecting the product family filter, Sales can analyze which type of product is sold by whom. By

Page 8: MOSS eMagazine

SharePoint® eMagazine2010 Special

selecting an area or by drilling down, the Sales representative can analyze past and present sales of every reseller. But wait, wouldn’t it be great to see what marketing effort is undertaken locally? By displaying an Internet search query, looking for planned expos and conventions in the local region, together with our financial data, Sales can decide to step in the local marketing effort. A business connectivity service connection to our order entry application enables us to search through the latest orders of a specific reseller and even enter and write back new customer orders.

Tags: record center, document routing, ECM for the masses, BI for the masses, business connectivity services, SharePoint & Fast Search, composites & mashups, InfoPath services, managed metadata service.

Tech Eddy, the system ownerTech Eddy is maintaining the current MOSS 2007 environments. He values the intro-duction of separation of SharePoint development, test, acceptance and production environments. But such a hassle to maintain all those different servers! Microsoft has good news for Tech Eddy. They understood his problems and offer him far better tooling and support with SharePoint 2010. From within System Center Operation Manager (SCOM) he can monitor all these environments and analyze server health problems. When Tech Eddy starts with SharePoint 2010, he immediately looks for the central administration. All seems pretty familiar, but he notices the new structuring of the services. The Shared Services Provider no longer exists. Instead, Eddy is looking at a bunch of services with names like “Managed Metadata Service” and “User Profile Service”. The improved service architecture of SharePoint makes SharePoint better suited for large and secure deployments.

Tech Eddy is thinking of the accident which took place last month. The database of his MOSS 2007 farm failed. Good backup and restore procedures ensured that he was quickly back in business. However, he was not able to restore the latest content because he could not reconnect to the content database with the last content changes. At last, SharePoint 2010 will support these scenarios. He can connect any content database without restoring it to the SharePoint environment. By connecting to the content database he can browse it and restore single sites, lists and documents which are stored in the content database.

At the top of the screen, the system is stating some problems. Tech Eddy is curious and clicks on the message. He ends up in the health monitor, a proactive analyzing tool which detects and prevents current and future problems/issues within the SharePoint environment. The tool can make suggestions how to solve the issues and can even be configured to solve the issues automatically. Could it have prevented a system failure like the database problems of last month?

The content database of his current farm had become very large. It probably contributed to the system’s failure. With those large CAD/CAM files, the database was growing rapidly. By making using of the SQL 2008 file stream option to store large files on disk and reference them from SQL, SharePoint 2010 should be able to decrease the size of the content database substantially.

Tech Eddy is a heavy user of Powershell for maintaining his Windows and Exchange servers (for example: maintaining active directory and exchange mailboxes). It would be very convenient if he could do the same with SharePoint 2010. Curiously, he inves-tigates and discovers that he can do all the same configurations for SharePoint 2010 in the central admin or in administration pages of different site collections! It will take him a couple of days, but Tech Eddy thinks that this investment is worth taking.

All these improvements are great, but how should Tech Eddy prepare to upgrade his current MOSS environments and servers? Tech Eddy is searching TechNet and soon discovers valuable information. A new cool feature is the ability to keep each Share-Point Server in a farm on a different patch level. This will make maintaining, patching and upgrading much easier to begin with. TechNet describes a couple of upgrade paths. First he has to upgrade his current MOSS 2007 and WSS 3 environments to SP2. The second step is running the upgrade checker and investigating the warnings and suggestions. Tech Eddy can choose from doing an in place upgrade, database

Page 9: MOSS eMagazine

SharePoint® eMagazine2010 Special

attach upgrade or single click install upgrade. After the technical upgrade process, Tech Eddy can let each user choose between the old interface and the new interface (offering new functionality like the ribbon). Each user can choose for the improved GUI by starting the option “visual upgrade”. Tech Eddy is convinced that SharePoint 2010 will be implemented this year and concludes that he has to write an upgrade plan.

Tags: service applications, SharePoint Services, central administration, health monitor, central logs, SCOM, Powershell, MOSS 2007 and WSS 3 upgrade, visual upgrade, backup and restore, attach content database, SQL 2008 file stream.

Remco, the interaction designerThe current enterprise is using MOSS for their public website and has some great internal knowledge management applications. Although Remco thinks MOSS is doing a great job, he is encountering the limitations on several areas. He hopes SharePoint 2010 will improve the visual experience of the end user and that it will offer him a lot of GUI improvements. His first experience with SharePoint 2010 quickly learns him some cool improvements which will upgrade SharePoint branding to current requirements. Overlays, tableless menus and controls, separation of design and ribbon functionality, theming improvements (much easier), tagging, scoring and rating content by end users, SharePoint 2010 Designer, managed metadata service (hierarchical thesaurus), improved content editor, 100% browser compatible, improved content query web part, list view web part, support of mobile devices, localization (ability to dynamically display any site in any language), greatly improved Silverlight integration, Enterprise Wiki, Office document previewing within the browser with Fast Search technologies and the list goes on.

Remco has to investigate all these changes which will enable him to do more with SharePoint. He navigates through a brand new SharePoint 2010 environment, adds some comments, creates some Wiki pages and rates some documents. After a while, he decides to look at the new “My Site” functionality. He creates a “My Site” and instantly sees, on his public pages, references to documents, items and conversa-tions he viewed, scored or replied on. SharePoint 2010 has brilliantly improved social networking functionality. Remco cannot wait to start using these great features.

Tags: branding, theming, social networking, tagging/scoring/rating content, managed metadata service, Enterprise Wiki, localization and languages, content query web part, list view web part, mobile devices, Silverlight, SharePoint Designer 2010, search.

Maria, the power userMaria is an employee who has worked at the company for 10 years. She is the secretary of Bob (CEO). Maria forms the center of the enterprise and she manages Bob’s day to day agenda. Important changes are best to be discussed with her before involving Bob. Maria has a lot of confidential information she has to store. Minutes of the board of directors, presence lists and address lists of large mailings. At the latest endeavor, Maria is organizing workshops for the top 100 customers of our company. The workshops are a paid service by our company and there is high interest. Maria is registering which customers have been invited, registered and paid for. She has developed a small Access database for the registration process.

Tech Eddy hears of all this information which Maria is storing on her local hard drive and in local Outlook archives (pst-files). The enterprise would be severely crippled if all this information is lost. Last year, he tried to convince Maria to store this infor-mation in SharePoint, but for Maria the MOSS environment did not offer enough ‘temptation’ to make her use SharePoint. But could do SharePoint 2010 do the job? Tech Eddy phones Jack and discusses his latest ideas. Jack agrees and will visit Maria.

Page 10: MOSS eMagazine

10

SharePoint® eMagazine2010 Special

One month later, Maria is using SharePoint 2010. Why didn’t she have this tool much earlier? The ribbon reveals all these wonderful abilities and actions. She can easily create meeting workspaces and authorize individual users to access these workspaces by using the ribbon. Maria sees how simple it is to add new documents to the sites. First she had some difficulty with the approval process. But with Jack she designed a workflow within Microsoft Visio 2010. Afterwards, Jack exported and opened this workflow in SharePoint Designer where he configured each workflow step. One small element could not be configured within SharePoint Designer, but Jack asked Mark to open the workflow in VS 2010 and program a custom step within this workflow. Now the workflow for the approval is made available in all the minute sites Maria creates. She can use the workflow whenever she wants.

Most of the mail merge lists that Maria stored, were Excel files. Jack showed her how easy it is to export these Excel files to SharePoint lists. Now Maria, and the rest of the secretariat, can use those list all at the same time and they are even available on Fridays when Maria works from home. Because of better office integration, those SharePoint lists can easily be used for mail merge activities.

The Access application which Maria made, was upgraded to Access 2010. Maria published the Access application to a SharePoint site and now all of the function-ality is supplied by standard SharePoint functionality. When she deletes an attendee, all linked information is discarded as well (cascade delete). All the forms she made are functioning and Jack even corrected a form with SharePoint Designer after the application had been published to SharePoint. For future congresses and workshops, Maria can reuse the Access application by publishing the same application to new SharePoint sites.

Tags: user interface improvements, ribbon, Office integration, workflow, Access services.

Huge, the end userAs a sales manager, Huge is mainly on the road. Because he often lacks an Internet connection while he is travelling, Huge tends to print and carry a pile of paper dossiers within his car. He uses SharePoint to store documents, but he always has trouble in finding the right site and the digital document he so desperately needs.

Jack setup a SharePoint 2010 pilot environment to let the company users asses this newest version. Huge is an innovator; he loves new technology and is appointed as a test user. Huge is using the ‘classic’ SharePoint 2010 sites together with Share-Point Workspace 2010 and Outlook 2010. In the pilot environment, Jack and Mark did some work. They created a business connectivity service connection to the ERP system (Dynamics Ax) in order to access and use customer information and order details. They published the customers, orders and order details as external content types/lists and created an InfoPath form which contains order and order details information. The InfoPath form was published to SharePoint. They configured the customers to be available in Outlook as contacts and they used a special tool (not yet released by Microsoft) to make the InfoPath form available in Outlook.

Huge is on the road again. He was just phoned by his most important customer about the shipment of an important order. The customer wants to add some products to this order and it should not be delivered to the main plant, but to the distribution center which is located nearby. Huge could phone to the office, but he knows that sales support is short on staff and is working overtime in this time of year. Huge starts his laptop, but guess what? No Internet connection. But remember, Huge is participating in the pilot and his computer has got some “magic” tricks. Huge opens Outlook and searches through his contacts. He finds the customer and looks at the contact details. On the contact card he notices the button “orders” and immediately selects the button. A neat selection box appears and he selects the latest order. The order opens up and he inspects the order details. He adds the products required to the order and changes the delivery address using his address book. Next time Huge is online, Outlook will synchronize these changes to the ERP (dynamics Ax) system, using SharePoint as a connection hub.

Page 11: MOSS eMagazine

11

SharePoint® eMagazine2010 Special

Huge phones the client and checks whether the order is in accordance with the wishes of his most important customer. Talking with the client, he is reminded of last week’s contract meeting. They agreed to adjust some of the terms regarding the contractual guarantee period and replacement procedures. He opens the SharePoint Workspace of this client and quickly finds the most recent contract. He alters the document and renews the end date of the contract. Next time his computer is connected to the Internet, the document changes are synchronized to the SharePoint customer site and the expiration period of the contract is updated.

Huge comes home and connects his laptop to his wireless home network. The changes he made earlier this day are synchronized to SharePoint and the ERP system. He has made some phone calls and needs a service contract for a new customer. He has to look for clients with existing requirements, but from past search experi-ences he knows that this can be difficult. However, with SharePoint 2010, the out-of-the-box search functionality will make his life much easier: full text search queries will support wildcards, asterisks and Boolean expressions. In order to support less query search, users can use tag clouds and drill down features (facetted search) which are all supported out-of-the-box! But Huge notices an odd phenomenon. When he searches the system, the documents he or his direct colleagues are working on, are listed higher in the search ranking. Is SharePoint using information about his social network to make a meaningful and user specific ranking of the search results? Huge navigates to his My Site and discovers listings of documents he reacted on, documents he created and sites he required access to. It is almost a grouping of his favorites for the entire SharePoint environment and he did not have to do anything!

He starts working on a new sales document and decides he has to write a proposal, but needs Maria to work with him. It is Friday and Maria is working from home. He puts in a search query for Maria and finds her contact details. The present indicator states that she is available and he starts an Office Communicator call (OCS) with Maria. Huge uploads a first draft document and asks Maria to review the document. Meanwhile, he will add a last chapter. They both open the document simultaneously and are making alterations. SharePoint will take care of the versioning, merging and displaying of the changes to them both in realtime! Huge is satisfied with the end results and sends the draft document to his new client in order to discuss it by phone tomorrow morning.

Tags: ribbon, my Site, search, Office integration, offline support, SharePoint Workspace, external list, business connectivity services, co-authoring, Office Communicator

Bob, the company’s founderAs founder of the company, Bob is the driving force behind the company. The company has grown substantially so Bob has had to delegate more and more. He knows that his employees are committed and motivated, but Bob is of the opinion that a lot of effort and money is piled on trivial activities. He manages the IT department, but lets the day to day activities to Arthur. But Arthur has got little management experience and Bob thinks that the increased IT spendings could burn a hole in the company’s pocket if business was to slow down. The latest investment request was for upgrading the current SharePoint platform to SharePoint 2010. He does not know whether this would be wise. Wouldn’t IT investments rise yet again?

Arthur convinces him that IT productivity could increase because of better tooling, richer SharePoint applications and increased stability and scalability. They investigate some preliminary studies which indicate that the TCO of SharePoint 2010 would be even lower than MOSS 2007. They agree to do some pilots before they will pop the big question: should they migrate to SharePoint 2010 this year? Arthur will calculate a business case, based on the results of these pilots.

Bob is also curious about how critical SharePoint has become. An increasing amount of digital documents is stored in SharePoint, but he has no reports showing how many document and sites there actually are and how frequent employees and customers are using data. Bob visited an executive meeting with some CEO’s in his industry

Page 12: MOSS eMagazine

1�

SharePoint® eMagazine2010 Special

and they talked about upcoming compliancy legislation. Are contracts stored and secured properly? Bob would like to get some monitors in place to give him more insight regarding these questions. Arthur shows him some examples of usage and audit reports. Bob decides to ask Arthur to include these reports in the pilots and make a monthly report about the size of the environment, the usage and the audit information about “disappeared” legal contracts and safeguards, preventing the accidental change or destruction of vital information.

Tags: audit trail, usage reports, TCO, case studies, SharePoint licenses, legal hold, records.

Arthur, the IT ArchitectAnxiously, Arthur heard of all the marvels of SharePoint 2010. He supports the choice for the Microsoft platform and SharePoint, but he has some questions based on his elaborate experience. He knows that customizing standard software can be quite difficult. A portal should be flexible and expandable though. Support of software development and deployment strategy are key. Better support to roll out customiza-tions through a development, test, acceptance and production environment is just as important as the development tools themselves. Arthur is aware that Bob wants to focus on the core business. Heavy investments in IT dedicated systems are possible, but are there possibilities to outsource parts? Arthur discussed the need with Bob to make a start with customer portals. Last year’s pilot proved that the authentication and security requirements in these scenarios can become complex. Will SharePoint 2010 and Office 2010 provide better support for these scenarios?

Eddy explains to Arthur how the new SharePoint service applications can be used to tighten security and to size SharePoint with greater ease and how it will support far more complex and larger deployments. Arthur likes the concept of sharing services among farms. Could the sharing of services, combined with for example claims based authentication, be used for cloud computing scenarios? Arthur decides he wants to take a firm interest in this subject!

Arthur makes a listing of all the different development tooling for SharePoint:

n Visio for developing graphics and visual designing workflows schemes.

n Excel for creating web based Excel sheets/graphs and interactive calculations where end users can enter parameters (for example a maximum loan calculator).

n Access for creating database like applications for SharePoint (including macros, dashboards, user role specific entry screens and cascade/delete linkages between lists).

n SharePoint Designer for creating and customizing sites and lists, branding, configuring workflows, creating Business Connectivity Services connections, CAML queries and XSLT editing, site definitions (!) and even WSP’s.

n Visual Studio for creating custom web parts and other artifacts, Solutions, features and custom workflow (activities).

Arthur thinks that Visio, Excel and Access can be used by power users. SharePoint Designer can be used by consultants, interaction designers and developers and Visual Studio can be used by developers.

Tags: development strategy, cloud Computing, service applications, forms based authentication, workflow tools (Visio, SharePoint Designer and Visual Studio), SharePoint solutions (SharePoint Designer and Visual Studio), sizing and securing SharePoint.

ConclusionWith SharePoint 2010 Microsoft did an amazing job. Microsoft added extra configu-ration parameters, introduced new functionality and improved Office integration. Most noticeable are the improvements mode for developers (Visual Studio and Share-Point Designer), the improved service structure of SharePoint and the modernized

Page 13: MOSS eMagazine

1�

SharePoint® eMagazine2010 Special

GUI/WCM functionality. Users who attended the Las Vegas conference where enthu-siastic and concluded that SharePoint 2010 has matured and has got far too many functionality and different application to be mastered in depth by one individual. Probably we will see a lot of area experts who will focus on different aspects and areas within the SharePoint technology stack. In this article we used different personas to give a broad overview of the new functionality and changes that are made to Share-Point 2010. You can use this information to decide which SharePoint 2010 areas you want to explore first.

In short we can conclude that SharePoint 2010 is a formidable web platform. The IT research industry predicts a bright future and dominant role for SharePoint 2010.

... by the way ...

The SharePoint 2010 beta Developers Trainings Kit is downloadable from:http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=bfd1603b-

7550-4b8e-be85-4215a5069b90;This kit is full of videos, hands-on labs and other practical content for the SharePoint

developer.

Tip from Marcel Meijer (VX Company) http://www.marcelmeijer.net

Page 14: MOSS eMagazine

14

SharePoint® eMagazine2010 Special

Customizing the SharePoint Ribbonby Marianne van Wanrooij

The Ribbon was introduced to us with Office 2007. And to be very honest. I’ve had problems finding my way at first. oh well.. sometimes I still get lost! Next to Office clients, even Paint and WordPad (if you’re running Windows 7) has adopted the Ribbon and now SharePoint is the next product to use the Ribbon in its user interface. In this article I will discuss the Ribbon basics and

look into some terminology, how you can add or remove a button and how to add events.

Ribbon basicsBefore we start let’s look at some terminology of the Ribbon. What is the Ribbon? The Ribbon User Interface is a task oriented Graphical User Interface. It’s the central control center which stays on top of the page and doesn’t scroll out of the view.

Fig. 1: Ribbon basics.

The mayor parts of a Ribbon exists of 4 elements: (figure 1).

1 Contextual tabs: based on your position within the site the needed functionality will appear.

2 Tabs: On a tab you will find all tasks organized by function and organizes a set of groups.

3 Groups: groups contains a set of controls. Each group can contain multiple controls and has a label to identify each group.

4 Controls: this is where the action is performed. Each control has a unique command.

You can use different kind of controls in the Ribbon. These controls are the same as you can use for the client Ribbon. Like the Button, CheckBox, ComboBox, DropDownList, Label or TextBox. These are the well known basic Web Controls which won’t be discussed here.

Other Controls you can use are:

n FlyoutAnchor; is a button with a down arrow which opens another menu or collection of buttons when you click on it

n GalleryButton; is just like a regular button only it is designed to host an image of any size (this one is not used in a out-of-the-box installation of SharePoint.

n Spinner; A control used to insert a value by typing or using the arrow keys to cycle through the values.

n SplitButton; is used as both a button and a menu (e.g. the workflow button)

n ToggleButton; A button used to toggle between an on and off state.

The only client Ribbon control that is not out of the box for the SharePoint Ribbon is the in-Ribbon Gallery Contol. But you can create/fake this control by using a drop down grid or with buttons. Maybe in the next release it will make the feature list.

The Ribbon is fully extensible. You can add, modify or remove controls from the Ribbon. Even the out of the box buttons can be removed. (If you like you can even remove the complete Ribbon.) If you have created Custom Actions in WSS 3.0, after an update they will automatically appear on the “Custom Commands” tab of the Ribbon.

The Out of the Box (OOB) Ribbon is heavily cached and the controls added through non-filtered the CustomActions are cached with the OOB controls. Non Filtered Custom Actions are always on the Ribbon and need to be registered.

Page 15: MOSS eMagazine

1�

SharePoint® eMagazine2010 Special

<CommandUI> <Ribbon ... <Tabs ... <Tab ... <Groups ... <Controls ... <Button ... <ContextualTabs ... <Templates ... <RibbonTemplates ... <GroupTemplate ...

<?xml version=”1.0” encoding=”utf-8”?><Elements xmlns=”http://schemas.microsoft.com/sharepoint/”> <CustomAction Id=”Ribbon.Documents.New.NewRibbonButton” Location=”CommandUI.Ribbon” RegistrationId=”101” RegistrationType=”List” Title=”Add a Ribbon Button”> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location=”Ribbon.Documents.New.Controls. _ children”> <Button Id=”Ribbon.Library.Actions.NewRibbonButton” Command=”NewRibbonButtonCommand” Image16by16=”/ _ layouts/images/demo/button16.gif” Image32by32=”/ _ layouts/images/demo/button32.gif” LabelText=”My First Button” Sequence=”25” TemplateAlias=”o2” /> </CommandUIDefinition> </CommandUIDefinitions> <CommandUIHandlers> <CommandUIHandler Command=”NewRibbonButtonCommand” CommandAction=”javascript:alert(‘Hello world!’);” /> </CommandUIHandlers> </CommandUIExtension> </CustomAction></Elements>

Controls added through filtered CustomActions are not cached. Filtered Custom-Actions are controls that are pointed to specific registrationType and has a registra-tionId assigned (e.g. 101 for a Document Library or a content type). Especially when you have added your own security trimming you don’t want to cache the controls.

The Ribbon UI is defined in a XML file - the CMDUI.xml and contains the OOB site wide Ribbon implementation and can be found at the location<SharePointRoot>\TEMPLATE\GLOBAL\XML.

The structure of the XML is shown in the listing 1.

Listing 1: XML structure of the Global CommandUI.

The HTML that is rendered contains mainly DIVs. No TABLE-tags are used. This makes the use of jQuery an easy task.

Add a control to the RibbonThe Ribbon in SharePoint can be customized by using XML and ECMAScript (a standardised script language of which JavaScript and JScript are dialects from). Customizations to the Ribbon are configured and installed like a feature using a Feature.xml and a Manifest.xml file.

The Manifest.xml could look like this (Listing 2):

Listing 2: The manifest for Ribbon Customization.

Let’s look at some important parts of this XML.

n CustomAction attribute Id: The Id looks like this “Ribbon.Documents.New.MyButton” it is best practice to have a naming convention like this: Ribbon.TabName.GroupName.ControlName. This helps you to identify the location of the control.

Page 16: MOSS eMagazine

1�

SharePoint® eMagazine2010 Special

<Group Id=”Ribbon.Library.Actions” Sequence=”50” Command=”ActionsGroup” Title=”$Resources:core,cui _ GrpConnect;” .... Template=”Ribbon.Templates.Flexible2” >

<?xml version=”1.0” encoding=”utf-8”?><Elements xmlns=”http://schemas.microsoft.com/sharepoint/”> <CustomAction Id=”RemoveButton” Location=”CommandUI.Ribbon” RegistrationId=”101” RegistrationType=”List”> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location=”Ribbon.Library.Actions.ConnectToClient” /> </CommandUIDefinitions> </CommandUIExtension> </CustomAction></Elements>

n CustomAction attributes RegistrationId and RegistrationType: This tells us it’s a filtered Control, shown when you’re in the Document Library List view (101). Important to know here is that when you have a web part with a custom view of the Document Library the button will not appear.

n CommandUIDefinition attribute Location: This is standard for adding controls to the Ribbon. In this example we want to add a button. This is done by using the same naming convention “Ribbon.Documents.New.Controls._children “. When you want to add a group this would have been “Ribbon.Documents.Groups._children” or when you want to add a Tab this would have been “Ribbon.Tabs._children”.

n Button attribute Command: This must be a unique string and tells what CommandUIHandler should be used. This handler is found in the CommandUI-Handlers element or on the page as a Page Control.

n Button attribute Image16by16 and Image32by32: For scaling purposes you can add a smaller version of the image. This prevents blurry pictures when the browser scales.

n Button attribute Sequence: The sequence is the order of the controls in the Ribbon. The sequence numbers from OOB controls is always a multiple of 10.

n Button attribute TemplateAlias: The TemlateAlias is used for styling. In the CMDUI.xml you’ll find different Templates. These templates are referenced in the Group definition.

Listing 3: Group definition in CMDUI.xml.

In the template definition of Ribbon.Templates.Flexible2 you will find the behavior of the TemplateAlias. o1 or o2 is a definition for a OverFlow. Meaning the group will be expand when more controls are added.

Something to keep in mind is that when you have a typo for the TemplateAlias, the control, or in our case, the button will not show on the Ribbon.

Remove a controlRemoving a control from the Ribbon is easy do. Just add the CommandUIdefinition to the location. Because the Control is not defined nothing will be shown in the Ribbon for that particular Id. As an example: you want to remove the button “Connect to Outlook” from the Library tab in the Actions group.

Listing 4: Remove a control.

Page 17: MOSS eMagazine

1�

SharePoint® eMagazine2010 Special

<?xml version=”1.0” encoding=”utf-8”?><Elements xmlns=”http://schemas.microsoft.com/sharepoint/”> <CustomAction Id=”Ribbon.Library.Actions.RelacementButton” Location=”CommandUI.Ribbon” RegistrationId=”101” RegistrationType=”List” Title=”Replace a Ribbon Button”> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location=”Ribbon.Library.Actions.ConnectToClient”> <Button Id=”Ribbon.Library.Actions.ReplaceRibbonButton” Command=”ReplacedRibbonButtonCommand” Image16by16=”/ _ layouts/images/demo/button16.gif” Image32by32=”/ _ layouts/images/demo/button32.gif” LabelText=”My Replaced Button” TemplateAlias=”o2” /> </CommandUIDefinition> </CommandUIDefinitions> <CommandUIHandlers> <CommandUIHandler Command=” ReplacedRibbonButtonCommand” CommandAction=”javascript:alert(‘I have replaced it!’);” /> </CommandUIHandlers> </CommandUIExtension> </CustomAction></Elements>

Replace a control Replacing a button for another button seems simular to adding a button. If you compare listing 1 and 5 you notice that the location of the CommandUIDefinition is different.

Instead of adding the button to the Controls._children collection, it overwrites the “Connect to Outlook” button. (Note: Make sure the button is there! In the previous example the button is hidden. You may need to deactivate the RemoveRibbonButton feature first.)

Listing 5: Replace a button.

Adding events to the controlThe previous examples are very basic with just “hello world” alerts. Of course in the real world you need more than that. The examples work perfectly for simple functions. But if you would like to add more advanced functionality you will need a different approach.

There are three ways to add ECMAScript on the page.

1. Target a delegate control on the page such as AdditionalPageHead. This could be used when targeting a specific list for customization. When working with a specific document library or list, the control can determine the current list and output the ECMAScript as necessary. If you are not targeting a specific list, use the ScriptLink method instead.

2. Put a Web Part on the page register script by using the ClientScriptManagerReg-isterClientScriptBlock() method of the System.Web.UI.Page object or inserting it directly into the page. This method of adding ECMAScript should be used when the Ribbon button is related to the Web Part that emits the ECMAScript.

3. Use ScriptLink for the Location attribute on a CustomAction (declarative method) Using ScriptLink as the Location attribute on a custom action places script on the page at the Microsoft.SharePoint.SPSite level. All pages in the site will have the script on the page. This type of customization should be used when the ECMAScript is used on most pages within a site.

You can use the SharePoint JavaScript API to add functionality. For example show an AJAX dialog box. In the example below we use the ScriptLink as a the Location to enable or disable the button depending on if there is a list item selected.

Page 18: MOSS eMagazine

1�

SharePoint® eMagazine2010 Special

..... <CommandUIHandlers> <CommandUIHandler Command=” NewRibbonButtonCommand” CommandAction=”javascript:alert(‘Helloworld!’); EnabledScript=”javascript:enableButton();” /> </CommandUIHandlers> </CommandUIExtension> </CustomAction> <CustomAction Id=” Ribbon.Library.Actions.MyButton.CheckEnable” Location=”ScriptLink” ScriptBlock=”function enableButton() { var IsEnabled = false; var context = SP.ClientContext.get _ current(); var items = SP.ListOperation.Selection.getSelectedItems(context); if (items.length > 0) { IsEnabled = true; } return IsEnabled; }”/>...

Install-SPFeature FeatureId Enable-SPFeature FeatureId -Url http://hostheader/sitename

Listing 6: Adding ScriptBlock.

Deployment You can deploy the customization, together with feature xml, using Windows Power-Shell using the following commands (listing 3). Where the parameter ‘FeatureId’ is the FeatureId in the Feature xml. You can scope the customizations to a site or to a particular web by using the Scope attribute in the feature.xml file.

Listing 7: Deploying customization.

Once you’ve had added and enabled the feature the CMDUI.XML with the OOB Ribbon definition will merge with the Custom Action(s) from the Feature(s).

First it will look for the CommandUIHandlers in the CustomAction. If it’s not there it will look in the page for the right Script. You can add this script adding a Page Component (PC) with the JavaScript or JScript that handles the control.

This principle is shown in figure 2.

Fig. 2: Rendering the Ribbon.

Source: SPC358.pptx - Developing with the new UI features in SP2010 - E. Olson

Page 19: MOSS eMagazine

1�

SharePoint® eMagazine2010 Special

ConclusionIt’s very easy to add functionality to the Ribbon. Using the Ribbon for the user inter-action on your Custom Lists or Web Parts the GUI will stay the same for the end user. Your customizations will be better integrated and this helps the user adopting your functionality.

Customization of the Ribbon is difficult. The Style sheet is not pretty and it is difficult to add your own styling.

Security should be considered as well by developing custom buttons. When you are a visitor you can see all of the controls. If you do not have rights to functionality the controls are grayed out. You have to add this for custom buttons as well.

SourcesMSDN - Customizing the Ribbon (http://msdn.microsoft.com/en-us/library/ee539395(office.14).aspx)

SPC09 - Developing with the new UI features in SP2010 - Elisabeth Olson

... by the way ...If you use Metadata on your Documents or Listitems it is also possible to use Metadata as a

navigation tool. In the library- or list settings click on Metadata navigation settings and add one or more Columns or Contenttypes to be used for navigation. After enabling you will see in the Quick Launch that a navigation option was added.

Tip from Jan Ligtenberg APS IT-diensten; www.apsitprojecten.nl

Page 20: MOSS eMagazine

�0

SharePoint® eMagazine2010 Special

First things firstI see many SharePoint developers that need to offer certain functionality to their client open their browser early in the process and then continue to click all kinds of options in SharePoint. Indeed, in order to supply a good solution you need to perform quite a few mouse clicks sometimes. Basically, this is not really a bad approach if, for instance, you want to demonstrate something to your client quickly. Or if you are performing functional management in an existing environment. However, if you are starting a new project you should start by considering a number of basic questions, such as: is it a Development-Test-Acceptance-Production (DTAP) -environment and how scalable should the solution be?

Two examples. A client requests a SharePoint environment with a number of webparts that can read data from various SharePoint lists. One approach might be to produce these lists in the development or test environment by using the browser.

Example 1: How do you then transfer the work that you have done in the development or test environment easily to the user acceptance and ultimately to the production environment?

Basically, SharePoint is very scalable. For instance, if you need to improve performance in an existing environment, you can easily add a web-front-end server without needing to (re-)do difficult configurations. Suppose the developer of the client’s request in the previous example, if you have made a webpart that reads certain application settings from the web.config. Each web.config in each web-front-end server will now have to include this setting.

Example 2: How can you make sure that the web.config is automatically adjusted to the application settings required for your webpart when a new web-front-end server is added to the farm?

The correct answer to both questions is: by setting up a project structure in Visual Studio for your SharePoint solution. The SharePoint solution can then be deployed simply across the SharePoint DTAP environment by using packages.

And now for realNow you need to get started with the Visual Studio extensions. I will start by describing the steps you need to take in order to be able to develop SharePoint solutions. Subse-quently, I will show you how a SharePoint solution is built up and how you can easily create a package that you can deploy across environments. Finally, I will explain why you do not need the Visual Studio SharePoint Extensions in a production environment. This article will conclude with the future and the new Visual Studio 2010 version in combination with SharePoint development.

Microsoft has released the Visual Studio extensions to allow you to quickly set up Share-Point solutions. These extensions add item templates to Visual Studio for list defini-tions, list definitions based on content types, field controls, webparts, Modules, Root Files, Templates, Event Receivers and List Instances. These extensions also add project templates for team site definitions, blank site definitions, list definitions and webparts.

Visual Studio extensions or a manually build solution?by Niels Loup

“Designing SharePoint solutions is not for me!” This is something you hear a lot from software developers. Many software developers also believe that SharePoint requires too much mouse

clicking and that the level of software development you can do for SharePoint is insufficient. But is this true? In this article I will guide you through the possibilities to get started quickly building

SharePoint solutions using Visual Studio. Together we will build a SharePoint solution. Further along this article I will show you that this is very easy when using the SharePoint extensions in

Visual Studio. Of course, you can also create solutions manually. This offers you complete freedom and flexibility, and you can decide how your SharePoint solution is structured.

Page 21: MOSS eMagazine

�1

SharePoint® eMagazine2010 Special

The Visual Studio extensions for WSS 3.0 (VSeWSS version 1.3) can be downloaded using the url below:

http://www.microsoft.com/downloads/details.aspx?familyid=FB9D4B85-DA2A-432E-91FB-D505199C49F6&displaylang=en

When installing VSeWSS you must be aware that a web service will be installed which is used by Visual Studio to communicate with SharePoint. This communication is restricted to local connections. Therefore you must add the application pool account (where the web service is hosted) to the group administrators IIS_IUSRS, Users, WSS_ADMIN_WPG, WSS_RESTRICTED_WPG, WSS_WPG and SQLServer2005MSSQLUser$.

During installation an installation wizard screen will remind you of it (see fig. 1).

Fig. 1: Wizard to add the appPool account to the group ‘local administrators’.

Once this is done, you must allow the user to access to the IIS metabase and other directories used by ASP.NET. You do this by opening an administrator prompt and entering the command:

ASPNET _ REGIIS -ga domain\user

Fig. 2: After installing the VSe a new website is created to host the web service. This manages the communication between Visual Studio and SharePoint.

At the end you need to perform an iisreset and you will be ready to continue.

Page 22: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

The first stepsNow that VSeWSS has been installed, you are ready to create your first SharePoint project in Visual Studio.

Open Visual Studio and create a new project.

By installing VSeWSS the category SharePoint will be added to the Visual Studio project templates. As shown in figure 3, you can choose new project templates. For now you will create a new Team Site Definition.

Fig. 3: Visual Studio New Project screen.

A site definition is a template for a site that can be used in a SharePoint environment as the basis for a new site. In these templates you can determine for yourself how a site should look visually. You can also define which lists, pages and other parts should be created automatically after you make a new site in SharePoint based on this template.

After you have created a project, the solution explorer will look like figure 4.

Fig. 4: Display of the solution explorer after creating a new“Team Site Definition” project.

What have you just createdIn fact the project is a class-library. That is why you will also see the well-known file assemblyinfo.cs. This assembly has to be signed with a strong name key in order to get Code Access Security policy (see note on CAS at the end of this article).

In this example it is done using TeamSiteDefinition1.snk.

Page 23: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

In the next step we will see the folder Site Definition. It contains two files Default.aspx and onet.xml. Default.aspx is the standard aspx page that is loaded when a visitor visits the site after it has been created. Onet.xml is the blueprint for the site definition. Among others in this file tells the navigation bars to be displayed, the lists and the aspx files to be created and the features to be activated on the site after it has been created.

Packages and deploymentAt the beginning of this article I explained that the correct way to add new function-ality to SharePoint is by using SharePoint solutions in the form of packages. By installing VSeWSS we have access to a number of project and item templates but also to a number of handy tools to turn the project simply into a package that can be deployed in the SharePoint environment.

If you right click on the project TeamSiteDefinition1 you will see the drop down menu with a number of SharePoint commands as shown in Figure 5.

Fig. 5: Commands that can be performed in the SharePoint project.

Step 1: Package; If you perform this command, a SharePoint solution and a package will be created for the project.

In the project folder a new sub folder “pkg” will be created. This folder is used as an intermediate folder for packaging all artifacts from the Visual Studio project into a SharePoint solution. When you open this folder you will see a number of files: solution.xml and manifest.xml. These two files contain references to the various SharePoint artifacts that will end up in the package and that need to be deployed to the SharePoint environment. For now, I won’t discuss the structure of this folder in detail. It would be good to browse to this folder yourself and explore the contents of the various files and sub directories that are created here.

As mentioned, the “pkg” folder contains the content of the SharePoint solution. The content of this folder cannot be deployed to a SharePoint environment. First you need to create a package. You can find the package in the project’s “debug” or “release” folder. In this case you will find a file called TeamSiteDefinition1.wsp in the debug directory. This wsp-file is the package that can be deployed to a SharePoint environment.

The content of the package are exactly the same as the contents of the “pkg” folder, but now compressed using the cabinet algorithm. Is it possible to see the content of a wsp-file for yourself? Sure, change the file extension to .cab and double click on the file. You will now see a structure that matches the structure of the “pkg” folder in the project folder.

Step 2: The next command, Deploy, (figure 5) deploys the package to the local SharePoint environment. Deployment in this case means that the functionality included in the package is made available to users.

Page 24: MOSS eMagazine

�4

SharePoint® eMagazine2010 Special

After the package has been deployed, you can simply create a new site in SharePoint based on the TeamSiteDefinition1 template.

Step 3: Open the SharePoint site in a browser. Then click on Site actions -> Create Site. Figure 6 shows the screen that will be opened. Give your your new site a name and choose the template TeamSiteDefinition1 from the field template selection with the tab Development. Now, when you click on “create”, your new site will be created with all the functionality as defined in the Visual Studio project.

Fig. 6: Creating a new site.

SharePoint will create a new site based on the template you created in Visual Studio. At this point, we still have not changed the standard Visual Studio project very much. Now that you have seen how easy it is to start with VSeWSS to create your own SharePoint project, you can take it to the next level by expanding the Team-SiteDefinition1 project with lists, also created automatically with the creation of a new site based on the template in SharePoint. Try adding some new items to the project yourself as shown in figure 7.

Fig. 7: Adding items to a SharePoint project

Are there other ways?Tools, such as the VSeWSS automate a lot of manual steps. You can also choose to do all the work that VSeWSS does yourself. That way you can set up your own project structure and add the manifest, site definitions, list definitions, content types, site columns and all other SharePoint artifacts that you may need in your project. This article will not explain these steps in details. However, this is an alternative with many advantages and disadvantages.

Page 25: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

The big advantage of VSeWSS is that you can start building the solution you envision quickly. You do not need a lot of knowledge of all the options of the SharePoint solutions and how you can set them up manually. The disadvantage of the extensions is that you are bound by the structure that is generated for you when you create a new project or item that is based on one of the SharePoint Visual Studio templates.

The main advantage of setting up your SharePoint solution manually is that it offers you maximum freedom on the solution structure. Often you will use a standard approach, but you can easily add changes for a specific client or project. The disad-vantage of manually managing your SharePoint solution is that it requires you to have in-depth knowledge of the WSS solution framework.

SharePoint templates in the year 2010 In this article I described how the Visual Studio extensions can help software devel-opers with little or no SharePoint experience to easily create their own SharePoint solutions. My research is based on Visual Studio 2008 and VSeWSS 1.3.

But what will this be like after Visual Studio 2010 is released? Will a new version of the Visual Studio extension be released as well?

No new version of VSeWSS will be released after version 1.3. Instead Visual Studio 2010 will be expanded with a large number of SharePoint project and item templates. On the Somasegar blog (http://blogs.msdn.com/somasegar/archive/2009/02/19/sharepoint-tools-support-in-visual-studio.aspx) the following statement has been published:

Visual Studio 2010 will come with a broad set of project and items templates.You’ll be able to use these to quickly create or update SharePoint elements such as list definitions, list instances, site definitions, workflows, event receivers, Business Data Catalog models, and content types.

Right now the Beta 2 version of Visual Studio 2010 has already been released. The Beta 2 does not include the above mentioned SharePoint templates. Writing this, we unfortunately do not have a preview available for you.

1 Code Access Security (CAS) is part of the .NET framework. CAS prevents code from executing un-authorized opera-tions and allows administrators to configure policies. When the CLR loads an assembly it will be interrogated to identify the code group which the assembly belongs to. A code group has a permission set (one or more authoriza-tions). When an assembly executes a certain action, it will also execute a code-access-demand which will cause the CLR to traverse through the call stack and check which permissions have been granted to the assembly. Code groups are collections of permissions sets and are set/managed by the administrator.

... by the way ...

TIP1: The SharePoint 2010 developer dashboard gives a breakdown of the request and response cycle with timings for each operation. This means the dashboard can be used to track down why a certain page in your environment is slow. Even if the page doesn’t contains any custom code.

TIP 2: In SharePoint 2010 profile pictures will no longer be stored in the user’s My Site. They will now be stored in a central library on the My Site Host site collection (http://<mysitehost>/UserPhotos/).

Tips from Mirjam van Olst (Macaw) http://sharepointchick.com

Page 26: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Working With Data in SharePoint Designer 2010by Laura Rogers

The data view web part has been referred to by some, as the Swiss Army Knife of SharePoint. This flexible web part can be used to display and aggregate data from various sources. Organizations

often have data dispersed on multiple platforms other than SharePoint. With the functionality leveraged by data view web parts, there is the potential for a singular repository accessible by the end users. Now the information and data of interest can all be displayed in one place – SharePoint.

Data View Web PartsSharePoint Designer is the tool used to create data view web parts. In this article, the data view web part and its evolution will be introduced. The new interface and functionalities will also be covered.

Why create a data view web part in the first place? There are several reasons:

1. The data lives in another location besides a SharePoint list or library, such as a database, an XML file, or a web service.

2. The data exists within a SharePoint list or library, but the view needs to be customized further. Once the limitations of regular list views in the browser have been reached, customizations such as formatting can be taken to the next level.

3. The data exists in SharePoint, but not within the default list or library fields. Some data is only accessible through SharePoint’s built in web service layer, which can interact with servers, sites, and lists.

HistoryThe data view web part has been around since SharePoint Portal Server 2003 and WSS 2.0. Back in 2003, Microsoft Office FrontPage was used to create data view web parts. With Microsoft Office SharePoint Server 2007 and WSS 3.0, FrontPage has evolved into SharePoint Designer. In regards to SharePoint 2010, which is currently in its Beta release, SharePoint Designer 2010 will be used for the creation of data view web parts. SharePoint Designer 2010 is not compatible with older versions of SharePoint. Figure 1 displays the new user interface.

Fig. 1: SharePoint Designer 2010 User Interface.

Step-By-StepData view web parts can easily be created by non-developers, and the three steps are: select a data source, pick the fields to display, and then customize the way the data is viewed. These steps will be covered below and the new SharePoint Designer 2010 capabilities will be highlighted.

Page 27: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Security Note: At the web application and site collection levels, there are SharePoint Designer Settings, in which to lock down the use of this software. Administrators have the option to disable the use of SharePoint Designer, or just certain aspects of it such as customizing master pages.

First, a data source is selected. The Data Source Library is the main interface for accessing and managing data sources within SharePoint sites. By default, all of the lists and libraries on the current site are listed as data sources. Once the SharePoint site has been opened in SharePoint Designer 2010, follow these steps to add additional data sources:

Click Data Sources in the left pane. This screen will display the Data Sources tab in the ribbon at the top of the screen, shown in Figure 2.

Fig. 2: List of Data Source Types.

On this screen, new data sources can be added, using the buttons in the ribbon. New data source types include Linked Data Sources, Database Connections, SOAP Service Connections, REST Service Connections, and XML File Connections. Note that a Linked Data Source is unique in that it merges or joins two or more data sources to create a new one.

Once the target data source exists in the list of the site’s data sources, the data view web part can be inserted on a page. Open an .ASPX web part page in SharePoint Designer, and put the cursor in the desired web part zone. In this example, the web part page is called “ExampleDVWP.aspx”. The Policies document library will be used, which contains all of the corporate policies. Click the Insert tab on the ribbon, and click Data View to choose a data source. See Figure 3.

Best Practice: Create a blank web part page on which to develop the data view web part. When complete, save the web part (see Figure 9), which can then be inserted in any location in the site collection. Using this practice helps avoid having a work in progress on production pages.

Page 28: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Fig. 3: Insert a Data View.

The Policies document library is selected, which automatically inserts the library on the page, with some default columns displayed. When the data view web part is clicked on (selected), the contextual ribbon shows a List View Tools section. The Data Source Details pane can be displayed by clicking Data Source Details on the Options tab. This pane displays fields that exist within the current data source.

The RibbonThe new ribbon interface is everywhere in Microsoft products now, and SharePoint Designer 2010 is no exception. “Ribbon” is the terminology that describes the panel at the top of the screen, which contains a set of contextual toolbars.

Fig. 4: The Options Tab.

In Figure 4, the List View Tools are displayed in the ribbon, which includes four tabs. These tabs are Options, Design, Web Part, and Table. All of the functionality of Share-Point 2007 is still here. One of the main differences between older versions, and SharePoint Designer 2010, is that settings are easier to find. When tasks need to be accomplished in this product, there are now less menus and dialogue boxes to click through.

The Options TabThe Options tab contains some of the familiar data view concepts, such as filtering, sorting, grouping, paging, parameters, web part connections, and the ability to add and remove columns. There are also a few new items here that are worth mentioning.

Page 29: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Filtering Narrow down the list of items returned, by specifying a subset of data.

Sorting Determine the order in which the data is to be displayed

Grouping Set groupings on data, according to data in one or more fields. These groupings

can be collapsed or expanded.

Paging Set the number of list items to be returned per page of data.

Parameters Specify parameters coming from different sources such as cookies, form values

and query string variables.

Formula Insert a formula into the data view web part, such the calculation of the sum of the data in two fields.

Web Part Connections Connect web parts to each other to pass filter data or parameters.

Add/Remove Columns Add or remove data fields to the view.

Conditional Formatting When a selection has been made in the data view web part, the conditional

formatting drop-down box will display options as to which content needs to be formatted. Once the content is chosen such as row, column, or selection, then the user is prompted to create the condition (rule). Conditional formatting is not a new feature, but the new interface makes this feature more readily accessible.

Inline Editing When the Inline Editing toggle button is pressed, a new (seemingly empty)

column will appear as the leftmost column in the data view web part. It won’t be apparent within this design view, but when the page is saved and previewed, the inline editing button will be displayed. When this new button is clicked, the fields in the row become editable directly in the list view. Note that the inline editing capability is also available when creating regular list views in SharePoint 2010, and is not limited to the data view web part.

Show List Item Menu In the browser view of a document library, the list item menu associated with

each record has typically been available on the Title field of each SharePoint list. In SharePoint Designer 2010, we now have the ability to choose the field(s) on which to display this menu. The options for this configuration are shown in Figure 5.

Fig. 5: Field-Leve Common Tasks.

Asynchronous Update There is a new check box called asynchronous update. With this option enabled,

the data becomes dynamic, and the Refresh Button and Refresh Interval options also become available. If the Refresh button is checked, an icon will be placed at the top right of the web part, for end users who choose to refresh the displayed

Page 30: MOSS eMagazine

�0

SharePoint® eMagazine2010 Special

data. Refresh Interval allows automatic data refresh at the interval you specify, as shown in Figure 6.

Fig. 6: Asynchronous Update Options.

Folder Scope If there are folders in the data source, choose whether to display them, or

display all list items without consideration for the folder structure.

The Design TabThis tab contains options related to the design and formatting of the data view web part as a whole. This tab is displayed in Figure 7. Again, most of the options on this screen are not new, they are just easier to get to, with less clicks.

Fig. 7: The Design Tab.

Show/Hide The ability to choose whether sample data is displayed is useful when working

with a list that has no data displayed. The totals row check box will insert a row at the top of the data table, displaying a field that totals each column.

View Style Choose the visual style of the data that is displayed. Examples are displayed on

each button. Note that when changing the view style, the currently displayed list columns will be reset. It is a best practice to select a view style toward the beginning of the data view design, so that customizations will not be lost.

Toolbar This is a web part setting. Choose to display the full web part toolbar, a summary

toolbar, or none. An example of the summary toolbar is displayed in Figure 10.

Actions Insert data view controls on the form, or customize the form’s XSLT code.

Preview The preview section contains options to preview how the data will be displayed

under various circumstances, such as determining how many sample items are displayed in the list during web part creation in SharePoint Designer. Some new items to note are the last three in Figure 8.

Page 31: MOSS eMagazine

�1

SharePoint® eMagazine2010 Special

Fig. 8: Data View Preview Options.

‘No Matching Items’ Template By default, when there are no items in the list or filtered view, the following

text is displayed: “There are no items to show in this view of the “ListName” list. To create a new item, click “New” above.” In a document library, the default text is: There are no items to show in this view of the “LibraryName” document library. To create a new item, click “New” or “Upload” above.

This ‘No Matching Items’ template allows for customization of the page that is displayed when there are no items in the view. Not only edit the displayed text, but the page itself, which could include images, links, or any free-form customi-zations.

Edit Template Only available when inline editing has been enabled on the Options Tab. The

Edit Template is the page that end users see when inline-editing a list item.

Insert Template Only available when inline editing has been enabled on the Options Tab. This is

the form interface when end users are using inline editing to insert a new row of data in the list.

The Web Part TabThe web part tab consists of web part properties from the familiar web part toolpane in the browser, and is displayed in Figure 9.

Fig. 9: The Web Part Tab.

Web part options are illustrated using the following screenshot of a web part in the browser. See Figure 10.

Fig. 10: Anatomy of a Web Part.

Page 32: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Web Part Title The web part title can be configured. By default, this displayed title is the name

of the data source, but can be changed. For example, the title of a filtered library view of items modified by me, can be changed to My Modified Documents. This makes the title more descriptive of the items contained in the current view. Use the Properties button to elicit the web part properties screen, which contains more settings.

Appearance The chrome is the frame of the web part. The chrome type is an option to display

the web part title, a border around the web part, neither, or both. The chrome state options are normal or minimized. Liken this setting to minimizing and maximizing windows in the operating system. If a web part is set as minimized by default, end users must click a button to maximize it in order to view the contents.

Size By default, a web part is automatically sized to the part of the page in which it

is added. Alternately, specific dimensions may be hard-coded.

Connections Add new web part connections, and if web part connections already exist, click

to “Manage Connections”.

Allow This section contains options for actions that will be available for end users to

take, when it comes to modifying the web part.

Save Web Part The ability to save a web part from within SharePoint Designer is new. When

saving a web part “To File”, there is simply a prompt to pick a location on the hard drive in which to save this .WEBPART file. When saving a web part directly to the site’s web part gallery, there is a prompt to configure the web part’s name and description for the gallery listing. See Figure 11, which displays the prompt that is shown when saving a data view web part of a document library called “Policies” to the site gallery.

Fig. 11: Save Web Part to Site Gallery.

After clicking OK to save the web part to the gallery, there is yet another prompt:

Do you want this web part to always show List data from the current Web site http://site.yourcompany.com? If you select No, the Web Part will show data from the list at the path Policies, relative to the site in which it is used.

What does this mean? Here are the two options available when saving the web part to the gallery:

Page 33: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

1. Show list data from the current web site. This means that this exact list of the same “Policy” documents will be displayed when the web part is inserted anywhere in the site collection. In this case, there is only one “Policy” document library, and changes will be propagated to all instances of this web part.

2. Show data at the list relative to the site in which it is used. In this situation, there could be various departmental sites, each with their own “Policies” document library. Inserting this “Policies” web part would apply the current web part view to the “Policies” document library for that department.

The Table TabThis tab consists of options for formatting the data table. See Figure 12.

Fig. 12: The Table Tab.

These table options are the same familiar options that exist within other Microsoft Office products, like Excel and Word.

Other New FunctionalitiesBesides the new data view web part tabs in SharePoint Designer 2010, there are some other new functionalities to take advantage of, which will be highlighted in the next sections.

Field LevelWhen right clicking on any field in the data view web part, there are several options. Tasks such as creating hyperlinks can be accomplished quicker in SharePoint Designer 2010, meaning fewer clicks. As shown in Figure 13, when Format item as is selected, and Hyperlink to, there are options to create links to the form’s New Item, Edit Form, or Display Form pages.

Fig. 13: Field-Level Formatting.

Quick Tag EditorThe Quick Tag Editor is a new option for quickly editing the code for just one element on the web part page. Select an item on the page, and on SharePoint Designer’s Home tab, click Quick Tag Editor, which is shown in Figure 14. The snippet of code related to the current selection is shown, with drop-down options to Edit Tag, Wrap Tag, or Insert HTML.

Page 34: MOSS eMagazine

�4

SharePoint® eMagazine2010 Special

Fig. 14: Quick Tag Editor.

Skewer ClickUse the new Skewer Click button to select an element on the page, or its parents or children. For example, click the Skewer click button on the Home tab, and then click on a cell in a table on the web page. This will elicit a drop-down type menu that contains a selectable list of the elements on the page.

ConclusionThis has been a brief, high level overview of some new functionalities with regards to creating data view web parts in SharePoint 2010, using SharePoint Designer 2010. Several new functionalities have been highlighted, along with basic instructions to get started with these web parts. The data view web part allows for advanced user interfaces to back end data to be built quickly and easily, with the ability to avoid custom programming.

When building custom solutions in SharePoint, data view web parts are very useful when appropriate. When the limitations of a regular list view have been reached, the data view web part is the next step. Once the limitations of a data view web part have been reached, custom programming may be required.

Page 35: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Resource Measure Resources Per Point AbnormalProcessTerminationCount 1 terminationCPUExecutionTime 3600 secondsCriticalExceptionCount 10 exceptionsInvocationCount 100 invocationsPercentProcessorTime 85 ProcessCPUCycles 100000000000 cyclesProcessHandleCount 10000 handlesProcessIOBytes 0 ProcessThreadCount 10000 ProcessVirtualBytes 0 SharePointDatabaseQueryCount 20 queriesSharePointDatabaseQueryTime 120 secondsUnhandledExceptionCount 50 exceptionsUnresponsiveprocessCount 2 processes

Sandboxed Solutions in SharePoint 2010by Mirjam van Olst

SharePoint 2010 introduces several new concepts, one of which is Sandboxed Solutions.This article will explain about the what, the why, the when and the how.

What?Sandboxed solutions (.wsp files) are packages of custom SharePoint artifacts that can be uploaded to and deployed from a Solutions Gallery at the site collection level by site collection administrators. The sandboxed solution is completely isolated to the site collection it is deployed to. This also means that the functionality in the solution can only be used within that single site collection.

Sandboxed solutions are completely isolated to the site collection they are deployed to.

To enable completely isolating the sandboxed solution to the site collection a couple of special measures have to be taken.

n Sandboxed solutions are deployed to the database. This means that no files within the sandboxed solution will ever touch the file system of the server. Even dlls, xml files and aspx pages will be deployed to the database.

n Sandboxed solutions run within a special process, the Sandbox Worker Process (SPUCWorkerProcess.exe). The sandbox worker process makes sure the artifacts from the solution can be used as though they were deployed to the server itself and it will enforce the limits of a Code Access Security (CAS) policy on the contents of the solution. The following permissions will be granted to the solution by the CAS policy:

w SharePointPermission.ObjectModel

w SecurityPermission.Execution

w AspNetHostingPermission.Level = Minimal

n When using sandboxed solutions a farm administrator can assign “resource points” to a site collection. The default quota is 300 points per day and points are calculated based on 14 different metrics. These metrics were chosen because they impact the health and stability of the server. The use of resources that have a higher impact on the server will cost you more points. The metrics are called ResourceMeasures and since they can’t really be normalized each of them has a ResourcesPerPoint property.

Table 1: Resource measures and resources per point.

Page 36: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

When the sandboxed solutions in a site collection use more than the assigned amount of points in a single day the sandboxed solutions in that particular site collection are shut down by SharePoint. This means that end users won’t be able to use the functionality of any sandboxed solution in that specific site collection until the resource points are reset. The quota is per day, so after 24 hours the site collection will be unlocked and sandboxed solutions in that site collection can be used again. One badly designed sandboxed solution will cause the other sandboxed solutions in that same site collection to become unavailable to the end user. After 24 hours the number of used resource points are reset, so sandboxed solutions in the site collection will start working again, but it will be important to filter out the bad solution and change or remove that, to prevent it from shutting down all sandboxed solutions in the site collection again.

Because a sandboxed solution is completely isolated to its site collection only a subset of the Microsoft.SharePoint object model can be used. Only objects that operate within the current site collection are available to you, when you are building a sandboxed solution. The list below is an overview of objects from the SharePoint object model that can and can’t be used in a sandboxed solution.

n Microsoft.SharePoint Except

w SPSite constructor

w SPSecurity object

w SPWorkItem and SPWorkItemCollection objects

w SPAlertCollection.Add method

w SPAlertTemplateCollection.Add method

w SPUserSolution and SPUserSolutionCollection objects

w SPTransformUtilities

n Microsoft.SharePoint.Navigation

n Microsoft.SharePoint.Utilities Except

w SPUtility.SendEmail method

w SPUtility.GetNTFullNameandEmailFromLogin method

n Microsoft.SharePoint.Workflow

n Microsoft.SharePoint.WebPartPages Except

w SPWebPartManager object

w SPWebPartConnection object

w WebPartZone object

w WebPartPage object

w ToolPane object

w ToolPart object

Why?

As a developer you can deploy your own solution, you don’t have to wait till the farm administrator can deploy your solution, which makes you more agile.-As a farm administrator you can be certain that whatever a developer creates and deploys, it can never run under full trust and it can never bring you entire farm down.

In SharePoint 2007 the SharePoint Solution framework was introduced. This framework makes it possible to package and deploy solutions for SharePoint in a consistent and managed way.

Solutions are deployed by farm and server administrators and artifacts from that solution can be deployed to the file system of the SharePoint server and are available within the entire farm.

Page 37: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

These solutions, that are called Farm solutions in SharePoint 2010, often run under full trust, because either they are deployed to the GAC, or the trustLevel of the web application is set to Full. With sandboxed solutions the solution can be deployed by a site collection administrator and it can never run under full trust.

This has two major advantages:

n From the developer’s perspective, you can deploy your own solution, assuming you are a site collection administrator. You don’t have to wait till the farm administrator takes the time to review and deploy your solution. This makes you more agile.

n From a farm administrator’s perspective you can be certain that whatever the developer creates and deploys, it can never run under full trust and it can never bring your entire farm down.

An obvious disadvantage for developers is that you can’t use the full object model and that there are certain types of solutions that can’t be built as a sandboxed solution.

The development of sandboxed solutions has been triggered by SharePoint Online, by far the largest SharePoint implementation at the moment. SharePoint Online is a hosted SharePoint environment that is being used by many companies, both large and small ones. Depending on the type of service they chose, SharePoint sites for several companies might be hosted on a single farm. This means that there are serious consequences to deploying custom solutions to that farm. Some functionality that can be deployed using solutions might be available to all customers on that farm and that might not be desirable at all. Also, if a solution was developed in a poor fashion it might bring the entire farm down, which will affect all customers on that server. Because of this, if you are using shared hosting on SharePoint Online 2007, you are not allowed to deploy custom solutions.

With SharePoint 2010 you can deploy your sandboxed solutions to your own site collection, which will give you the flexibility you need and the farm administrator the stable environment he wants.

When?

If you are developing a solution for SharePoint 2010, your first choice should be to create a sandboxed solution.

So when would you choose to use sandboxed solutions and when would you use could old farm solutions?

If you are developing a solution for SharePoint 2010, by default you should create a sandboxed solution. It’s like when you are creating a new solution using Visual Studio 2010. The default choice, when selecting the type of solution, is sandboxed solution.

Some of the capabilities and elements that you can create using sandboxed solutions are:

n List definitions

n List instances

n Onet.xml

n WebTemplate Feature (you can’t use Webtemp.xml in sandboxed solutions)

n Content Types/Fields

n Navigation

n Module/files

n Feature callouts

n Web Parts derived from System.Web.UI.WebControls.Webparts.WebPart

n Event receivers (on items, lists and webs)

n Custom Actions

n Workflows

Page 38: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Things that are definitely not available in sandboxed solutions are:

n Custom Action groups

n HideCustomAction element

n Content Type Binding

n Web Application and Farm scoped Features

n Timer Jobs

n Visual Web Parts

So if you want to use one of these capabilities you need to build a farm solution.

Also, if you are developing a solution that should be available in all (or a lot of) site collections you are probably better of using a farm solution. After all if you want to make a sandboxed solution available in more than one site collection you will have to deploy it to every site collection you want to make it available in. When you build a farm solution you only have to deploy it once and it will be available throughout the web application or farm.

How? After all this talk it’s time for some action. We are going to create a site template using an onet.xml file and a WebTemplate feature.

But before we can start the actual development we need to make sure that our environment is ready for running sandboxed solutions.

First of all the sandboxed solution service needs to be activated. To do this you browse to the Central Administration web site and you click “System Settings” and select “Manage services on server”. Now find the “Microsoft SharePoint Foundation User Code Service” and start it.

Fig. 1: Activate the user code service.

If you are running SharePoint 2010 on a Domain Controller you need to run the PowerShell script displayed in figure 2 to add an ACL Access Rule to enable Sandboxed Solutions. If you don’t add this Access Rule starting the User Code Service won’t start all the necessary processes.

Fig. 2: PowerShell script to add an ACL Access Rule.

Second, go to “Application Management” and select “Configure quotas and locks”. Select the site collection you want to deploy the sandboxed solution to and check whether the “User Solutions Resource Quota” to the value you want it to have. Unfor-tunately there are no best practices available at the moment, so it’s probably best to leave it at the default and lower it when you notice your environment resources get drained by your sandboxed solutions, or make it higher when you have got plenty of environment resources and your sandboxed solutions are starving.

Page 39: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Fig. 3: Set the user solutions resource quota.

Now that we’ve set up our environment correctly we are ready to start building a sandboxed solution.

n Start by opening up Visual Studio 2010

n Create a new “Empty SharePoint Project” and give it an appropriate name, for instance “SandBoxedSiteTemplate”.

Fig. 4: Create an empty SharePoint project.

n Fill in the URL of a SharePoint site on the machine you’re working on and leave the trust level at “Deploy as a sandboxed solution”.

n You’ve now got an empty Visual Studio SharePoint project. This project by default contains a Features and a Package section and a key.snk key.

Page 40: MOSS eMagazine

40

SharePoint® eMagazine2010 Special

Fig.5: Empty SharePoint project.

n Add a new Module to the solution and name it “AlternateTeamSite”.

Fig. 6: Add a new module to the SharePoint project.

n You should now be able to see your module in Visual Studio’s solution explorer. Visual Studio also created a feature for you, that by default is called Feature1.

wRename this feature to “SiteTemplateFeature”.

wDouble-clicking on SiteTemplateFeature opens the feature designer up.

wChange the title of your feature to “Fancy Site Template Feature” and add a description for the feature, for instance, “This is a fancy site template feature that is deployed as a sandboxed solution and therefore only available in this site collection.”

wAlso change the scope of the feature to “Site”. If you forget to change the scope before you deploy the feature for the first time you will have to create a new feature, as changing the scope of an existing feature is not allowed and won’t work.

You can see in the feature designer that Visual Studio already added the Alternate-TeamSite module to the feature for you.

Page 41: MOSS eMagazine

41

SharePoint® eMagazine2010 Special

Fig.7: The new feature designer in Visual Studio 2010.

n Open the Elements.xml file from our AlternateTeamSite module. As you can see Visual Studio helped you out here again. It added a Module element that references the Sample.txt file that is added to a new module by default. If you delete the sample file, or add new files they will be added to the Elements.xml file automatically.

w We are now going to add a new WebTemplate element to the Elements file and we will place this above the Module element.

w The “Name” needs to be the same as the name of your module, or your deployment will fail.

w The “Title” and the “Description” are shown in the user interface when a user wants to use your site template to create a new site, so choose something a user will understand.

w Because we will base our site template on the default Team Site template, we fill in a BaseTemplateID of 1 and BaseConfigurationID of 0. The BaseTem-plateName is STS.

w If you want to you can fill in a DisplayCategory, I’ve given it the very appro-priate name “Fancy Sites”.

Fig. 8: Elements.xml file with WebTemplate element.

n Next step is to add a new XML file to the AlternateTeamSite module. Name the XML file “onet.xml”.

Page 42: MOSS eMagazine

4�

SharePoint® eMagazine2010 Special

Fig. 9: Add new onet.xml file to the project.

n Find the standard Team Site onet.xml in the folder “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\Site Templates\sts\xml” and copy the contents of the file to your own onet.xml file. Of course creating a site template that is an exact copy of the standard team site site definition isn’t really useful, but that doesn’t matter

n Delete the Sample.txt file from the module.

n In Visual Studio, go to View and select Output. This will show the Output window

n Right-click on the solution name and select “Deploy Solution”.

n In the Output window you can see the steps that are performed while the solution is being deployed and this shows us some interesting things:

w You can see that no IIS application pool recycle is done, because we are deploying a sandboxed solution.

When you deploy a farm solution SharePoint will always do an IIS application pool reset, which will cause your site to be unavailable to the end users for at least a couple of seconds. In most production environments this is not acceptable, which means that you can’t just deploy your solution when it’s ready, but you need to wait for a dedicated maintenance window.

w Visual Studio not only adds and deploys the solution on your SharePoint site, it also activates the features. If you don’t like this behavior you can change it in the deployment configurations of the SharePoint section of the solution properties.

w The last line of the output window should state “Deploy: 1 succeeded, 0 failed, 0 skipped”.

Fig. 10: Output window with output from sandboxed solution deployment.

Page 43: MOSS eMagazine

4�

SharePoint® eMagazine2010 Special

Your sandboxed solution is now deployed and ready for use!

We can check whether it all went according to plan by opening up a couple of pages in the SharePoint site.

n Go to the SharePoint site that you deployed your solution to.

n Click “Site Actions” and selected “Site Settings”.

n Choose “Solutions” under “Galleries”. You should be able to see your solution here and the solution’s status should be activated.

Fig. 11: Solution Gallery containing an activated sandboxed solution.

n Next go back to site settings and select “Site Collection Features” under “Site Collection Administration”. You can see the Active feature “Fancy Site Template Feature” here.

Fig. 12: Overview of Site Collection Features with Fancy Site Template Feature.

n To create a new site using the template click on “Site Actions” and select “New Site”. If you used your own display category that should be visible on the left side and selecting it will show you the “Fancy site template” with our fancy description on the right. Also on the right you can fill in a name and a URL to create a new site based on this template. Click “Create” to actually create the site.

Fig. 13: Create a new site based on the fancy site template.

Since we didn’t change anything in the onet.xml of the standard team site definition your site should look just like a standard team site. If you succeeded in performing all these steps you have now officially created your first sandboxed solution AND your first WebTemplate feature.

Page 44: MOSS eMagazine

44

SharePoint® eMagazine2010 Special

0 1 1 0 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 1 0 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 0 0 11 1 0 1 1 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 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1 0 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 1 0 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 0 0 0 0 0 1 1 10 0 0 1 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 0 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0

a new and easy way toclassify and restructureyour organizational data

and move it to Microsoft SharePoint

Visit CiiGrid.Com/SDN to receive a 25% discount( valid until February 28th, 2010 )

www.CiiGrid.com"We have declared war on the Document File Server"

Fig. 14: Site created using the new fancy site template.

So...So you now know that a sandboxed solution is a SharePoint solution that operates within the boundaries of a site collection. You know that sandboxed solutions were created to make it possible to develop SharePoint solution in a more agile way, without making compromises to the stability of your environment. You know that you choose to use a sandboxed solution over a farm solution whenever possible and as long as your solution is targeted at the use in a single site collection, or in very few site collections.

The Visual Studio 2010 Tools for SharePoint 2010 have improved vastly compared to the Visual Studio 2008 Extensions for WSS. The tools will help you to setup your solution, to create SharePoint artifacts and to package and deploy your solution.

Page 45: MOSS eMagazine

4�

SharePoint® eMagazine2010 Special

New ECM features in SharePoint 2010Robert van Son

From the first release of SharePoint, it has always been its philosophy to provide a platform for unstructured content. A lot of organisations had (and some still have) their content stored all over the enterprise. Documents are stored on file shares, in very inflexible folder structures. Customer

information is stored in a CRM system and employee data in a HR system and their knowledge profiles are usually stored in their own brains. SharePoint is the platform that brings all of this

information together in one place. Content can be combined and found through simple but very powerful search features. All of this can be accessed by just using a browser, making the content

available anytime, anywhere.

Since the launch of SharePoint in late 2000, the feature to manage all of the content has evolved into an extremely powerful platform. SharePoint 2010 will add its bit to those features presenting the user with a great new set of Enterprise Content Management (ECM) functionality. Obviously, Microsoft has put a lot of effort in making SharePoint better for large enterprises. Additionally smaller deployments of SharePoint 2010 benefit from these new features. This article provides an overview of some key developments for end users who will need to work on ECM with SharePoint 2010.

Managed Content TypesWhen you take a look at all of the information in your own organisation, you will recognize different types of content. On a portal, you might want to publish news articles; in a document library, there can be user manuals and documents describing a company policy. Besides the actual content like text and dates, the same types of content will contain the same elements. A news article, for instance, will have a title, a body text, a publishing date and an expiration date. To make sure all news articles are created in the same way in SharePoint, you can create a content type called ´News Article´. This content type will define which fields are necessary to create a news article and set the rules for these elements (for instance, it should always have a title and the publishing date must be a valid date). All news articles created based on this content type will inherit these rules. One can define the metadata that must be entered when storing the document to a SharePoint library for different sorts of documents, such as a policy document. You can enforce the end user to describe what type of policy it is and who its owner is. Therefore setting up a good design for these content types is crucial when implementing SharePoint. However content types will change over time and therefore it becomes necessary to have good management support. SharePoint 2010 offers a new feature called ‘Managed Content Types’.

In MOSS 2007, content types are restricted to the site collection in which they are created. SharePoint 2010 offers the ability to manage the content types outside of the borders of a site collection making them available to other site collections and even other web applications. Content types can be created within a master site collection (defined as a hub) and from there published around the enterprise. For instance, when a new policy is defined that instructs that documents need to have an expiration date, the appropriate content type at the hub must be changed first; only then can it be republished. All consumers of the hub that have subscribed to this content type will be notified. By accepting the changes, its own content type is updated with the adjustments.

When a consuming site uses a published content type from the hub, it is available read-only. Consequently, no changes can be made to the content type at the consuming site. It can, of course, create its own content types based on the published one, extending it with its own metadata. When a content type is unpublished at the hub, it becomes editable at the consuming site.

Page 46: MOSS eMagazine

4�

SharePoint® eMagazine2010 Special

Managed MetadataMetadata is “data-about-data”. It provides extra information about the content that is stored on your SharePoint portal. Metadata can be divided into two categories ´Contextual Metadata´ and ´Descriptive Metadata´. Contextual Metadata are fields that are automatically assigned to the content. Examples are ́ Created By´ and ́ Created on´. Descriptive Metadata are fields that add additional information to the content. A contract can have an expiry date and a policy document can have a department to which it applies. Metadata is used to structure, identify or sort the content. In Share-Point, you can also assign actions based on metadata such as workflows to handle content.

In MOSS 2007 metadata was handled locally in either content types or at a list or library level. Many organisations require the use of centrally administered and approved metadata. Site columns can be used for this, but if metadata is needed for more than one site column, the metadata needs to be re-entered in a new site column. One of the most revolutionary ECM features in SharePoint 2010 is managed metadata. This provides the site administrator with the ability to centrally define a taxonomy. This taxonomy becomes available throughout the entire SharePoint environment. You can create and manage the taxonomy with the ´Term store management´ tool in the site setting of SharePoint 2010. Here you can create a central taxonomy. The terms can be grouped in a tree-like structure. The top level contains the metadata service. Followed by, at the first level, term groups. Below a group, a tree structure can be created containing term sets and terms. Terms will be used to tag the content items. This can be seen in the following figure (figure 1):

Fig. 1: Overview of a Taxonomy tree structure.

Using managed metadata with contentNow content types can contain a column based on the managed metadata. When creating a column of this type, you can specify which metadata is valid for this content type. You can specify which of the available metadata you want to use for this site, or if you want to use just a group or terms set within the taxonomy. When a content item based on this content type is used, all terms are available from the selected level down. When using managed metadata with a column of a content type, you can allow the user to add terms -when an item is created or edited by allowing ‘Fill-in’ choices. The ‘Submission Policy’ of the linked parent term set need to be set to ‘Open’ to enable this feature. In information management terms, the store used

Page 47: MOSS eMagazine

4�

SharePoint® eMagazine2010 Special

for the managed metadata turns from a taxonomy to a folksonomy. End-users are allowed to add terms themselves, enabling a more organic growth of the taxonomy. This is a very flexible taxonomy, and not all organisations will think their end users will be able to use this correctly. Of course, you can use both options in the same content type by adding two metadata columns. With some search customisations, the centrally managed metadata field can be weighed as more important to manage search results.

When adding a content item which requires the use of managed metadata, the user can start typing a term in the input box. The SharePoint Fluent UI provides a type-ahead feature which suggests certain terms.

Fig. 2: Type-ahead suggestions of managed keywords.

The user can also use the item picker to browse through the metadata structure. When fill-in choices are allowed, the user can add an item from the term picker.

Fig. 3: Using the term picker to add keywords.

The managed metadata terms are also available in the Office client applications. This can be done in the document information panel in the Office Backstage view.

Page 48: MOSS eMagazine

4�

SharePoint® eMagazine2010 Special

Fig. 4: Adding keywords directly from Word 2010.

Other managed metadata featuresn Synonyms can be added to terms. When a synonym is used by the end user in

the managed metadata input box, SharePoint will automatically suggest the right term.

n Terms can be copied, moved, reused (copied to another location, but as a link to the original term), depreciated (making it unavailable for new assignments) and merged. In case of merged terms, the type-ahead function will automati-cally suggest the term with which the entered term was merged.

n Multi language. Every term can be translated to different languages. Share-Point 2010 will use the translation corresponding with the language that is used for the site.

Document managementAs said before, document management has come a long way since the launch of the first SharePoint platform. Previously, documents were stored on files servers, making them very hard to find and hardly accessible from outside the office premises. Giving access to some of the documents to an outsider was nearly impossible. An alternative was implementing a Document Management System (DMS). They were (and some still are) really good at one thing: managing the documents. But documents are just a part of all the enterprise content and a DMS usually works pretty much on its own. SharePoint provides a platform where you can manage your documents and bring them in context with the rest of your content, inside or outside SharePoint. Already MOSS 2007 was good at managing documents; SharePoint 2010 takes document management to an entirely different level by adding numerous new features to the platform. Now file shares will be obsolete and your Total Cost of Ownership (TCO) will be reduced by migrating your DMS to SharePoint.

Large librariesIn SharePoint 2010, document libraries are much more scalable. They can now hold up to as much as 10 million + items without reducing performance. As a result, both the number of stored documents and the size of the individual documents are not bound to restrictions. This is particularly convenient in libraries that store media items.

Page 49: MOSS eMagazine

4�

SharePoint® eMagazine2010 Special

Office Web AppsWith Office Web Apps, documents can be edited within the browser. No client instal-lation of Microsoft Office is needed. Word, Excel, PowerPoint and OneNote are available online. The versions are not full featured, but provide all the functionalities that are needed to do most of the editing work.

Collaborative editing in Microsoft Word, Excel, PowerPoint en OneNote 2010

With Microsoft Office 2010, it is now possible to edit a document with more than one author simultaneously. When a paragraph is changed by one author, it will be locked for editing for the other authors. The user can see which paragraph in the document is being changed and who is making the changes. The user can update his or her opened version with the changes that are being made by the other author(s). Imagine a quotation that needs input from an account manager, a project manager and a consultant. All three can work on the same document at the same time without needing to create their own local copy and manually merging all the versions later.

Content OrganizerIn most of the cases, more document libraries need to be created. Retention settings for HR documents will differ from project documents and access rights for project documents will differ from department documents. This would mean that an author will need to know in which library his or her work needs to be stored. This is not always the case. Fortunately, SharePoint 2010 provides a great feature eliminating this problem. The ‘Content Organizer’ can deliver the content to the right library. A ‘Drop Off Library’ can be created in which all users can save their documents. Rules can be defined on this ‘Drop Off Library’ which will manage the distribution of the documents (figure 5). For instance, when a metadata name contains the name of a project, the document will be automatically move to the project document library.

Fig. 5: Adding rules to organize your documents.

Manage documents with Information Management Policy Settings

Per content type that is assigned to a document library, the following management settings can be applied:

Policy settings: This is a statement which will be shown to the users when an item of the appli-

cable content type is being created. When a quotation is being added to the library, the user can be pointed at the new general conditions that need to be handed to the customer;

Page 50: MOSS eMagazine

�0

SharePoint® eMagazine2010 Special

Retention: When enabling retention on a content type, rules can be defined to automati-

cally deal with documents in time. For instance, one can remove all minor versions of a document one year after it has been created. After two years, all major versions can be deleted and finally the document itself can be deleted or moved to another location after three years. This feature will be useful especially with records management which will be described further on;

Auditing: When auditing is enabled, all actions on the item will be logged. Reports on

audit trails will become available showing who viewed, edited, moved, copied, etc. the document;

Barcodes and Labels: These features are also available in MOSS2007 and remains unchanged in

SharePoint 2010.

Fig. 6: Information Management Policy Settings.

Document setsDocument sets enhance the use of document libraries. For example, a company might have a library containing all company policies. Within this library, you might want to separate the financial reporting policies from the IT policies. Of course, you can store documents in different folders within a document library to keep those policy documents together. However, the problem with folders is that they are not very flexible. If you create a new policy group, governance, it must contain documents from both IT policies and financial reporting policies. This means moving documents around from one folder to the next. In this case, it would have been better when all documents were given the right metadata and with the appropriate views in the library. However, what if you need to download an entire set of documents or what if you need to change a retention policy on that set? The solution is ´Document Sets´. This is actually a content type based on the folder content type. It is easy to create a new content type called´Governance´ with policies based on a document set and extend the content type with the right metadata. When the content type is created, the metadata of the document set will apply on all documents in the set. The set can then be downloaded as a ZIP file, or specific retention rules can be defined on the particular set. It is also possible to start a workflow on an entire document set.

Validation of metadataValidation based on a combination of metadata fields is also a new feature in Share-Point 2010. For instance, a contract ending date can never be earlier than its starting date. SharePoint can compare those metadata fields and reject changes when they are made. This ensures the metadata given to an item is - valid and you can rely on the quality of the data.

Document ID’sDocuments normally have a name when they are saved to a document library. Those are not necessarily unique and it is hard to enforce the end user to enter a unique

Page 51: MOSS eMagazine

�1

SharePoint® eMagazine2010 Special

name. SharePoint 2010 offers a feature to assign unique IDs to each document that is saved to a document library. When the feature ´Document ID Service´ is enabled on a site level, unique IDs can be created through combining metadata fields with a pre- or postfix, e.g. an autonumber.

Document library overview with the document centerA document center comes with a overview page of the documents and libraries within it. Basically, it is a welcome page displaying information with the newest documents and documents edited by the user. This overview is a regular SharePoint page and can be changed. For example, webparts can be added and so on.

Connect to OfficeWhen you are working on a project, you probably will need to work on documents stored on the project team site on a frequent basis. Each document library offers the ability to connect to Office. When you use this feature, the library becomes available from the Office client applications making the library easily accessible.

Records managementWhen you start with document management, legal or other governance require-ments might pop up. Tax law tells you to retain invoices for several years and there are other requirements for documents regarding research data of a pharmaceutical company. In those cases, you will need to implement records management. This means that rules need to be defined that apply to certain types of documents describing retention, user rights and audit trails.

In MOSS 2007, records management is made possible through the record center. A document becomes a record when it is stored in a record center. In SharePoint 2010, records management features are available in every document library. This is beneficial, because in spite of the fact that rules apply that a document may not be edited anymore, it might still be needed in collaborative processes. You can save the document in the document library in which it was created, or leave it in place and still use it, despite the fact that it is a record. A record center can be created and you are able to move records to that center at any time. Retention policies can be used to automate that process. You can also declare items that are added to a document library as a record either automatically or manually.

Retention rules can also go the other way. Certain laws may tell you to destroy a prospective employee’s resumé after six months after he or she applied for a job at your company. This is easy to define as described before. The user can set up a rule that automatically destroys items in a resume library after six months.

Discover and holdAssume you find yourself in a situation (in which you do not want to be:) where a client has filed a law suit against your company. You will need to build a case in your defence, but you know a lot of people worked on the customer’s projects, therefore several team sites might retain important information. The last thing you want is for users to edit or delete the information from these SharePoint sites. SharePoint 2010 offers the ability search for information regarding this customer ( SharePoint search) and block this information from the search results. In fact, all information is declared as a record at once and becomes read-only to all users. The content regarding the block can either stay at its original place or be moved to a specific library.

... by the way ...

Installing SharePoint with a local account: http://bit.ly/5jGtciSharePoint 2010 default logging is set to 1TB, make sure to ‘shrink’ it down a bit on your

development machines.Tip from Albert Jan Schot (TamTam) http://blogs.tamtam.nl/appie

Page 52: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Creating new Visual Experiences with Visio Services

by Toni Frankola

SharePoint 2010 introduces a new set of very exciting services, and one of the most exciting ones are brand new Visio Services. Visio Services is a server component that works with Visio 2010 client and allows you to easily publish, share and collaborate on Visio diagrams. The approach is exactly the same as for Excel services - you simply save or upload your Visio diagram to your Document Library and SharePoint takes care of the rest. When a user clicks on a diagram file, it

will be rendered as a web page using Silverlight. If you do not have Silverlight installed, it would render as a PNG image allowing you to see diagrams from any web browser.

Fig. 1: Sample Visio Computer Network Diagram displayed in Visio Web Accces Web Part. Silverlight component allows you to zoom-in and focus to individual elements.

Picture would render as PNG for users without Silverlight installed.

Key scenarios for Visio ServicesThere are a number of scenarios in which you could use Visio Services. As previously mentioned, you could use them to distribute your Visio diagrams to other members of your network, or to your public facing web site. Visitors do not need Visio client or plugins to preview or explore your drawing.

Fig. 2: Defining custom item display with data bar, relevant to free hard disk capacity.

Page 53: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Benefits of Visio services do not stop at just drawing sharing. You can also integrate each drawing with backend data sources. For each element in your drawing you can define a backend system and retrieve relevant data from it. For example, in our network diagram shown above we could connect to a backend database or custom data source (e.g. SCOM 2007 monitoring database) and visualize the health of your SharePoint farm.

Fig. 3: Visio Web Access displays custom visualization for each server based on capacity retrieved from a custom data source.

There are number of benefits of this approach: Visio diagrams are very easy to create, end users can easily create drawings with Visio. Integration with backend data services is also easy to understand and one can create visually appealing Drawings with colorful indicators without too much work. On top of everything you can easily publish these to your colleagues or to your web site.

Backend integration supports SQL, Excel, Access, SharePoint lists, other ODBC or OLEDB sources. You can also use existing Office connections. If your backend system requires authentication, you can leverage built in authentication mechanisms like Kerberos.

Once you have a data connection embedded in your Visio drawing you can configure the drawing to refresh allowing you to have a live dashboard of e.g. traffic infor-mation or server health monitoring.

InteractionVisio Web Services allow you to do much more than just rendering Visio files as Silver-light or PNG images. With Visio Web Access Web part you can easily display Visio images on any SharePoint page and connect it to other web parts. Let’s say you have an office floor plan created as Visio drawing. You want to publish everything on the web, and allow users to select an office they want to rent and highlight it in the main drawing.

You can see sample integration on a picture below. Visio Web Access is located in the main zone, and SharePoint list in the right zone. When User selects an office on right it is highlighted on the main web part.

Fig. 4: This figure shows two integrated web parts. In the main zone, Visio Web Access shows a Visio diagram. Visio drawing shapes (rooms) are highlighted as user clicks on

elements on the list on the right.

These connections are easy to define. In Visio drawing you need to define a name for each element you want to highlight, then create a list of Visio elements in Share-Point (in my case this is a list of offices) and type drawing elements names in one of columns of your list. Use standard Web Part Connections menu to connect the two web parts.

On top of built-in web part connections you can also use JavaScript Mash-up APIs to integrate with your existing solutions.

Page 54: MOSS eMagazine

�4

SharePoint® eMagazine2010 Special

Visio Services and Workflow visualizationYou can use Visio services for an additional, very exacting visualization - Workflow. Back in SharePoint 2007, business users had a lot of problems with tracking any Share-Point Workflows. Now they can easily navigate through Visio Web Access, zoom in to Workflow activities and track Workflows progress as Visio Flowchart. End users will love this feature as it is much easier to follow a diagram than read Workflow history lists.

Fig. 5: This figure shows simple 2 level workflow visualization. Users can easily zoom on more complex workflows and easily review workflow flow and history.

Visio integration with SharePoint workflows does not stop there, there is more! Now business users can use Visio client to design workflow flowcharts of their processes using special SharePoint Workflow Visio stencil. This stencil contains default SharePoint workflows actions and allows you to easily drag and drop them on Workflow area.

Fig. 6: SharePoint Diagram in Visio.

Diagrams created in Visio can be easily exported and imported to SharePoint Designer 2010 for further configuration and adjustments. The other way around is also supported: you can export an existing SharePoint Designer Workflow to Visio, so that a business user can review it and update it to match company’s policies.

When drawing Workflows in Visio, business users can only design the flow, all other configuration is still being performed in SharePoint Designer 2010.

Fig. 7: Configuring Workflow in SharePoint Designer 2010.

Page 55: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

EditionsDiagram designers must have Visio 2010 client to create diagrams that can be published as web pages. You also need Enterprise CAL for SharePoint to enable Visio Services.

ConclusionVisio Services introduces some very interesting and powerful features. It is hard to select one feature of Visio Services as the coolest one. Visio Services empower your end users to easily publish nice looking and power diagrams, connect them to backend LOB systems and easily share them with other users. Business users and analysts will enjoy the ability to design business process as Visio diagrams and publish them as SharePoint workflows.

How to guides - Visio Servicesby Toni Frankola

Enabling Visio ServicesVisio Services are part of SharePoint Enterprise feature set. Before you can use it, you need to enable Enterprise features on Site Collection level. To enable Enterprise features go to Site Settings > Site Collection Features and activate “SharePoint Server Enterprise Site Collection features”.

Fig. 8: Make sure you have enabled Enterprise features before deploying your Visio Drawings.

By enabling enterprise features SharePoint will now render Visio Drawings in your browser. You will also be able to use Visio Web Access Web Part. This web part is available in the Office Clients Applications category.

Fig. 9: Visio Web Access Web Part is available in the Office Client Applications category.

Page 56: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Publishing Visio files to your SharePoint SitesThe easiest way to publish your Visio drawing to SharePoint is to use Visio client or simply upload a drawing to the desired document library.(Please note: in case you cannot save from Visio to SharePoint in Beta2, save your drawing as Web Drawing, and the upload it to the desired Document Library).

Fig. 10: Save to SharePoint is available from Visio Client.

About DIWUGDIWUG is a platform for people that are interested in information worker solutions. Several times a year, DIWUG organizes events where members can meet, share knowledge and see interesting presentations in an informal setting.

DIWUG is a non-profit organization, which is supported from the information worker community. Its goal is to activate the Dutch information worker community to:

n Encourage knowledge sharing between members and organizations regarding Information Worker Solutions;

n Enlarge knowledge of participants by attending presentations;

n Provide a networking environment.

CONTACT INFORMATIONMarianne van Wanrooij; [email protected]

Mirjam van Olst; [email protected]

http://www.diwug.nl

Page 57: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Working with Visio DrawingsIn a document library Visio drawing is displayed as all other documents. Document context menu allows you to open file as a web page or in Visio client. By default, if a user clicks on filename it will open in browser.

Fig. 11: Item context menu allows you to open file in Web Browsers or Edit in Visio.

Fig. 12: Visio Drawing rendered in Firefox via Silverlight.

... by the way ...

Out of the box SharePoint 2010 support Ratings for libraries and list. But by default they are disabled. Go to your library- or list settings and choose Rating settings. Click on yes and you can make use of Ratings. The column Rating can even be used in the Content Query Webpart, nice feature!

A tip from Jan Ligtenberg, (APS IT-diensten), www.apsitdiensten.nl

Page 58: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Link your Visio Shapes with External dataIntegration of your shapes with backend systems is defined from Visio client. Integration features are available under Data ribbon. To define a connection, click on “Link Data to Shapes” button. A new dialog will open, allowing you to select a number of connection types you can use.

Fig. 13: Configuring Data Connection in Visio.

With a data connection in place you can configure Graphic for each shape. Configu-ration is very similar to conditional formatting options of Excel 2007. The following figure displays a rule that changes icon in the icon set according to CPU value. Each shape in Visio has a set of predefined data fields, but you can add your custom to match your business need.

Fig. 14: Configuring Data Graphics for selected shape.

Page 59: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Fig. 15: Defining Shape graphics.

Building interactive Visio DrawingsIf you plan to build interactive drawings one of the most important shape attributes is "Shape name". The easiest way to view the name and change it is via Developer ribbon. (To enable Developer ribbon go to Visio Options > Customize Ribbon). Select a shape whose name you want to change and then click "Shape name" button in the Developer toolbar. Change the name or remember the existing one to build inter-active diagrams.

Fig. 16: Shape Name option is available on the Developer ribbon.

Use to change the name of your shapes.

Page 60: MOSS eMagazine

�0

SharePoint® eMagazine2010 Special

Connect web parts to create interactivityYou can create interactive Visio Services applications by using two web parts: Visio Web Access and regular List View web part. Simple application is built on top of a custom list (with all the shape names) and Visio Web Access Web Part. Add both as web parts on a web part page and then configure a connection between the two.

When a user clicks on a small arrows icon, next to the list item, corresponding shape in connected Visio drawing will be highlighted.

Fig. 17: To configure connection between the two web parts go to

Connection > Send Row of Data to > [Your Visio Web Access Web Part Name].

Fig. 18: This dialog allows you to configure mapping between Provider (your list) and Consumer (Visio drawing).

Creating Workflows with VisioVisio 2010 comes with a new template for designing Workflows. To create a Share-Point workflow go to New > Flowcharts and then select "Microsoft SharePoint Workflow".

Fig. 19: Visio 2010 introduces a new template “Microsoft SharePoint Workflow”Activities on this template are same as activities in SharePoint Designer.

Page 61: MOSS eMagazine

�1

SharePoint® eMagazine2010 Special

Fig. 20: Visio 2010 SharePoint Workflow Actions.

When designing workflows in Visio you need to make sure your workflow has Start and End Terminator as show on figure below.

Fig. 21: Each SharePoint workflow designed in Visio

must have Start and End Terminator.

Your workflow drawing must also fulfill certain rules (e.g. all shapes must be connected etc.). Before exporting workflow from Visio you can use Check diagram button to verify your model is correct.

Fig. 22: Process Ribbon contains commands to verify andimport/export your workflows.

When you are designing workflows in Visio, the model is not SharePoint aware. You can design the flow but you will still have to use SharePoint Designer 2010 to configure lists, users etc. you want to use. Use Export button to Export the workflow model.

... by the way ...

The biographies of all authors are grouped together in order of appearance on the pages 103, 104 and 105.

Page 62: MOSS eMagazine

9.000

Join

professionals work together on innovative Microsoft projects

Working for Avanade means being part of a global network of IT professionals and working on interesting projects for large clients. These projects are very diverse and in addition to having SharePoint at their core, consist of many other technologies and products. Avanade consultants specialize in the Microsoft technology platform and receive diverse training opportunities to develop themselves further.

Do you want to work on a professional IT career? Please find more information atwww.avanade.nl.Or contact us at +31 36 547 51 07.

Page 63: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

A SharePoint User eXperienceby Sandra de Ridder

The great variety of features, possibilities and information within SharePoint portals make it hard to provide customers with the right user experience. Slight changes and, for example, the use of

Silverlight can give the user’s experience a big boost. This article gives you some tips and tricks on how you can improve the user experience of a SharePoint collaboration portal.

What is User eXperience?In short, UX is understanding what people do and how we can make it better. Or, according to the Nielsen Norman Group:

User experience is more than just user interface design: it encompasses all aspects of the end-user’s interaction with the company, its services, and its products. The first requirement for an exemplary user experience is to meet the exact needs of the customer, without fuss or bother. Next comes simplicity and elegance that produce products that are a joy to own, a joy to use. True user experience goes far beyond giving customers what they say they want, or providing checklist features. In order to achieve high-quality user experience in a company’s offerings there must be a seamless merging of the services of multiple disciplines, including engineering, marketing, graphical and industrial design, and interface design.

Know your usersYou are not the user, neither is your boss or client. It is tempting to design for the person making the buying decision but they are usually not the person that will be ultimately using the application. Managers don’t always understand the details of how work really gets done. Make sure to talk to the people that will be using the product, not just their manager.

Fig. 1: You are not the user, neither is your boss or client.

A great way to get to know your users is making personas. User Personas help us define who is using the site and who we want to use the site. You create a person-ality based on ages, culture, usage patterns and communities. That helps you to do research to help support who these users are and what they will do in the portal.

The goal is to develop a precise description of your user(s) and what he wishes to accomplish. A good person will enable you to build a product that solves a real problem and that people love.

NeedsBe careful to capture the end goals rather than goals that are a means to an end. A good test to decide if you have identified an end goal is to continually ask the question “why is this important?”. If there is an answer, you have not identified the

Page 64: MOSS eMagazine

�4

SharePoint® eMagazine2010 Special

root goal yet. Some examples of “fake” goals are: save memory, save keystrokes, speed up data entry, be easy to learn, use cool technology or features. They may want to speed up data entry because they want to get out of the office on time and get home to their family. Or they may want to use cool technology because they want to be seen as the cool gadget guy on the cutting edge.

ShareWhat?A website should be intuitive, easy to use and help you reach your goal quickly. If you have to explain how to use it, your design failed. No different for SharePoint, but SharePoint as a collaboration portal can scare people. They find it difficult, it changes the way they do their job. The job they have been doing for fifteen years in a certain (paper)way. And SharePoint has all these new features they aren’t familiar with.

Keep It Simple and StupidThe KISS principle states that design simplicity should be a key goal and that un-necessary complexity should be avoided. Help users get started quickly. Instead of overwhelming the user with detail and features, offer an overview that is easy to grasp and, most importantly, easy to start with. News, HRM information, simple forms, people search /contact information and team sites with announcements, a calendar, tasks and sharing documents are a great way for a user to learn more about Share-Point. Organize a workshop or training for the different user groups and give them some time to play and get used to this (basic) features. Provide good help documen-tation, the wiki feature is a great way to set up a help an FAQ library.

Why should I use it?Intranet or collaboration platforms are experienced as portals with information that are nice to read besides your work. Users see them when they start up their computer or browser and immediately close it or surf to another website. Make it personal. Start with a core business feature like digital mailroom or working schedules. Make sure it becomes the portal where they can find all the information and applications they need in order to get their work done.

Fig. 2: Start with a core business feature like digital mailroom or working schedules.

Usability Testing and EvaluationWhat application or tool is the company using now? Evaluate the client’s current application and evaluate opportunities for improvements. Not only by interviewing users, but also by letting them use the current application. Let them get involved in the process from the beginning of the project and let them test the application during the implementation.

Keep on evaluating your application by using statistics. Why are users leaving this page or closing the application when they are on this page. Is there something wrong with the content or is the button on the wrong spot, were the users expecting other information on this page or did they expect to navigate to another page?

Page 65: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

An effective website is providing the user the correct information and answers, has a logic structure, doesn’t waste resources and asks less time management. A satisfied user finds what he needs, achieves his goal, enjoys the experience, promotes your application to his colleagues and comes back again.

Avoid solutioneeringDesign by very definition, is the act of solving problems. In order for anything to be designed well, you must first identify the problem we are trying to solve and the goals we are trying to reach. Promote questions before answers. What is the problem at hand and what solutions can resolve that problem? Keep asking before giving an answer or solution. Don’t forget that the client often speaks a different (not so technical) language. Offer a variety of solutions.

Fig. 3: Avoid Solutioneering.

Form Follows functionThe basic rule for any design is “Form follows function.” If an object has to perform a certain function, its design must support that function to the fullest extent possible. This goes for industrial design and even more for Web design. Silverlight and Flash are tools that can add experience to your application and allow people to embrace the tool or service in a closer interaction. But always keep the user and his goals in mind. If the use of Silverlight or flash becomes a goal in itself, instead of a means to an end, the website will not work.

Content design79% of users scan the page instead of reading word-for-word. On any page with text, make sure most of your best design efforts account for making that text scanable, clickable, readable and understandable. Stay close to the standards. Use underscore for links, heading to highlight important sections, avoid long text blocks and long sentences.

Less words, less web parts. On the average SharePoint team site all the lists and libraries are cramped up on the start page “to get a good overview of the content”. This is an overkill of information. An alternative is to put only the most important information on the start page and provide links to the other content.

Ask yourself: How easy is it for users to accomplish their tasks on first visit? Once users are familiar with the application, how quickly can they perform these tasks? When users return after a period of not using the interface, how easily can they reestablish proficiency? How many errors do users make, how severe are the errors, and how easily can they recover?

On the average SharePoint TeamSite all the lists and libraries are cramped up on the start page.

Page 66: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

AccessibilityClients keep the business goals in mind, but often put their own needs over their users. Stay close to the web standards and look in what context the application will be used. With the possibilities of mobile internet a new User eXperience for the web is introduced.

Information ArchitectureInformation architecture is 80% of the usability. Get to know your audience. Design an efficient navigational structure with clear navigation, in a logical structure, with easy-to-follow site hierarchy. Most of the intranet environments have an information architecture that follows the structure of the organization they are implemented in. This is quite strange.

For example: When you build a website for a clothing company you don’t even think about providing the user a navigational structure with sales department, financial department, the warehouse, etc. A more effective and likely structure would be women, men and children’s collection. It’s the same with a collaboration platform, keep the process in mind. Keep focused on what the user is trying to achieve and what for the user is the most reasonable and effective way to achieve it.

Another challenge is preventing the user getting lost in the different site collections. For a developer it is clear what the difference is between them and how to navigate from one site collection to another. Going to his MySite can leave the user completely confused and lost in your application. All of a sudden the navigation has changed and it’s hard to go back to the main site. Using different colors for different site collec-tions and putting a “home” button on every page in every site collection can help the user to navigate through the application and provides him the ability always to go back to the main page.

Looking for something?A user can search for people, documents, or other items on the portal site by typing words in the search box located under the navigation bar. With scopes you can give the user more control over search results. They can easily choose if they want to search through all the content, or for example documents only. Custom search scopes feature is only available with SharePoint Standard or better. A Silverlight People finder can make searching for a colleague a better user experience. By filtering immediately you can easily search for people on only the first character of their name. This is standard in SharePoint 2010.

SharePoint 2010One of the biggest changes of SharePoint 2010 is in the User eXperience area. The editor is improved and features the famous “ribbon” from Office 2007 and 2010. Modifying text on a page is as easy as in Word. This includes adding and modifying images. SharePoint automatically ensures that everything is in the right place.

The use of Silverlight in SharePoint has also been improved. There are even standard features in SharePoint using Silverlight. Streaming video is so good, it’s almost unreal. The video plays without additional drivers and codecs installed and runs smoothly. Even when choosing a new starting point. Is the SharePoint User eXperience changing???

ConclusionUser eXperience is often underestimated in the implementation of an application. That is a shame because the success of your application depends on a good user experience. Certainly a SharePoint application. With relatively simple modifications and getting the user involved from the beginning of the implementation process and testing of the application, the changes on succes are a lot bigger. 2010 is a special (SharePoint) year. The expectations are high, especially for User eXperience. I hope that with the introduction of SP2010the love hate relationship between SharePoint and UX can be converted into a good marriage. But even in a good marriage, there often is tension and a (small) fight:)

Page 67: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Introduction to the Business Connectivity Servicesby Nick Swan

Business Connectivity Services will make your users and management happy, and will allow you to leave work on time and spend more time at home with your family. A bold claim – let’s see

how SharePoint 2010 and the BCS can do this.

Once upon a timeA long time ago all information within a business was stored on paper! All personal information, financial data, product and ordering records – myth has it that some of these organizations still exist!

Many other places however have moved into the digital age and have this type of information stored in databases. The problem is different databases have been imple-mented over time to store this data in meaning in your organization you may have a HR application, Finance package, and product data all living in different systems. This could mean a separate User Interface and login account for each system, with it being very difficult to share data across these systems. Training users on all these different systems can also be a headache.

SharePoint 2003 introduced many organizations to the idea of moving away from file shares for storing documents and better practices for collaboration. Users are happy working away in Word and Excel and saving documents to their sites – but why do they have to keep moving away to these separate systems to get access to product information from the product database? And how can they re-use customer details that are stored in Oracle when they want to tag an invoice with the customer it refers to as meta data?

SharePoint 2007 enters the ringThankfully Microsoft saw this problem and realized that SharePoint could be the central integration piece that brings all of these separate data systems together. Microsoft Office SharePoint Server (MOSS) 2007 Enterprise Edition came with a component called the Business Data Catalog. This allowed you to define your backend data sources to SharePoint and then re-use that business data with many out of the box features:

Fig. 1: Architecture of the BDC.

Page 68: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Web PartsFive BDC web parts came with MOSS 2007 that allowed your users to create dashboards with the business data they were interested in. The data could be filtered, related together to create associations and action’d upon by linking to actionable urls.

Business Data ColumnThe Business Data Column allowed you to re-use your business data as meta data against documents and SharePoint list items. Rather than having to re-type all your customers in by hand against invoices you were saving into SharePoint you could pick them from a list presented through the Business Data Catalog.

SearchThe Business Data Catalog opened up all of your systems to being crawled and indexed by SharePoint Search, meaning if your users searched for a Product they could get information not just from within SharePoint being returned, but also directly from your Product catalog database. SharePoint all of a sudden became the single place to search all of your systems within your organization.

User ProfilesIf you had a separate HR system containing information you’d like to publish to peoples SharePoint profiles (think phone numbers, job descriptions) you could join Active Directory properties and your HR system through the Business Data Catalog to complete the user profiles.

BDC Object ModelAll of the data sources you defined within the Business Data Catalog were available through a single API. This meant your developers only had to learn one programming method for accessing many different types of data sources – a huge boost in developer productivity.

So life was good – SharePoint was a place that people could now go to for collab-oration, and also for viewing and interacting with the data from other business systems. But you may have noticed from the five uses of the BDC that the Business Data Catalog was a read only solution. You could get your data to display in Share-Point quite easily, but if you wanted to write back – well things were a little trickier. You did have some options:

InfoPath FormsUtilize InfoPath Forms Server, build some browseable forms, and a web service layer to write back to your system

BDC ActionsIt was possible to link back to your original system user interface through URL actions and parameter passing

Custom Web PartsWith the tool we created called BDC Meta Man, it was possible to generate Share-Point web parts to write back to your LOB system through SharePoint.

So there were some solutions, but each took some work to get things up and running – it wasn’t a write-back story ‘out of the box’.

Page 69: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Also to let SharePoint know about the system you wished to integrate with you had to create an application definition file that contain information such as connection settings and how to execute methods on the backend to return data. These files could easily become thousands of lines of XML. Initially it required people to open up Notepad and craft this XML themselves until third party vendors came along with solutions to automatically generate them. While these tools were good, many people expected Microsoft to offer more assistance to do this.

Enter Business Connectivity ServicesBusiness Connectivity Services (BCS) is the new name for Business Data Catalog in SharePoint 2010. Not only does it have a new name, it also has a many new features, wider availability and also better tooling to help you configure it.

Fig. 2: Business Connectivity Services.

External Content TypesAn External Content Type (ECT) is representation of your business objects within the BCS. Some examples of ECTs could be Customers, Orders or Products. In SharePoint 2007 we referred to these as Entities, but for 2010 they are now known as External Content Types. If you are using the beta version of SharePoint 2010 you’ll find the odd occurrence where the terms Entity and External Content Type are both used interchangeably.

Features available for your dataThe Business Connectivity Service has a number of new features for you to use once you have declared the backend data you wish to use within SharePoint.

Write-backThe BCS is now a full write back solution. As long as you define the correct methods within your External Content Type you can use the out of the box user interface to write back through to your LOB system.

External ListsAn external list allows you to display data from your BCS data source in what looks to the user as a normal SharePoint list. They can filter, view, edit and even add new list items if the External Content Type supports it and these changes will be written back to the backend data source. To the user they think they are working with a SharePoint list, but they are actually talking straight to the back end system.

Page 70: MOSS eMagazine

�0

SharePoint® eMagazine2010 Special

Fig. 3: View of an external list.

Developers can also access the external lists through the standard SPList object model meaning you can now write solutions that can use both standard SharePoint lists and external lists.

Dot Net Assembly Data SourceWith the BCS we can now connect directly to a .NET assembly as a data source. This can help create incredibly powerful scenarios where you can use C# code to access data from multiple data sources, mash it up and present it through the BCS. Imagine you had Customer information spread across SQL Server and Oracle. Using C# code you can get the data and push it through to the BCS as a single Customer External Content Type.

Taking BCS data offlineYou are now able to take your BCS data offline to use in Office Clients such as Outlook, Word and SharePoint Workspaces. When the ‘Take Offline’ button is pressed the BCS data is copied down to a local SQL Server CE cache to be able to be used in a disconnected manner. Data can even be added to or edited, with the changes being written back to the SQL Server CE cache, and then sync’d up when reconnected to the network.

Office Business TypesTaking your data offline in Outlook is pretty cool, but if it displayed contact infor-mation in a datagrid that’d be pretty rubbish! Well thankfully you can map your External Content Type to common Office Data Types such as Calendars, Tasks and Contacts. This means if you connect Outlook through to the External Content Type the data will appear to display in the relevant format ie dates on an Outlook calendar or contacts as Outlook business cards. Again this data can be edited or added to from within Outlook.

Server and Client APIsAs we’ve already seen the business data catalog had an API that could be used on the SharePoint server to develop custom solutions. This API exists and has been improved on the server for BCS, but as data can be taken offline on client machines, there is now also a client side BCS object model. This is really powerful if you want to create Office Business Applications that can work with your data when the user is in a disconnected situation.

Still AroundSo those are a few highlights of the new functionality available in the Business Connectivity Services, but don’t forget we still have the Business Data column, BCS Search and the ability to add BCS data to user profiles.

Another big announcement however is the availability of the BCS to SharePoint Foundation.

Page 71: MOSS eMagazine

�1

SharePoint® eMagazine2010 Special

Wider availabilityAs we’ve mentioned the BDC was only part of MOSS 2007 Enterprise Edition. Business Connectivity Services is now part of SharePoint Foundation and SharePoint Server 2010! In SharePoint Foundation you get access to External Lists, Business Data Column and the BCS API.

With SharePoint Server you get the added ability of BCS Web Parts, Search, and User Profile assistance.

Opening up BCS to SharePoint Foundation is huge in my opinion – Microsoft has opened up SharePoint as an integration platform for companies who are both big and small.

Tooling availableWith the Business Data Catalog you had to rely on third party tools such as BDC Meta Man to help you integrate your backend data system with SharePoint 2007. BCS comes with tooling support from SharePoint Designer and Visual Studio 2010 Professional.

SharePoint Designer SharePoint Designer will allow you to connect to MS SQL Server, WCF and an already pre-deployed Dot Net Assembly Connector. This tool is great if you want to hook something up with the BCS quickly such as an External Content Type based directly from a SQL Server table. SharePoint Designer allows you to get working with the BCS very quickly and easily without having to understand too much of the BCS model behind the scenes.

Fig. 4: Manage settings of external content types.

But if you want to do anything complex with your data such as connect to an ODBC data source, or mash data together to present as a single ECT then Visual Studio 2010 is the route you will want to take.

Visual Studio 2010 tools for SharePointAs you are writing code in Visual Studio you can get your data from where ever you want, and perform many different manipulations on it before presenting it to the BCS. If you are using VS 2010 you will need to have a deeper understanding of the underlying BCS model as you need to manually create methods, type descriptors and parts that help explain to the BCS how your Dot Net Assembly Connector will present data to it. The great thing about Visual Studio 2010 BCS projects is the F5 deployment. Your BCS model and code will get packaged up and deployed directly from Share-Point, with Visual Studio also attaching to the correct process so you can debug and step your code as the BCS is executing it.

Page 72: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Third Party Solutions for taking the BCS furtherMicrosoft often presents SharePoint as being the platform for you to build applica-tions on top of. You can expect many vendors to see the BCS functionality that is available both in terms of SharePoint and the tooling and extend it to make it even more powerful.

SummarySo going back to our original statement about BCS.

Making your users and management happy – with BCS able to write back and take data offline your users and management will be able to make much better use of their Business Data. Your users really can stay in SharePoint and Office now to work with data that is stored in an external system.

Give you more free time? – the tooling for BCS will make it much easier for you to integrate and setup. This could take weeks with the Business Data Catalog, but with the BCS it is much improved – allowing you to leave work on time and do the activities you love!

The SharePoint team has made a big investment in Business Connectivity Services for SharePoint 2010 after seeing great adoption of the Business Data Catalog in SharePoint 2007. The features and functionality have been greatly improved, as has the tooling and general availability of BCS as an integration platform with the core technology now available in SharePoint Foundation. We are really excited about the integration opportunities that the BCS will bring for companies and can’t wait to see that solutions that are developed and deployed.

Page 73: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

SharePoint 2010 Client Object Modelsby Ton Stegeman

SharePoint 2010 offers a lot of new features that are interesting for developers. One of the areas of improvement is the introduction of new SharePoint object models. The next version of the platform

will offer three new object models, client object models. These APIs can be used to create client applications for SharePoint in a different way. In SharePoint 2007, these applications were created using the web services, WebDAV or the RPC protocols. Although it could be done, this was not an

easy task, and it certainly is completely different from programming using the server object model.

Three New API’sSharePoint Foundation 2010 (previously called WSS) will ship with three new object models:

.NET Managed Use this API to create managed .NET client applications (.NET framework 3.5

and higher).

Silverlight This managed object model can be used to create Silverlight applications that

use SharePoint data and objects. (Silverlight 2 and newer versions).

ECMAScript API to call SharePoint directly from javascript.

These three APIs are a subset of the SharePoint 2010 Foundation server API. The majority of the properties and methods of the site collection and all lower objects in the SharePoint hierarchy are available. This is very powerful, because it makes building client applications for SharePoint easier and more in sync with building server appli-cations. All object models are now pretty similar and provide a consistent system to interact with SharePoint. It also enhances the options to build client applications for hosted SharePoint environments (like SharePoint Online). These SharePoint sites were difficult to interact with, because the hosting company did not allow you to run your server side code in SharePoint 2007.

Programming by using these object models is very similar to server side programming, but there are some significant differences. This article shows samples of each of the new APIs. Please note: these samples were created using an early beta of the software. It is possible that these samples will not work in the final version of SharePoint. These samples do not include exception handling, to make them as compact as possible.

.NET Managed Object ModelTo use the .NET Managed API, the Visual Studio Project needs a reference to two assemblies; Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll. These can be found in ´<SharePoint Root>\ISAPI´ on the SharePoint server.

<SharePoint Root> is the new name for the folder ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14’. The application installer needs to deploy these two assemblies to the client machines. The following samples show code snippets of a Windows Forms application that provisions a number of artifacts in a plain SharePoint team site:

n List Companies.

n Lookup site column to the list Companies.

n Content type Contact that uses this site column.

n Association of the new content type to the Contacts list.

First thing to do is to check whether or not the list Companies already exists. Code sample 1 shows the code how to do this. Just like in the server object model, the SharePoint context is used. Instantiate a new ClientContext object using the site URL as parameter for the constructor. The property Web of this context object is the client equivalent of the server SPWeb object. This Web object has a property called

Page 74: MOSS eMagazine

�4

SharePoint® eMagazine2010 Special

ListCollection lists = teamWeb.Lists;context.Load(lists, listCollection => listCollection.IncludeWithDefaultProperties(list => list.RootFolder));context.ExecuteQuery();

List companiesList = null;using (ClientContext context = new ClientContext(“http://tstmss/teamsite”)){ Web teamWeb = context.Web; ListCollection lists = teamWeb.Lists; context.Load(lists); context.ExecuteQuery();

foreach (List list in lists) { if (list.Title.Equals(“Companies”)) { companiesList = list; break; } }}

Lists, which is a reference to a ListCollection containing all lists in the site. Until now, writing code using the client object model seems very similar to writing server side code. There is however one big difference.

Until now, a connection to the SharePoint content database has not been established. The client application did not yet interact with the SharePoint server, and therefore, this ListCollection is still empty. The Load method takes care of loading the collection, but it is not loaded until the ExecuteQuery method of the ClientContext is called. This might look like a number of extra, unnecessary steps. They actually are necessary and by design. It allows the programmer to call a number of load statements and compile these into one batch of commands that is sent to SharePoint as one package. It is designed this way to minimize the number of round trips from client to server. By maintaining the Object Identity Path, the client APIs know which objects belong to each Load statement. After the collections is loaded from SharePoint, the application iterates through the collection and looks for the list with ‘Companies’ as title.

Code sample 1: Check whether or not a list exists.

The pattern in the above code sample is a common pattern in all client object models. There are always three steps:

n Instantiate objects and request the required properties.

n Load the object(s), update existing objects or create new objects.

n Send a batch of commands to SharePoint by calling ClientContext.ExecuteQuery.

The next sample makes the previous sample a little more robust. Instead of checking the title of a list, the application checks the name of the RootFolder of the list. If a user changes the title of the list, the application will not break. In the foreach loop, the if statement is changed. The list.Title part is replaced by list.RootFolder.Name. Running the application, an exception of type PropertyOrFieldNotInitializedException is now thrown. This is caused by the biggest difference between server and client object models. In the client models, just the basic properties (like Id, Title) of all objects are loaded. If the program needs access to other properties, these properties need to be loaded explicitly. The server API always has all properties loaded and programmers need not to worry about this. This is a major difference that you need to be aware of. Loading the ListCollection is changed to the snippet shown in Code sample 2.

Code sample 2: Specify all properties to be loaded.

This sample used the IncludeWithDefaultProperties method, that is available in most collection objects. In the method parameters, the List properties that need to be

Page 75: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

ListCollection lists= teamWeb.Lists;IEnumerable<List> resultLists = context.LoadQuery(lists.Include( list => list.Title, list => list.Description, list => list.RootFolder, list => list.Id).Where( list => list.RootFolder.Name == “Companies” ));context.ExecuteQuery();

if (resultLists.Count() == 1){ companiesList = resultLists.First();}

bool update = false;if (companiesList == null){ ListCreationInformation creationInfo = new ListCreationInformation(); creationInfo.Title = “Companies”; creationInfo.TemplateType = (int)ListTemplateType.GenericList; companiesList = teamWeb.Lists.Add(creationInfo); update = true;}String companiesTitle = “Our companies”;if (!companiesList.Title.Equals(companiesTitle)){ companiesList.Title = companiesTitle; update = true;}String companiesDescription = “Use this list to manage contact details of all our companies”;if (companiesList.Description==null || !companiesList.Description.Equals(companiesDescription)){ companiesList.Description = companiesDescription; update = true;}if (update){ companiesList.Update(); context.ExecuteQuery();}

loaded are specified. IncludeWithDefaultProperties is not available in the ECMA-Script javascript library.

An alternative for using IncludeWithDefaultProperties, is replacing the Load method by LoadQuery. This method accepts a LINQ query as parameter. Code sample 3 shows the LINQ query. This query specifies that the RootFolder property needs to be loaded and ensures that just lists with RootFolder name ´Companies´ are returned to the client. This enhances the efficiency of the routine that checks the existence of a list. Instead of returning all lists to the client and evaluating this list at the client, the code now only returns the list objects that were specified before calling SharePoint.

Code sample 3: Just load the specified list object.

If the Companies list does not yet exists, the next step is to create it. If it already exists, the program updates Title and Description. Creating a new list is done by using a ListCreationInformation object. A lot of SharePoint objects have a specific Creation-Information object. The pattern is equal to the previous examples. After setting up the ClientContext, the object is created and Title and Description are set. After setting up the list, the Update method is called. As in previous examples, this does not call SharePoint and create the list yet. This is done when ExecuteQuery is called. Instead of provisioning one list, the code could have provisioned a number of lists and other objects in one batch. Code sample 4 shows how to create the list object.

Code sample 4: Creating and updating a SharePoint list.

Page 76: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

String fieldName = “OurCompany”;Field companyField = null;

ExceptionHandlingScope scope = new ExceptionHandlingScope(context);using (scope.StartScope()){ using (scope.StartTry()) { companyField = teamWeb.Fields.GetByInternalNameOrTitle(fieldName); } using (scope.StartCatch()) { String lookupXML = “<Field” + “SourceID=\”http://schemas.microsoft.com/sharepoint/v3\”” + “Type=\”Lookup\”” + “Name=\”{1}\”” + “DisplayName=\”Our company\”” + “Required=\”TRUE\”” + “List=\”{0}\”” + “ShowField=\”Title\” />”; lookupXML = String.Format(lookupXML, companiesList.Id.ToString(“B”), fieldName); companyField = teamWeb.Fields.AddFieldAsXml(lookupXML, true, AddFieldOptions.AddFieldCheckDisplayName); } using (scope.StartFinally()) { companyField = teamWeb.Fields.GetByInternalNameOrTitle(fieldName); }}context.ExecuteQuery();

Screenshot 1 shows the contents of the site after running the Windows Forms appli-cation.

Screenshot 1: New list, created using the.NET Managed Client API.

Next step creates the site column. This will be a lookup field that points to the Companies list. Previous examples showed code that first checks whether or not an object exists. If this is not the case, it is created, otherwise it is updated. By using exception handling in the .NET Managed API, this can be done in one step. This makes the code more compact and it requires one less call to the SharePoint server. Code sample 5 shows the code.

Code sample 5: Create a site column by using exception handling.

In this sample, the assumption is that SharePoint throws an exception if the new field object does not exist when we first try to access this object in StartTry(). The previous sample introduced the CreationInformation object. For Field objects (for lists and sites) however, these objects do not exist. A new site column can be created by using the XML string field definition.

New Content TypeNext step in the provisioning process is creating a new content type. This code is shown in Code sample 6. To find the content types, our application queries the Available-

Page 77: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

ContentTypeCollection contentTypeCollection = teamWeb.AvailableContentTypes;IEnumerable<ContentType> ourContactContentTypes = context.LoadQuery( contentTypeCollection.Include( ct => ct.FieldLinks).Where( ct => ct.Name == “OurContact”));IEnumerable<ContentType> contactContentTypes = context.LoadQuery( contentTypeCollection.Include().Where( ct => ct.Name == “Contact”));context.Load(contentTypeCollection);context.ExecuteQuery();

ContentType ourContactContentType = ourContactContentTypes.FirstOrDefault();ContentType parentContentType = contactContentTypes.FirstOrDefault(); if (ourContactContentType == null && parentContentType!=null){ ContentTypeCreationInformation creationInfo = new ContentTypeCreationInformation(); creationInfo.Name = “OurContact”; creationInfo.ParentContentType = parentContentType; parentContentType = teamWeb.ContentTypes.Add(creationInfo); parentContentType.Update(true); context.ExecuteQuery();}

IEnumerable<FieldLink> contactLinks = ourContactContentType.FieldLinks;FieldLink companyLink = contactLinks.Where( ct => ct.Name.Equals(“OurCompany”)).FirstOrDefault();if (companyLink==null){ FieldLinkCreationInformation companyLinkInfo = new FieldLinkCreationInformation(); companyLinkInfo.Field = teamWeb.Fields.GetByInternalNameOrTitle(“OurCompany”); ourContactContentType.FieldLinks.Add(companyLinkInfo); ourContactContentType.Update(true); context.ExecuteQuery();}

Contenttypes collection of the Web. In one query we search for the new content type, to check if it exists, and the parent content type that is required to create the custom content type. Again, a different approach from using the server object model. Structure your client object model code in a way that groups the requests to the server in batches as much as possible. This minimizes the number of round trips to the server and makes the application more efficient.

Code sample 6: Create a new content type.

The application is using a ContenttypeCreationInformation object to create the new content type. To add the new site column to this content type, the application needs access to the FieldLinks collection. To access this collection, an extra call to SharePoint using ExecuteQuery is necessary. This example shows that you need to think about your code very well. When do you need access to what properties and at which point are they loaded? The previous call to group as many actions as possible to one Execute-Query statement is still valid, but you cannot simply group all calls.

In the method in Code sample 7, the new content type, including the FieldLinks collection, is loaded. This collection is queried by using a LINQ query to find the site column in the associated site columns. If the site column is not yet available in the content type, it is added to the collection. Please note that the Update method of the ContentType is called to save the changes.

Code sample 7: Find a FieldLink using a LINQ query.

Please note this is LINQ to Objects. This is not to be confused with the new LINQ to SharePoint. That is a new server side only technology to query SharePoint content. The LINQ samples in this article are using LINQ to Objects.

Final step in the provisioning process is the association of the content type with the list. The same techniques as described in previous samples are applied. The Add-ExistingContentType method of the ContentTypeCollection associates the content type with the list. The DeleteObject object of the ContentType object deletes the default Contact content type from the list. It is not required to call the Update method of the List object before calling ExecuteQuery to save the changes.

Page 78: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

String defaultCompany = “Adventure Works”;

CamlQuery query = new CamlQuery();query.ViewXml = String.Format(“<View><Query><Where>” + “<Eq><FieldRef Name=’Title’/><Value Type=’Text’>{0}</Value>” + “</Eq></Where></Query></View>”, defaultCompany);ListItemCollection selectCompanies = companiesList.GetItems(query);context.Load(selectCompanies);context.ExecuteQuery();if (selectCompanies.Count == 0){ ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation(); ListItem companyItem = companiesList.AddItem(itemCreateInfo); companyItem[“Title”] = defaultCompany; companyItem.Update(); context.ExecuteQuery();}

The last .NET Managed client object model sample (Code sample 8) shows how to add an item to the new Companies list. Just as in the server object model, a CAML query is created to check whether or not the item exists in the list.

Code sample 8: Add an item to the Companies list.

This sample shows that CAML is still alive and kicking in SharePoint 2010. LINQ to SharePoint is also available, but this is a server side only technology. In the client object models querying SharePoint data needs to be done using CAML queries.

Silverlight Object ModelThe Silverlight API can be used in Visual Studio by adding a reference to the assemblies Microsoft.SharePoint.Client.Silverlight.dll and Microsoft.SharePoint.Client.Silverlight.Runtime.dll. These are located in folder ‘<SharePoint Root>\TEMPLATE\LAYOUTS\ClientBin’. The Silverlight client object model is very similar to the .NET OM. Biggest difference is that the Silverlight Client Object Model is asynchronous. The next sample will show this. This sample is part of a Silverlight web part that renders contacts from the contacts list of the previous samples in a Silverlight interface. Screenshot 2 shows the web part in action. In this sample the interface is not important. The important thing to learn is how easy it is to get data from SharePoint and use that in a Silverlight application.

Screenshot 2: Silverlight web part shows contacts.

To show the company logo the lookup column uses a new SharePoint 2010 feature. For each lookup column you can specify which other fields from the lookup list you want to add besides the Title field. The BDC field type in SharePoint 2007 already offered this option. Now it is also available for lookup fields. Code sample 9 shows the query how to read items from a list. Until the ExecuteQuery query statement it is very similar to the patterns used in previous samples. After getting the ClientContext, the application specifies which properties it expects SharePoint to return. Field values of list items are not returned by default, and therefore need to be specified in the Include statement.

Page 79: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

using (ClientContext context = new ClientContext(“http://tstmss/team”)){ Web teamWeb = context.Web; _ contactsList = teamWeb.Lists.GetByTitle(“Contacts”);

CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = “<View><RowLimit>100</RowLimit></View>”;

_ contacts = _ contactsList.GetItems(camlQuery);

context.Load( _ contacts, items => items.Include( item => item.Id, item => item[“FullName”], item => item[“Email”], item => item[“Picture”], item => item[“WorkCity”], item => item[“CellPhone”], item => item[“ContactCompany _ x003a _ LogoUrl”], item => item.Id, item => item.DisplayName));

ClientRequestSucceededEventHandler success = new ClientRequestSucceededEventHandler(SuccesHandler); ClientRequestFailedEventHandler failure = new ClientRequestFailedEventHandler(FailureHandler); context.ExecuteQueryAsync(success, failure);}

private void SuccesHandler(object Sender, ClientRequestSucceededEventArgs e){ List<Contact> contacts = new List<Contact>(); foreach (ListItem contact in _ contacts) { Contact newContact = new Contact(contact[“FullName”].ToString()); newContact.EMail = contact[“Email”].ToString(); FieldUrlValue pictureUrl = contact[“Picture”] as FieldUrlValue; newContact.PictureUrl = pictureUrl.Url; newContact.City = contact[“WorkCity”].ToString(); newContact.Phone = contact[“CellPhone”].ToString(); FieldLookupValue companyLogo = contact[“ContactCompany _ x003a _ LogoUrl”] as FieldLookupValue; newContact.CompanyLogo = companyLogo.LookupValue; contacts.Add(newContact); } Dispatcher.BeginInvoke(() => { ContactList.ItemsSource = contacts; });}

Code sample 9: Get items from a list using the Silverlight client object model.

Instead of getting the ClientContext by using the URL, we could have used Client-Context.Current to get the current SharePoint context. Just before the query is executed, two event handlers are created. These are passed as parameters to the ExecuteQueryAsync method, the ExecuteQuery equivalent in the Silverlight API. If the query is successful, the ClientRequestSucceededEventHandler is called. If the query generates an error, the application ends up in the ClientRequestFailedEventHandler event handler. Code sample 10 shows the succes event handler.

Code sample 10: Success event handler after loading contacts.

This handler iterates through all contacts found in the ListItemCollection. For every item, a Contact object is instantiated and added to a collection. This collection is bound as Datasource to the XAML code. Because query execution is asynchronous, the application needs to assure that the code to bind the data is run on the UI thread. To do this, Dispatcher.BeginInvoke is called just before the ItemsSource property is set.

Page 80: MOSS eMagazine

�0

SharePoint® eMagazine2010 Special

<SharePoint:ScriptLink Name=”sp.js” LoadAfterUI=”true”Localizable=”false” runat=”server”/>

ECMAScript Object ModelThe third new client object model is a Javascript API. Just like the Silverlight API, this object model is asynchronous. Following code samples are part of a LAYOUTS page. This page shows all users that have access to the site because they have been granted access directly. They did not get access by being a member of a SharePoint group. By clicking the name of a user, the page shows extra information about that user. The page also shows a list of available SharePoint groups. By clicking a group name, the selected users are added to the group as members and their direct permissions on the site are removed. Screenshot 3 shows this page in action.

Screenshot 3: Page to move users with direct permissions to SharePoint groups.

Loading and rendering users and groups in this page is server side code. Showing more information, adding users to groups and removing their permissions, is Java-script code using the ECMAScript client object model. By using the library, the page does not need to reload when a link is clicked. The page does not use postbacks to work, which improves the user experience. To use the SharePoint objects in the SP namespace, a reference to the ‘SP.js’ file needs to be added to the page:

The Javascipt API is not just in SP.js. It is divided to a number of JS files that are available as minified files in the <SharePoint Root>\TEMPLATE\LAYOUTS folder. This folder also contains the debug versions of the javascript files; e.g. SP.Debug.js. The SharePoint Foundation SDK shows all available JS files. By using the ScriptLink control, SharePoint automatically loads all necessary javascript files. If the debug attribute of the <Compi-lation /> element in web.config is set to true, the ScriptLink control automatically loads the debug files. Instead of SP.js, SP.debug.js is loaded. If you enabled javascript debugging in the browser, you can debug your ECMAScript SharePoint code in Visual Studio easily by adding a “debugger;” statement to the code. This makes development using this new API a lot easier. Screenshot 4 shows the debugger in action.

Screenshot 4: Debugging ECMA Script

In our ASPX page, a second JS file is loaded. This file contains the scripts for the custom page. Code sample 11 shows the code for getting information about the selected user. In JavaScript function getUserInfo the first action is to get the ClientContext. The script is called from an ASPX page in the LAYOUTS folder, and therefore already knows the SharePoint context. That context can be referenced easily by using the Current property. Next statement gets a reference to the User Information List. This is the out of the box SharePoint list that contains the data about the user. A CAML query is constructed to find the selected user based on the ID. Final step is to call the ExecuteQueryAsync method that loads the listitem object.

Page 81: MOSS eMagazine

�1

SharePoint® eMagazine2010 Special

function getUserInfo(userID) { var clientContext = new SP.ClientContext.get _ current(); var web = clientContext.get _ web(); var userInfoList = web.get _ siteUserInfoList(); var camlQuery = new SP.CamlQuery(); camlQuery.set _ viewXml(‘<View><RowLimit>10</RowLimit></View>’); camlQuery.set _ viewXml(‘<View><Query><Where>’ + ‘<Eq><FieldRef Name=\’ID\’/><Value Type=\’Number\’>’ + userID + ‘</Value></Eq></Where></Query><RowLimit>1</RowLimit></View>’); this.collListItem = userInfoList.getItems(camlQuery); clientContext.load(collListItem); clientContext.executeQuery( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));}

function onQuerySucceeded(sender, args) { var item = collListItem.itemAt(0); var profile = item.get _ item(‘Notes’); var pictureUrl = item.get _ item(‘Picture’).get _ url(); var userImage = document.getElementById(‘userImage’); userImage.src = pictureUrl; var profileDiv = document.getElementById(‘userProfile’); profileDiv.innerHTML = profile;}

Code sample 11: Getting data from the selected user.

In this method you will see the calls to properties and methods are slightly different in the ECMAScript API. All of them are documented on MSDN (http://msdn.microsoft.com/en-us/library/ee538253(office.14).aspx). You can also open sp.debug.js to look at the implementation and find what properties/methods are available. The Execute-QueryAsync method is called using two parameters, which are the event handlers to be used when the call completes. Code sample 12 shows the function that is called if the query was successful.

... by the way ...

Downloadable .chm files are available that contain help for Windows PowerShell cmdlets for SharePoint Server 2010.

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=045f7af5-b226-4a05-8ace-4e17cfdef856

Tip from Mirjam van Olst (Macaw) http://sharepointchick.com

Code sample 12: Handle the query results for the selected user.

In this function, the first item from the collection is loaded. The UI is updated by linking the content of the fields of this list item to the HTML controls in the page.

ConclusionThe three new object models are an important new feature for SharePoint devel-opers. Building client applications is now a lot easier and intuitive because it is more similar to the server side programming model that you already know. In this article the three new models are introduced in a number of samples. These samples show a few important differences between SharePoint server side and client side programming. Look into these differences and get a feel for how they will influence the way you structure your code. This article is meant to be a starting point for your first project using the new Client Object models. Full source code of these samples is available on my CodePlex site (see my biography).

Page 82: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Understanding Identity in SharePoint 2010by Michiel van Otegem

SharePoint 2007 and earlier versions have some serious drawbacks when it comes to dealing with the identity and authorization of the user. In SharePoint 2010 the security model has been completely revamped and based on the new Windows Identity Foundation. The implications of

this change are minor at first glance, but profound if you look at the bigger picture.

Claims Based AuthorizationWindows Identity Foundation (WIF) is a set of .NET Framework classes that enable application to work with a concept known as Claims Based Authorization (CBA). Before getting into how this works in SharePoint 2010, I’ll first go over the basics of CBA. In CBA a user’s identity basically consists of a set of claims. A claim is basically a piece of information about the user. This information can be used in an appli-cation or service to determine what the user may or may not do. Claims can contain arbitrary pieces of information, not just the username and roles a user belongs to, as is common in security. It could for instance contain the user’s age and/or transaction limit. The former could be useful for a web shop selling liquor online, the latter for a banking application. These pieces of information can be used to authorize users based on business logic. This is much more intuitive than using role based authori-zation, because creating different security groups based on age or transaction limit isn’t very handy.

CBA allows for much granular and flexible authorization, and allows multi-dimen-sional security as opposed to one dimensional security offered by role based security. With CBA you can easily make a security rule that checks whether a user is in a certain department and is a manager. In role based authorization this combination would need to be a single role, increasing the number of roles that are needed.

Claims or factsThe reason claims are called claims and not facts is because a claim may not be factually true. This is quite common on the internet, where I can identify myself on a forum as for instance President Obama. On the forum this may be acceptable, but when I have to identify myself on a government site, I probably need to use something like my social security number, which will clearly show I am not President Obama. This is where it becomes important who is making the claim. An identity is issued by a so called Identity Provider (IP). An application or service accepting the identity of an (external) IP is known as a Relying Party (RP), because it relies on or trusts the IP. The forum trusts an IP that allows users to use fake names, as the only important thing for the forum is to distinguish between different forum users consistently. A government site will definitely not trust the same IP. In the Netherlands for instance, the government has an IP known as DigID, which most government sites accept as a valid IP. CBA works with tokens, and these tokens are issued by a Security Token Service (STS), which is part of an IP.

An RP tells which claims it needs through a policy, and an STS issues token based on this policy when a user requests a token for the RP. This means that the STS must have the information needed to create the needed claims, and also that the STS can decide whether or not to accept a policy. In other words, a STS has the power to deny a RP access to certain information about a user. On the internet this is quite important, because this means that privacy sensitive information is only disclosed if really necessary. In fact, a token doesn’t even have to contain the (user)name if this is not required for the RP the user wants to access. Similarly, neither the liquor web shop nor the forum has any reason to know my social security number, so they won’t get it.

Page 83: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

In intranet scenario’s common to SharePoint this is obviously less of a problem, but it is worth mentioning nonetheless, because it is a key feature of CBA in general.

Windows Communication FoundationSo much for the theory behind CBA, let’s move on to how this works in WIF. WIF implements CBA using several standards specifications, such as WS-Trust, WS-Feder-ation, and Security Assertion Markup Language (SAML). As you may have gathered from the mentioned standard, WIF is web service based and integrates with Windows Communication Foundation (WCF). This means WIF can in fact work with any non-WIF STS, RP, or client, as long as they support these standards. This includes WIF-less WCF using the WsFederationHttpBinding or non-Microsoft implementations.

The SharePoint 2010 web services are all implemented using WCF and integrate WIF, but the question remains on how this works when you have a browser client accessing a website, which is also important for SharePoint. To accommodate this, WIF provides a “wrapper” around the WS-* interactions that enable a website to become so called Claims Aware. In this context you may come across so called Active and Passive STSs.

An Active STS is one that works with WCF based clients and services, whereas a Passive STS provides the wrapper functionality needed for websites. You could create a standalone Passive STS, but it in mixed scenario’s where both websites and web services are used, it makes sense to have an IP provide both an Active and a Passive STS, or have the Passive STS wrap the Active STS. In any case, because SharePoint requires browser based access, it requires a Passive STS. The interaction between the browser, SharePoint, and an STS is depicted in Figure 1.

Fig. 1: Interaction between a browser, SharePoint, and an STS.

The interaction in figure 1 shows the browser trying to access a SharePoint website (1). Because the user is not authenticated yet, the browser gets a redirect response (2), redirecting to the STS. The querystring of the redirect URL contains a URL back to the SharePoint website for later use. The user then has to authenticate against the STS (3), which will yield the claims token (4). Finally, the browser sends the claims token to the SharePoint website (5) to get access. In figure 1 you also see a step 0, which is not part of the runtime interaction with the browser. It represents the SharePoint site registering with the STS to setup the required trust relationship between them. The STS at that point can be configured to determine which claims are sent in a token to the SharePoint website.

Security Token Service ApplicationAt this point you may be thinking that all this isn’t very useful and just adds additional interactions and complexity, and I can’t say I’d blame you. However, there are some important advantages to this setup. For starters, because SharePoint 2010 supports WIF, it no longer needs to support different authentication mechanisms. Authenti-cation happens outside SharePoint, and regardless of the authentication mechanism used by the STS, the user comes into SharePoint in the same way. This reduces the complexity of SharePoint, rather than increasing it, and makes for a more consistent

Page 84: MOSS eMagazine

�4

SharePoint® eMagazine2010 Special

programming model. That said, SharePoint 2010 actually supports to different modes: “classic mode” for standard Windows Authentication (which is the default), and “claims mode” supporting WIF scenario’s. Because “claims mode” is something that is available out-of-the-box, a STS also comes with SharePoint 2010.

Figure 2 shows what IIS looks like after a default installation. Notice the SecurityTo-kenServiceApplication under SharePoint Web Services, which shows you that Share-Point provides an STS to work with.

Fig. 2. SharePoint applications in IIS after default installation.

Another advantage of using WIF is the fact that its standards based and actually enables SharePoint to deal with users that are not in the (same) Windows domain as the portal itself. One scenario where this is useful is business-to-business communica-tions where one organization (org A) wants to grant access to its portal to users of another organization (org B).

In SharePoint 2007 and earlier, this requires users from Org B to get an account in the Active Directory of Org A, or in the SharePoint user store if Forms Authentication is used. In SharePoint 2010 this is not needed, because SharePoint can be setup to trust the STS of Org B, or the STS of Org B can be “chanied” to the STS of Org A, which is trusted by SharePoint. Claims can then be used to grant or deny individual users. This is much more elegant and doesn’t clutter the user store of Org A, and it also means that when Org B disables the account of some user, that user can automatically no longer access the SharePoint portal of Org A. In the SharePoint 2007 scenario Org B would have to notify Org A of this event and Org A would have to disable the account too.

Page 85: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Single-Sign-OnThe last advantage I’d like to cover here is the fact that WIF enables Single-Sign-On across multiple farms and services that trust the same STS. Without some serious tweaking this is only possible in SharePoint 2007 when you use Windows Authenti-cation. One of the implications of this is that SharePoint services no longer have to be accessed through delegation, in the process losing the user’s true identity, but can be accessed as the original user itself, making it much easier to ensure that the user is authorized for whatever the user wants to do/see. To cover scenario’s where the user’s Windows account is actually required at some point, for instance to access a non-claims aware resource that SharePoint makes available, SharePoint uses WIF functionality to convert a so called User Principal Name (UPN) claim into an actual Windows account that it can use for impersonation. This functionality known as c2WTS (Claims To Windows Token Service) is a Windows service. For security reasons it is not running by default, and applications that want to use it need to be configured explicitly as accepted callers, to ensure that a claim is never inadvertently converted to a Windows account. Also, the UPN must correspond to an existing account, but in most cases this is ensured if you’re using SharePoint within a domain.

ConclusionThere is much more to learn about Windows Identity Foundation in itself and how it interacts with SharePoint 2010. For more information on WIF, see http://msdn.microsoft.com/en-us/security. There is also a good session about WIF and SharePoint 2010 from PDC available at http://microsoftpdc.com/Sessions/SVC26. Be sure to check it out, because Windows Identity Foundation is becoming a core piece of the security infrastructure on the Microsoft platform.

... by the way ...

Did you know ...

n With the new claims mechanism in SharePoint 2010 it’s possible to use multiple authentication mechanism in a single web application in a single zone.

n User profile synchronization in SharePoint 2010 enables writing data back to for instance Active Directory out of the box.

n SharePoint Server 2010 can only run on a 64-bit machine.

n It’s now possible to use Visio to design your SharePoint workflows and to import these workflows in to SharePoint Designer.

n Visual Studio 2010 can package your SharePoint solution in a .wsp file with a single button click.

n Visual Studio 2010 supports F5 SharePoint debugging and deployment. No more “attach to process”!

n Turn the developer dashboard on using PowerShell: Get-SPFarm.PerformanceMonitor.DeveloperDashboardLevel = “OnDemand”

Tips from Mirjam van Olst (Macaw) http://sharepointchick.com

Page 86: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Microsoft Project & SharePoint:

Happy Together in 2010by Dux

For a lot of project managers, Microsoft Project is the de facto project management tool that they rely on. It effectively supports project planning (schedule development, resource definition and

task assignments, budget, etc) AND project tracking (schedule, resource, cost, etc).

To reap the benefits of Microsoft Project, it is pertinent that you:

n Are familiar with basic project management concepts AND

n Have a project management process that you follow

Without these two, it is less likely that you will appreciate Microsoft Project and more likely blame it for causing frustration and heartache. Keep in mind that Microsoft Project is a tool; it won’t make your projects on time, on budget and on scope.

SharePoint as a Project Management Information System (PMIS)

Another great tool that aids project managers today is SharePoint. If implemented accordingly, project managers can be empowered to develop a project web site that centralizes project artifacts and can streamline project communications. This is much better than solely relying on email to collaborate. With out of the box SharePoint, a project manager can:

n Centralize project information and communication in a SharePoint site

n Automate project processes like change control process by utilizing built in SharePoint workflows

n Efficiently interact with project information on a SharePoint site by integrating it with common Microsoft Office tools such as Word, Excel, and Outlook

n Enable alerts to send automated reminders to project stakeholders

n Define and monitor project tasks in the enhanced project task list which now shows task dependencies and a “Microsoft Project-like” Gantt view interface.

Fig. 1: Microsoft Project-like Gantt view interface.Project Manager’s Dilemma

A current limitation of Microsoft Project 2007 is the lack of integration with Share-Point. It would have been a great way to allow project resources to update their task status directly into a SharePoint task list and have it synchronize with the Microsoft Project file that is maintained by a project manager. The only way to achieve this today is through Microsoft Project Server.

Page 87: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Fortunately, those days are long over. This need has been addressed in Microsoft Project 2010. The ability to synchronize a Microsoft Project 2010 project plan to a SharePoint 2010 project tasks list is available out of the box. In addition, this capability can also be used with existing WSS 3.0 or MOSS 2007. The Microsoft Project team has published a great blog post on how to make the synchronization work.

Interactive Project Reporting That You Can ProvideAnother great benefit of leveraging Microsoft Project 2010 with SharePoint 2010 is the out of the box charting capabilities that SharePoint provides. Imagine being able to take relevant project information, make it available in SharePoint and display it as a management dashboard.

Let’s See It In ActionWant to see how Microsoft Project 2010 and SharePoint 2010 work happily together? Check out this presentation I led during the Microsoft SharePoint Conference 2009.

More information:

n Basic steps of Project Management http://sp.meetdux.com/archive/2009/01/28/manage-your-projects-not-just-your-schedule-part-1.aspx

n Project 2010: Sync to SharePoint http://blogs.msdn.com/project/archive/2009/ 10/19/project-2010-introducing-sync-to-sharepoint.aspx

n SharePoint 2010 for Project Management Success video http://vimeo.com/7300710

About SDNThe Software Development Network, is a community for IT-professionals. SDN is divided into sections. Each section is specifically aimed at a certain group developers. The main sections are: .NET, User eXperience, Information Worker, DotNetNuke, Delphi, Core Systems, Database technologies and Architecture.

SDN eventsBesides our annual SDN Conference, SDN organizes many other things. Regular meetings are held four times a year in a seminar-like approach. On several occasions we have invited foreign speakers for these meetings.

SDN MagazineOur quarterly magazine contains high quality articles mostly written in Dutch, however, we often publish English articles as well.

The SDN ConferenceThis conference is a two-day event with international speakers. Like the Software Development Network itself, is organized on a non-profit basis. The fee that the attendants have to pay is used entirely for organizing this event.

SDN Conference 2010 will be held in October 2010.

CONTACT INFORMATIONRemi Caron (president), Joop Pecht (secretary)

Phone: +31-543-518058; Email: [email protected]; Web: www.sdn.nl

Page 88: MOSS eMagazine

SharePoint-specialisten

Stel, je hebt je gespecialiseerd in SharePoint.

En je weet dat er met jouw kennis en ervaring

veel meer mogelijk is. Dan ben je bij Sogeti aan

het juiste adres. Van de 700 collega’s die zich

bezighouden met Microsoft-infrastructuur en

–applicatieontwikkeling, weten er zeventig alles

over SharePoint. We streven naar innovatie en

doen mee met het SharePoint 2010 Evidence-

programma van Microsoft.

Kortom, als je ergens kunt doorgroeien, dan is

het wel bij ons. We bieden je masterclasses.

De keuze uit heel veel SharePoint-opleidingen.

En daar horen uiteraard ook certifi ceringen bij.

De projecten die je voor klanten uitvoert, variëren

enorm. Van portal realisaties tot het neerzetten

van een collaboration omgeving voor 140.000

gebruikers. Ander voorbeeld: momenteel werken we

aan de omvangrijkste integratie ooit van SharePoint

in Dynamics CRM.

Interesse? Bel Lijnske Boogaarts of stuur haar je

cv: (088) 660 66 00 (nakiesnummer 0954), lijnske.

[email protected]. Meer informatie vind je op

werkenbijsogeti.nl.

Wat kun je? Die vraag stelt ieder bedrijf met een vacature. Wie ben je? Die vraag stelt Sogeti

meteen daarna. We vinden het belangrijk dat je bij ons past. Want een ICT-er van Sogeti is

geen gemiddelde ICT-er. Het is er een met uitgesproken eigenschappen.

Gedreven. Resultaatgericht. En niet snel tevreden. Natuurlijk: plezier hoort erbij. Maar we

gaan op de eerste plaats voor de inhoud. Zo kennen klanten ons. Zo kennen we elkaar.

Als het een ICT-er is, zit hij bij Sogeti.

Page 89: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

SharePoint 2010 Chart Web Partby Agnes Molnar

Whatever you do in your everyday work, I’m sure you prefer to visualize data in a better way than viewing plain tables or text files with thousands of rows. A good chart is worth more than millions of data fields. SharePoint 2010 has a great new web part that is able to display your data in various

data sources as graphical charts and diagrams. Let’s see what capabilities this Chart Web Part has.

Chart Web Part - The BasicsThe Chart Web Part is new in SharePoint 2010, so first of all let me show you how to insert it into your pages:

1. Open your SharePoint 2010 page. In order to edit your page, click on the ‘Page’ ribbon, and choose ‘Edit Page’ option.

2. Click on ‘Add a Web Part’ on the zone you’d like to add the Chart to. The Web Parts list will appear on the top of your page.

3. Select the category ‘Miscellaneous’, and ‘Chart Web Part’ from the Web Parts list.

Fig. 1: Insert Chart Web Part into your SharePoint 2010 page.

That’s it, you can enjoy your Chart Web Part immediately. It’s on your page and you can start to use it. Only two steps are missing: to define where your chart data comes from, and what chart type would you like to use.

Fig. 2: Chart Web Part.

Page 90: MOSS eMagazine

�0

SharePoint® eMagazine2010 Special

Chart Web Part - Data SourcesAfter inserting a Chart Web Part into your page, you need to connect the chart to some data source, and customize it. The Chart Web Part in SharePoint 2010 can be connected to the following types of data sources:

n Another Web Part;Another Web Part;

n SharePoint list;SharePoint list;

n Business data;Business data;

n Excel Services.Excel Services.

SharePoint listAs the simplest and most obvious data sources, connecting to SharePoint lists is very easy. In my very plain example list I’ve stored items of bugs: the requirement is to store the number of bugs (critical and minor errors, change requests) for every day of the testing period:

Fig. 3: Simple SharePoint 2010 list.

Let’s go back to the page where you inserted the Chart Web Part into, and select SharePoint list as data source. The configuration is very simple: you need to select the site and list, configure the series (in my example I have three series: Critical Errors, Minor Errors and Change Requests), and your new chart is ready to use immediately.

Fig. 4: Adding more series to the chart.

When you’ve added the series you will see the results immediately. The series will show up in a line chart as you can see in figure 5.

Page 91: MOSS eMagazine

�1

SharePoint® eMagazine2010 Special

Fig. 5: Our new chart with three series.

Another Web PartI have to admit, I was surprised when I read of this capability of connect the Chart Web Part to another Web Part on the page. The source Web Part has to be an XsltList-ViewWebPart, for example a list or library view. These views can be a data source if the data stored in the Web Part can be organized into a table-like structure.

Excel ServicesAbove others, Excel Services can be the data source of the Chart Web Part. In this case, we need to prepare our environment, but it definitely worth: in my experience, end users like the Excel sheets, export to and manipulate data in Excel files, etc. In this way, we can separate the data (in the Excel file) and the visualization (on your SharePoint 2010 page).

These are the steps of defining Excel Services as the data source of Chart Web Part:

1. Enable Excel Services on your farm.

2. Define trusted file locations and trusted connections if needed.

3. Publish your Excel workbook to one of the trusted libraries.

4. Insert a Chart Web Part into your SharePoint 2010 page.

5. Select ‘Excel Services’ as the data source of your chart.

6. On the next screen, you have to set the basic connection info to your Excel data:

n Excel Web Service URL: The default value of this field is the URL of Excel Service (http://sp2010/_vti_bin/excelservice.asmx), so if you’d like to use the default Excel Service instance, don’t touch it.

n Excel Workbook Path: The exact path to your Excel workbook (eg. http://sp2010/dms/BusinessDocs/Documents/Books1.xslx)

n Range Name: The name of the range in the workbook that you want to use as data source (eg. Sheet1!$A$1:$B$51).

7. After a successful connection, the source data is immediately assigned to the chart. You only need to set the required Series, X and Y values, and your Chart is ready to use.

In my really simple example, I have an Excel sheet with two columns: Year and Value. The workbook and the connection info are the followings:

Page 92: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Fig. 6: The example data sheet.

Instead of using the series as in the previous example we will show the data as a column diagram. With the Value on the vertical ax and the Year in the horizontal ax. Figure 7 shows how to implement this.

Fig. 7: Binding series to the chart.

The result is a very simple chart, based on the default chart type (in my case, column type), similar to the other examples above:

Page 93: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Fig. 8: Basic column chart based on Excel Services data.

My favorite capability of this conjunction is the “live data”: whenever the permitted users edit the data in the Excel file (either in Excel or in their browser with Excel Services), the chart can be refreshed immediately with the new data behind.

Business dataFinally, let’s have a look at my favorite data source that expands the whole data visualization. In SharePoint 2010, we can connect to the Line-of Business systems (LOB) via Business Connectivity Services (BCS) in a two-way mode. Of course, the Chart Web Part can use the BCS data as a data source.

So now our SharePoint can be a real data visualization interface! Just imagine: you have some data in SAP, some in your custom HR system, some in SQL or in Oracle databases, in SharePoint lists, in Excel workbooks… and all of them can be visualized with SharePoint 2010 Chart Web Part!

Well, in this article I can’t cover the topic of LOB systems and BCS connections, so let me show you how to use BCS data after the connection is established to the LOB system. As the Chart Web Part only visualize (read) data, it’s not required to build two-way connection to the LOB system, it’s enough to read the data.

After selecting the option ‘Business Data Catalog’ as data source, the next step is setting the required Business Data Catalog existing in your system and accessible from the current site.

Tip: The other way to display business data in a Chart Web Part is to create an External List based on the Business Data Definition, and connect your chart to this External List.

Page 94: MOSS eMagazine

�4

SharePoint® eMagazine2010 Special

Customization capabilities of Chart Web PartChart Web Part has so much customization settings that it’s almost impossible to count all of them. Anyway, I’m trying to show as much as possible in this article.

Chart TypeLet’s start from a basic chart, for example our former Bugs Chart. The first thing we’d like to change very often is the chart type. You can do it right after the configuration of the data source by selecting ‘Customize Your Chart’ option from the Chart Web Part’s menu. There are a lot of types you can choose:

n BarBar

n AreaArea

n LineLine

n Point/BubblePoint/Bubble

n FinancialFinancial

n PiePie

n Radar

n Polar

n Gantt/Range Column

n Range

n Error Bar

n Box Plot

n Funnel

n Pyramid

Awesome list, right? Moreover, you can select from 2D and 3D types, and after customizing your chart, there’s an option to save it as a Custom Chart Type.

Chart Appearance PropertiesIn this step, you can select a theme for your chart, with custom drawing styles and transparency values as well. You can give the Chart the look & feel that fits best on your intranet page. Also, this is the interface for defining the size of the chart, and the image format (BMP, JPG or PNG). Yes, image format: the Chart Web Part generates an image from your data by your settings, and puts it to your SharePoint 2010 page. (Fig. 9).

Fig. 9: Appearance Themes.

Page 95: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

The second Tab on this page is for the 3D settings of the chart. First of all you can check in or out if you’d like to see your chart in 3D, and some other properties (Rotation, Perspective, Light, Wall Thickness, etc.) if you choose yes.. It’s very useful to see the difference between the 2D and 3D versions of the same chart immediately:

Fig. 10: Preview of the same chart in 2D and 3D.

Chart Element PropertiesOn the last page of the Chart Customization Wizard, we can set a lot of general chart properties, mostly familiar from Excel, for example.

These settings are:

n Chart Title: The displaying of the chart title can be turned on or off by your choice, and the position and font type can be customized too.

n Legend: The displaying of the chart legend can be turned on or off by your choice, and the legend title, position, style and font type can be customized too. Also the legend can be docked to the chart area, inside or outside of it.

n Axes and Grid Lines: X and Y axes and gridlines can be customized here.

n Data Labels: Data labels can highlight or explain data shown in the chart, and can be formatted in different types (e.g. Numeric and DateTime types).

n Markers: Markers can highlight specific data points of the chart, and they can be styled as square, circle, diamond, triangle, etc. Also the markers’ size can be set here.

n Hyperlinks and Tooltips: Also very useful option that can help you display other information about your series, or redirect the users interested in the series to a custom URL or page.

ConclusionAs you can see, the SharePoint 2010 charts can be customized in various different ways, and because of that can be a really powerful way to visualize data for your business. Whatever you would like to visualize, SharePoint 2010 Chart Web Part can help you - moreover, its configuration and customization is very easy.

No development/code is necessary. The only pre-requirement: the data sources have to be prepared for visualization, but that is a story that fits a new topic for a next magazine!

... by the way ...

The biographies of all authors are grouped together in order of appearance on the pages 103, 104 and 105.

Page 96: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Enrich your SharePoint 2010 portal by integrating SAP applications

by Cyrill Visser a.o.

SharePoint is becoming the number one frontend application for many organizations rapidly. Many of these organizations are using SAP to support their core and subsidiary business

processes. The upcoming release of Microsoft SharePoint Server 2010 expands the possibilities of integrating your SAP applications and data. By using the SharePoint Business Connectivity

Services and SAP Enterprise Services, data can be extracted from SAP, enriched and presented in your SharePoint portal. In practice however, not all data relevant to these processes is stored in SAP; a lot of organizations have included Microsoft Excel in their “informal” business processes.

In time these informal processes become part of the primary decision making processes.

This leads us to the following scenario: An organization uses Excel worksheets to calculate annual project budgets, uses SAP CATS for storing the actual project infor-mation (hours, team members and so on). The Cross Application Time Sheet (CATS) can be used by employees or personal administrators to track employee working times. Project managers would like to have a management dashboard in their portal to monitor how the actual projects are doing compared to the estimated annual budget.

We will give you a quick overview of a number of integration scenarios and explain how to configure the BCS and SAP Enterprise Services to bring the case scenario mentioned above alive.

Connecting SharePoint to SAPThere are multiple ways of integrating SAP applications with a SharePoint portal and these can be categorized into three groups:

1. User Interface integration

2. Process integration

3. Data integration

User Interface IntegrationIntegration with SAP can be realized by exposing SAP UI in a SharePoint site. You can host complete SAP pages in SharePoint using IFrames that contain SAP Business Server Pages (BSP). Due to the way BSP’s work this is somewhat of a challenge1. SAP also offers iViews which are based on the SAP NetWeaver Enterprise Portal product. IViews allows you to expose and combine pieces of SAP functionality using IView WebParts.

In our scenario UI integration is too limited because we want to combine and aggregate data from different sources. We want complete freedom in the look and feel of the user interface where both BSP’s and iViews will always have a SAP look and feel.

Process IntegrationProcess integration occurs when a business process has been started in SharePoint and uses SAP data or executes a SAP process before completing. Exposing SAP function-ality to the outside world can be accomplished in a number of ways. The old-school way is by using SAP Remote Function Calls (RFC) – or standardized Business Appli-cation Programming Interface (BAPI) program interface. Since the SAP API is used to extract data or execute a process this way of integration means tightly coupling. An upgrade of SAP could break your solution.

Page 97: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Fig. 1: The anatomy of a SAP Enterprise Service.

A better way would be by using SAP Enterprise Services. These services are stand-ardized web services which expose certain business data. All the Enterprise Services are stored in the Enterprise Services Repository (ESR). At this moment there are more than 3000 services available. Fortunately they are well-documented by SAP. Enter-prise Services offers the best solution for data integration, extracting data from SAP and using this data in SharePoint for scenarios like BI and full-text search.

The third way would be by using SAP NetWeaver Process Integration. This middleware layer maps, routes and transports data elements in messages. Adapters are available to map the data from SAP structures in Microsoft (.Net) structures in Microsoft appli-cations. The middleware layer centralizes the monitoring and lifecycle management of the process integration. This is also used in registry and management of Enterprise Services (The SAP Enterprise Service Registry and the SAP Enterprise Service Repository. Examples for using process integration in the area of processing EDI messages are csv files, SAP Intermediate Documents (IDoc’s) and exchange of XML files. An example for the use of web services is the Enterprise Services for chain process integration.

Data IntegrationData integration is much more interesting and we see a lot of business needs for this form of integration. Data integration is needed when not all the data needed for decision making is complete in the ERP system but is scattered over multiple back office systems. This is often the case in most companies. Imagine that you want to present a picture of an employee to the SAP CATS system but these pictures are in a separate system or file store. But also combining data and data enrichment from excel sheets must be quick and easy. Key is that the data from the original source keep their integrity. Determining the most robust way of data integration that respects all the existing business rules of the used data stores is described in this article.

One way to integrate with SAP on the data level is to export SAP transactional infor-mation into a SQL Server Analysis Services warehouse and then expose the data in SharePoint using the KPI capabilities2. Our scenario required real-time information however and therefore required a different solution.

Where to present the dataWhen sketching and architecture for the above described scenarios the question must be answered where to present the data to the end-user. As lots of companies now a days have SharePoint as an intranet portal SharePoint would be the most obvious place to implement the data and process enrichment. One of the key features of Microsoft SharePoint 2010 is the presentation of information and data. The Business Connectivity Service is one of the features that would be the most efficient place to integrate the data presented. It’s a standard service and it’s quick to realize because in this scenario it needs a minimum or no application development. Only the queries to the back office systems needs to be configured and enriched if they do not meet

Page 98: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

the requirements. As SharePoint 2010 has an enormous library of KPI-Web Parts and KPI lists the presentation possibilities are enormous.

SAP user authenticationWhen a user wants to access SAP data from within SharePoint you want to ensure that the user is authorized to access that data. Although there are multiple possi-bilities, depending on your SAP implementation, the two most commonly used are

1. SPNego - Active Directory for user authentication

2. SAP Logon Tickets - SAP usernames and passwords for user authentication

When SAP uses AD you have to ensure that you can delegate the user’s credentials from SharePoint to SAP which requires the use of Kerberos. This is by far the best and most secure way to pass credentials to SAP. When SAP uses SAP usernames and passwords you have no option but to do a form of credential mapping. Assuming your SharePoint solution uses AD accounts you will have to map each AD account to a SAP account or map an AD group of users to a specific SAP account. Mapping an AD group will ease access but at the cost of control. SharePoint offers the Secure Store Service (formerly known as SharePoint single sign on (SSO)) to enable you to do the credential mapping.

There are other ways to authenticate users in SAP. One of them being SAML; Security Assertion Markup Language (SAML) is an XML-based standard for exchanging authen-tication and authorization data between security domains. The usage of SAML might be interesting since SharePoint 2010 fully supports claim based authorization but that is beyond the scope of our case.

Using SAP Enterprise ServicesThe SAP Enterprise Services are atomic. So there is only one service operation in the enterprise service. Often they must be composed into composite enterprise services in order to use them in a business process. The next figure gives an overview how the business process is supported by the enterprise services.

Fig. 2: Overview which describes how a Business processis supported by an Enterprise Service.

Figure 2 shows that various service operations are used in the enterprise service. There are two options to compose enterprise services into consumable services: the SAP Composition Environment (using SAP CAF) and SAP NetWeaver Process Integration (using SAP Enterprise Services Builder). SAP Composite Application Framework (SAP CAF) is a composition tool in NWDS (SAP NetWeaver Developer Studio - an Eclipse-based IDE) and runtime on SAP Web Application Server Java for developing, testing, deploying, running and configuring composite applications.

We will focus on composition using the SAP Enterprise Services Builder. The process details are given in the next figure.

Page 99: MOSS eMagazine

��

SharePoint® eMagazine2010 Special

Fig. 3: Composing an Enterprise Service.

The SAP Enterprise Service Builder is a component of SAP NetWeaver Process Integration. In our case scenario we need three Enterprise Services:

1. Get a list of employee numbers with data entries in the time sheet database (SAP CATS)

2. Get the employee name for a given employee number form SAP HR

3. Get the time sheets for an employee number in a given time frame (SAP CATS)

The services are selected in the SAP Enterprise Service Repository. This contains the XML structures and binding to the SAP back-end in ABAP classes that actually access the data. In order to populate the Enterprise Service it must be published using the SAP SOA Manager in a UDDI standardized registry. After this step the enterprise service is available.

There are two options to bind the implementation to the composed enterprise service. Using internal binding and external binding. The internal binding uses the SAP API (ABAP Provider Class) and the external binding uses the published atomic enterprise services as individual service operations. It is obvious that external binding is better because it is more future proof.

Now we have our SAP Enterprise Service composed and available we should set up the BCS and connect it to our Enterprise Services.

Using SharePoint 2010 Business Connectivity ServicesThe primary way to integrate external data in SharePoint 2010 is a service application called Business Connectivity Services (BCS). This service uses connectors to connect to external data sources and maps the external data to a SharePoint data model. The data model is based on the way data is structured in SharePoint using Lists and Columns and is called External Content Types. This functionality enables you to integrate SAP data or other external data sources in your SharePoint site and use that to provide portal functionality like exposing and searching SAP data in your portal or offering BI functionality in your portal (aggregate SAP data and create Charts and KPI’s).

BCS is able to connect to the following data sources:

n Databases using ADO.NET

n Web services or WCF services

n Microsoft .NET Connector Assemblies

n Custom data sources

Page 100: MOSS eMagazine

100

SharePoint® eMagazine2010 Special

Fig. 4: BCS architecture.

These data sources are listed in order of ease of use. Connecting to a database is easy because they usually map very well to External Content Types since Lists have a lot in common with database tables. An External Content Type in SharePoint is an external data source that is exposed (using BCS) as a special SharePoint List called an External List. One of the advantages of that approach is that the User Interface is identical to that of a normal List in SharePoint and is therefore intuitive to the experienced SharePoint user. A user viewing and editing customer data for instance might not even notice that the data is actually coming from and being updated in SAP. Also external data can be joined with SharePoint data and can be filtered just like Share-Point Lists.

Connecting to Web and WCF services very much depends on the complexity of the service and the types used and how well they support the model BCS requires. If a data source is not directly supported or you need to do some translation you will have to write a .NET Connector or a Custom Data source using Visual Studio 2010, the differences between these two go beyond the scope of this article. There is better tooling and support to create .NET connectors but a Custom data source might be necessary if your back-end service is very dynamic or uses complex types.

For our business scenario we need to configure the BCS to connect to our composed SAP Enterprise Service. The first step we have to take is to configure the SharePoint Secure Store Service to map AD / SAP credentials. The next step is to discover our SAP Enterprise Service and create the external content type:

Fig. 5: Configuring a Read Item operation for the SAP Enterprise Service.

Page 101: MOSS eMagazine

101

SharePoint® eMagazine2010 Special

We will select the WCF type and enter some parameters for the data connection like URL for WSDL, URL for Web service endpoint and Target application ID as defined in Secure Store Service. After that we use the created External Content Types in Share-Point to create the External Lists. Finally we create a SharePoint Composite appli-cation that combines data from SAP, SharePoint and Excel Services. Now we have all the data to create whatever dashboard we want.

ConclusionThe SharePoint Business Connectivity Services is a great way of consuming data from SAP. Unfortunately we were not able to connect the current beta (v. 14.0.4536.1000) of SharePoint 2010 directly to the SAP Web services. We encountered two problems. The first was that BCS requires that both the Finder and SpecificFinder3 method of an external content type has to come from a single data source (Web service) where that functionality could only be found in separate SAP Web services. The creation of our SAP Composed Web service fixed that.

The second problem we encountered is when saving the external content type, due to what we suspect is still a bug in the beta version. We ended up creating our own WCF service that operates as a wrapper around the set of SAP Web services. In the end you will probably always need some form of wrapper or middleware because the SAP Web services do not conform to the requirements of BCS.

Once we had BCS configured we were able to expose SAP data in the form of external lists and start building our SharePoint Composite Application.

Another nice feature of the BCS, which we haven’t mentioned so far is that it can be used by an Office Client. It is a relatively small step to expose data from SAP services, through the BCS to the Microsoft Word, Excel or Outlook client. This is a very strong feature to offer SAP data to the standard and intuitive clients to a broader audience without distributing the standard SAP Client.

More infon Integration of SAP Business Server Pages (SAP BSP) in SharePoint 2007 (Microsoft)

http://bit.ly/6CZ18e

n Integrating Office SharePoint Server 2007 and SAP (Microsoft) http://go.microsoft.com/fwlink/?LinkId=91026

n Stereotyped Operations Supported By BDC http://msdn.microsoft.com/en-us/library/ee557363%28office.14%29.aspx

... by the way ...

SharePoint can be installed on Windows 7! Perfect for development. Make sure you meet the requirements, you do need a 64bit machine.

More information on the installation can be found on the following site:http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx

Tip from Marcel Meijer (VX Company) http://www.marcelmeijer.net

Page 102: MOSS eMagazine

10�

SharePoint® eMagazine2010 Special

SharePointComicby Dan Lewis

Page 103: MOSS eMagazine

10�

SharePoint® eMagazine2010 Special

Working With Data in SharePoint Designer 2010

Laura Rogers is a Senior SharePoint Consultant at SharePoint911. She has more than five years’ experience in SharePoint archi-tecture, administration, training and customization. Laura focuses on maximizing SharePoint’s out-of-box capabilities, and can be found doing screencasts on endusersharepoint.com, for her data view web part series. She is an enthusiastic blogger and tweeter, and an active member of the SharePoint community.

Sandboxed Solutions in SharePoint 2010

Mirjam van Olst is a SharePoint Architect in the Information Worker Solutions department of Macaw in the Netherlands. In this role she has been helping companies to implement SharePoint solutions since 2004. Mirjam is a Microsoft Certified Master for SharePoint 2007. Mirjam is co-organizer of DIWUG and a track owner of the Information Worker track of the SDN. Blog: www.sharepointchick.com.

New ECM features in SharePoint 2010

Robert van Son is Team Manager SharePoint at Wortell.Blog: http://blog.wortell.nl/robertWebsite: http://www.wortell.nlTwitter: http://www.twitter.com/rvanson

The SharePoint 2010 Enterprise

Sjoerd van Lochem is Competence Manager for SharePoint technologies at Qurius. He has been involved at numerous SharePoint projects. You can contact Sjoerd by e-mail [email protected].

Visual Studio Extensions or a Manually Build Solution?

Niels Loup is co-founder of Mavention and realizes as a principle consultant the most complex SharePoint solutions. Mavention translates concepts like “new way of work”, “web 2.0” and “information management” into applications with added value for organizations. Niels and Mavention are operative within the healthcare, government and business services industry. You can reach him by email at [email protected].

Customizing the SharePoint Ribbon

Marianne van Wanrooij is a solution architect and developer for Connected Solutions. She works on Information Worker solutions in the Education industry, integrating line of business (LOB) applications with Office clients and SharePoint. Next to her daily work, she runs two user groups, DIWUG (www.diwug.nl) and the SDN Information Worker track (www.sdn.nl/iw).

Creating new Visual Experiences with Visio Services

Toni Frankola’s primary focus is on Microsoft Office SharePoint and Dynamics CRM. He runs his own company that specializes in SharePoint consulting, education and software product development. Toni is author of SharePoint Use Cases (www.sharepointusecases.com) and co-author at End User SharePoint (www.endusersharepoint.com)

Page 104: MOSS eMagazine

104

SharePoint® eMagazine2010 Special

A SharePoint User eXperience

Sandra de Ridder ([email protected]) is a SharePoint and UX consultant at Sparked (www.Sparked.nl). She is also involved in the UX track from SDN.

SharePoint 2010 Client Object Models

Ton Stegeman ([email protected]) works as SharePoint architect for PGGM in the Netherlands.His weblog (www.tonstegeman.com/blog) contains a lot of SharePoint development related content.The CodePlex project (http://sharepointobjects.codeplex.com) contains a number of open source SharePoint projects that are created and maintained by Ton.

Understanding Identity in SharePoint 2010

Michiel van Otegem is Chief Software Architect at BataviaLabs in the Netherlands. He is also an author and speaker, and has been a Microsoft MVP for the last 7 years. You can reach Michiel at [email protected] and check out his blog at http://michiel.vanotegem.nl.

Introduction to the Business Connectivity Services

Nick Swan, a MVP for Office SharePoint Server, has been devel-oping on top of the Microsoft technology stack since 2000. After creating one too many ASP.NET web sites and Winform applica-tions Nick decides to look into another area and since 2005 has been concentrating on SharePoint. Nick spends the majority of his time developing SharePoint tools under the umbrella of Lightning Tools. They specialize in BDC development tools and web parts. Nick also co-organizes the SharePoint User Group (www.suguk.org). Blog: www.sharepointnick.com.

SharePoint 2010 Chart Web Part

Agnes Molnar (MVP) has been working with Microsoft techno-logies and SharePoint since 2001. After releasing MOSS 2007, she founded L&M Solutions, her own SharePoint consultant company in Hungary, Central Europe. She’s been working as principal consultant and solutions architect, has leaded numerous Central European companies’ SharePoint implemen-tation. She’s an active writer and regular speaker of various SharePoint conferences around the world.

Happy Together in 2010

With over 15 years of experience in IT and Project Management, Dux (you’re right, it’s pronounced as “ducks”) has earned a reputation as leading expert in leveraging technology to enhance project management. A Project Management Profes-sional (PMP), he is currently a managing partner and the chief evangelist of Innovative-e, Inc. He is the author of “SharePoint for Project Management”. Blog: http://www.meetdux.com

Page 105: MOSS eMagazine

10�

SharePoint® eMagazine2010 Special

Enrich your SharePoint 2010 portalby integrating SAP applications

Cyrille Visser is a Senior Architect within Atos Origin with a strong background in Microsoft technology. He is specialized in Service Oriented Architectures and gets very enthusiastic in dealing with complex architectural problems.

Johan Kroese is a Microsoft solution specialist working at Atos Origin who has been architecting and developing Microsoft based solutions for customers for over a decade. Although he still enjoys pure (ASP).NET he now spends most of his time on SharePoint Solutions and is a Microsoft Certified Master (MCM) on SharePoint 2007.

Huub Montanus is a SAP Solution architect at Atos Origin with a focus on enterprise architecture and process integration.

SharePoint ComicDan Lewis a SharePoint Consultant & Speaker. He is specialized in Microsoft Office SharePoint Server 2007 and Windows Share-Point Services 3.0. He’s a MCAD as well as a MCTS in the config-uration of SharePoint. He’s a Senior SharePoint Consultant for ettain group and active in the SharePoint community and on the committee for the Charlotte SharePoint User Group.website: http://www.sharepointcomic.com/default.aspx