You can add a site to an application that you have already deployed.
To add a site to your application, you must export the application, add the new site, and then import the updated application. Every site must have its own site definition, and if you plan on filtering records for the new site, you must configure a site-based filter as well.
Export the application to which you want to add a site.
Navigate to the
<app dir>\control\
directory on Windows (<app dir>/control/
directory on Unix).From the command line, export the application by entering the following command:
runcommand.<
bat|sh
> IFCR exportApplication <destination
>Unzip the
<app name><date&time>.zip
file to an empty directory, for example:\myexports\discover
.
Add the default site ID, site node and site definition for you new site.
Navigate to the pages node of your unzipped exported application, for example,
\myexports\discover\pages
.Open the
_.json
file in an editor and add a default site ID.For example:
{ "defaultSiteId": "/DiscoverElectronics", "ecr:type": "page-root" }
This is the site that the Assembler uses when the request cannot be matched to any site using the URL patterns.
Note
All properties in JSON files must be in UTF-8 character format. Convert all Unicode characters to JSON encoded values.
Navigate to the
\myexports\discover\pages
directory. Note that the application already has an existing site. For example, the Discover application has an existing site withDiscoverElectronics
as thesite_ID
.Create a folder for your new site parallel to the existing site. The name that you provide for the folder becomes the
site_ID
, for exampleDiscoverCameras
.Navigate to the existing site in your application, for example
pages\DiscoverElectronics
.Copy the site definition file,
_.json
, from the folder and paste it into your new site folder, for examplepages\DiscoverCameras\_.json
.Use a text editor to update the site definition with unique information appropriate for your new site. For example, the following new site has been updated with a unique URL pattern, display name, and description.
{ "ecr:type": "site-home", "urlPattern" : "/DiscoverCameras", "displayName" : "Discover Cameras", "description" : "This site shows you all the Cameras available at Discover.", }
If you want the site to have its own unique icon to identify it in Experience Manager, you can replace the default site icon with one of your own by copying an image to the same directory as the site's JSON file.
The image must be 16 by 16 pixels, and be named
siteIcon.<
, for exampleextension
>pages\DiscoverCameras\siteIcon.png
. The supported formats are JPG, JPEG, PNG, GIF, and TIF. Oracle recommends using the PNG format.
If you want your site to filter a subset of relevant records, you need to add a site-based filter to your site.
Navigate to the new site directory
pages/<new site_ID>
, for examplepages/DiscoverCameras
.Create an XML file and name it
filterState.xml
. The following file filters records so that only those records in the cameras category can appear in the site.<Item class="com.endeca.infront.navigation.model.FilterState" xmlns="http://ende¬ ca.com/schema/xavia/2010"> <Property name="recordFilters"> <List> <String>product.category:cameras</String> </List> </Property> </Item>
A site needs at least one page in order to display so copy and paste pages that you want from your original site to your new site.
For example, you could copy the browse folder from
pages/DiscoverElectronics
topages/DiscoverCameras
.Import the content with the new site information.
Navigate to the
<app dir>
\control\<app dir>
/control/From the command line, import the updated content by entering the following command:
runcommand.<
.bat/sh
> IFCR importContent pages <path to source>For example:
runcommand.bat IFCR importContent pages c:\myexports\Discover\config\import\pages
After you have added a site to your application, you must complete the following tasks:
If you want keyword redirects to send end users to a specified page in a site when they enter search terms then you must configure site-based keyword redirect groups. See Configuring site-based keyword redirects.
If your application was built using Spring and
ActionPathProvider
was implemented for your application, then you might need to update the action paths inassembler-context.xml
file. See Configuring site awareness in action links.Update permission settings for business users that have access to Experience Manager. You can limit the site pages that business users can modify. See Modifying users and groups