help.axcms.netAxinom Logo
Save Save Chapter Send Feedback

Upgrading to AxCMS.net 9.0.0

 

Visual Studio 2008 / .NET 3.5

AxCMS.net was upgraded to .NET 3.5 and Visual Studio 2008. All template projects also have to be upgraded. Upgrading your solution should be very easy and transparent - just open your VS2005 solution in VS2008 and it will be converted. The only problem we experienced is that VS2008 adds web.config to templates project (as it is a web application). This web.config needs to be deleted for solution to work.

AxCategory is now extendable

Category persistence was changed to use same persistance model as for AxPage and AxDocument. This allows extending class of category and adding custom fields and functionality.

Category class was renamed to AxCategory, CategoryCollection was renamed to AxCategoryCollection. You will have to replace all usages of these classes to their new names. AxCategoryCollection now contains AxCategory instances, not INode implementations. INode interface was removed - if you use it, switch to direct AxCategory calls.

All load, save, etc activities with categories are now done with AxCategoryAdapter. E.g. if you have loaded category with code:
   Category active = new Category();
   active.ID = categoryid;
   active.Load();
New code should be:
   AxCategory active = new AxCategoryAdapter().Load(categoryid);

Dynamic Control support was removed

Since AxCMS 5.2.5, dynamic controls were considered obsolete and in version 9, dynamic control support is removed completely. You have to convert all your DynamicControlDefinitions to ElementTemplateDefinitions: 

  1. Backup CmsSite.xml
  2. Go to http://localhost/AxCMSweb_Sample/installation/CMSSiteTranslation.aspx (replace http://localhost/AxCMSweb_Sample with your actual host and virtual directory)
  3. Enter Destination path for the new CmsSite.xml under Converting CmsSite.xml from 6.0 to 9.0 and click Convert CmsSite.xml
  4. Check generated CmsSite.xml and replace your old file with it

When you have upgraded CmsSite.xml, you also have to upgrade database and replace all existing dynamic controls with your new element templates:

  1. Backup management system database
  2. Go to http://localhost/AxCMSweb_Sample/installation/CMSSiteTranslation.aspx (replace http://localhost/AxCMSweb_Sample with your actual host and virtual directory)
  3. Click Convert DB
  4. Make sure pages with dynamic controls still work fine

If you have created control editors using IDynamicControlEditor, you have to change your class declaration to implement interface IStructureElementEditor and implement method PostSaveAction(), e.g.:

 public class DemoControlEditor : UserControl, IStructureElementEditor
 {
         ...
         public void PostSaveAction()
         {
         }
 } 

AxDynControl table was removed, if you use it in your code, please modify it. Also remove AxDynControl table from DeleteTable parameters in your create application.

New ribbon menu

AxCMS 9 uses new ribbon menu made in Silverlight using WCF for communication with backend. Following changes need to be done to upgrade:

  • Add following to MS web.config before </configuration>:
      <system.codedom>
        <compilers>
          <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
            <providerOption name="CompilerVersion" value="v3.5"/>
            <providerOption name="WarnAsError" value="false"/>
          </compiler>
        </compilers>
      </system.codedom>
    <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
        <behaviors>
          <serviceBehaviors>
            <behavior name="AxCMS.AxCMSweb.ConceptBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings> 
          <basicHttpBinding>
            <binding name="myServicesBinding">
              <readerQuotas maxDepth="500" maxArrayLength="20000000" maxStringContentLength="20000000"/>
            </binding>
          </basicHttpBinding>
        </bindings>
        <services>
          <service behaviorConfiguration="AxCMS.AxCMSweb.ConceptBehavior" name="AxCMS.AxCMSweb.Concept">
            <endpoint address="" binding="basicHttpBinding" contract="AxCMS.AxCMSweb.IConcept" bindingConfiguration="myServicesBinding" />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
      </system.serviceModel>
     
    If you use Windows Authentication you have to enable it also for WCF service configured above. Add to <binding name="myServicesBinding"> section following:
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Windows" />
              </security>
    And in <service> section replace second <endpoint> elements with:
            <endpoint address="mex" binding="basicHttpBinding" contract="IMetadataExchange" bindingConfiguration="myServicesBinding" />
  • Add following to <httpHandlers> configuration element in MS web.config:
          <remove verb="*" path="*.asmx"/>
          <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
     
  • Add following to <pages> configuration element in MS web.config:
          <controls>
            <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </controls>
     
  • Replace <assemblies> element in <compilation> configuration element in MS web.config with:
          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
          </assemblies>
     
  • If you have customized MS top menu, your customizations will not work with AxCMS9, since menu is now in Silverlight and the way to override it is changed. You have to create your class overriding Axinom.AECMS.TopMenuModel and specify it in MS web.config, e.g.:
    <add key="TopMenuModelClass" value="PremiumSample.BL.PremiumSampleTopMenu, PremiumSample.BL"/>
    For sample code, see Premium Template Project.

AuthenticationModule and LiveHttpHandler are replaced by AxCMSHttpModule

New AxCMSHttpModule completely controls page and document serving in Live System. This includes:

  • Url resolving - e.g. Page.AxCMS is mapped to /publish/Page.aspx
  • Object existence and object validation - e.g. offline, online pages and documents
  • Access authorization, permission checks etc.
  • Site and object handling (error, redirect, switch - page handling types)
  • Navigation handling - finding current active navigation node
  • Error handling - catching exceptions and serving defined error pages
  • Logging for reporting - logging AxPageViewAction and AxDocumentViewAction

AxCMSHttpModule is required for Live System to work and has to be defined in web.config. To upgrade, in LS web.config replace <add type="AxCMS.AxCMSwebLive.AuthenticationModule, AxCMSwebLive" name="AuthenticationModule" /> with <add type="Axinom.AECMS.HttpHandler.AxCMSHttpModule, AxCMS.BL" name="AxCMSHttpModule" /> and remove <add verb="*" path="*.AxCMS" type="Axinom.AECMS.HttpHandler.LiveHttpHandler, AxCMS.BL" />. For IIS7 systems running in integrated mode, map .AxCMS extension to System.Web.UI.PageHandlerFactory.

AxCMSHttpModule functions can be overriden - so if you have implemented your own AuthenticationModule consider replacing it with AxCMSHttpModule override.

Changes in configuration files

CMSSystemRootDir and LiveSystemRootDir are now depreciated and stay only in old configuration files. They have both same behaviour as previously for backward compatibility. New keys introduced instead: MSRootDir and LSRootDir. While old keys were pointing to the level above the real CMS / Live files (e.g. C:\Projects\AxCMS_Sample), new keys are pointing to the real directories (e.g. C:\Projects\AxCMS_Sample\AxCMSweb_Sample). So now it is possible to rename virtual directories without renaming physical folders.

MediaServerRootDir and MediaServerHostName are also deprecated and not used in AxCMS code. MediaServerHostName was removed completely, while MediaServerRootDir is left for application backward compatibility. New key UploadRootDir is introduced pointing to the actual upload folder of the system.

TemplateDirectory and PublishDirectory keys are also considered obsolete, they are now constant and declared in WebControlConst class.

For changing location of publish folder, new key is introduced - PublishRootDir, pointing to actual publish folder of the system.

ExecuteAt and cmsCssFile keys were also removed - they were not used by CMS. If you have used them, change your calls to AppSettings.

Modules

Due to all changes above, all AxCMS modules (Contact, Forum, Banner, Voting) are also have to be upgraded. New module versions are included in new Premium Template Project.