Adding the Experience Manager Web site extension to a JSP Web site
You can add the Experience Manager Web site extension to your existing staging Web site, or you can create a standalone Web site that contains the Experience Manager Web site extension. You would typically do the latter for testing purposes.
Procedure
- Ensure that all the prerequisites for a Content Delivery Server Role are met on your target system.
- Access the SDL Tridion installation media.
- Access the preview\web\java\webapp\ subfolder.
- Do one of the following with the file cd_preview_web.war in this location:
- In a test scenario, deploy the WAR file on its own. Note that by default, this Web site is not secure because it is considered a staging Web site, and so it is expected to be behind a firewall or otherwise protected.
- To add the Experience Manager Web site extension to your staging Web site, add its contents to the Web site.
- If you store published content in a database, download the JDBC driver (JAR file) required for your specific database vendor and copy it into the WEB-INF/lib directory of your Web application:
Vendor JDBC Driver Required JAR Microsoft SQL Server Microsoft SQL Server JDBC Driver 4.0 sqljdbc42.jar for Java 8
sqljdbc4.jar for Java 6 or Java 7
Oracle Oracle JDBC driver 11.2.0.3 (deprecated) ojdbc6.jar for Java 6 or Java 7
Oracle Oracle JDBC driver 12.1.0.1 ojdbc7-12.1.0.1.jar for Java 8
ojdbc7.jar for Java 7
ojdbc6.jar for Java 6
IBM DB2 IBM Data Server Driver for JDBC and SQLJ (9.7 GA) (deprecated) Not supported with Java 8
db2jcc.jar for Java 6 or Java 7
You can download JDBC drivers from the following locations:- Oracle: download the JDBC Driver 12.1.0.1 from this location: http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
- SQL Server: download the JDBC Driver 4.0 from this location: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11774
- DB2: the JDBC driver is included with your DB2 installation.
- Navigate to the folder \Content Delivery\roles\preview\web\configuration\samples\.
- Copy logback.xml from that folder to the WEB-INF/classes/ subdirectory of your Web application.
- Copy each of the files that end in _sample.xml, except jvm_sample.xml, to the WEB-INF/classes folder of your Web application, and rename them by removing the string _sample from each filename (for example, rename cd_storage_conf_sample.xml to cd_storage_conf.xml).
- Open cd_ambient_conf.xml for editing.
- Find the
<Security>section and enclose it in comments. This element is only needed if you intend to set up OAuth authentication. - Ensure the presence of the following lines inside the
<Cartridges>section:<Cartridge File="cd_webservice_preview_cartridge.xml"/> <Cartridge File="footprint_cartridge_conf.xml"/> - Save and close cd_ambient_conf.xml.
- Open cd_dynamic_conf.xml in a plain-text or XML editor, and insert the following structure as the first child element inside the root element. This section may already exist, in which case you can use the mappings you see, and add new ones if needed.
<URLMappings> <StaticMappings> <Publications> <Publication Id="23"> <Host Domain="example.com" Port="91" Protocol="http" Path="/local-fr" /> </Publication> </Publications> </StaticMappings> <StorageMapping IdentifyPublicationByProperty="publicationUrl" /> </URLMappings>This example makes it possible to retrieve metadata for a Web page located in the http://example.com:91/local-fr/ by checking the corresponding Page in the Publication with ID 23 in the Content Manager. - Save and close cd_dynamic_conf.xml.
- Copy cd_licenses.xml, your Content Delivery license file available from SDL Tridion Customer Support, to the WEB-INF/classes directory of your Web application.
If you want to name the file differently or put it in a different location, you need to update the
Licenseelement in your configuration files. - Optional: Configure logging.
- Configure the Storage Layer and optionally encrypt sensitive strings. Add an attribute
defaultFileSystemto eachStorageelement in your configuration and set this attribute tofalse. - If your Web application server is JBoss, do the following:
- Locate the following files in the WEB-INF/lib/ subdirectory and remove them:
- stax-api.jar
- serializer.jar
- xalan.jar
- If you use JBoss 5.1 or 5.2, add the following JVM property-value pair to the
JAVA_OPTSvariable:-Dorg.jboss.logging.provider=slf4j - If you use JBoss 6.0 or 6.1, create a file with the following contents called jboss-deployment-structure.xml and save the file in the WEB-INF/ directory:
<jboss-deployment-structure> <deployment> <exclusions> <module name="org.slf4j" /> <module name="org.slf4j.impl" /> <module name="com.sun.jersey" /> <module name="com.sun.jersey.json" /> <module name="com.sun.jersey.core" /> </exclusions> </deployment> </jboss-deployment-structure> - If you use JBoss 6.0 or 6.1, open WEB-INF/web.xml, add the following section and save the file:
<context-param> <param-name>resteasy.scan</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>resteasy.scan.resources</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>resteasy.scan.providers</param-name> <param-value>false</param-value> </context-param>
- Locate the following files in the WEB-INF/lib/ subdirectory and remove them:
- If your Web application server is WebLogic, do the following:
- Remove the file stax-api.jar from your WEB-INF/lib/ subdirectory.
- Add a weblogic.xml file to the WEB-INF folder of your Web application that forces WebLogic to use the libraries contained in the Web application, rather than its own libraries. The contents of this weblogic.xml file must be as follows:
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"> <container-descriptor> <prefer-application-packages> <package-name>javax.persistence.**</package-name> <package-name>antlr.*</package-name> <package-name>org.slf4j.**</package-name> <package-name>org.apache.log4j.**</package-name> <package-name>org.apache.xml.serializer.**</package-name> </prefer-application-packages> </container-descriptor> </weblogic-web-app>
- Access the root of your staging Web site and open web.xml in a plain-text or XML editor.
- Ensure the presence of the following:
<listener> <listener-class> com.tridion.storage.persistence.session.SessionManagementContextListener </listener-class> </listener> <filter> <filter-name>Page Content Filter</filter-name> <filter-class>com.tridion.preview.web.PageContentFilter</filter-class> </filter> <filter-mapping> <filter-name>Page Content Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>Binary Content Filter</filter-name> <filter-class>com.tridion.preview.web.BinaryContentFilter</filter-class> </filter> <filter-mapping> <filter-name>Binary Content Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>This applies session preview filtering to your entire Web site. If your entire staging Web is located in a subdirectory, change the value ofurl-pattern. - Enable the Ambient Data Framework by adding the following to your web.xml:
<filter> <filter-name>Ambient Data Framework</filter-name> <filter-class>com.tridion.ambientdata.web.AmbientDataServletFilter</filter-class> </filter> <filter-mapping> <filter-name>Ambient Data Framework</filter-name> <servlet-name>Content Delivery Web service</servlet-name> </filter-mapping>This enables the Ambient Data Framework for the Content Delivery Web service only. If you want to enable the Ambient Data Framework in the entire Web application, replace the
servlet-nameelement with the following:<url-pattern>/*</url-pattern> - Save and close web.xml and restart your JSP Web site.
- Restart the Web application.