Joseph Guadagno

Founder of Southeast Valley .NET User and Microsoft Visual C# MVP

Although this books title states the book is for ASP.NET 3.5 application architecture and design, you will be able to take these concepts well beyond ASP.NET.  The concepts and technics that this author conveys can be used for all Windows .NET development.  The author starts out explaining basic 1 tier architecture and eventually graduates you to a five tier architecture.

The book covers ER diagrams, domain modeling, common design patterns, SOA, WCF and even database design.  This book is a good starter book for those of you that want to move out of the developer role and start learning about basic principals in applications design.

There is only one downside the book and that is the formatting of the code samples.  There seems to be an issue with the spacing and tabs (at least in the book).  Other than that it is a good read.

You can purchase the book on the PackT Publishing site.


I typically post reviews of books based on technology topics like .NET, LINQ, etc. but I thought this book would be a could fit for the site.  This book is about creating effective PowerPoint slides which many technology professionals, like myself, do on a regular basis. On to the review...

The author breaks up the book into multiple chapters but not your typically kind of chapters.  These chapters are about the different parts that make up a slide; graphics, displaying data, diagrams, use of movement, etc.  Each chapter is typically closed with a Case Study which demonstrates the use of the technic or recommend. This is done by showing a before and after presentation.  The author also reinforces her points effectively by using graphics, colors and illustrations.

The book is chock full of handy tips and suggestions that anyone can use to create dazzling and effective PowerPoint slides.  If you present using PowerPoint, this is a must have.


LINQ in Action

I think the expression is "don't cry over spilled milk...", well when my son spilled milk on this book I almost cried. Why would you cry over a book you ask? There are many reasons.  Not only does the book go into LINQ in depth (I know there is a C# in Depth book) but the authors cover all of the parts of the .NET framework that were created and needed for LINQ to function. In addition, all of the samples provided are both in C# and VB.NET. These samples are not your basic "Hello World" samples but useful reusable code snippets that get the point of the book section across.

The book starts of with an introduction to LINQ and the different versions of LINQ to xxx, more than enough to wet your whistle. The authors then go into the prerequisites of the .NET framework required, generics, anonymous types and lambda expressions.  This chapter was so good I read it twice.  The third chapter discusses how LINQ is made up.  After this, the authors go in depth in describing the different types of LINQ, including LINQ to SQL, LINQ to Objects and LINQ to Amazon with useful examples. 

This book will be a reference book on my book shelf.  I expect to refer to this book constantly.


T-Mobile WiFi Calling

A month or so ago I signed up for this new T-Mobile plan that allows you to use your cell / mobile phone to make unlimited calls from almost any WiFi connection.  The reason I say almost is because there are two types of WiFi connections it will not make, a secured WiFi network that you do not have the security key for and any "free" WiFi connections that require you to accept the terms of use (most public access points).  When I saw this deal I signed up almost immediately. The idea that you can be on the road using your normal cell phone tower and them walk in to you house and seamlessly have the call transferred to your wireless network was awesome. So I purchased four Samsung Katalyst T-739 phones which have WiFI / UMA calling built in and my journey began.

Since then I have had two months of unreliable WiFi calling connectivity. My first connection attempts were with my AirLink AR430W SuperG Wireless router that I purchased for $15.00 dollars at a local Frys Electronic store. With this router I would get sporadic WiFi/UMA connectivity on all four phones.  Some of them would connect, some of them would not. I would get one of a few T-Mobile errors; W002 and W010.  After googling for days and weeks, there was not a lot of information about these errors on the Internet. Most of the errors pointed to Blackberry connectivity issues and that errors W002 and W010 means that the device could not get an IP address which was quite strange because both laptops, my Wii and Xbox 360 all connected fine.  So I began my troubleshooting...

First I tried to connect to a friends un-secure router, every connection attempt was successful and I was making calls but this was not legal. So I tried to un-secure my wireless network, this worked for some of the phones some of the time. I tried changing the network beacon timeout, this worked for some of the phones some of the times.  The phones would sometimes connect after rebooting the router but this was unacceptable.  After about a month I decided it was my cheap $15 dollar router, so I went out and purchased a TrendNET TEW-631BRP 300Mbps Wireless N Broadband route. I continued to have the the same issues as above so I went back to Google and found a few sites that suggested to turn off MAC filtering, this was not applicable to me, or to try to assign static IP addresses to the phone so I tried this but no dice.  After about six weeks of troubleshooting and phone tag with the T-Mobile WiFi calling help desk we came up with a solution.

The solution

It turned out that the sporadic access was because I had the router set to automatically determine a channel.  The T-Mobile WiFi/UMA service will only work with channels 1,6, or 11, which I why it connected to my neighbors router (channel 6).

Here are all of the settings that you can apply to router to make it function similarly to the T-Mobile branded LinkSys router.

Setting Value
Beacon Period 100
RTS Threshold 2347
Fragmentation Threshold 2346
DTIM Interval 1
Wireless Channel (try in this order) 11, 6, 1
For a secure network WPA 2 is preferred over WEP

I hope this helps solve some of your problems and that T-Mobile documents this somewhere.


This book is short on the number of pages but not necessarily on content.  The books author approaches Software Development Project Management as a problem and offers up how you can use Trac and Subversion as a solution. 

The book starts to talk about what Software Development Project Management is a how to break it up into its pieces.  It then proceeds to introduce how to make Software Development Project Management easier with Trac, Subversion, Apache Web Server and WebDAV. The book then begins to describe how to use Trac and Subversion of some of the details of each.

Overall, the book is a good starting point if you want to add Trac and Subversion to your project.  There are two things that I would have liked to see in the book however.  The first is the use of TortoiseSVN client as opposed to the command line.  The second is less use of the command line, while this is OK for Linux developers and some Windows developers, most do not like to use command lines.

You can find more about the book from the Packt Publishing web site at http://www.packtpub.com/managing-software-development-with-trac-and-subversion/book


Well as you can see the title is quite but extremely accurate.  The book covers a "real world" use of Windows Workflow foundation.  The author takes you through Windows Workflow Foundation by building a bug tracking application which is an ideal candidate for a workflow technology.  I think this approach is what makes this book stand apart from other Windows Workflow foundation books. It is short and concise and gives you a real application of the technology.  This is not a book filled with marketing fluff or the Hello World app (with the exception of the first chapter).

Overall, this book is a good read for those that want to get started in Windows Workflow Foundation.

The books web site: http://www.packtpub.com/windows-workflow-foundation-Csharp/book


 Download this document: How to create a Sitefinity custom module

Download the source: SEVDNUG.Contact.zip

This document outlines how to create a custom Sitefinity module by modifying the SEVDNUG.Contacts module.  The SEVDNUG.Contacts module was based on the Samples.Contacts module found on the Sitefinity blog.  This document gives you step by step directions on how to modify/tweak this SEVDNUG.Contacts module to implement your new custom module.  In addition, I attempt to explain what each file is used for. This sample module is constructed in a very similar to the way the modules of Sitefinity application are constructed. As a result, you should be able to use parts of this document to figure out how to customize certain features of Sitefinity modules. After completing the “First Steps” and “Modify the Code” sections of this document, your new module will be available on your Sitefinity site.

If you have any questions or issues, feel free to contact me at jguadagno [at] hotmail.com

Document conventions

 Text enclosed in <> brackets should be replaced by the type of text listed. So if you see <CompanyName>.<ModuleName>, the <ModuleName> should be replaced by whatever you want to call your module, and the <CompanyName> should be replaced by your company name like SEVDNUG.Vendors.

Contents

  • First Steps
  • Modify the Code
    • <CompanyName>.<ModuleName> Project
    • <CompanyName>.<ModuleName>.Data Project
    • <CompanyName>.<ModuleName>.Web Project
  • Sample Solution Structure          

First Steps

  • Rename the solution file to <CompanyName>.<ModuleName>.sln
  • Rename the folders
    • SEVDNUG.Contacts to <CompanyName>.<ModuleName>
    • SEVDNUG.Contacts.Data to <CompanyName>.<ModuleName>.Data
    • SEVDNUG.Contacts.Web to <CompanyName>.<ModuleName>.Web
  • Rename the Visual Studio project files
    • <CompanyName>.<ModuleName>\SEVDNUG.Contacts.csproj to <CompanyName>.<ModuleName>\<CompanyName>.<ModuleName>
    • <CompanyName>.<ModuleName>.Data\SEVDNUG.Contacts.Data.csproj to <CompanyName>.<ModuleName>.Data\<CompanyName>.<ModuleName>.Data
  • Open up the solution in a text editor like Notepad, search and replace SEVDNUG.Contacts to <CompanyName>.<ModuleName>
  • Open up the <CompanyName>.<ModuleName>.sln solution file in Visual Studio.
  • Search and replace the text  SEVDNUG.Contacts with <CompanyName>.<ModuleName>
  • Rename solution (optional)

At the end of this article you will find a sample of what the solution would like.

Modify the Code

<CompanyName>.<ModuleName> Project

Please follow these steps for this project prior to modifying the files.

  • Rename all of the Contacts*.cs files to <ModuleName>*.cs.
  • Rename IContact.cs to I<ModuleName>.cs
  • Rename WebControls\Contacts*.cs to WebControls\<ModuleName>*.cs
  • Rename WebControls\SingleContact*.cs to WebControls\Single<ModuleName>.cs
  • Rename the references to Contact object and IContact to <ModuleName>, if necessary.

I<ModuleName>.cs

  • Add whatever properties will make up the <ModuleName> object, these properties should match what you plan on storing in the database.

<ModuleName>Module.cs

This file contains the Name, Title, and Description of your module, as well as the security for your module.

  • Update the Description, Title and Name properties to whatever you want to be displayed.
  • Rename the text, Contact to <ModuleName>
  • Note that nothing else needs to be changed, other than description, title and name properties

<ModuleName>Provider.cs

This class contains the “definition” of what your module provider implementation needs to support.

  • Rename the text, Contact to <ModuleName>
  • Replace the content of the region “Contact Methods” with methods the fit your desired functionality.  Most of the contact methods should be a good starting point.
  • Add whatever additional methods you think your provider will need. Some examples are:
    • Get<ModuleName>
    • Save<ModuleName>
    • Delete<ModuleName>
    • Get<ModuleName>s
  • Under the properties section, add properties to the template files that your module will use. If you are making new templates, such as controls for the public facing side of the site such as the blog posts control, you would want to add them here. Here is an example:

 

/// <summary>

/// Returns the path of external template for ControlPanel control in insert/edit mode

/// </summary>

public string ControlPanelInsertEditTemplate

        {

            get

            {

                return this.controlPanelInsertEditTemplate;

            }

        }

<ModuleName>Manager.cs

This class provides is present in most Provider model patterns. It contain methods to interact with the provider.

  • Rename the text, Contact to <ModuleName>
  • Replace the content of the region “Contact Methods” with methods the fit your desired functionality.  Most of the contact methods should be a good starting point. This should closely mirror the Provider methods.
  • Add whatever additional methods you think your manager class will need.

WebControls/*

These classes provide the functionality to edit or display the data within Sitefinity.

  • Replace the text, Contact to <ModuleName>
  • Note, you probably will have to manually change the Resources/Messages.resx content. TODO: Add reference to new localization article.

Single<ModuleName>.cs

This is used to display a single item (<ModuleName>). This file provides the code behind to the Single<ModuleName>.ascx file.

  • Replace the text, Contact to <ModuleName>
  • Modify the Single<ModuleName>Container to include the fields defined in I<ModuleName>.cs file.
  • Modify the CreateChildControls to reflect the controls that are available in the layoutContainer

<ModuleName>Lists.cs

This is used to display a list of items (<ModuleName>s)

  • Replace the text, Contact to <ModuleName>
  • Modify the <ModuleName>Repeater_ItemDataBound method to display the properties of the object.

Admin\<ModuleName>Editor.cs

This control is used for inserting new <ModuleName> objects or editing existing ones.

  • Replace the text, Contact to <ModuleName>
  • Update the CreateChildControls method of the <ModuleName>Editor class to match the properties available within your new module class.
  • Update the CreateNew<ModuleName> method of the <ModuleName>Editor class to match the properties available within your new module class.
  • Update the Update<ModuleName> method of the <ModuleName>Editor class to match the properties available within your new module class.
  • Update the <ModuleName>EditorContainer class to the match the properties within your new module class. This should most likely match the Single<ModuleName>.cs class.

Essentially, any properties that are available in your I<ModuleName> interface should have a line in the CreateChildControls, CreateNew<ModuleName>, Update<ModuleName> methods, as wells as properties in the <ModuleName>EditorContainer class.

Admin\CommandPanel.cs

This module is used to display the side content in the Sitefinity admin interface. Other than changing its name, you do not need to change this control.

  • Replace the text, Contact to <ModuleName>

Admin\ControlPanel.cs

This module is used to display the side content in the Sitefinity admin interface. Other than changing its name, you do not need to change this control.

  • Replace the text, Contact to <ModuleName>

<CompanyName>.<ModuleName>.Data Project

This assembly is responsible for all of the data access. At minimum it will have three classes, with this implementation, DefaultProvider.cs, Variable.dbclass, and <ModuleName>.dbclass. Optionally, you can add <ModuleName>.cs and <ModuleNames>s.cs to add additional data access methods. Any file with the extension “.dbclass” makes a table in your database.

Please follow these steps for this project prior to modifying the files.

  • Rename Contact.* to <ModuleName>*.cs
  • Search and replace Contact with <ModuleName>.
  • Add a reference to the new <CompanyName>.<ModuleName> project.

DefaultProvider.cs

This class provides the implementation of the provider for the <ModuleName>. The private fields and following methods should not need to be changed; SetVariable, GetVariable, and Initialize. The first step to do is to replace the Contact with <ModuleName>. The next step is to implement any of the other methods required by <ModuleName>Provider.

Variable.dbclass

This file generates the database table for the variables table. This should not change.

<ModuleName>.dbclass

This class generates the database for the <ModuleName> table.  This file should change according to the way you want your database table. The Nolics library will create the table for you. Example:

dbclass ModuleName [TableName="SEVDNUG_ModuleName"]{

    primary key string Application [50], guid ID[AutoGenGUID = true];

    string Name[Length=100];

    string Url[Length=255];

    string LogoUrl[Length=255];

    modified date ModifiedOn;

    created date CreatedOn;

For more info on modifying the dbclass library or how to modify this file, check the Nolics documentation at http://www.nolics.net/Docs4_2/Ref_dbclass.html.

Where is the tutorial that tells you how to make tables?

<ModuleName>.cs

This class will allow you to add additional properties and methods to the Nolics generated class.

<ModuleName>s.cs

This class creates a dynamic query around the module table. Dynamic queries are typically used when there are custom table joins that you want to be available to any calling class. For more information on creating or using dynamic queries with Nolics please check out the Nolics documentation at http://www.nolics.com/Material2005/WT10_Queries.doc.

public class ModuleNames: Query<ModuleName>

{

 

}

<CompanyName>.<ModuleName>.Web Project

Please follow these steps for this project prior to modifying the files.

  • Rename the /Sitefinity/ControlTemplates/Contacts folder to /Sitefinity/ControlTemplates/<ModuleName>
  • Rename the file /Sitefinity/ControlTemplates/<ModuleName>/ContactsListTemplate.ascx to <ModuleName>ListTemplate.ascx
  • Rename the file /Sitefinity/ControlTemplates/<ModuleName>/ContactsListTemplate.ascx to Single<ModuleName>Template.ascx

Web.Config

The web.config file for your Sitefinity installation will need to be modified to inform Sitefinity of the new module.  Please note: this section of the document requires that you modify your existing Sitefinity web.config. PLEASE BACK UP YOU WEB.CONFIG FILE BEFORE YOU CHANGE IT.

There are three parts of the web.config file that need to be modified. They include the modules section, section group, and the meta fields section. The web.config provided in this example has a <!-- START REPLACE : Step # --> tag followed by a <!— END REPLACE : Step # --> tag where text needs to be replaced or modified. 

Notify ASP.NET of the new section group

Search for <!-- START REPLACE : Step 1 -->.  This section needs to be placed after the closing tag of the Telerik section group of your existing Sitefinity web.config file.

  • Replace the text of SEVDNUG with your company name. This should be what every use used for <CompanyName>.
  • Replace the text of Contacts with your module name. This should be what every use used for <ModuleName>.

Tell Sitefinity about your new module

Search for <!-- START REPLACE : Step 2 -->.  The line following this tag needs to be added to you telerik/framework/modules/ section of your existing Sitefinity web.config file.

  • Replace the text of SEVDNUG with your company name. This should be what every use used for <CompanyName>.
  • Replace the text of Contacts with your module name. This should be what every use used for <ModuleName>.

 

Add the new section group

Search <!-- START REPLACE : Step 3 -->.  Everything between this tag and the <!-- END REPLACE : Step 3 --> tag should be added to the end your exist web.config.

  • Replace the text of SEVDNUG with your company name. This should be what every use used for <CompanyName>.
  • Replace the text of Contacts with your module name. This should be what every use used for <ModuleName>.
  • Replace the text of contact with the <ModuleName> for the following lines.

contactsPermissionsTemplate="~/Sitefinity/Admin/ControlTemplates/Contacts/ContactsPermissionsTemplate.ascx"

contactEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Contacts/ContactEditorTemplate.ascx"

contactsListTemplate="~/Sitefinity/ControlTemplates/Contacts/ContactsListTemplate.ascx"

singleContactTemplate="~/Sitefinity/ControlTemplates/Contacts/SingleContactTemplate.ascx"

Note, these xml attributes map to the properties that you defined in the <ModuleName>Provider class. Here is an example:

/// <summary>

/// Returns the path of external template for ContactsPermission

/// view set in web.config

/// </summary>

public string ContactsPermissionsTemplate

{

get

{

                return this.contactsPermissionsTemplate;

            }

        }

Add the new meta fields

So Sitefinity can recognize the database columns that your module will make, you must declare them in the meta fields section of your web.config. Here is an example from the blogs module:

<metafields>

<add key="<ModuleName>.Title" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>

<add key="<ModuleName>.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>

<add key="<ModuleName>.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/>

<add key="<ModuleName>.BlogID" valueType="Guid" visible="False" searchable="True" sortable="True" defaultValue=""/>

<add key="<ModuleName>.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""></add>

</metafields>

Here is a breakdown of the properties:

Key: This is the name of your module, then a period, then the name of the field.

ValueType: This property will depend on the type you set in your I<ModuleName>.cs file. If you set the type to GUID, then the value type will be GUID. This property should be short text for a paragraph under 256 characters and long text if it is above 256 characters.

Visible: This property should be true, unless this field is an ID column which should not be edited. If the valueType property is GUID, then the visible property should be false.

Searchable: If you would like your end user to search this property in the admin when in this module, then set this property to true. In the blogs module, as an example, you can search blogs by title.

Sortable: In the grid for the module in the admin, this will make the field sortable.

DefaultValue: This property is set to null, unless you want a value to be added all the time

Public and Private Templates

So your end user can use the control on the page, you will need a public template. Generally, this consists of a repeater control with a series of controls inheriting from the ItextControl Interface. Sitefinity mainly uses literal and label controls and binds their ID property to a datafield. In the blogs module, you could bind a label control to the autor field like this:

<asp:Label ID=”Author” runat=”server”></asp:label>

When you are in the blogs module, you omit the word blogs and just use the word after the period.

The private templates are for users who click on the modules tab in the admin. These templates are used to add content to the modules and set permissions. Generally, you would only want to edit the templates that a person uses to add content. Adding and removing fields in the same as the public templates. Just add a label, as an example, and give its ID property a name from the meta fields section of the web.config.

Copy to Sitefinity

To deploy your module, you must copy the module theme, the newly created bin files and the templates by following these instructions:

  • Add a reference in your Sitefinity web project to the new <CompanyName>.<ModuleName> and <CompanyName>.<ModuleName>.Data assemblies or projects.
  • Copy <CompanyName>.<ModuleName>.Website\Admin\ControlTemplates\<ModuleName> to your Sitefinity directory\Admin\ControlTemplates\<ModuleName>
  • Copy <CompanyName>.<ModuleName>.Website\ControlTemplates\<ModuleName> to your Sitefinity directory\ ControlTemplates\<ModuleName>
  • Copy <CompanyName>.<ModuleName>.Website\Admin\Themes\Default\ to your Sitefinity directory\Admin\Themes\Default\

Sample Solution Structure

<CompanyName>.<ModuleName>

·         Properties

o   AssemblyInfo.cs

·         References

o   RadComboNox.Net2 [i]

o   RadGrid.Net2[ii]

o   RadMenu.Net2[iii]

o   RadTreeView.Net2 [iv]

o   System

o   System.configuration

o   System.Data

o   System.Drawing

o   System.Web

o   System.Xml

o   Telerik.Cms

o   Telerik.Cms.Web.UI

o   Telerik.Framework

o   Telerik.Security

·         Configuration

o   ConfigurationHelper.cs

o   SectionHandler.cs

·         Resources

o   CommandPanel.js

o   Messages.resx

·         Security

o   GlobalPermission.cs

o   GlobalPermissions.cs

·         WebControls

o   Admin

§  AlphabetLinks.cs [v]

§  CommandPanel.cs

§  <ModuleName>Editor.cs

§  ControlPanel.cs

o   <ModuleName>List.cs

o   <ModuleName>ListToolboxItem.cs

o   Single<ModuleName>.cs

o   Single<ModuleName>ToolboxItem.cs

·         <ModuleName>Manager.cs

·         <ModuleName>.Module.cs

·         <ModuleName>Provider.cs

·         I<ModuleName>.cs

<CompanyName>.<ModuleName>.Data

·         Properties

o   AssemblyInfo.cs

·         References

o   Nolics.Engine.v4.2 [vi]

o   <CompanyName>.<ModuleName>

o   System

o   System.configuration

o   System.Data

o   System.Xml

o   Telerik.DataAccess

o   Telerik.Framework

o   Telerik.Security

·         Resources

o   Messages.resx

·         <ModuleName>.cs  [vii]

·         <TableName>.dbclass

·         DefaultProvider.cs

<CompanyName>.<ModuleName>.Website

·         Admin

o   ControlTemplates

§  <ModuleName>

·         CommandPanelTemplate.ascx

·         <ModuleName>EditorTemplate.ascx

·         <ModuleName>sPermissions.ascx

·         ControlPanelInsertEditTemplate.ascx

·         ControlPanelListTemplate.ascx

o   App_LocalResources

§  Any resource files

o   Themes

§  Default

·         Modules.css

·         ControlTemplates

o   <ModuleName>

§  <ModuleName>sListTemplate.ascx

§  Single<ModuleName>Template.ascx



[i] Optional, only required if you controls/templates use this control and you are licensed to use it.

[ii] Optional, only required if you controls/templates use this control and you are licensed to use it.

[iii] Optional, only required if you controls/templates use this control and you are licensed to use it.

[iv] Optional, only required if you controls/templates use this control and you are licensed to use it.

[v] Optional, only if you wish to implement this command panel control.

[vi] Optional, only if you use the Nolics library for data access.

[vii] Optional, only if you want to add additional data access methods to the Nolics’ generated class.


Telerik.Events

The Telerik.Events assembly is distributed with Sitefinity. This module is responsible for adding, removing, deleting events from the Sitefinity system. This guide is meant to supplement the documentation that is available for Sitefinity. This document will cover the following:

As of the time when this was written, development documentation does not exist for the Telerik.Events assembly. The code samples where either "figured out" or derived from other samples. Thanks to Visual Studio®'s Intellisense® feature, Visual Studio®'s Object Browser and Reflector, I figured out most of it.
In order to work with events in Sitefinity you must add a reference to the Telerik.Events assembly. This assembly is already included in the Sitefinity install; it is mentioned in case you want to create a separate assembly for your events customization. The Telerik.Events.EventsManager handles all of the event management. An instance of the EventManager can be created like this.

string providerName = "Events";
EventsManager eventsManager = new Telerik.Events.EventsManager(providerName);

After this, the eventsManager object will contain all the methods that you should need.

Files for events module

Like most (if not all) modules, the templates or user controls are keep in two directories underneath the /Sitefinity folder, the Sitefinity\Admin\ControlTemplates\<ModuleName>, in this case Events and Sitefinity\ControlTemplates\<ModuleName>. Within these directories you will find a collection of files and one folder App_Resources. The App_Resources folder provides Sitefinity (or any .NET application) the ability to be localized. Keep in mind that if you want to change the text of a field or add a new field you will probably find the string in the corresponding .resx. In other words, if you are modifying CommandPanel.ascx you will find the resources to modify in \App_Resources\CommandPanel.ascx.resx. An example of this can be found in the section Adding meta field to an event.
The developers of Sitefinity seem to be consistent with the naming of files, they sort of follow this syntax <object><function>.ascx. So the insert form for an event can be found in the ControlPanelInsert.ascx file.

Admin\ControlTemplates\Events Files

This folder contains the files for the administrative portion of the events modules. While in most cases, except for adding meta fields to the event, you will not need to modify these files. However, if you are like me you like to know how things work.

Filename   Purpose
CategoriesField.ascx   Contains a list of event categories.
CategoriesManagement.ascx   Provides functions to manage the categories; add, rename, etc.
CategoriesSelector.ascx    
CommandPanel.ascx   The command panel contains all of the functions for managing the events modules. This is the list that appears on the left hand side. Command panels load the Control Panels (middle of the interface).
CommentsEdit.ascx   This control provides the ability to edit comments for an event.
CommentsList.ascx   This control lists the comments for an event.
CommentsView.ascx   This control lists a single comment for an event.
ContentSelector.ascx    
ContentVersionView.aspx   This control is used when viewing the version history of an event (or any generic content item)
ControlPanelEdit.ascx   This control is used when editing an existing event.
ControlPanelInsert.ascx   This control is used when adding a new event.
ControlPanelList.ascx   This control is used to list all of the events.
ControlPanelPermissions.ascx   This control is used to display / modify the permissions for events. This can be viewed by clicking on "Permissions" in the command panel.
EditorTemplate.ascx   This control is used to display the RadEditor for the content of the event. This is used for all generic content.
EventsScheduler.ascx   This is the control used when you first enter the events admin module or click on the "Events" link in the command panel.
GeomappingEditor.ascx   This control is used to edit the geomappings for an event. This is used in ControlPanelInsert and ControlPanelEdit
GeomappingSettings.ascx   This control is used to update the mapping api URLs and keys. This can be view by clicking on "Geomapping" settings in the command panel.
NewContentDialog.ascx   I do not think this is used. This is carried over from the Generic Content controls, to create shared content.
RecurringIntervalSelector.ascx   This is probably for a future release of the events module which would allow you to select a recurrence pattern.
SelectContentDialog.ascx   I do not think this is used. This is carried over from the Generic Content controls, to share content.
TagEditor.ascx   This is used when editing a tag on an event.
TagsManagement.ascx   This control is used to manage the tags for the events. This can be viewed by clicking on the "Tags" link in the command panel.

ControlTemplates\Events Files

This folder contains the files for the public/display portion of the events modules. These controls will be used to display the events on the public facing site.

Filename   Purpose
ArchiveTemplate.ascx    
CategoriesList.ascx   Displays a list of event categories and the number of events in that category. Not displayed in the "Community" template.
CommentsList.ascx   Displays the list of comments for an event.
CommunityContentViewItemList.ascx   This control is used by the Events page in the "Community" template to display a list of events.
CommunityContentViewSingleItem.ascx   This control is used to display and event that is clicked in the CommunityContentViewItemList control.
ContentViewItemList.ascx   This control is used by the Upcoming Events page in the "Community" template to display a list of events.
ContentViewSingleItem.ascx   This control is used to display and event that is clicked in the ContentViewItemList control.
eventsCommonLayout.css   The Cascading Style Sheet (CSS) used for the event pages.
EventsScheduleView.ascx   Displays the events in a calendar view.
HomeContentViewItemList.ascx   This control is used to display the events in on the home page for the "Community" template.
TagsList.ascx   Displays the lists of tags for an event.

Creating an event

In order to create an event in Sitefinity using the Telerik.Events assembly, you must follow a few steps.

  • Create an instance of the EventsManager class with the correct provider...
    EventsManager eventsManager = new Telerik.Events.EventsManager(providerName);
  • Create a new generic content object...
    IContent newEvent = eventsManager.Content.CreateContent("text/html");
  • Update the meta data...
    newEvent.SetMetaData("Title", eventTitle);
    newEvent.SetMetaData("Content", eventDescription);
  • Optionally, get/create an event category, then update the meta data...
    // If the categoryName is not null or empty, update the category field.
    if (string.IsNullOrEmpty(categoryName) == false)
    {
        // See if this event category exists
        ICategory category = eventsManager.Content.GetCategory(categoryName);
        if (category == null)
        {
            // Create the category            
            category = eventsManager.Content.CreateCategory(categoryName);
            eventsManager.Content.SaveCategory(category);
        }
        // Update the meta data
        newEvent.SetMetaData("Category", categoryName);
    }
  • Save the content...
    eventsManager.Content.SaveContent(newEvent);

Utility method for creating an event.

    protected void CreateEvent(
        string eventTitle, 
        string eventDescription,
        string contactName,
        string contactEmail,
        string contactPhone,
        string contactCell,
        string contactWeb,
        string street,
        string city,
        string state,
        string country,
        DateTime eventStartDate, 
        DateTime eventEndDate,
        DateTime eventExpirationDate,
        DateTime publicationDate,
        string geomappingData,
        string categoryName,
    {

        string providerName = "Events";
        EventsManager eventsManager = new Telerik.Events.EventsManager(providerName);
        IContent newEvent = eventsManager.Content.CreateContent("text/html");
        
        // Set the Generic Content Meta Data
        newEvent.SetMetaData("Title", eventTitle);
        newEvent.SetMetaData("Content", eventDescription);
        newEvent.SetMetaData("Street", street);
        newEvent.SetMetaData("City", city);
        newEvent.SetMetaData("State", state);
        newEvent.SetMetaData("Country", country);
        newEvent.SetMetaData("Contact_Name", contactName);
        newEvent.SetMetaData("Contact_Email", contactEmail);
        newEvent.SetMetaData("Contact_Phone", contactPhone);
        newEvent.SetMetaData("Contact_Cell", contactCell);
        newEvent.SetMetaData("Contact_Web", contactWeb);

        newEvent.SetMetaData("Event_Start", eventStartDate);
        newEvent.SetMetaData("Event_End", eventEndDate);
        newEvent.SetMetaData("Publication_Date", publicationDate);
        newEvent.SetMetaData("Expiration_Date", eventExpirationDate);
        newEvent.SetMetaData("Geomapping_Data", geomappingData);

        // If the categoryName is not null or empty, update the category field.
        if (string.IsNullOrEmpty(categoryName) == false)
        {
            // See if this event category exists
            ICategory category = eventsManager.Content.GetCategory(categoryName);
            if (category == null)
            {
                // Create the category
                category = eventsManager.Content.CreateCategory(categoryName);
                eventsManager.Content.SaveCategory(category);
            }
            // Update the meta data
            newEvent.SetMetaData("Category", categoryName);
        }

        // Save the Generic content
        eventsManager.Content.SaveContent(newEvent);

    }

Deleting an event

In order to delete an event using the Telerik.Events assembly, you must get an instance of the Telerik.Events.EventsManager object. As you will see the code sample below, the eventsManager class has one method called DeleteEvent() which has 2 overloads.
The first overload requires two parameters, the Event GUID which is the Event.Id and a boolen which indicates if the manager should delete the associated generic content.

public void DeleteEvent(Guid ID, bool deleteContentItem)

The second overload requires two parameters, the Event which is the Event.Id and a boolen which indicates if the manager should delete the associated generic content.

public void DeleteEvent(IEvent _event, bool deleteContentItem);

Warning: This sample will delete all of the events in Sitefinity.

string providerName = "Events";
EventsManager eventsManager = new Telerik.Events.EventsManager(providerName);

IList events = eventsManager.GetEvents();
foreach (IEvent eventItem in events)
{
    eventsManager.DeleteEvent(eventItem.ID, true);
}

Adding meta fields to an event

Adding meta fields to the events module is a 5 step process which involves editing the web.config file, editing the administration control templates, and the public display templates.
For this example we will add a Short Text meta field call ClickToAttendId that we want to be displayed as part of a HTML hyperlink similar to this http://www.clicktoattend.com/invitation.aspx?code=ClickToAttendId

Step 1: Edit the web.config file.

Open the web.config file and search for <metaFields>. This is where Sitefinity loads the list of meta tags for each of the generic content modules. You should find a series of "add" XML elements. These "add" elements take 6 attributes, key, valueType, searchable, sortable, and defaultValue.

Element   Purpose
key   The key is made up of two parts, modulename.fieldName. So Events.Title means the Title meta field of the events module.
valueType   The type of data that will be stored. The following are valid types:
  • Binary
  • Boolean
  • DateTime
  • FloatingPoint
  • Guid
  • Integer
  • LongText
  • ShortText
visible   Indicates whether it will be shown in the admin section of the events module.
searchable   Indicates if you can search on this field.
sortable   Indicates if this field can be sorted on.
defaultValue   The default value for this field.

Add a XML element to the <metaFields> section that looks like this

<add key="Events.ClickToAttendId" valueType="ShortText" visible="True" searchable="False" sortable="True" defaultValue=""/>

Save an close the web.config.

Step 2: Edit the Admin\ControlTemplates\Events\ControlPanelEdit.ascx.

Where you place the HTML markup depends on where you think the control needs to be. At the minimum it needs to be placed after the <p class="button_area top"> code block and before the block...

    </ItemTemplate>
</sfGCn:ContentMetaFields>

An example of the markup could look like this.

    
<h3><asp:Literal ID="ltrClickToAttend" runat="server" Text="<%$Resources:ClickToAttend %>"></asp:Literal></h3>
<fieldset class="set">
    <div class="setIn">
        <asp:Label ID="lblClickToAttendId" runat="server" Text='<%$Resources:ClickToAttendId %>' AssociatedControlID="ClickToAttendId"></asp:Label>
        <asp:TextBox ID="ClickToAttendId" runat="server"></asp:TextBox>
    </div>
</fieldset>
<div class="bottom">
    <div>
        <!-- -->
    </div>
</div>

The <h3>< section is used for the title of grouping of the data.
The <fieldset class="set"> element is used to contain the label and text box for the ClickToAttendId.
Notice that there is a consistent naming theme for the HTML controls, lblfieldName for the label (this is optional), the text box must be the fieldName or Sitefinity will not be able to update it.
Save the file.
Open up App_Resources\ControlPanelEdit.ascx.resx and add in any of the resources that you referred to in this sample, namely ClickToAttendId.

Step 3: Edit the Admin\ControlTemplates\Events\ControlPanelInsert.ascx.

The ControlPanelInsert.ascx should be edited in the same way that the ControlPanelEdit.ascx was edited.

Step 4: Edit the ControlTemplates\Events\CommunityContentViewSingleItem.ascx

The markup can be placed anywhere inside the div block <div class="sf_eventContent">.
A sample of the markup could be.

    <h4>Event Registration</h4>
<p>This event requires registration, please register <a href='http://www.clicktoattend.com/invitation.aspx?code=<asp:Literal ID="ClickToAttendId" runat="server"></asp:Literal>'>here</a>.</p>

Just as in the administrative templates, in order to display the meta data there should be a control on the form that matches the name of the meta data.
Save the file.
If neccessary, open up the App_Resources\ContentViewSingleItem.ascx.resx file and add whatever resources you require.

Step 5: Edit the ControlTemplates\Events\ContentViewSingleItem.ascx

For some reason, the markup of the ContentViewSingleItem is a bit different.
The markup can be placed anywhere inside the div block <div class="sf_eventContent">.
A sample of the markup could be.

<asp:PlaceHolder ID="plClickToAttendId" runat="server">
    <h2>Event Registration</h2>
    <p>Please click
        <asp:HyperLink ID="ClickToAttendId" runat="server" NavigateUrl='<% "http://www.clicktoattend.com/invitation.aspx?code=" + this.Text %>'></asp:HyperLink>
        to complete the registration for this event.</p>
</asp:PlaceHolder>

Save the file.
If neccessary, open up the App_Resources\ContentViewSingleItem.ascx.resx file and add whatever resources you require.

Adding the missing RSS Provider

Coming soon...


This book covers all of the basic functionality of the Community Server product from Telligent. Chapter 1 gives you a background of the product. Chapter 2 tells you what is required to use the product and how to get a copy of it. The rest of the chapters dive into the detail on the individual features of Community Server, like blogging, forums, RSS feeds, user management and more.

The author of the book was very diligent to capture every and explain the many configuration options for Community Server. This makes the book a worthwhile purchase for anyone who wants to implement Community Server.

This book is out and is available from Packt. For more information about this book, please visit: http://www.packtpub.com/community-server/book


The back cover of the book states that the intended audience is ..."beginners in the developer track who are looking to get an exposure to SSIS".  It was right on the money. 

The book starts off with the a great introduction to what SSIS is and what it is made up of. In then goes into, in depth, how to use Visual Studio 2005 to create, modify, debug and execute SSIS packages.  The rest of the book is a series of Hands On labs guiding you through different task like transferring date from xyz source to SQL Server, which I find to be the best way for me to learn a topic. There is one chapter on scripting with unfortunately for my task a bit simple.  It would have been nice to see an advanced script, maybe something that calculated a value and updated a column.

There were two things that the book was missing... It did not talk about the error handling or logging available in SSIS other than a mention that SSIS has it.

In summary, this is a great book for beginners to SSIS and DBA's that what to start using Visual Studio to debug their SSIS packages.

This book is out and is available from Packt. For more information about this book, please visit: www.packtpub.com/sql-server-integration-services-visual-studio-2005/book


PhotoStream

About the author

Joseph Guadagno Name: Joseph Guadagno
Occupation: Programmer, SEVDNUG, Microsoft Visual C# MVP
Location: Chandler, AZ

Joseph Guadagno RSS Joseph Guadagno Twitter Joseph Guadagno Linked In