R – Set the Category/group for webpart on deployment using WSPBuilder

shared-librariessharepointsharepoint-2007

I have developed an event handler,called TaskListEventHandler, for the Task list ((ItemAdding, ItemDeleting, ItemUpdating) as feasture using the WSP Builder project template, and I have also added a web part, called RegisterEventHandler, which will be used to bind(register) the events to a list. The webpart is WSP Builder template "Webpart without feature".

Currently, on deployment, my feature and the webpart is getting deployed sucessfully. The web part is also available in the web part gallery.

Now i need to make the web part available in a particular category/group in the gallery using the WSP Builder?

I tried setting the group in the RegisterEventHandler.webpart file (which is automatically created by WSP builder on adding the webpart template inot the project), but still it doesn't show up 🙁

Cannot import RegisterEventHandler Web Part.

RegisterEventHandler
This webpart is used to register or unregister the event handler to the task list – By Biju (09 Sep 2009)
Biju Webparts

Could anyone please help or suggest me some solution or sample code?

Best Answer

Like Per says.. if you add a webpart feature with wspbuilder it will give you an elements.xml file. This contains an entry like this:

<File Url="WPName.webpart" Type="GhostableInLibrary">
    <Property Name="Group" Value="MyGroup" />
    <Property Name="QuickAddGroups" Value="QuickGroup" />
</File>

Where the properties determine what group is used in the library. Mind you if this web part is already activated in your site re-activating it again wil often not overwrite the existing registration; you'll have to delete the .webpart file from the web part library first.