Managing Web Parts

This section covers how to deploy third-party or your own custom Web Parts. This includes steps for installation on a SharePoint Web front end or server farm, as well as making them available within Web Part Galleries to enable user customization and personalization.

Adding Web Parts to the Web Part Galleries

There are two galleries to which you can add your custom Web Part: the Site Gallery or the Server Gallery.

  • The Site Gallery lists all of the Web Parts registered for a particular site collection. Using this Web Part Gallery, administrators can control what modular applications are available to specific site collection user populations. Specialized teams may need specific Web Parts that other teams do not. You can add one or more specialty Web Parts to a site collection.

  • Large enterprises with many sites may decide to install the same set of Web Parts on many sites. In this case, consider storing these Web Parts in a Server Gallery. You can deploy Web Parts in a Server Gallery 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 Web Part to the Server Web Part Gallery

After developing your own or acquiring third-party Web Parts, you will want to deploy to your server so that users within your organization can take advantage of the new features and functionality they possess. After you have a Web Part Package file, to deploy it, follow these steps:

1.
Log on 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 FilesCommon FilesMicrosoft SharedWeb Server Extensions12in.

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, install the Web Part Package on all of them using the –globalinstall switch in the given command.


Deploying a Web Part to the Site Web Part Gallery

In SharePoint 2007, once a Web Part DLL is registered in the web.config correctly, SharePoint automatically detects Web Parts from those DLLs. This makes it easy to surface new Web Part applications from the site settings page. The following steps explain how to automatically populate the Web Part Gallery for your site collection.

1.
From your SharePoint site, click Site Actions, Site Settings, and then Modify All Site Settings.

2.
In the Site Collection Administration section, click Go to top-level site settings (if you are not already at the top-level site).

3.
In the Galleries section click Web Parts and then click New from the toolbar.

4.
The list shows all of the Web Parts registered on the server, including your new one. You may have to do an IISRESET (by typing IISRESET from a command line and pressing Enter) on the server if you have recently deployed new Web Parts and they don’t appear in the list, and then refresh the page.

5.
Select the Web Part you would like to add to the gallery and select Populate Gallery.

Removing Web Parts from the Gallery

You may find that some Web Parts are not useful or that you do not want to expose them to users. The following steps explain how to remove Web Parts from the Web Part Gallery for your site collection.

1.
From your SharePoint site, click Site Actions, Site Settings, and then Modify All Site Settings.

2.
In the Site Collection Administration section, click Go to top-level site settings (if you are not already at the top-level site

3.
In the Galleries section, click Web Parts and then click the Edit icon next to the Web Part you’d like to remove

4.
Click the Delete button in the toolbar.

5.
Click OK

Exporting and importing Web Parts

The following example scenario explains how you can export and then import a Web Part and its settings.

You can add a Web Part to a Web Part page by importing a DWP file you exported from another site or received from another site user. For this to work, you and/or your colleague need to perform the following tasks to the Web Part that has already been configured:

1.
Load the Web Part page that contains the already-configured Web Part.

2.
Click Edit Page from the Site Actions menu on that page.

3.
Once the page is in Edit Mode, click the down arrow in the title bar of the Web Part you want to transfer, and then choose Export from the drop-down menu.

4.
When the File Download dialog box appears, click Save.

  • When the Save As dialog box appears, choose a file location, a filename, and a filename extension of .dwt, and then click the Save button.

  • Send the resulting DWT file to the person who wants to install the Web Part with a configuration identical to yours.

The team member who wants to add the Web Part would then follow this procedure:

1.
Browse to the page where you want the preconfigured Web Part to appear.

2.
Display the Add Web Parts import form in either of two ways:

  • Choose Add Web Parts from the Modify Shared Page or Modify My Page drop-down menu, and then choose Import.

  • Click the down arrow on the Add Web Parts toolbar, and then choose Import.

3.
Type in the name and path of the DWP file you received, or click the Browse button and use the resulting Choose File dialog box to locate the file.

4.
Click the Upload button.

5.
When the Web Part appears under the Uploaded Web Part heading, set the Add To drop-down list to the Web Part zone you want, and then click Import.

6.
Select Close in the Add Web Parts task pane.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.159.116