Microsoft .Net Development, Components, OutSourcing And Support Forum

   
  ABOUT PROJECTS PURCHASE CLIENTS SUPPORT FORUM CONTACT US
 
  Flesk.Accelerator
  Flesk.Cart
  Flesk.Catalog
  Flesk.Templates
  Flesk.ViewStateOptimizer
  Free Flesk.Uploader
  .Net Tips and Tricks

 ' Thank you very much, for the good service you provide '

Roman Pittroff
Bangkok, Thailand

  
 
  Flesk.Catalog - Deploy a product catalog to your website in minutes.
 

www.truehome.pt uses Flesk.Catalog to list their RealEstate portfolio in several languages.Flesk.Catalog is an easy to install catalog component that has no limits to your design.

Using simple tag scripting and normal HTML templates, you can deploy a product catalog to your website in minutes with almost no programming.
Tags are defined in a XML file where rules are declared (ie: you may want that the Tag appears as a Currency, so you just have to define a rule that translates your tag into a currency, any currency).


Flesk.Catalog includes Paging facilities, that can be linkbuttons or images or
any kind of HTML value. Paging status text can be set as you wish
(ie: 'Listing Page 1 of 10' or 'Showing 1 page in 10').
Pager can have separated CSS Styles for pager's link buttons and status.

Using HTML templates you can have all diferent designs you want. The unique Flesk.Catalog's Nested Template System let's you set nested templates, so that you can control your dinamic website just as you want.

How it works?

Installing Flesk.Catalog to your .Net website is easy: just copy Flesk.Catalog component to your Bin directory, copy file catalog.ascx to your website's root directory, and add a configuration setting line to your web.config file. Create templateTagTranslator.xml and add references to your HTML template files, as stated in the Flesk.Catalog's documentation.

The templateTagTranslator is a XML file that lets developers format their template’s tag value. A template tag is nothing else than a place holder to be replaced by a value in the template's HTML, which might need to be formated.
Tag value formats can be set as a Currency, a DateTime value, a String, an Image or as an Identifier, or even a PlaceHolder for nested templates.
In common templating engines, all tag values are treated as Strings, but with Flesk.Catalog and Flesk.Templates, there is now the possibility to format values as needed.

A tipical templateTagTranslator.xml format would be:


This example defines 2 HTMLTemplates and their tags.
The first template is listing.htm that has the following html schema:


The second template’s schema, features.htm, is:

Both LABEL and VALUE are strings.

  • PRODID : this is the ID returned by your database query. It is set as Type=”Identity”. If any tag named as {PRODID} is found in the html source of the template file (listing.htm), it will be replaced by the string value
  • NAME / SUBNAME: value will be replaced by data as a string;
  • FEATURES: set as a PlaceHolder. This is the most important feature of Flesk.Catalog and Flesk.Templates: Nested Template. PlaceHolders have 2 attributes:
    File : URL of nested template page to be executed
    PassValue : value to be added to the URL's querystring specified by attribute File. PassValue must have the same name as one of the tags set in the current tagList, in this case {ID}. The Nested Template will be formated as:

           http://localhost/website/features.aspx?PRODID=1

    This example shows you what URL the template system is going to retrieve data from.
    Note that was added to the URL a querystring, PRODID=1, where ‘1’ is the value returned by your database query or set programatically.
    Of course, as in all HTTP requests, http://localhost/website/features.aspx?PRODID=1 will return formated HTML. Whatever its content is, Flesk.Catalog and Flesk.Templates will treate content as a string, will replace your template’s tag with that string, as the value. This also means that you can fetch data from any other URL address, from any other website and insert that data in your template with great ease.
    Note the FILE attribute: the value is "http://localhost/website/features.aspx". The HTTP request will the call "features.aspx" page and return HTML that will be included in your template. File "features.aspx" is a plain and simple .Net web page.

    Since version 1.2 Flesk.Catalog's and Flesk.Templates Nested Template feature works with .Net UserControls. This means that instead of using HTTP request, the Nested Template will call and process a .Net UserControl that will return HTML formated data, after being processed by the .Net Framework.

    Setting a Nested Template to work with UserControls is almost the same as explained above.
    Instead of using:

    use:
     <tag name="Features" type="PlaceHolder" LoadControl="features.ascx" PassValue="PRODID" />

    .Net UserControl "features.ascx" file must follow some rules too. Flesk.Catalog or Flesk.Templates will set a property on the UserControl, called PRODID, with the value returned. The UserControl will and must look something like:

    <%@ Control Language="C#" %>
    <script language="C#" runat="server">

    string prodId = "";

    public string PRODID
    {
      get { return prodId; }
      set { prodId = value; }
    }

    protected override void Render(System.Web.UI.HtmlTextWriter writer) {

      writer.Write(this.PRODID);

    }

    </script>

    Note that the UserControl renders everything to a System.Web.UI.HtmlTextWriter object that will be sent to the template, and then processed.
  • FILENAME : is set to be an Image file. If no value is returned or specified to replace the tag, {FILENAME} tag will be replaced by the specified value set in Missing attribute. Note that this is a HTTP request too.
  • DESCRIPTION : is set as a String.
    MaxLength attribute returns the first, in this case, 150 characters/letters/symbols starting from the beginning of the value.
    AtEndAdd adds the specified string at the end of the DESCRIPTION value
    DecodeHTML (boolean) : if True, returns DESCRIPTION value HTML decoded. This is usefull if the value returned by your database is in Encoded format. Note that if MaxLength is specified, the template system will count HTML tags as characters/letters/symbols too.
  • PRICE : is set as a Currency value, where currency symbol is “€”. For better currency format, the ISO Country code CultureInfo can be specified.
  • DATE_IN : is set as a DateTime value. Like any DateTime object (C# or VB.NET), it can be formated to the following types:
    ToShortDateString
    ToLongDateString
    ToShortTimeString
    ToLongtTmeString
    For better Date formating possibilities, Country’s LCID can be specified.

Implementing Flesk.Catalog to your code is really simple. Click here to see an example.

 

 

Features

  • Setup only requires a few minutes.
  • Supports OLEDB, ODBC and SQL Connections. By specifying the Database Connection type, Flesk.Catalog works with support to OleDb, Odbc or SQLServer drivers.
  • Developer can use a DataTable as a datasource for the catalog, or may specify a query directly to the component. By specifiying a previously filled DataTable as the datasource, it means that Flesk.Catalog supports virtually any kind of database engine that works with .NET framework.
  • The implementation of Flesk.Catalog is so easy that webdesigners, with little or no programming knowledge, can setup a catalog in minutes.
  • Flesk.Catalog can be set to use Data Caching facility, to release load on your database server. Cache life duration can be specified too.
  • Template fields can be specified by an ArrayList (pair of fieldname/fieldvalue), or by adding manually a pair of Field/Value.
  • Flesk.Catalog can use up to 2 templates, alternating listing between them. Both templates are normal HTML files, where are specified Tags that represents a value from your datasource.
  • By using a XML file, all tags can have special rules, so you may specify how a tag's value appears on your site. Possible rules can set a tag's value as an Identity, a String, a Datetime with specified format, a Currency with CultureInfo formating, an Image or as a Nested Template that connects via HTTP to another file fetching data or by adding .Net User Controls!
  • CSS Styles and Classes can be specified as you wish.
    Flesk.Catalog's Pager can be set in any position (left,right,center) at top or bottom (or even both) of your listing.
  • Pager can have its own CSS Styles or Classes. You may also specify Pager's text.
    Page Size can be specified. You may specifiy if Flesk.Catalog uses paging facilities or not. You can even specify how many repeated columns and rows you want to be listed (ie: repeat products by 2 rows and 3 columns, having a page size of 6 products per page).
    V1.2
  • You can now specify what Pager type you want, Numerical or Text pager type.
  • Support for virtually any Currency format
  • CutString function. When setting MaxLength on a string, the ending word won't be cut.
 
 


 
   
 
  Download the demo version here
  »DEMO

©2004 Flesk.Net | info@flesk.net  | Contact us | Privacy Statement
 
this website is powered by Flesk.Accelerator HTTP Content Compression Component  Render Time : milliseconds