Themelia Pro A powerful new development platform built on ASP.NET.
 
Understanding Web Domains
 
 

One of the first things a developer needs to understand when working with Themelia is that there is no concept of a "web site root".  The web development paradigm in Themelia, however, is completely based on the concept of a "web domain".  These are segments of a web site in which you do all your Themelia development.  When you setup access to your web site, install an HTTP handler, register a Themelia processor, or restrict access you are doing so in a Web Domain.  A web domain is the canvas upon which your brush of development paints.

Web domains are setup by declarative configuration.  The configuration is also extremely simple.  Here's an example of two web domains:

<themelia.web>
  <webDomains>
    <add name="northSales" path="/sale/region/north/" />
  </webDomains>
</themelia.web>

This configuration actually declares not one, but two web domains.  You will always have a web domain called "root" into which all unhandles requests enter.  In this example, any requests to the web site in the /sale/region/north/ branch go to the "northSales" web domain and everything else goes to "root".

You can create as many web domains as necesary to maximize the flexibility of your web site.  Not only that, but one of the things that makes web domains so powerful is a feature called "web domain inheritance".  With this feature you can declaratively configure a new web domain, one which copies all of its content from an existing web domain.  This comes is extremely handy when you want two branches of your web site to look completely different, but act exactly the same.

Here's an example of a configuration using multiple web domains:

<themelia.web>
  <webDomains>
    <add name="finance" path="/finance/">
      <factories>
        <add type="ABCCorp.Web.Routing.CorporateHandlerFactory, ABCCorp" />
      </factories>
      <accessDenials>
        <add type="address" text="69.147.112.160" message="Your IP address has been blocked." target="" enabled="true" />
      </accessDenials>
      <endpoints>
        <add selector="endsWith" type="ReportWriter" text=".xls" />
      </endpoints>
    </add>
    <add name="sales" path="/finance/sales/" basedOn="finance">
      <accessDenials reset="true" />
    </add>
    <add name="marketing" path="/marketing/" basedOn="sales">
      <endpoints reset="true">
        <add selector="endsWith" type="ConverstionTracking" text="/tracking/" />
      </endpoints>
    </add>
  </webDomains>
</themelia.web>

At this point, almost none of that should make any sense to you.  When you continue to study the documentation and learn about default pages, factories, access denials, and endpoints, this will all start to make sense.  For now, to put it simply, this example shows three web domains mapped to three different web site access points:

  • "finance" is handles to /finance/
  • "sales" handles /finance/sales/
  •  "marketing" handles /marketing/

When a user accesses something under a specific web domain, the rules of that web domain apply to that user.  The rules in "finance" are the base level rules.  "sales" copies all those rules except for access denials.  "marketing", then, copies all the sales rules, removes all existing endpoints and adds an endpoint of its own.

Again, all of this will make more sense to you as you continue through the documentation and work with Themelia Pro.