Simulating a customer license

Release 1.01 - ...

When developing a site for a specific customer, there will always be a mismatch between the customer's production environment and the developer's environment: they both have their own, probably totally different, licenses.

To make sure the site functions as expected, you would want to simulate the license terms of the customer's license. This is the only way you can make sure that no functionality has been used which is not included within the license of the customer.

Well, when your local or network-based license includes the DevelopmentLicense feature (feature id 147), you can!

Featurelist

Usually, your local or network-based license will be a developer license, including (almost) every available feature and no restrictions on e.g. site name(s), number of contenttypes, number of hostheaders, etc.

So, how can you simulate that your license does not include a certain feature while it actually does include that feature?

This is where the featurelist element within the Smartsite.Licensing.config configuration file comes in. Whenever Smartsite checks if a feature is licensed, it will first check the actual license for this specific feature. If the feature is licensed and your license includes the DevelopmentLicense feature and the applymask attribute of the featurelist element has been set to true, Smartsite will execute an additional check to verify if the specific feature is listed within the featurelist element.

To simulate the licensed features of your customer, you should follow these steps:

  • Make a backup copy of your own Smartsite.Licensing.config file.
  • Replace the featurelist element within your own Smartsite.Licensing.config file with the one found in the customer's Smartsite.Licensing.config file (or use one of the default featurelist templates linked below).
  • Or: adjust the featurelist element within your own Smartsite.Licensing.config file to reflect the customer's version by way of commenting out not licensed features or adding/setting enabled attribute to false on not licensed features.
  • Set the applymask attribute of the featurelist element to true.

Within the example below, the features with id's 5 and 6 will be considered as not licensed.

XML CopyCode image Copy Code
<featurelist applymask="true">
    <feature id="1" name="PublicationEngine" />
    <feature id="2" name="CmsEngine" />
    <feature id="3" name="SiteInstance" />
    <feature id="4" name="PublicationChannels" />
    <!-- <feature id="5" name="ComplianceTools" /> -->
    <feature id="6" name="ContentRepositoryModel" enabled="false" />
    <feature id="7" name="Versioning" />
    <!-- other features omitted -->
</featurelist>

When you make changes to the Smartsite.Licensing.config file, the AppDomain will be recycled. If not, you should do it manually, since the licensing config file is being kept in memory.

Memory data

A license does not just contain a list of features, it also contains read-only memory data. Within this memory data additional restrictions, some bound to specific features, may be included.

Naturally, your developer license will contain other memory data then the customer's license. However, when your license includes the DevelopmentLicense feature, you can simulate the customer's read-only memory data as well.

In this case, you would need to add or change the customlicensedata element within your local Smartsite.Licensing.config file to reflect the memory data of the customer's license.

The read-only memory data applicable for a specific license (of the current site) can be retrieved using e.g. the Immediate Window within the CMS manager by specifying the following command:

  CopyCode image Copy Code
?Site.Srm.ReadMemoryData(Site.ManagerHaspSession)

The returned value (xml string, see example below) should be included within the customlicensedata element.

XML CopyCode image Copy Code
<lic>
<sites>emptysix</sites>
<cntrs>
<f4 override="false">20</f4>
</cntrs>
<data>
<f146>*</f146>
</data>
</lic>

Sites

The memory data example shown above does have a restriction on site name, only the site with its name set to emptysix will be allowed to run. If the license applies to multiple sites, sites may include a semicolon (';') separated list of sitenames or '*' to indicate there's no restriction on site name.

Counters

Within the cntrs element (counters per feature), there is a restriction specified for feature 4 (PublicationChannels), which means the number of allowed Publication Channels has been set to 20.

If a counter for a specific feature is requested and the cntrs element within the memory data does not contain an xml element for that specific feature, -1 will be returned (no restriction on the number of whatever the feature represents).

Data

Furthermore, the data element contains string data for one or more features, in this case feature 146 (HostHeaders). The interpretation of the feature data is feature specific, however in case of HostHeaders this means the feature data contains a list of allowed host-headers where '*' means no restrictions on host-headers.

Override

In the actual memory data (of your site's license), there may be an override attribute included on one or more child-elements of the cntrs element, the data element or on the sites element. When this attribute is present and is set to false, this means you can not override its value using the customlicensedata element.

Topics