Wrox Beginning SharePoint 2010 Development phần 7 doc

50 318 0
Wrox Beginning SharePoint 2010 Development phần 7 doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Building the Application  269 5. In Step 1 of the wizard, select the Column chart, as shown in Figure 7-11. Accept the default options for Step 2 of the wizard and click Next. FIGURE 711 Standard Chart Types Categories dialog 6. For Step 3 of the wizard, check the Show Chart Title checkbox and provide a title for your chart (for example, FY 10 Sales, as shown in Figure 7-12) and click Auto Preview to see a rendering of the chart. Click Finish to complete the custom chart configuration. FIGURE 712 Adding a chart title and viewing a preview 584637c07.indd 269 5/2/10 7:13:31 PM 270  CHAPTER 7 Creating Your First sharePoint 2010 aPPliCation 7. Right-click the drop-down arrow again and select Connect To Data, as shown in Figure 7-13. 8. Select “Connect to a List” and click Next, as shown in Figure 7-14. 9. Select the list to which you want to bind your Chart map and click Next, as shown in Figure 7-15. 10. If your mapping was successful, you will see a tabular rendering of the data as shown in Figure 7-16. Click Next to move to the next step in the wizard. 11. You can provide some customizations to change how the chart will look in this step. Accept the default options and click Finish to complete the wizard, as shown in Figure 7-17. FIGURE 715 Binding the chart to a list FIGURE 716 Retrieving and filtering data FIGURE 713 Connecting Chart Web part to data FIGURE 714 Connecting to a list 584637c07.indd 270 5/2/10 7:13:31 PM Building the Application  271 FIGURE 717 Binding the chart to data At this point, SharePoint will render the Chart Web part and expose a columnar chart view of the data in the Total Sales list. Figure 7-18 provides an example of this. One thing worth mentioning is that, when you update the list, the Chart Web part is updated automatically, so you don’t need to worry about your user having to explicitly click a Refresh button anywhere. Once the data is updated from the Aggregate Sales Web part, the changes will be graphically reflected in the Chart Web part. Final Dashboard Using the site themes, you can very easily provide some brand- ing for the site where you’re going to insert all of the Web parts. Alternatively, you could add a simple graphic (such as a company or group logo) to light up the out-of-the-box themes as well. Or, you could go so far as to create a custom master page for your site. You’ll note that, in Figure 7-19, there is a custom logo that is used (the fictional Litware company logo). This was added by using the Image Viewer Web part (Site Actions  Edit Page  “Add a web part”  Insert  “Media and Content,” and select the Image Viewer Web part), which simply exposes (using a URL reference) a graphic file you’ve added to a SharePoint library. However, the effects of including even a simple graphic can be transformative for your site. So, be sure to think about these small enhancements when building your SharePoint sites. FIGURE 718 Displaying data in the Chart Web part 584637c07.indd 271 5/2/10 7:13:31 PM 272  CHAPTER 7 Creating Your First sharePoint 2010 aPPliCation Figure 7-19 shows the final sales dashboard. You can see here that a number of companies have been added to the Customer Sales Information Web part, the sales have been tallied, and the data has been rendered across three fiscal years in the Chart Web part. FIGURE 719 Rendering the Final Sales dashboard Congratulations! Now that you’ve created all of the Web parts that made up the Sales dashboard, you’ve created your first end-to-end solution. You did apply many of the things you’ve already seen in the book — with a few new items thrown in — so this should have been pulling practice together. As you become more familiar with the SharePoint object model and APIs, you’ll think of other ways that you can creatively integrate data and .NET applications with SharePoint. SUMMARY The great thing about SharePoint is that you can create simple or more complex solutions — depend- ing on what you’re trying to achieve. For example, you’ll learn later in this book that you can use InfoPath as a data-entry form, or the list itself can be exposed as a Web part and, thus, be an arti- fact of your dashboard. Further, key performance indicators (KPIs) or Excel Services could also be used. And all of this is okay, because, in the real world, you would make choices against all of these features within SharePoint. In this chapter, things have been kept simple, and your design was aligned with what was learned in previous chapters. You’ll want to explore the different ways in which you can build and integrate applications with and into SharePoint 2010. In this chapter (and very much in the past few chapters), you’ve learned that lists and Web parts are the core building blocks of a SharePoint site, and there are many different ways to code against them and leverage them. As you move into the next few chapters of the book, you’ll go beyond the list and Web part to explore other, more advanced programmatic aspects of SharePoint. 584637c07.indd 272 5/2/10 7:13:31 PM Summary  273 Chapter 8 starts that exploration with an examination of the integration of line-of-business (LOB) data using Business Connectivity Services (BCS). EXERCISES 1. Review other features of SharePoint and write down different ways that you might design the solution, assuming that the requirements do not change. For example, instead of using the server-side object model, use the Lists Web service. 2. Add the capability to check to see if the FY10 list item exists before adding a new record. If it does, then replace the old data with newly updated aggregates calculated using an extended helper function. 3. Create a new list definition and list instance programmatically. Deploy the code into SharePoint and manually add some data to the list to test the functionality. 584637c07.indd 273 5/2/10 7:13:31 PM 274  CHAPTER 7 Creating Your First sharePoint 2010 aPPliCation WHAT YOU LEARNED IN THIS CHAPTER  ITEMS DESCRIPTION Design Designing SharePoint solutions can encompass multiple features or SharePoint artifacts (for example, list, Web part, and so on). Server-Side Object Model This chapter put the server-side object model into practice as one of the central list APIs in SharePoint 2010. Visual Web Parts Visual Web parts enable many dierent types of customization. In this chap- ter, you learned how to use these types of Web parts with datagrids and read/write list programmability. Lists as a data source You learned that you can use lists as data sources, which can be manually created or deployed as list definitions/instances with your solution files. RECOMMENDED READING Microsoft SharePoint 2010 SDK at  http://msdn.microsoft.com/en-us/library/ ee557253(office.14).aspx SharePoint 2010 Web Services SDK at  http://msdn.microsoft.com/en-us/library/ ee705814(office.14).aspx MSDN content on  String.Format method at http://msdn.microsoft.com/en-us/ library/system.string.format.aspx 584637c07.indd 274 5/2/10 7:13:31 PM Part III Advanced Topics for SharePoint 2010 Development CHAPTER 8:  Integrating Line-of-Business Data Using Business Connectivity Services CHAPTER 9:  Creating Enhanced User Experiences for SharePoint with Silverlight CHAPTER 10:  Developing Service-Oriented Applications for SharePoint 2010 CHAPTER 11:  Integrating SharePoint with Microsoft Oce CHAPTER 12:  Securing Your SharePoint 2010 Applications 584637c08.indd 275 5/2/10 7:13:43 PM 584637c08.indd 276 5/2/10 7:13:43 PM Integrating Line-of-Business Data Using Business Connectivity Services WHAT YOU'LL LEARN IN THIS CHAPTER: Getting to Know Oce business applications (OBAs)  Understanding the Business Connectivity Services (BCS) and how  you can build OBAs using them Working with SharePoint and Oce integration techniques using BCS  One of the key innovations in SharePoint 2007 was the Business Data Catalog (BDC), which was a set of services and Web parts that enabled read-access to ADO.NET and Web service-based connections to line-of-business (LOB) systems. However, there were limitations with the BDC (for example, it was read-only), so, SharePoint 2010 introduced the Business Connectivity Services (BCS) as an evolution to the BDC. BCS evolved the BDC to be read/write, more programmable, and to look and feel like other lists in SharePoint. BCS is important because many companies want to integrate LOB data with SharePoint, and they want read/write access to that data from SharePoint and Microsoft Office. Because these applications integrate LOB systems with SharePoint and Microsoft Office, they are called Office Business Applications (OBAs). This chapter introduces you to the concept of OBAs and discusses SharePoint’s new BCS func- tionality that provides great integration with LOB systems. This chapter also walks you through some practical examples of how you can integrate ADO.NET-based and Web service-based con- nections with SharePoint and Microsoft Office to create an OBA. 8 584637c08.indd 277 5/2/10 7:13:43 PM 278  CHAPTER 8 IntegratIng LIne-of-BusIness Data usIng BusIness ConneCtIvIty servICes UNDERSTANDING OFFICE BUSINESS APPLICATIONS OBAS One of the key issues faced by many organizations is unlocking critical business data that resides in large, enterprise systems. This might be seen as a data issue — that is, getting the right data out of a back-end system and into the hands of information workers to help them in their day-to-day jobs. However, many business and IT managers will also tell you that there is a significant monetary and productivity gain in extracting this data, and in creating the connection to those who need it the most. Take the example of sales forecasting, which typically needs to happen at the summary level on a quarterly basis. Often, you’ll find that companies track this information on a daily or weekly basis to ensure that pressure is constantly applied toward tracking and achieving the revenue goals of the company. If the sales data resides in a system that is not easily accessible, then unlocking this infor- mation becomes critical to the enterprise. Let’s imagine that a fictional company called Acme has an SAP system in which they store all customer and sales information. Today, accessing data in SAP is difficult, because you may need to interact with an IT professional who has SAP-specific knowledge and access to get you that information. The sales team wants this information in the tools that they use everyday: Microsoft Excel and SharePoint. This enables them to view and manage the data in the way in which they’re most comfortable. To achieve this, the SAP IT professional copies the data into a spreadsheet, perhaps formats it, and then sends it on to the team via email. The team then uses that spreadsheet in the course of their forecasting exercises. Now, this may seem acceptable for a quarterly process. However, when you begin to think about this process from the monthly, weekly, daily, or even on-demand perspective, creating a dependency like this on the SAP specialist gets a bit hairy. Furthermore, once you have a snapshot of the data, you may want to leverage it across other applications (for example, pull it into PowerPoint to auto- matically create sales presentations). Thus, the question becomes why not customize the Office or SharePoint interface, and have a direct link to the LOB data so that information workers don’t have to focus on the process of getting the data? The information workers could instead focus on work- ing with the data. Enter Office business applications (OBAs). Simply defined, an OBA is a solution that integrates SharePoint and/or Microsoft Office and LOB data. It was created as a result of companies using Office and SharePoint as a targeted interface into specific LOB data (also called external system or external data source). OBAs can be very powerful when fully realized. The power of OBAs derives from the capability to leverage many of the different features of the SharePoint and Office platforms — as well as wider Microsoft and non-Microsoft technologies. For example, OBAs can integrate customizations that you build into the Office client (such as custom Word templates), integrate LOB data into the documents, and then tie the document to an organi- zational process using SharePoint workflow. You can also create a simple SharePoint list that pro- vides a read/write view into a back-end LOB system. You might also leverage Silverlight to create a more dynamic experience with the LOB data (something you’ll learn in Chapter 9), and deploy the Silverlight-enabled application in SharePoint. And the possibilities go on. The point is that OBAs represent an expansive and versatile way to leverage many different parts of the Office and SharePoint platform to get LOB data into the hands of information workers. And, at 584637c08.indd 278 5/2/10 7:13:43 PM [...]... saves the document to SharePoint, and an approval workflow is kicked off • SharePoint document library Opens mail that is generated from SharePoint workflow and clicks a link to Stan’s forecast She approves the document, and an approval email is sent to Stan • Approval workflow Stan (Account Manager) Amy (Stan’s Manager) • SAP (LOB system) • Custom Excel document • Custom content type • SharePoint. .. AdventureWorksLT2008 Customer table, follow these steps: 1 Open SharePoint Designer 2010 2 Click File ➪ Open Site and then type the URL of your SharePoint site (for example, http:// fabrikamhockey) 584637c08.indd 291 5/2/10 7: 13:45 PM 292  3 ❘  Chapter 8   Integrating Line-of-Business Data Using Business Connectivity Services When SharePoint Designer loads the SharePoint site, it will display the current settings... in, for example, Office documents, SharePoint, and Internet blogs and wikis This was illustrated in Figure 8-1 584637c08.indd 280 5/2/10 7: 13:44 PM OBAs and BCS  ❘  281 In its simplest form, BCS represents a way to integrate external data systems with both SharePoint and Office In the process, BCS provides a way for developers to do the following: ➤➤ Surface external data in both SharePoint and Office... structures that you want to deploy into SharePoint On the right-hand side of Figure 8-2, SharePoint 2010 contains a BCS runtime that supports the BCS APIs and the execution of any code you write against BCS It also contains the external content type, which is the main way that SharePoint understands how to communicate with the external data system 584637c08.indd 281 5/2/10 7: 13:44 PM 282  ❘  Chapter 8   Integrating... and deploy to SharePoint Finally, the Web parts represent the BDC Web parts that ship with SharePoint 2010 The top layer contains the external list, which represents a new addition to SharePoint Foundation 2010 that enables the reading and writing of data to and from an external data source The external list looks and feels much like a normal list However, the data does not live in the SharePoint list,... System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089” IsCollection=”true”> 584637c08.indd 288 5/2/10 7: 13:45 PM Developing Your First Application Using BCS  ❘  289 . SharePoint sites. FIGURE 7 18 Displaying data in the Chart Web part 584637c 07. indd 271 5/2/10 7: 13:31 PM 272  CHAPTER 7 Creating Your First sharePoint 2010 aPPliCation Figure 7- 19 shows the final. Figure 7- 17. FIGURE 7 15 Binding the chart to a list FIGURE 7 16 Retrieving and filtering data FIGURE 7 13 Connecting Chart Web part to data FIGURE 7 14 Connecting to a list 584637c 07. indd 270 5/2/10. the code into SharePoint and manually add some data to the list to test the functionality. 584637c 07. indd 273 5/2/10 7: 13:31 PM 274  CHAPTER 7 Creating Your First sharePoint 2010 aPPliCation WHAT

Ngày đăng: 07/08/2014, 17:21

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan