Add a New Channel
Introduction
Goal
Add a delivery channel to a Bloomreach Experience Manager implementation project.
Prerequisites
The starting point for the example described on this page is a default Bloomreach Experience Manager project created using the Maven archetype with a translated channel added as described in Add a Translated Channel. Adding a new channel is very similar.
Steps in the CMS
Assume we already have a content folder myproject. Now, depending on whether the new channel needs to be translated or not, you need add a root 'folder' or 'non-translated folder' in the CMS Content Perspective. Do this by clicking Add root folder. Assume we add mysecondchannel.
Now, add some initial folder structure and documents. This may be similar to the already existing channel, or completely different, depending on your use case.
If you need this new channel to be translated, repeat the steps at Add a Translated Channel after you finished this page.
Steps in the HST configuration
Add a new hst:configuration for the new channel mysecondchannel .
Assume we already had different translations for myproject and have the following hst:configuration:
/hst:myproject: /hst:configurations: /hst:default: /common: /hst:pages: /hst:components: /hst:templates: /hst:catalog: /myproject: hst:inheritsfrom: [../common] /hst:sitemap: /hst:sitemenus: /hst:channel: hst:name: My project /monprojet: hst:inheritsfrom: [../common] /hst:sitemap: /hst:sitemenus: /hst:channel: hst:name: Mon projet
(Note that in the example above, the hst:channel is not below the hst:workspace, meaning it will be read-only, also see Workspace Configuration)
Depending on your domain specific use case, we can or cannot reuse the common part for the already existing channel myproject. Assume, the new channel mysecondchannel has the same hst:components, hst:templates and hst:catalog but it has different hst:pages. We can thus reuse everything except the hst:pages. If we first move hst:pages to a new hst:configuration sharedpages, and make sure we do cascading inheritance, we can later on easily add mysecondchannel. Thus
Split off hst:pages from common
/hst:myproject: /hst:configurations: /hst:default: /common: /hst:components: /hst:templates: /hst:catalog: /sharedpages: hst:inheritsfrom: [../common] /hst:pages: /myproject: hst:inheritsfrom: [../sharedpages] /hst:sitemap: /hst:sitemenus: /hst:channel: hst:name: My project /monprojet: hst:inheritsfrom: [../sharedpages] /hst:sitemap: /hst:sitemenus: /hst:channel: hst:name: Mon projet
hst:inheritsfrom for myproject and monprojet now have cascading inheritance
The hst:inheritsfrom inherits from sharedpages which in turn inherits from common. If sharedpages does not inherit from common, you can still inherit from common as follows: hst:inheritsfrom = {../sharedpages , ../common} where the property has two values.
Add mysecondchannel
Now, add mysecondchannel:
/hst:myproject:
/hst:configurations:
/hst:default:
/common:
/hst:components:
/hst:templates:
/hst:catalog:
/sharedpages:
/hst:pages:
/myproject:
hst:inheritsfrom: [../sharedpages , ../common]
/hst:sitemap:
/hst:sitemenus:
/hst:channel:
hst:name: My project
/monprojet:
hst:inheritsfrom: [../sharedpages , ../common]
/hst:sitemap:
/hst:sitemenus:
/hst:channel:
hst:name: Mon projet
/mysecondchannel:
hst:inheritsfrom: [../common]
/hst:sitemap:
/hst:sitemenus:
/hst:pages:
/hst:channel:
hst:name: My second channel
Add a new hst:site for the new channel
Assume you already had:
/hst:myproject: jcr:primaryType: hst:hst /hst:sites: jcr:primaryType: hst:sites /myproject: jcr:primaryType: hst:site /monprojet: jcr:primaryType: hst:site
After adding the mysecondchannel, you'll have something like:
/hst:myproject:
jcr:primaryType: hst:hst
/hst:sites:
jcr:primaryType: hst:sites
/myproject:
jcr:primaryType: hst:site
/monprojet:
jcr:primaryType: hst:site
/mysecondchannel:
jcr:primaryType: hst:site
Make sure that for mysecondchannel, you change the hippo:content property to the absolute JCR path /content/documents/mysecondchannel you created at the beginning of this page.
Create the host or "URL space" for the new channel.
Assume you already had
/hst:myproject: jcr:primaryType: hst:hst /hst:hosts: jcr:primaryType: hst:virtualhosts /prod: jcr:primaryType: hst:virtualhostgroup /com: jcr:primaryType: hst:virtualhost /myproject: jcr:primaryType: hst:virtualhost /www: jcr:primaryType: hst:virtualhost /hst:root: jcr:primaryType: hst:mount /fr: jcr:primaryType: hst:virtualhost /monprojet: jcr:primaryType: hst:virtualhost /www: jcr:primaryType: hst:virtualhost /hst:root: jcr:primaryType: hst:mount
now, adding the new channel as a new host can be done as follows:
/hst:myproject:
jcr:primaryType: hst:hst
/hst:hosts:
jcr:primaryType: hst:virtualhosts
/prod:
jcr:primaryType: hst:virtualhostgroup
/com:
jcr:primaryType: hst:virtualhost
/myproject:
jcr:primaryType: hst:virtualhost
/www:
jcr:primaryType: hst:virtualhost
/hst:root:
jcr:primaryType: hst:mount
/mysecondchannel:
jcr:primaryType: hst:virtualhost
/www:
jcr:primaryType: hst:virtualhost
/hst:root:
jcr:primaryType: hst:mount
/fr:
jcr:primaryType: hst:virtualhost
/monprojet:
jcr:primaryType: hst:virtualhost
/www:
jcr:primaryType: hst:virtualhost
/hst:root:
jcr:primaryType: hst:mount
Above, we have added the host www.mysecondchannel.com. Make sure the hst:mountpoint for
/hst:myproject/hst:hosts/prod/com/mysecondchannel/www/hst:root
points to the site node /hst:myproject/hst:sites/mysecondchannel created in the step 2.
If you do not want the new channel to have a different hostname, but a different URL, you can instead configure it as follows (again make sure the hst:mountpoint is correct).
/hst:myproject: jcr:primaryType: hst:hst /hst:hosts: jcr:primaryType: hst:virtualhosts /prod: jcr:primaryType: hst:virtualhostgroup /com: jcr:primaryType: hst:virtualhost /myproject: jcr:primaryType: hst:virtualhost /www: jcr:primaryType: hst:virtualhost /hst:root: jcr:primaryType: hst:mount /second: jcr:primaryType: hst:mount /fr: jcr:primaryType: hst:virtualhost /monprojet: jcr:primaryType: hst:virtualhost /www: jcr:primaryType: hst:virtualhost /hst:root: jcr:primaryType: hst:mount
Now, the new channel is available at www.myproject.com/second.