Working With Web Part Libraries A Microsoft® Office FrontPage® 2003 White Paper This white paper discusses the different types of Web Part Libraries available to the FrontPage 2003 developer. It describes each library, and how to manage Web Parts in that library. It also points out the differences between accessing the libraries using FrontPage 2003 and using the web browser. Note: The instructions, screenshots, and behavior discussed in this white paper are based on Microsoft Internet Explorer version 5.5 or above. The user experience with prior versions of Microsoft Internet Explorer and with other browsers is going to be different – in general, the same level of features may not be available. Published: September 2003 For the latest information, please see http://www.microsoft.com/frontpage/default.htm Contents Introduction .................................................................................................................................1 Virtual Server Library ..................................................................................................................2 Deploying a Virtual Server Library .........................................................................................2 Site Library ..................................................................................................................................3 Navigating the Site Library .....................................................................................................3 Adding a Web Part to the Site Library Using FrontPage 2003 ..............................................4 Managing Site Library with SharePoint Central Admin ..........................................................5 Adding a Deployed Web Part in the Site Library ..............................................................5 Adding a New Web Part to the Site Library ......................................................................5 Removing a Web Part from the Site Library .....................................................................5 Online Library ..............................................................................................................................7 Creating a Library of Parts for a Page ........................................................................................8 Importing a Web Part ................................................................................................................11 Conclusion ................................................................................................................................12 References ................................................................................................................................13 Other Microsoft Resources ..................................................................................................13 Introduction A Web Part library is a central warehouse of Web Parts that you can use to locate a specific Web Part when you are creating a Web Part Page. You can access Web Part libraries at your site by clicking either Browse or Search from the Add Web Parts menu of the Web Parts task pane in FrontPage 2003: Web Parts Task Pane Once you locate the Web Part you want, you typically drag it to your Web Part Page. Depending on how your site administrator has configured your site, there can be up to three different Web Part libraries available: 1. Site Library: Web Parts available to a top level Windows SharePoint Services Web site. 2. Virtual Server Library: This library contains Web Parts available to all sites and subsites within a virtual server. 3. Online Library: By default, the Online Library contains an additional set of Web Parts available from Microsoft. However, a site administrator can redirect the online library to a different site. We will discuss each of these libraries in detail in the following sections. Note: Windows SharePoint Services has the notion of another library called the Page Library; however, FrontPage 2003 does not directly expose this library to users. We will discuss this in more detail at the end of this document. Working With Web Part Libraries 1 Virtual Server Library Large enterprises with many sites may decide to conveniently install the same set of Web Parts on many sites. In this case, consider storing these Web Parts in a Virtual Server Web Part Library. You can deploy Web Parts in a Virtual Server Web Part Library by developing a Web Part Package file (.cab). For more information on developing Web Part Package files, see the Windows SharePoint Services Software Development Kit. Deploying a Virtual Server Library Once you have a Web Part Package file, to deploy it, follow these steps: 1. Logon at the Windows SharePoint Services server with an account that has administrative rights. 2. Open a command prompt and change directory to local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\bin. 3. Run the following command: stsadm.exe –o addwppack –filename path_to_web_part_package_file This installs the Web Parts contained in the .CAB file into the virtual server library. Note: If there are multiple virtual servers on the same machine, then install the Web Part Package on all of them using the –globalinstall switch in the given command. For more information, see the article “Packaging and Deploying Web Parts for Microsoft Windows SharePoint Services” which is available online at http://msdn.microsoft.com/library/enus/dnspts/html/sharepoint_deployingwebparts.asp . Working With Web Part Libraries 2 Site Library These are Web Parts available to a given top level site and subsites within it. The name of this library is usually the same as the name of the top level site (such as “Team Web site Library” where “Team Web” is the name of the top level Web site). The Site Web Part Library is often the most central Web Part library for your work group. The Web Parts in this library come from: 1. The Web Parts made available to you by your site administrator at the top level Web site are the DWP files located in the Web Part Catalog document library. The server administrator typically manages these files and decides which Web Parts are available and safe for your site Note: You have to have at least Reader level permissions to the top level Web site to see the Web Parts present there. 2. Windows SharePoint Services lists (Announcements, Events, etc.) and libraries (Shared Documents, etc.) that are in the current subsite. Navigating the Site Library Sometimes, as the site changes, this library may end up with a large collection of Web Parts. To help the author navigate through this library, FrontPage 2003 provides the ability to filter based on the type of the Web Part. When you select the site library in the Web Parts task pane, FrontPage 2003 makes available a Filter link. Clicking on this link displays a drop down list of filter conditions, which you can use to choose a subset of Web Parts in this library. Working With Web Part Libraries 3 Show Libraries menu Specifically you can choose to see: 1. All Items: This is the inclusive view which shows all the Web Parts available in this library. 2. Web Parts: Shows only the Web Parts which have been added to the site library of the top level Web site by the site administrator. 3. Lists: Shows the Web Parts for the lists that exist on this subsite, such as Announcements, Events, etc. 4. Libraries: Shows the Web Parts for the libraries that exist on this sub-site, such as Shared Documents, etc. Add Web Parts to the site library by using FrontPage 2003 or SharePoint Central Administration’s comprehensive set of tools. Adding a Web Part to the Site Library Using FrontPage 2003 Before using FrontPage 2003 to add Web Parts to the site library, the following statements must both be true: 1. The Web Part should not be a List View or List Form View (such as the standard Announcements, Events and Shared Documents Web Parts). 2. The author should have at least Web Designer level permissions on the top level Web site. Assuming the above statements are true, to add Web Parts to the site library using FrontPage 2003, follow these steps: 1. Open the page in Design view. Working With Web Part Libraries 4 2. Click on the Web Part that you wish to add to the site library. 3. From the Tools menu; select Save Web Part to… and then Site Gallery. This brings up the Save Web Part to Site Gallery dialog box. 4. Enter a Name and a Description for the part. 5. You can also, at this time, customize the Web Part by setting its properties such as Title, Height, Width, Frame Style, etc. To do this, click on Set Properties… 6. Click OK to save the Web Part. Managing Site Library with SharePoint Central Admin Web Parts in the site library can also be managed using SharePoint Central Administration. Adding a Deployed Web Part in the Site Library To make an existing Web Part available in the site library, follow these steps: Note: By “existing Web Part” we mean Web Parts that have already been deployed in the Virtual Server Library on the server running Windows SharePoint Services. 1. On a top-level Web site, click Site Settings. 2. Under Administration, click Go to Site Administration. 3. Under Site Collection Galleries, click Manage Web Part gallery. 4. On the Web Part Gallery page, click New Web Part. 5. Select the check box next to the Web Parts that you want to include in the gallery, and then click Populate Gallery. Adding a New Web Part to the Site Library You can add a Web Part to the Site Library even if it has not been installed in the Virtual Server Library. To do this in the web browser interface, follow these steps: 1. On a top-level Web site, click Site Settings. 2. Under Administration, click Go to Site Administration. 3. Under Site Collection Galleries, click Manage Web Part gallery. 4. On the Web Part Gallery page, click Upload Web Part. 5. In the Name box, type the name of the Web Part (including the full path to the .dwp file), or click Browse. 6. If you have several Web Parts that you want to upload at once, click Upload Multiple Files and select the Web Parts to upload. 7. In the Group box, select a group, or under Specify your own value:, type a group name for the Web Part. 8. Click Save and Close. Removing a Web Part from the Site Library You can remove a Web Part from the gallery if you want to make it unavailable to users. If a user has already used a Web Part in the site, and you delete the Web Part from the site gallery, the Web Part will remain on the Web Part Page and will still work. However, if an administrator on the server computer removes the Web Part assembly that contains the Web Part from the server, or marks the assembly as unsafe in the Web.config file for the server, Working With Web Part Libraries 5 the Web Part will no longer run and the user will see an error message. To remove a Web part, follow these steps: 1. On a top-level Web site, click Site Settings. 2. Under Administration, click Go to Site Administration. 3. Under Site Collection Galleries, click Manage Web Part gallery. 4. On the Web Part Gallery page, next to the Web Part that you want to remove, click the Edit icon. 5. On the Web Part Gallery: Web Part Name page, click Delete. 6. Click OK to delete the Web Part. Working With Web Part Libraries 6 Online Library By default, the online library points to a site which contains web parts provided by Microsoft. As of this writing, the Online Web Part Library from Microsoft contains several MSNBC Web Parts that display news, stock, and weather information. Overtime, you may find additional Web Parts available in the Online Web Part Library, either from Microsoft, or from other software manufacturers and vendors. You can also create your own Online Web Part Library. For more information on creating your own Online Library, see the Microsoft Windows SharePoint Services Software Development Kit. You can also redirect the online library to a different library setup. Do this by editing the web.config on the server running Windows SharePoint Services. You can usually find this file under the local_drive:\InetPub\wwwroot directory of the server machine. Open this file, and locate the <OnlineLibrary> tag. It is under <Configuration>/<SharePoint>. When pointing to the Microsoft Online Library, the tag looks like this: <OnlineLibrary Url="http://rbeta2.officebeta.microsoft.com/r/hlidAwsGallery" /> You can change the URL property to point to a custom online library. Working With Web Part Libraries 7 Creating a Library of Parts for a Page The Web Parts Infrastructure allows a page author to make several Web Parts available on a page for the end users to customize in a browser. In the browser, these Web Parts are included in a special library called the “Web Part Page Library.” Through this library a Web Part Page author can, for example, create a pool of recommended Web Parts for users to add to the Web Part Page. The Page Library is visible only when modifying the page in a web browser. When working in FrontPage 2003, the web parts in the page library simply show up as grayed out web parts within the page itself. The screenshot below shows the default.aspx page being modified in the browser; in the Add Web Parts menu on the right, displays the contents of Web Part Page Library. As you can see, it has 2 Web Parts: Contacts and Image. Add Web Parts Note: Closing a Web Part in the browser removes it from the Web Part Page and moves it to the Web Part Page Library. A closed Web Part (as opposed to a deleted Web Part) is still technically on the Web Part Page, but is not available because its IsIncluded property is set to False. However, you can add it back to the Web Part Page at any time, if you have the appropriate permission. The following screenshot shows the same page open in FrontPage 2003 Working With Web Part Libraries 8 Add Web Parts Notice that, unlike in the browser case, the Web Part Page Library doesn’t show up in the list of libraries (see the task pane on the right). However, the Contacts and Image Web Parts appear grayed out in the page. You simply need to make it visible again instead of dragging the Web Part from the library. To make Web Parts Visible, follow these steps: 1. Right-click on the web part. 2. Choose Web Part Properties to open the Web Part Properties dialog box. 3. Expand the Layout category. 4. Check the Include on Page property. Working With Web Part Libraries 9 The include on page checkbox in the Contacts dialog Working With Web Part Libraries 10 Importing a Web Part Though you can simply import a Web Part onto a page, importing does not add the Web Part to the Virtual, Site, or Online libraries; it is just available on a given page. Of course, once the part is imported, use FrontPage 2003 to save it in the Site Library by using the steps described previously in this document. To import a Web Part onto a page using FrontPage 2003, follow these steps: 1. Bring up the Web Parts task pane by selecting Task Pane from the View menu and select Web Parts from the dropdown list of available task panes. 2. Under Add Web Parts, click Import. 3. Browse to or type in the location of the .dwp file for the Web Part you want to import. Note: The Web Part description file (.dwp) is a portable container of default and personalized property values for the Web Part. 4. Click Upload. The Web Part now appears on the task pane. 5. You may now drag and drop the part onto the page. Working With Web Part Libraries 11 Conclusion A Web Part library is a central warehouse of Web Parts used to locate a specific Web Part when creating a Web Part Page. Web Part Pages are special ASP.NET pages which are the building blocks of a Windows SharePoint Services-based data driven Web site. There are different types of Web Part Libraries available to the developer using FrontPage 2003. Developers can use Microsoft FrontPage 2003 to leverage Windows SharePoint Services and use the Web Part Framework and Web Part library to easily build and customize data driven Web sites using a library of readily available web parts. Working With Web Part Libraries 12 References FrontPage 2003: Overview of Web Parts Framework FrontPage 2003: Customizing Web Parts FrontPage 2003: Connecting Web Parts FrontPage 2003: Working with Web Part Pages FrontPage 2003: Working with the Data View Web Part FrontPage 2003: An Architectural Introduction to Web Parts and ASP.NET Other Microsoft Resources Microsoft FrontPage 2003 Customization Kit Web: http://www.sharepointcustomization.com Microsoft FrontPage Web site: http://www.microsoft.com/frontpage/default.htm Microsoft FrontPage Add-in Center: http://www.microsoft.com/frontpage/downloads/addin/default.asp Microsoft SharePoint Products and Technologies: http://www.microsoft.com/sharepoint/default.asp SharePoint Products and Technologies Web Component Directory: http://www.microsoft.com/sharepoint/downloads/components/default.asp The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This white paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. Working With Web Part Libraries 13 Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in, or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. © 2001 Microsoft Corporation. All rights reserved. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Microsoft, FrontPage, and SharePoint are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Working With Web Part Libraries 14