CASK - CaskDotNet library upgraded to .NET 3.5

by 21. December 2008 04:47

Supplemental information available HERE 

This won't be a good thing for those still developing in .NET 2.0 but I reached a threshold where it is no longer cost-effective to not move forward; I'll have to work a lot harder and there is just so much that still needs to be done...

The following culprit is the reason for the upgrade:

        /// <summary>

        /// Use the URL as a key, e.g. "gv.Localhost" the first

        /// occurrence will be found, split and the value returned.

        /// In the example below "OI812NItWasGr8".  Note: CASK

        /// expects a "from/to" pair on separate lines so you'll

        /// need to add a dummy to: line.

        ///

        /// The Transformations content will be in the format:

        /// ---------------------------------------------------

        /// from: :)

        /// to: <img src="~/emoticons/smile.gif">

        /// from: <code><CONTENTS></code>

        /// to: <pre><CONTENTS></pre>

        /// from: <b><CONTENTS></b>

        /// to: <b><CONTENTS></b>

        /// from: gv.Localhost=OI812NItWasGr8          <=== ADDED

        /// to: --                                    <=== ADDED

        /// ---------------------------------------------------

        /// </summary>

        /// <param name="url"></param>

        /// <returns></returns>

        public string GetMetaDataFromTransformations(string url)

        {

            var query =

                from word in Transformations.Split('\n')

                where word.Contains(url)

                let MetaValue = word.Split('=')[1]

                select MetaValue;

 

            return query.FirstOrDefault();

        }

The above link query will find, and extract the "OI812NItWasGr8" text, from the "from: gv.Localhost=OI812NItWasGr8" line with just one line of code from the following text:

The following communityDefault.aspx update along with it's corresponding code-behind updates wraps up the process nicely:

 

CASK - Google verification meta tag support added

by 21. December 2008 04:00

I have big plans for the CASK application.  I first want to get SharePoint under my belt so that I can understand it's interfaces and class structures.  CASK and SharePoint have quite a bit in common, i.e., they both can create Web Sites with sections; each site can have a Downloads, Calendar, Articles, Discussion and other types of sections.  

I'll use my http://www.CodePlex.com/SDMS application as the foundation for the next version of CASK - it will have a WinForm and Web (Silverlight) Interface utilizing the CompositeWPF/Prism and MEF packages.  My early goals are to design the Administrative functions that will permit the user to select a provider (SharePoint or CaskDotNet) and add sites, sections, users and roles as applicable.

WHY THIS INTRO for the Google verification topic?

I don't want to change the database structure of the CASK application.  I continue to maintain and update the CASK application but the focus of my work will be in the newer SDMS system (when released it will split in two with the web component being the new CASK application).   The inability to change the database structure can be problematic especially when I get a valuable upgrade request from a user that I want to implement into the existing CASK system.

I am not a big fan of reusing tables/fields for other than what they were intended for because it will make a confusing application more confusing - I want to move CASK in a user-friendly direction.   In this case I'll have to make an exception to the rule because I need to ensure those that rely on CASK (i.e., my business and it's clients) can easily upgrade to the new version when it releases - I need to leave the database intact.

For this Google verfication meta tag requirement (which I will now go into) I will reuse the CASK Transformation feature (blogged about HERE).

If you register for Google and go to WebMaster tools you will have the opportunity to register your website(s) with Google.  One of the options is to have Google generate a "Verification meta tag" that you can place on your main page.   In the example below I am using the fake tag "OI812NItWasGr8" for Google's meta tag name "verify-v1".  CASK will use the internal ID of GoogleVerify.

Since CASK is a Data-Driven system, which can support mulitple sites, this Content will change per website configuration.  We have to have a way to let CASK know which content to serve up for each applicable Community (website).

To configure the Google provided meta tag for your system using CASK you'll first have to know your community name.  To obtain this go to the Communities link and locate the "Name" for the applicable Community / Site.

Now that you know your community name you can configure the site by following the directions for Transformations (blogged HERE) and add the following configuration to the Transformations section - IT IS IMPORTANT THAT YOU FOLLOW THE STEPS IN THE METIONED BLOG FROM IT'S HOMEPAGE!! 

from: gv.Localhost=OI812NItWasGr8
to: --

Where "gv." tells the CASK system that this is a Google Verification meta tag and the value is 0812NItWasGr8 - you will plug in the value provided by Google (without quotes) and you are done. Example follows:

SOURCE AVAILABLE HERE  ChangeSet 45115

MORE ON THE CODE CHANGES HERE 

 

CASK - Admin transformations

by 21. December 2008 03:14

The Community Starter Kit application is a well designed (complicated) application - one that wasn't well documented so many valuable features may be overlooked.   A few years ago I took on the task of upgrading it to .NET 2.0, and now .NET 3.5, and called it the Community (Advanced) Starter Kit (http://www.CodePlex.com/CASKDotNet) because "Starter Kit" can be somewhat misleading - it uses advanced features of ASP.NET. 

My Goal - document the CASK application as opportunities arise.   This weeks opportunity was the need to provide easy support for Google's verification process.

Transformations is such a feature that is probably not used - I am safely assuming it has been overlooked because I attempted to use one in a section Header and Footer and it didn't work.   I examined the code and was surprised that transformations only applied to a few components - I added support to footer and header.

In the example below I want to add a smiley face to the header below (after "about upcoming events").  I'll click on the Admin pencil icon which is a short cut to the Admin | Section area.

Once in the section if I click on the "Appearance" tab and scroll down to Section Transformations.

Note above the lines:

from: :)
to: <img src="~/emoticons/smile.gif">

This tells the program that whenever it encounters a ":)" that it should transform it to the defined "to:" information.   Note: This section expects that there will be a "from:" and "to:" pair.

Since the definition is already there for me I simply have to type in ":)" in my header and click SAVE.

I'm then greated with the following header with my smiley icon!

CASK - Configuring Communities

by 17. September 2008 13:07

The Communities feature of CASK (http://www.CodePlex.com/CaskDotNet) are beyond the scope of any single blog however I'll try my best to summarize it in a manner where you can appreciate the power.

First and foremost it helps to have a good hosting company (I've been with CrystalTech.com for years and have not been disappointed).  CASK works particularly well with host that support Domain Pointers.  I point all of my Domain Names to the same DNS and CASK takes care of the rest.  It parses the incoming Domain Name (below you'll see it know's I'm in as http://www.aclamplight.com/) and loads that site/community.  If it doesn't find it configured in the "Communities" list then it starts a Wizard to add it (more on the Wizard HERE).  I have literally put new sites up within 30 minutes (creating new templates is another story).

Note above that I am FTP'd into my primary server.  Under the server I have a Web folder which holds this databases domains.  I have another database, and different folder, that holds many more domains. 

If you create a folder with the "Community Name" under the Communities folder than that folder, and it's child folders, will have it's webcontrols used -- instead of the Common\Themes\<selected theme> folders.

This is particularly powerful if you want to share the themes between numerous client sites but do not want them to see "other client sites".  Note above that you see all of the themes under Common\Themes however since this is ACLamplight they only see their themes, not SingLikeTheKing or OsbornOrthodontic themes.  Recap: theme folders under communities will only be seen by the applicable domain where all sites will see themes under the Common\Themes.

 

It is important to note that the Communities\Common\Themes default folder contains ALL of the webcontrols that drive the CASK system screens (there are hundreds).

The global themes (Arc, ArcMarble, etc) and client themes (ACLampLight and SingLikeTheKing) child folders only have to keep WebControls that they want to alter.  This is an important feature!!   You can start a new theme with empty folders (as I did with the Simple Template).  You then bring over the webcontrols (copy/paste) that you want to alter for that particular theme.

The exception to this rule is the Styles.css, you'll want to copy a style sheet from one of the template that has matches your theme (and then alter it); when you see the number of style definitions you'll understand why I advise this.

The "master page", or default page, for every them (global or client) resides in it's respective Skins\PageSkins\Default.ascx file.   This is the template that drives the layout of your theme.

Below you'll find the default.ascx page layout for the http://www.ACLamplight.com website; the controls are literally drag'n drop in their respective table sections.  

Notice

Blog videos and references to CodePlex projects are no longer valid