Working with Web Parts and Lists in the BDC


Once you have defined an application in the BDC per the discussion in the last section, SharePoint users can access it from within interface elements, such as Web Parts and list columns. You discover how to work with these items in this section.

Chapter 7 discusses how important Web Parts are to a SharePoint site for displaying information users need to do their jobs. One of the Web Part groups introduced in that chapter was the Business Data group, which has a specialized set of Web Parts that interact and connect with one another so users have a rich reporting environment. The Business Data Web Parts give you a way to display business information on your SharePoint site and allow users to interact with it to filter and generate more information.

If you had a business application in the BDC that contained all your customer service information, you could use Web Parts to see a listing of customers, search for customer information, view customer details, or see a listing of orders related to a selected customer. All of this is possible using one or more of the following Web Parts:

  • Business Data List Web Part:   Allows you to display information from a business application related to a specific entity. This information may be based on a predefined filter so that users automatically see a list when viewing the Web Part, or it may be based on searches that the user conducts within the Web Part.

  • Related Business Data List Web Part:   Connects to another Web Part, such as the Business Data List Web Part to show more information related to a selected item such as product subcategories or customer invoices.

  • Business Item Web Part:   You can use this on its own to display a single item, but often it is connected to another Web Part to display details of a selected item. For example, you can use a Business Item Web Part to display invoice details based on a user’s selection of a customer invoice from a Related Business Data List Web Part.

You review each of these Web Parts in the upcoming sections of this chapter.

As the person responsible for managing your organization’s SharePoint environment, it’s important for you to meet with your business users to define what applications contain the data they need to perform their jobs more effectively, and then create an interface that supports their goals and objectives. By familiarizing yourself with the various Web Parts and their capabilities, you become better equipped to make good recommendations and implementation choices on how best to empower your business users.

Business Data List Web Part

The Business Data List Web Part is very similar to a Datasheet View or the List View Web Parts explored in Chapter 7. It can display a business application’s information in a table view. However, unlike a List Web Part, it can facilitate real-time drill-down searching and information filtering, and can generate reports based on user requirements.

The next four Try It Outs show you everything you need to know to set up a Business Data List Web Part. In the first Try It Out, you configure the Web Part by defining which business application and entity the Web Part will connect to. In addition, you can set limits to the number of items that are returned or what properties are displayed. In the second Try It Out, you use the Web Part to search for a specific item, which involves defining criteria for your search. In the third Try It Out, you see how to launch an action from a Web Part. In the final Try it Out of this section, you learn how to customize the Web Part view based on user requirements or preferences.

Try It Out-Configure the Business Data List Web Part

image from book

In this example, you add the Business Data List Web Part to the customer service team site so that members of the site can easily retrieve information about products. You then select what business data entity you want to display in the Web Part. Because your goal is to provide users with quick and easy access to detailed product information, you add the product entity so that users can perform lookups on specific products directly from their SharePoint site.

  1. From your corporate intranet portal, create a new site from the Sites directory called “Customer Service” using the blank site template. The blank site template was introduced in Chapter 8 as one of the collaborative site templates.

  2. Choose Site Actions image from book Edit Page. The page reloads in Edit mode.

  3. Click the Add a Web Part link from the left Web Part zone. The Web Part selection window appears, as shown in Figure 12-8.

    image from book
    Figure 12-8

  4. Select the Business Data List Web Part from the Business Data section.

  5. Click the Add button. The Web Part Selection window closes, and the page reloads with the Web Part you selected added to the left Web Part zone.

  6. Click the Open Tool Pane link in the Business Data List Web Part.

  1. Click the Browse button. The Business Data Type Picker – Webpage Dialog appears, as shown in Figure 12-9.

    image from book
    Figure 12-9

  2. Select the Business Data list you want to display. In Figure 12-9, you select the Products list from the AdventureWorks Sample database.

  3. Click the OK button.

  4. Expand the Appearance options and change the Title to Our Products.

  5. Click Apply, and then OK. The page refreshes with the Business Data List Web Part configured on the page.

image from book

Try It Out-Display Items in the Business Data List Web Part

image from book

In this example, you use the search capabilities of the Business Data List Web Part to locate product details on a bike stand that your company produces. First, you select the Name property from the drop-down list and enter a value that you expect the product name contains. You can include additional criteria in your search by clicking the Add button and defining new rules. Once you define the criteria of the search query, you select the Retrieve Data button, which returns a filtered set of results meeting your criteria.

  1. From the main page of your customer service page, select a property from the drop-down list in the Our Products Web Part you configured in the last exercise, as shown in Figure 12-10. In this example, you perform a search using the Name property.

  1. For the text value, select Contains.

    image from book
    Figure 12-10

  2. Type a value into the search box that will likely return the items for which you are looking. In this example, search for items that contain the word Bike.

  3. Click the Add link.

  4. Add another test value to further refine your search. This example selects where the description contained the word stand because you want to search for a bike stand.

  5. Click the Retrieve Data button. Results are returned similar to what appears in Figure 12-11.

    image from book
    Figure 12-11

image from book

Try It Out-Launch an Action from a Business Item

image from book

In this example, you conduct a search for an item with a specific phrase or word in the product name. From the listing of returned results, a subset of details should display in the Web Part. The details of what displays in the Web Part are selected by the site manger, and you review how this is done in the next Try It Out. Sometimes to keep the display of information simple and easy to read, you should have only a small amount of data display in the Web Part. For example, for a product, you might only display the product name and price columns. To view more details on a specific product, you would want to be able to click a link to see all the information. In the Business Data List Web Part, you can use the View Profile action to do this.

  1. Return to the home page of your customer service site. Use the Business Data List Web Part that you added to the page in the previous Try It Out to perform a search. This example will perform a search for where the product name contains “HL.”

  1. From the returned results, select an item and hover your cursor over the item name to expand the contextual menu.

  2. Select the View Profile action as shown in Figure 12-12.

    image from book
    Figure 12-12

image from book

Try It Out-Change the View of the Business Data List Web Part

image from book

By default, all columns related to the data source display in the Web Part. In this Try It Out, you edit the properties of the Business Data List Web Part so that you change what details display, including the number of items. When determining how many items display on the site, remember that the more you select, the more time it takes to load them on the page. Obviously, pulling too much data from the data source will result in delays.

The process of selecting what properties display in the Web Part is very similar to creating a view on a list, which you learned about in Chapter 4. You select the check boxes of the items you want to display in the view and then identify the order in which they are listed from left to right. You should only include the items that users are likely to need. Using actions, users can view the complete profile of an item (see the previous Try It Out); therefore, you should only include those properties most relevant to users. For example, if you were showing product information, you may only include details related to the product that users would often look up, such as name, description, and price.

  1. From the main page of your customer service site created in a previous Try It Out, select the menu arrow on the “Our Products” Web Part and then Modify Shared Web Part. The page and Web Part reload in edit mode.

  1. Select Edit View as shown in Figure 12-13. You are redirected to a page where you may edit details of the view.

    image from book
    Figure 12-13

  2. Select Retrieve All Items.

  3. Unselect the columns you do not need displayed in the view, as shown in Figure 12-14.

    image from book
    Figure 12-14

  4. For the Pages section, select to return items in groups of 10.

  5. Click the OK button.

How It Works

Because specific queries can potentially return large amounts of data, the Web Part supports the grouping of results so that only a limited number of items display at a time. Users can use the arrows next to the results grouping to view the next set of items in the list. Figure 12-15 shows an example of this..

image from book
Figure 12-15

image from book

Related Business Data List Web Part

As mentioned in the section “Viewing Entities,” entities store information concerning how they relate to other application entities. The SharePoint site manager can use the Related Business Data List Web Part to create a drill-down or dynamically driven reporting experience for site visitors. As a user selects an item in one Web Part, another Web Part can automatically filter to display more details related to the initial selection. For example, if the Business Data List Web Part displays a listing of customers, you can use the Related Business Data List Web Part to display a related listing of invoices.

In the first of the two Try It Outs in this section, you walk through the process of adding a related Business Data Web Part to a page along with a Business List Web Part and connecting the two parts so that users can select an item in one and see a related list drawn in the second. To start off the exercise, you create reports your customer service team needs as well as the document library that stores them. You then connect the two Web Parts on the Web Part page. This creates a filtered connection between the two related items. Now when a user visits the page, the selection in one Web Part should change the information that is presented in the other Web Part. In the second Try It Out, you test your creation by selecting items in one Web Part to see how the second one changes.

Try It Out-Configure the Related Business Data Web Part on a Page

image from book

In this example, you create a new document library on the customer service site for storing custom reports that you want users to access. You select Web Part page as the document template for the library because users will create the majority of report pages by clicking the New menu item directly from the Document Library toolbar. Users can select whichever Web Part page layout they feel best suits their data. Agood choice is a multiple column web page of Web Part zones; it allows you to see two Web Parts side by side so that as users change one, they can view the changes on the other.

At first you add a simple Business Data List Web Part containing a list of product categories. In the case of the AdventureWorks database used for this exercise, you only have four product categories. Therefore, it’s wise to have all items retrieved by default when users visit the page. After you configure the Business List Web Part containing product categories in the left-hand column, you add the Related Business Data List Web Part to the page to the right-hand column. You will then connect this Web Part to the product subcategories entity. This Web Part, while very similar in display to the previous Web Part, relies on the relationship between two entities to function. By defining the relationship in the Web Part properties, you will notice a message advising that the Web Part must be connected to the product categories list.

  1. From your customer service site, select Site Actions image from book Create. You are redirected to the content creation page.

  2. Select Document Library.

  3. Name your document library Reports, select to display the library on the Quick Launch bar, and select Web Part Page as the document template.

  4. Click the Create button. The page reloads, and you are redirected to your new document library.

  5. Select the New button from the Document Library toolbar. The New Web Part Page appears, as shown in Figure 12-16.

    image from book
    Figure 12-16

  6. Enter a name for the Web Part page. For this example, enter productcategories.aspx.

  7. For the layout template, select Header, Left Column, Body.

  8. Click the Create button. The page reloads, and you are redirected to your new Web Part page.

  9. From the left column, select Add a Web Part.

  10. Select the Business Data List Web Part and click the Add button. The page reloads containing your Web Part. No information is displayed in the Web Part until it has been configured.

  11. Click the Open the Tool Pane link to modify the properties of the Web Part.

  12. In the Web Part properties pane, for the Type field, click the Browse button. The Business Data Type Picker – Webpage Dialog appears, as shown in Figure 12-17.

    image from book
    Figure 12-17

  1. Select an entity that will be the master list. For example, select the Product Category list from the AdventureWorks DB Sample.

  2. Click the OK button. The picker window closes and the selected entity is displayed in the Type field.

  3. Click Apply, and then OK. The page refreshes to show the configured Web Part.

  4. Click the Edit View link on the Web Part.

  5. For Items to Retrieve, select Retrieve All Items.

  6. Click the OK button. You are returned to the main page of your customer service site where the Business Data List Web Part displays all items from the selected entity.

  7. Select Site Actions image from book Edit Page.

  8. For the Body Web Part zone, select Add a Web Part.

  9. Select Business Data Related List, and click the Add button.

  10. Click the Open the Tool Pane link.

  11. From the Web Part properties pane, click the Browse button and select the child item from the Business Data Type picker window. For this example, select the Product Subcategory list from the AdventureWorks DB Sample.

  12. Click the OK button on the Business Data Type picker window.

  1. For Relationship, select the appropriate relationship between the current entity and the entity to which it is related. In this example, select the relationship that is available as the ProductCategorytoProductSubCategory item, as shown in Figure 12-18.

    image from book
    Figure 12-18

  2. Click Apply, and then OK on the Web Part properties pane. The page refreshes and displays a message indicating that the related business item Web Part must be connected to a Web Part that provides Product Category.

  3. Select the Edit button on the Product Subcategory List Web Part.

  4. Select Connections, then Get Related Item From, and then select the Product Category List.

  5. Click the Exit Edit Mode link.

image from book

Try It Out-View Related Business Data on a Page

image from book

In this example, you visit the reporting page that contains two connected Web Parts that you created in the last Try It Out. By selecting a product category from the first Web Part, a listing of subcategories returns in the other Web Part. This example demonstrates one possible level of filtering. Realistically, the next step would be to add another related items Web Part to the page so that when a user selects a product subcategory from the second Web Part, a listing of products related to that subcategory displays. More than one instance of a Related Business Data List Web Part can exist on a single page.

  1. From the home page of your customer service site, click the Reports link from the Quick Launch bar.

  2. Select the productcategories.aspx page. The page appears, as shown in Figure 12-19.

    image from book
    Figure 12-19

  3. Select an item in the Product Categories list in the left-hand column. The right-hand column’s data adjusts to display the items related to the category you selected.

image from book

Business Item Web Part

In the previous Try It Out, you saw how to connect the Related Business Data List Web Part to another business data list to show relevant information based on selection from the master list. With the Business Item Web Part, you can select an item from a Business Data List or Related Business Data List Web Part and the Item Web Part will display the details for the selected item. The Business Item Web Part can be filtered to display only a single item on the page by default, or it can be connected to another Web Part to display details for a selected item. For example, if you had a SharePoint site for tracking information related to a single customer, you might have only their record displayed in a Business Item Web Part on the site. Otherwise, you might connect the Web Part to another so that the details of a user’s selection display. For example, if a user selects a specific customer invoice from a business data list, the details of the invoice can display in a Business Item Web Part.

Try It Out-Configure the Business Item Web Part

image from book

In this example, you add two Web Parts to a custom Web Part page. The first Web Part is a Business Data List Web Part set to display a listing of items based on a user’s query. The second is a connected Web Part that is configured to display details of the selected item. When you combine this feature with the previous Try It Out, you can create reporting pages that allow a team member to select an item from a listing and then drill down via other Web Parts to related items and eventually view the details of a single selected record.

From the properties of a Business Item Web Part, you can determine what actions display on the toolbar of the Web Part. This allows users to launch related business activities and processes directly from the web page when viewing details about a specific item. For example, if your user is viewing a page that contains information about a customer, you can display an action on the toolbar to email the client.

  1. From the home page of your customer service site, select the Reports document library from the Quick Launch bar. You are redirected to the Reports document library.

  2. Click the New button from the Document Library toolbar. AWeb Part page creation screen appears.

  3. Enter the page name. For this example, enter productdetails for the page name.

  4. For page layout, select Left Column, Header, Footer, Top Row, 3 Columns.

  5. Click the Create button. Your new Web Part page is created, and you are redirected to it.

  6. From the left column, select Add a Web Part. The Web Part selection window appears.

  7. Select the Business Data List Web Part.

  8. Click the Add button. The Web Part selection window closes, and your Web Part is added to the page.

  9. Click the Open Tool Pane link from the Web Part.

  10. Select an entity to display in the listing using the method described in previous Try it Outs. In this example, you can use the Product entity from the AdventureWorks sample database.

  11. Click the OK button on the Business Data Type picker window once your entity is selected.

  12. Unselect the check box next to Display Animation When Loading.

  13. Click Apply, and then OK from the Web Part properties pane.

  14. Select Edit View on the Web Part. The Edit View window appears, as shown in Figure 12-20.

    image from book
    Figure 12-20

  1. For Items to Retrieve, maintain the choice of Retrieve Items Specified by the User.

  2. For Columns, unselect all items except the primary display name such as Name.

  3. Click the OK button. You are returned to your page.

  4. Select Site Actions image from book Edit Page.

  5. From the header Web Part zone, select Add a Web Part.

  6. Select Business Data Item.

  7. Click the Add button.

  8. Click the Open to Tool Pane link from the Business Item Web Part.

  9. Once again, select the same entity you used for the other Web Part in step 10. This example, selects Product for the entity, as was done in the previous step.

  10. Click the OK button on the Business Data Type picker window once your entity is selected.

  11. Click Apply, and then OK from the Web Part. The page refreshes and a message appears in the Web Part suggesting that you connect it to another Web Part.

  12. Click the Edit button for the Web Part.

  13. Select Connections image from book Get Item From image from book Product List from the drop-down menu, as shown in Figure 12-21.

    image from book
    Figure 12-21

  14. Click the Exit Edit mode link. Your page is now configured.

How It Works

To test your configuration, conduct a search in the Business Data List Web Part for items that contain HL in the name and select an item from the search results so that you can see the details appear in the Business Data Item Web Part. An example is shown below in Figure 12-22.

image from book
Figure 12-22

image from book

Business Data Actions Web Part

You can add the Business Data Actions Web Part to a page to launch actions available for selected or connected items. As previously discussed, entities can contain special actions that users can launch from either the Actions menu of an item or the toolbar of a Web Part. In addition, you can place a Business Data Actions Web Part on a page to enable users to launch actions related to business entities displayed on the current page.

You can add a Business Data Actions Web Part using the same steps as in steps 6 through 8 previously. Properties of the Web Part can then be modified by opening the tool pane, which is described in step 9 of the “Configure the Business Item Web Part” Try It Out.

When modifying the properties of a Business Data Actions Web Part, you must define the entity that the Web Part is referring to. From there, you may select what actions should display and the order in which they are listed. You may choose to display actions as a bulleted list, standard list, or toolbar. In addition, you may select to have new actions displayed within the Web Part automatically. This may result in less administrative overhead as the entities evolve over time.




Beginning SharePoint 2007. Building Team Solutions with MOSS 2007
Beginning SharePoint 2007: Building Team Solutions with MOSS 2007 (Programmer to Programmer)
ISBN: 0470124490
EAN: 2147483647
Year: 2007
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net