Set the category / group for the web part when deploying with WSPBuilder
I developed an event handler called TaskListEventHandler for a list of tasks ((ItemAdding, ItemDeleting, ItemUpdating) as a holiday using the WSP Builder project template and I also added a web part called RegisterEventHandler that will be used to bind (register) events in the list The web page is the WSP Builder No Function Web Page template.
Currently, when deploying, my function and webpage are deploying successfully. The web part is also available in the web part gallery.
Now I need to make the web part available in a specific category / group in the gallery using WSP Builder?
I tried to set the group in the RegisterEventHandler.webpart file (which is automatically generated by the WSP designer when the webpage template is added to the project), but it still doesn't show up :(
Unable to import the RegisterEventHandler web part. RegisterEventHandler This website is used to register or unregister an event handler in the task list - By Biju (09 September 2009) Biju Webparts
Can anyone help or suggest me some solution or sample code?
As Per. If you add webpart function using wspbuilder, it will provide you elements.xml file. It contains the following entry:
<File Url="WPName.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="MyGroup" />
<Property Name="QuickAddGroups" Value="QuickGroup" />
</File>
If properties determine which group is used in the library. Keep in mind, if this web part is already activated on your site, it will reactivate it again, often without overwriting your existing registration; you will first have to remove the .webpart file from the web part library.
source to share
The web part category / group is specified in the elements.xml file (Groups property).
But as Janice notes, it seems a bit odd to add a web part to add an EventHandler.
If you just want to add an event handler to all task lists on the site where you trigger the function, you can add to element.xml directly.
If you want to add it to a custom to-do list, you can do so in the FeatureReceiver.
If you want to give the enduser a choice of which list to add, then the web part might be ok, but the app page will probably be a more "SharePoint" way of doing it, or use the SPEvent Descriptor Manager from codeplex
source to share