October 2007 - Posts
A while back I talked about this new inline editing control that was being worked on by Mike Davis over on the Encosia blog. Yesterday, he posted an updated version that fixes some postback issues and adds some new features that make this a very useful control. I played around with it a little last night, and it looks great.
Highlights for this release:
- Toggling between edit mode and view mode can be triggered by either a single-click or a double-click. The single-click option is fast but the double-click option allows you to still work with any embedded links in the edit area without going into edit mode which I think is a great option.
- You can determine whether or not the control functions as an inline edit box or as a plain label. This is useful if you only want authenticated users to have the ability use the inline editing functionality. Having this option means you can use the control for the back end and the front end for content management.
- A "ClientIDSuffix" property was added to allow multiple instances of the control on a page. Before, you had to do a little workaround to display multiple instances. The example demonstrates how this property works.
Go take a look and share some feedback:
A while back I wrote an article for CodeProject that was just a simple demonstration of how to load portions of content after the initial page load using AJAX.NET.
Basically, using a timer and an update panel, this user control loads some RSS headlines after the initial page load. Simple and straightforward. Sample code is provided in VB and C# and there is also an online demo.
Did you read Day 1 first?
It was a rough start for me this morning as I battled an oncoming cold, here's what stuck during Day 2 of the Community Server Developer Conference 2007.
Low-Tech Options
- Scott reminds developers not to overlook the obvious. CS 2007 uses nice clean simple pages that you can customize very easily without modifying the core. These pages are all located in the ~/Themes folder.
High-Tech Options
- Use CSModules if you are make core changes. CSModules are like HTTPModules and are tailored to work with CS events. There is documentation and some examples for creating your own CSModules and, this point of this presentation seemed to be to point out that CSModules are the preferred method for extending CS beyond the low-tech options.
- You can use CSModules to override just about everything before it hits the database so, you can reach pretty deep into the core if you need....Why is my face red after reading that back?
- Examples of basic places you might extend might be spam rules or the point system but, certainly there are more advanced options. Dan Bartels and others have made quite a few such controls available.
- There were a couple of interesting (at least to me) notes about CS Tasks:
- There is a Windows service that can allow you to push offline tasks like indexing or stats tracking to a separate server.
- Email is an important task so make sure it is in its own <thread/> and adjust the timer according to your needs.
- SIDENOTE: While demonstrating the CSModules, Scott mentioned that Ink support may not be around much longer.
Shared Membership (a.k.a, Morpheous) (Jose Lema)
- It is a way to centralize your membership system for multiple sites.
- It is for cases where you may have multiple related sites with users that use one or more of them frequently. Example: asp.net, weblogs.asp.net, IIS.net, etc. have the same users so, they benefit from a shared membership system. If you have one site for Democrats and one for Republicans this may not be the feature for you.
- The shared membership feature stores login, roles (optional), and profile information centrally. All content (posts, ratings, etc) are local.
- Setting it up:
- Each site must use the same Application Name.
- Add new connection string for the shared membership database
- Point to the new provider
- Start with the largest site as the base
- Clean up duplicate users. There will be a script available for this and migrating from a virtualized setup in the downloads section of the CS website. If you don't do this, you will get "Role/User not found" messages for accounts like Admin and Anonymous.
- NOTE: If you want to keep roles separate, you can just exclude roles from the script.
Tips & Tricks for Shared Membership
- DON'T set CacheFactors="0". This will turn off all caching.
- Users are not created until they log on to other sites. From what I could tell, when a new user is created on one site, they don't get added to other sites until they try to login to them. I think it is just the CS piece that connects the user account to the content that doesn't get created. Maybe someone could clarify...
- You can't rename/delete users if you are using shared membership. Remove or hide the option from your Control Panel so you don't screw something up. CS2008 will have some logic in it that will show/hide this when appropriate.
- Resolving "Role/User not found" errors:
- You get this error when one or more of the following don't match up:
- Username in cs_User
- MembershipID in cs_User
- RoleID in cs_XXXPermissions
- To improve performance in large/busy sites, isolate the membership database from the sites--a dedicated server ought to do it.
The "Top 10" Tips & Tricks (Scott)
I was able to stay until the final item in the list but had to leave right after. I don't know what happened after the "top 10" list but Here's what I caught:
- Use configuration overrides. You can override the communityserver.config and siteurls.config files. You override them by creating an overrides file (i.e., siteurls_override.config). Put all of your custom markup in the override files to keep things clean and easy to upgrade. Also, use the override files to turn off any features you are not using. Wouldn't it be nice if the resource.xml and email templates supported overrides?
- Use CSModules. Not only are they easy to share/replicate, they help you leverage the CS core to extend CommunityServer.
- Use Chameleon controls. They really aren't all that tough once you get the basics and the documentation is pretty good. They are "CS2008-safe"--allegedly.
- Remove HTMLScrubber. I didn't quite get how this was a "tip". The HTMLScrubber protects you from script injection attracts. Maybe I missed something or maybe it would just be if you have a blog site where you are the "master of your domain" and control the content.
- Use shared membership instead of virtualization. These reads more like a warning than a "tip" if you ask me. On a related note, don't create custom themes for your users to select from and, don't encourage them to start using the Reader.
- a) Subforms can be your friends--if you'll let them, and b) You can extend them.
- Open your CS projects as a website instead of the full project (unless you need to). You'll still get all the intellisense goodies but will enjoy a faster environment. Want' something really fast? Try Notepad.
- Pick a good program that can help you track differences in files. When a new service pack or version is released, they can really help preserve any customizations you may have as well as give you an idea of what's been updated.
- Don't forget about 'Captn' Obvious. Backup your data frequently and before any updates. Use HTTPCompression. You'll enjoy a huge performance gain. Someone suggested ZIPEnable.
- Simple is okay. I'm not sure where this was headed because I had to leave. Couldn't have been too complicated though :-).
As with Day 1, you can also get the Telligent play-by-play of Day 2.
Later this week I will post my personal comments relating to the conference, the CommunityServer product, and the application of the "community" concept. My perspective is perhaps a bit different than many people who use CS. I don't make money using CS. No advertising. No retail. No commissions. No subscriptions. Not a dime. Well, okay, I get a salary but, that's not the point and not my primary job.
Part of my job is to make CS work for our organization at the purest level. The site exists for the sole purpose of building a strong community--everything CS purports to encourage with a twist or two.
How's it going? I'll talk about it later this week.
It was a beautiful day in Frisco, TX. Telligent picked a very nice venue and have been great hosts for the first CommunityServer Developer Conference. Here's a wrap-up of today's events:
Rob gave a little talk about Telligent and gave a quick demo of Enterprise Reporting and Graffiti. Best part--all attendees will be getting free licenses of both!
Introduction to Graffiti (Rob)
- Post-based content. It works like a blog so it's very easy to create content. They twist is the ability to configure navigation, add widgets, and theming options.
- Supports revision/history tracking. This allows for "mistakes" as you can view or go back to previous versions of a page. That's a nice touch.
- Basic workflow support. Users can be designated as "allowed to post and go live" or "post and require review". Nothing too sophisticated but in a good way.
- Graffiti is planned to be released before CS 2008 (see below for that date) with likely integration at some level with CS 2008.
Overview
- There are 7 groups of controls that make up the CS Chameleon theme engine. Each were demonstrated and provided some clearer insight into how the controls can be used as opposed to just what their guts look like. They are pretty extensive and getting familiar with the semantics and seeing it in action helps.
- Basically, the controls are context-sensitive and primarily use the URL and URL parameters to morph into the appropriate display. The URL and URL parameters are set through the SiteURLs.config file. I'm going to explore these controls more now that I have more context for how they work.
- Context is also set through containers. The page container provides a master container but you can then create user, blog or forum level containers that can contain child content. It's actually pretty clever if you ask me.
- Dynamic Configuration is the "quick 'n dirty" option for modifying things you would typically modify in CSS. Basically, it that's what it does. It's got some color-pickers and visual aids but, really, it's just a fancy web-based CSS editor.
- Dynamic Configuration files are saved as an XML file that can be imported and exported and, this it what makes it unique from a regular CSS editor. You can can control what options are configurable in the Control Panel by modifying the Themes.config file.
- After playing with this in the last theme contest, I found it time-consuming compared to manually editing the theme. A little over-engineered if you ask me but, still a cool concept.
- Something worth noting that you may or may not get in the documentation is that images can be save with the dynamic configuration. They get serialized into the XML file and are added to the Site Files folder when imported. That's kind of cool but still not really that valuable to me.
- Tip! When creating your theme file, make sure you select images from the My Files folder. The export function will only export/serialize files from this folder.
What's Coming in 2008
- Not very many changes to Chameleon. Existing 2007 customizations should work with CS 2008. Allegedly, 2008 will just add new pages. I'll believe it when I see it.
- Query Overrides: ability to pull data from a non-CS data source into a CS control. Pull data from things like an XML file or a web service.
- Link to logic: override whether or not a link is displayed. Extended control over when links are displayed. To be honest, I didn't really get the point of this feature.
- Widgets ("...but don't call them that")
- Coming in '08 are widgets that can be added anywhere on the page as opposed to just the sidebar. More like a plugin? Maybe we call them "Widgins" or "Pludgets".
- They will be configured/added at the Site, Blog, and Group level.
- Ben did a nice little demo on how to create and install a couple of these "pluglets" and I overheard the possibility of providing some kind of compatibility with existing 3rd party "wigglin's". Sounds like a promising feature for developers if we could just figure out what to call them...
- To be honest, I almost left for a walk before this started. It just didn't seem like a feature that I would be interested in. I was right until they demonstrated that Enterprise Reporting is NOT just for reporting on CommunityServer. This was news to me but really changes my perception of the project. Being able to point the reporting tool at my other SQL apps opens up a whole set of options. I'm not sure why Telligent hasn't clarified that--maybe I'm missing something.
- It is limited to SQL datasources at this point but additional datasources will likely be added.
- Assigning specific reports to related roles or users is pretty limited at this point.
- Look for a Beta download this week.
- Now we're talkin'! This is some very very cool stuff. It's just what I've been looking for and will open up a whole new world for CS developers.
- Basically, using REST, you will be able to select, insert and update data from your CS database. REST works similar to the familiar HTML form actions like GET, PUT, etc. so it's easy to figure out. CommunityServer sends you XML data and you send XML data back.
- A simple demonstration was given where a desktop application was created, references to the web services where added, and, within a short time, a form to moderated posts was created.
- The new web services stack uses the existing data access layer which includes all of the exception handling and caching currently being used.
- Returning data through JSON is under consideration but, for now, it's XML only.
- I can't wait to get my hands on this API. I've been looking for it for quite awhile and already have plans for it. This will be be the biggest selling point for me as far as 2008 goes.
- Though nothing earth-shattering was revealed, we did get a glimpse of how the much anticipated "Groups" feature will look.
- Groups are like virtual communities but not quite independent. They will have their own roles (different from the main site) with permissions yet to be defined.
- Groups will be able to have their own theme, widgins, and will be configured to be open (anyone can join), closed (requires invitation), and private (requires approval).
- The Control Panel is getting a facelift. The layout will be different and the way permissions and roles are displayed looks much cleaner.
- Assigning permissions in general has been greatly simplified which should help. Basically, permissions are context sensitive so you won't see "Blog Administrators" listed when you are viewing forum permissions.
- The reasons for getting rid of virtualization and user themes seems pretty reasonable. Their
reason excuse for getting rid of the Reader smells a little funny. "...we do not feel that it properly fits into the platform...Instead, we plan to release a separate RSS Reader application sometime in Summer 2008." It doesn't fit into the platform? What? Why bother creating a separate reader then? I'll see if I can get more on this tomorrow. - A beta is expected in January with a release in the first quarter of 2008 (though someone in the back--probably CEO, Rob Howard--yelled, "Projected release date!" So, we'll see. It would sure be nice to be able to play with the web services API as soon as possible.
That's it for today. Want more? Here's the official Telligenti report.
>> Day 2
I really like this DataCalendar control that I found a while back and, even though it's a few years old, I keep finding new uses for it.
I'm working on this little project that includes a feature for posting events (live auctions in this case). The project includes syndicating the event list through RSS but, the people using it didn't really understand why that was cool. So, using the DataCalendar control, I created a little "look-at-what-RSS-can-do" demonstration that, to put it simply, "goes out to a bunch of auction web sites and copies all of the upcoming auctions to a calendar on my web site". Here's what the example looked like.
Feel free to tinker with the example by using an RSS feed of your own choosing. Just change the "test" parameter like in this example that loads some blogs from one of my other sites.
Before you get started, you need to download the DataCalendar control.
NOTE: I created this calendar to display in my CommunityServer-based site but, it should be pretty easy to pick out the CS stuff if you want it "plain vanilla".
In the Default.aspx...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Auctions_Default" %>
<%@ Register Assembly="DataCalendar" Namespace="DataControls" TagPrefix="cc1" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<CS:MPContainer runat="server" id="Mpcontainer1" ThemeMasterFile="Master.ascx">
<CS:MPContent id="bcr" runat="server">
<div class="CommonContentArea">
<div class="CommonContent">
<CS:ContentPart runat="Server" contentname="CustomerAuctions" id="featuredContentPart"
text="<div class="CommonSidebarArea"><h4 class="CommonSidebarHeader">Featured Item</h4><div class="CommonSidebarContent">Content Management is easy in Community Server! <p>Sign-in with your Admin account and double-click to edit me!</p></div></div>" />
<cc1:DataCalendar ID="dcAuctions" ShowNextPrevMonth="true" BackColor="white" DayField="TaskDate"
Font-Names="verdana" NextPrevFormat="FullMonth" runat="server" Width="100%">
<SelectedDayStyle BackColor="ghostwhite" ForeColor="black" />
<OtherMonthDayStyle ForeColor="#999999" />
<NextPrevStyle Font-Size="10pt" Font-Underline="false" ForeColor="white" />
<DayHeaderStyle BackColor="lightgrey" ForeColor="black" Height="1px" />
<TitleStyle BackColor="black" Font-Bold="True" Font-Size="14pt" ForeColor="white"
Height="35px" />
<SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
<WeekendDayStyle BackColor="ghostWhite" />
<DayStyle HorizontalAlign="left" ForeColor="dimgray" VerticalAlign="top" />
<itemtemplate>
<a href="<%# Container.DataItem["link"] %>"
style="display:block; font-size:70%; margin:2px; padding:2px; text-transform:capitalize; border: 1px solid goldenrod; display:block; background-color:AntiqueWhite; text-decoration:none;"
title="Click for Details">
<%# Container.DataItem["Title"] %>
</itemtemplate>
<noeventstemplate>
<br /><br /><br /><br />
</noeventstemplate>
</cc1:DataCalendar>
</div>
</div>
</CS:MPContent>
</CS:MPContainer>
Then, wire it up (NOTE: this is just a bare example with no error handling):
In the Default.aspx.cs...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.XPath;
using System.Net;
public partial class Auctions_Default : CommunityServer.Components.CSPage
{
void Page_Load(object sender, EventArgs e)
{
RSSFeeds();
}
void RSSFeeds()
{
string[] aFeeds =
{
// Display the following feeds in the calendar
"http://nixonauctions.com/Feeds",
"http://michaelauction.com/Feeds",
"http://success-auctions.com/Feeds"
};
DataSet dta = new DataSet();
for (int i = 0; i < aFeeds.Length; i++)
{
// Loop through and add the feeds
HttpWebRequest feed =
HttpWebRequest.Create(aFeeds[i])
as HttpWebRequest;
DataSet ds = new DataSet();
ds.ReadXml(feed.GetResponse().GetResponseStream());
if (dta.Tables.Count == 0)
{ dta.Tables.Add(ds.Tables[2].Copy()); }
else
{ dta.Tables[0].Merge(ds.Tables[2].Copy()); }
ds.Clear();
}
dcAuctions.DataSource = dta.Tables[0];
dcAuctions.DataBind();
dcAuctions.DayField = "pubDate";
}
}
You could use this to aggregate and display select blogs, news columns, pictures, videos, etc. You may have to tweak the DataSet to adjust for different feed types, change some formatting, add some error handling but, if it's got an RSS feed, you can calenderize it.
In a move uncharacteristic of technology companies, Microsoft is giving its existing Zune customers a little bonus for jumping in early. Owners of the Zune 30 will be able to update their Zune with the new goodies that will be in the new Zune 80 in November..
Zune, you had me at, "Wireless Sync requires access to a home wireless network and can be manually initiated by clicking “sync now” on the Zune. Automatic Wireless Sync requires AC power to the Zune device via a dock, AC adapter or speaker dock accessory".
Inline editing can be a great supplement to the traditional "control panel" approach in content management systems. The of editing web pages and the whole control panel concept can be difficult for non-technical people to latch on to. Control panels typically takes users away from the context of the site into a world of option that can be a little freaky. Inline editing provides the context and instant feedback that people need so they can visualize how their content will be displayed. Sprinkle in some AJAX and you have a pretty user-friendly approach for managing content.
Here are a few ASP.NET / AJAX examples to get started with:
-
Anthem.NET's EditLabel Extension
Anthem.net has been around for a little while now but maybe you've never seen the Anthem extensions. One of the extensions is called "EditLabel". It's a nice little control that turns a label into an editable object just by clicking on it. When in edit mode, retains its styled format which nice touch.
-
Inline Edit Box .Net Mike Davis has been working on an inline editing control project that was inspired by
this example from Dave Ward. If this is of interest to you, go give him some support or suggestions. I like the direction they are going and offered a couple of suggestions myself.
Inline editing has some "gotchas" that you will want to consider:
-
It's not for huge busy sites. Inline editing controls will typically add some weight to your pages. It's not a big deal if you control it--it's just something to be aware of and consider.
-
It's a little easier to mess up your content. Most of the controls I've seen take a single click to begin editing and content is save when the control loses focus. Consider at least adding a confirmation before saving.
If there is enough interest in this topic, I'll post some examples of how inline editing controls could be used and perhaps even put together a "roll your own" example using AJAX.NET and the AJAX.NET Toolkit.
Know of some other good inline editing examples? Please share.
I am the sole web developer, designer, database admin, and network administrator for a contractor that services a Federal agency. As time permits, I also work on some side projects. I have a B.S. in Business Administration and have a pretty broad exposure to a wide variety of technologies--primarily Microsoft.
I wouldn't say that I am an expert in any one technology. Instead, I seem to have a knack for merging or applying technology to achieve a desired business objectives. Instead of focusing on building a better mouse trap, I tend to look for ways to bring the mouse and the trap together.
Thank you, Joe Stagner, for creating this opportunity for me blog on the ASP.NET web site.
On a personal note...
-
My wife and I just got SCUBA certified and are enjoying that new world.
-
We like to travel. We spent our 5th anniversary at Mr. Everest Base Camp.
-
I studied martial arts for 6 year but, I recently moved and haven't found a new school.
-
I also enjoy backpacking, cycling, tennis, and skiing.
More Posts