These Quick Start sample custom parts illustrate how to use the APIs in the NetCommunity arsenal. From "Hello World" to a full blown transaction round trip, this stuff should serve as a good starting point for those looking to dig in.
Download Source Code Samples
These samples which can be downloaded from the
appropriate link below, can help get you started with building custom parts, transaction processors and Web Service methods for Blackbaud NetCommunity.
It is assumed that the machine running the samples has had Blackbaud NetCommunity fully installed on it, including NetCommunity, Raisers Edge Web Service, Plugin Service, Blackbaud NetCommunity Plugin, and The Raiser's Edge. It is also assumed of course that the machine has IIS installed as well and that Visual Studio 2005 or 2008 is the development environment.
Important: If you are using NetCommunity 5.1 or prior (which is everyone at press time because 5.5 hasn't been released yet) then you need to download the 5.1 version below. These are in Visual Studio 2005 format and the code adheres to that version of the NetCommunity API. If you are using NetCommunity version 5.5 then download that version of the samples, which are in Visual Studio 2008 format, and have been updated to use the new methods of the API, which replace some obsoleted ones.
Included in the samples is a solution file (Samples.sln) which will load all the sample projects. You should load this solution and build it.
Also, in the samples you will find a command file (deploySamples.cmd) you can use to deploy the custom samples after every build of the solution. The command file makes assumptions about the locations of the various installed components you may need to modify it if you are not setup with a default installation.
Alternatively, you can take advantage of pre and post build events to deploy the files. See the
Creating a Custom Part article for additional details on deploying custom parts. This is the recommended approach because it is done automatically for you on each rebuild.
(Sample 1) Hello World
This sample shows the simplest example of a custom part. With very little coding the emphasis is instead on introducing the concepts of creating a custom part project with the appropriate files and references, deploying and installing the part, and using it on a page. It demonstrates all of the basic tasks common to any custom part project.
(Sample 2) Editable Content - Simple Text Editor
Taking Sample 1 to the next level, Sample 2 adds the ability to edit, store, retrieve, and display content with your custom part.
(Sample 3) Custom Web Service Method - Fetching Volunteer Data
Building on Sample 2, Sample 3 demonstrates building a Custom Web Service method to retrieve information from The Raiser’s Edge for the current logged in user. Topics covered include creating a custom web method project and deploying it to the RE7Service, as well as how to call the custom method from your custom part.
(Sample 4) Custom Transaction - Updating Volunteer Data
Taking sample 3 to the next level, sample 4 shows how to capture a custom transaction by allowing the user to modify the volunteer info and creating a custom transaction of those changes.
(Sample 5) Processing Custom Transaction - Processing Volunteer Updates in Raiser's Edge
This sample completes sample 4 by demonstrating a custom transaction processor for The Raiser's Edge Blackbaud NetCommunity plugin. The custom processor processes the volunteer transactions collected in sample 4.
(Sample 6) Personalization - Personal Notes
This sample demonstrates how to support personalization by creating a custom part that can be placed on a Personal Page. Each personal page owner will have their own content, even though they share a single Blackbaud NetCommunity page definition and the same custom part instance. When adding this custom part to NetCommunity Custom Parts Gallery, make certain to select "Personal Page Owner" option for the "Supports Personalization for" prompt.
About the Sample Solution
The above samples are laid out across 4 Visual Studio 2005 projects:
- SampleParts – a web project that contains all of the custom parts for the samples
- SampleWebService – VB class library project contains the code for the sample custom web service methods
- SamplePlugin- VB class library project contains the code for the sample custom transaction processor for The Raiser's Edge Blackbaud NetCommunity plugin
- SamplesCommon - VB class library project contains common classes used by all of the samples.
You should use the Samples.sln solution file to load all of these projects since they contain project references to each other.
After loading the solution you will need to visit each project's references and fix the reference to BBNCExtensions, either by removing it and re-adding it (the BBNCExtensions assembly you should reference should be found in the \bin folder of your local NetCommunity installation), or by setting a reference path in each project's properties that includes the \bin folder of your local NetCommunity installation (recommended approach). After this step the solution should compile and be ready for deployment. Note that SamplesCommon project does not need this reference.
After deploying remember to tell NetCommunity about your Sample parts. This is done in the Administrative side of NetCommunity under the
Administration->
Custom Parts menu. See the
Creating a Custom Part article for additional details on deploying and installing custom parts.
Once deployed you should be able to use the samples on your site and give 'em a spin. If you have setup your "Post Build" events properly in Visual Studio, you should be able to modify the samples to experiment with different features of the API, and subsequent builds will keep the necessary files deployed appropriately.