Skip to content

Composite C1 4.0

Compare
Choose a tag to compare
@pashakuzm pashakuzm released this 20 Nov 13:54
· 3739 commits to master since this release

Composite C1 4.0 (4.0.4897.31550)

Getting started

If you are new to Composite C1 and want to install it: http://docs.composite.net/Getting-started

What's new in Composite C1 4.0

The following are highlights of major changes since Composite C1 3.2:

General user features:

  • Uploads up to 512MB accepted in the media archive
  • New “Block Selector” in Visual Editor – enable users to create styled div, blockquote etc. elements (not yet available in IE)
  • IE9 and IE10 run in standards mode and have very good performance
  • Support for older IE7 and IE8 dropped
  • IE10 has spell checking in all input fields (like Firefox)
  • When media files are updated (like uploading a new image on top of an existing one) all client caches are automatically invalidated
  • Drop down menus support searches
  • Free hand image re-size in visual editor - images resized server side
  • New URL combobox widget allow for both internal URLs and a typed URL
  • The C1 Console tree showing website pages now use the 'Menu Title' for labels
  • New starter site (bootstrap/less/razor)

Developer features:

  • Support for .NET 4 and .NET 4.5
  • ASP.NET Razor, Web Forms and Master pages are now 1st class citizens
  • Support for inline SVG in page html, function output etc.
  • Data type editor let you make XHTML fields with one click.
  • Data type Editor now enable you to control sorting on tree elements
  • Public API expanded - http://api.composite.net/
  • VisualEditor; code view; setting attributes on now kept and lifted to rendered page.
  • Visual Editor pick up on CSS/LESS file changes and next load.
  • Support CDATA sections - enable unstructured markup to be placed in function output.
  • New C1 Functions HtmlTitleValue and MetaDescriptionValue (namespace Composite.Web.Htm.Template) which will output final title and description of a page.
  • Adding head element filtering (filtering on duplicate meta tag definitions, duplicate script and css includes).
  • Page Template supports Razor and Master pages with full C1 Console edit support in the Layout perspective
  • Razor Functions and User Control Functions known from C1Contrib build in, added to public API and manageable from within the C1 Console
  • In Layout perspective, New "Page Templates Features" allow you to maintain templates elements (like footer texts, navigation and aside columns functions) in a code free environment.
  • Code editor has razor syntax highlighting
  • ASP.NET Sitemap provider support
  • Copy XSLT Functions
  • OnStoreChange data event introduced for better scale out support
  • IFormLoginProvider and related types now exposed in the public API
  • RenderingResponseHandler and related types now exposed in the public API
  • Error boxes shown when a C1 Function fail on a page look better than ever. Highlighting the offending line etc.

Management:

  • New "HTTPS Enforcer" feature on the C1 Console (see change sets) - easy config to make the C1 Console either force HTTPS or be unavailable.
  • Install and perform well on Azure Websites.
  • Now possible to delete (or not copy) the "/Composite" folder on a deployment.
  • The C1 Console "Tools | Server Log" now offer filtering of event types '
  • XML data files serialize elements sorted by primary key. Makes use with code versioning systems easier.
  • Changes to XML data files are picked up. Data is reloaded and OnStoreChange are fired, updating all relevant Composite C1 caches.

Other:

  • Numerous bug fixes and minor improvements - for a more comprehensive list see change sets.

Upgrade guidelines
You can upgrade from 4.0 beta releases and earlier versions of Composite C1 - upgrading gives you access to all 4.0 features, fixes and packages.

Manual upgrade from 3.2 and earlier:
See below

Supported and automated upgrade
For automated and supported upgrade tool see https://www.composite.net/Plans-and-Pricing

Upgrading from 4.0 Beta:

  1. Take a backup of your website
  2. Launch the C1 Console
  3. Go to System | Packages | Available Packages | Composite.Updates
  4. Select "Package Info" on the update available and click "Install"

4.0

Manual Upgrade 3.2 -> 4.0

Important: The guide below is for the technically well-informed “DIY” people out there. We suggest you consider one of two other options before you proceed with a manual upgrade.

If you need to upgrade a commercial website and want professional automatic tooling and support, go to http://www.composite.net/Plans-and-Pricing - the money your client pay here is used to fund further open source development, so that’s excellent!

If you are upgrading a private, community related website, send a mail to [email protected] with the Installation ID (C1 Console – Help | About Composite C1) and the URL of your site. And we’ll probably give you the automated stuff for free and all!

If you proceed with the guide below, please read it through first so you are familiar with the tools and steps needed to complete.

Overview:

  1. Preparation
  2. Uninstalling packages
  3. Updating configuration files
  4. Updating C1 files
  5. Removing obsolete data types
  6. Updating CompositeC1Contrib's razor files (if needed)
  7. Updating CompositeC1Contrib's master page files (if needed)

1. Preparation

Remember to have a backup copy of your solution.
Download a clean 4.0 website from GitHub.

https://github.com/Orckestra/C1-CMS/releases/tag/v4.0

2. Uninstall the following packages if installed:

Composite.Tools.PackageCreator

After that, stop the website on IIS

3. Config changes

Apply the attached xsl transformation files to the following configuration files:

composite_config.xsl for ~/App_Data/Composite/Composite.config
web_config.xsl for ~/Web.config

Either open the xsl file in VisualStudio, and use XML -> "Run without debugging"
Or use online websites, f.e. http://www.xsltcake.com
a) In the top left, "Select XSLT processor" -> choose .NET 4
b) Copy your config file to the "XML" window
c) Copy the transformation to the "XSLT" windows
d) Press "Run" and copy the results to your configuration file.

If updating to 4.0 (not to 4.1), search for and remove

imageQuality="80"

from ~/App_Data/Composite/Composite.config

and search for and change

targetFramework="4.5"

to targetFramework="4.0"

in ~/Web.config

4. Apply file changes

Download sources of C1 4.0 from the CodePlex release page.

Copy and replace the following files from the 4.0 instance to your website:

~\Bin*. (!!!! Except Composite.Generated.dll !!!!)
~\Composite. (Just the files, not including the subfolders)
~\Renderers.*

~\App_Data\Composite\app_offline.htm
~\App_Data\Composite\TreeDefinitions\UrlConfiguration.xml
~\App_Data\Composite\Configuration\C1ConsoleAccess.xml
~\App_Data\PageTemplates\web.config
~\App_Data\Razor\web.config
~\App_Data\UserControls\web.config
~\Frontend\Config\VisualEditor\Styles\core.css
~\Frontend\Config\VisualEditor\Images\smalltext.png

~\default.aspx
~\Global.asax

Delete the following folders on your website, and copy them from the 4.0/4.1 instance:

~\Composite\content
~\Composite\controls
~\Composite\images
~\Composite\localization
~\Composite\schemas
~\Composite\scripts
~\Composite\services
~\Composite\skins
~\Composite\styles
~\Composite\templates
~\Composite\transformations\

Delete the following files and folders (if present):

~\App_Data\Composite\DataMetaData\IPageTemplate_7b54d7d2-6be6-48a6-9ae1-2e0373073d1d.xml
~\App_Data\Composite\DataMetaData\Composite.Data.Types.IPageTemplate_7b54d7d2-6be6-48a6-9ae1-2e0373073d1d.xml
~\bin\CompositeC1Contrib.RazorFunctions.dll
~\bin\CompositeC1Contrib.Rendering.MasterPage.dll
~\Composite\flash\

5. Remove obsolete data types

Composite.Data.Types.IWhiteListedLocale

Note: In v. 4.0 a lot of obsolete data types were removed. In case of compilation/log errors, the following data types should be removed from the configuration as well.

Composite.Data.Types.ILogEntry
Composite.Data.Types.IAggregationDescription
Composite.Data.Types.ICompositionDescription
Composite.Data.Types.IPageAssociationVisability
Composite.Data.Types.IXhtmlEditorElementClassConfiguration
Composite.Data.Types.IDataFieldDescriptor
Composite.Data.Types.IDataFieldDescriptor_FormRenderingProfile
Composite.Data.Types.IDataFieldDescriptor_ValidatorFunctionMarkup
Composite.Data.Types.IDataTypeAssociationDescriptor
Composite.Data.Types.IDataTypeDescriptor
Composite.Data.Types.IDataTypeDescriptor_DataScope
Composite.Data.Types.IDataTypeDescriptor_KeyFieldName
Composite.Data.Types.IDataTypeDescriptor_StoreSortOrderFieldName
Composite.Data.Types.IDataTypeDescriptor_SuperInterface

To remove a data type, do the following steps:

  1. Delete the related xml file if exists: /App_Data/Composite/DataMetaData/*.xml

  2. Delete the data store:
    a) If running on XML
    Delete it from ~/App_Data/Composite/Configuration/DynamicXmlDataProvider.config
    and delete the related storage file ~/App_Data/Composite/DataStores/*.xml

b) If running on SQL
Delete it from ~/App_Data/Composite/Configuration/DynamicSqlDataProvider.config
and delete the related table(s) from the database

6. If the original website was using CompositeC1Conrib's Razor functions
Edit each Razor function and apply the following steps:

  1. Remove:
@using CompositeC1Contrib.RazorFunctions;
@using CompositeC1Contrib.RazorFunctions.FunctionProvider;
@using CompositeC1Contrib.RazorFunctions.Html;
  1. Use
@inherits RazorFunction

instead of:

@inherits [CompositeC1Contrib.RazorFunctions.]CompositeC1WebPage
  1. Use
@Html.C1().Markup()

instead of

@Html.C1().Body()
  1. Convert function parameters.
    Old code:
[FunctionParameter("Include Parent Page", "Check the box if you want parent page to be displayed in navigation", false)]

New code:

[FunctionParameter(Label = "Include Parent Page", Help = "Check the box if you want parent page to be displayed in navigation", DefaultValue = false)]

7 . If the original website was using CompositeC1Contrib's Master Pages,

  1. In all the "~/App_Data/PageTemplates/*.master" files:

Replace title markup:

<rendering:Title ID="title" runat="server" />

With

<c1:Title ID="title" runat="server" />

Replace placeholder definitions, f.e.:

<rendering:Placeholder ID="aside" Title="Aside" [Default="true"] runat="server" />

To

<c1:Render Markup="<%# aside %>" runat="server"  />
  1. For each "~/App_Data/PageTemplates/*.master.cs" file:

Add new namespaces, inherit master page from MasterPagePageTemplate, add placeholder information:

From:

public partial class _1_column__full_width : System.Web.UI.MasterPage
{
}

To:

using Composite.Core.Xml;
using Composite.Plugins.PageTemplates.MasterPages;
using Composite.Core.PageTemplates;

public partial class Simple : MasterPagePageTemplate
{
    public override Guid TemplateId 
    {
        get { return new Guid("54d5a744-c31e-422d-8885-acd96721a351"); }
    }

    public override string TemplateTitle
    {
        get { return "Simple (master page)"; }
    }

    [Placeholder(Title="Content", IsDefault=true)]    
    public XhtmlDocument content { get; set; }

    [Placeholder(Title="Aside")]
    public XhtmlDocument aside { get; set; }
}   
  1. Edit Frontpage.master
    AutoEventWireup="true" CodeFile="1 column, full width.master.cs" Inherits="_1_column__full_width" %>

should be

    AutoEventWireup="true" CodeFile="Frontpage.master.cs" Inherits="Frontpage" %>

Finish: start the website on IIS