Skip to content

dd4t/dd4t-2-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dd4t-2-java

  • Current stable version: 2.1.11
  • Maven Central: org.dd4t

Changelog

2.1.11+

  • Upgraded to Spring 5.3.18
  • To prevent a circular dependency issue in this Spring version, remove the following property from your bean configuration for <bean id="dataBinder":
    • <property name="converter" ref="modelConverter"/>

2.1.8+

  • Tridion 9.5 compatibility
  • dd4t-providers-web8 renamed to dd4t-providers-odata to better reflect Tridion 9.5 support.

##Archetypes

Note that the archetypes are not supported anymore for Tridion 9.X.

Current stable archetype version:

  • Web 8: 1.1
  • Tridion 20XX: 1.6

##Prerequisites and Java dependencies

  1. Download and install Maven: https://maven.apache.org/run-maven/index.html

  2. Install all Tridion dependencies (aka JAR files) in your local Maven repository as these are not available in Maven Central. The general command to do this is:

     mvn -q install:install-file -DgroupId=com.tridion -DartifactId=cd_broker -Dversion=7.1.0 -Dpackaging=jar -Dfile=cd_broker-7.1.0.jar
    

To make this process a little more convenient, an install script was created to do this for all other required jars which are not in Maven Central.

Run this script in the directory where your Tridion jars are. Note that you have to rename them. For example, cd_core.jar has to become cd_core-7.1.0.jar. In addition to the Tridion jar, the script also installs the third party dependencies easylicense-2.5.jar,sqljdbc4-4.0.0.jar, jdbcpool-1.0.jar and the Tridion Contextual Web Delivery libraries should you need them.

In the above example, we install the Tridion 2013 SP1 Jar files, to which we have appended the version number. For older versions or for other version type (eg. -Dversion=2013SP1), you have to change the version property on your POM and in the script as well:

	<!-- Set the correct version for your local or central setup -->
	<properties>
	    <tridion.version>7.1.0</tridion.version>
	</properties>
	
A fairly normal setup for a DD4T 2 web application with Tridion dependencies included is: 

     <dependency>
        <groupId>com.tridion</groupId>
        <artifactId>cd_ambient</artifactId>
        <version>${tridion.version}</version>
    </dependency>
    <dependency>
        <groupId>com.tridion</groupId>
        <artifactId>cd_broker</artifactId>
        <version>${tridion.version}</version>
    </dependency>
    <dependency>
        <groupId>com.tridion</groupId>
        <artifactId>cd_cache</artifactId>
        <version>${tridion.version}</version>
    </dependency>
    <dependency>
        <groupId>com.tridion</groupId>
        <artifactId>cd_core</artifactId>
        <version>${tridion.version}</version>
    </dependency>
    <dependency>
        <groupId>com.tridion</groupId>
        <artifactId>cd_datalayer</artifactId>
        <version>${tridion.version}</version>
    </dependency>
    <dependency>
        <groupId>com.tridion</groupId>
        <artifactId>cd_dynamic</artifactId>
        <version>${tridion.version}</version>
    </dependency>
    <dependency>
        <groupId>com.tridion</groupId>
        <artifactId>cd_linking</artifactId>
        <version>${tridion.version}</version>
    </dependency>
    <dependency>
        <groupId>com.tridion</groupId>
        <artifactId>cd_model</artifactId>
        <version>${tridion.version}</version>
    </dependency>

Next, Tridion expects the following third party dependencies which are not in Maven Central and therefore have to be installed locally as well:

	<dependency>
        <groupId>com.vs.ezlicrun</groupId>
        <artifactId>easylicense</artifactId>
        <version>${easylicense-version}</version>
        <scope>runtime</scope>
    </dependency>
	<!-- SQL Server. 
	If you use Oracle, please consult the SDL Installation manual for the current proper dependency 
	-->
     <dependency>
        <groupId>com.microsoft.sqlserver</groupId>
        <artifactId>sqljdbc4</artifactId>
        <version>${sqljdbc4-version}</version>
        <scope>runtime</scope>
    </dependency>


These dependencies depend on the following properties in your POM:

	<properties>
		<sqljdbc4-version>4.0.0</sqljdbc4-version>
		<easylicense-version>2.5</easylicense-version>
	<properties>

Note that depending on your requirements or already present setup, version numbers may differ. Further reading on this can be done here.

##Fetching the latest version from Maven Central

dd4t-2-java is released to Maven Central, which means you do not have to download the source and embed it into your project anymore. The following core dependencies are usually always required:

   <dependency>
        <groupId>org.dd4t</groupId>
        <artifactId>dd4t-core</artifactId>
        <version>${dd4t.version}</version>
    </dependency>
    <dependency>
        <groupId>org.dd4t</groupId>
        <artifactId>dd4t-mvc-support</artifactId>
        <version>${dd4t.version}</version>
    </dependency>
    <dependency>
        <groupId>org.dd4t</groupId>
        <artifactId>dd4t-api</artifactId>
        <version>${dd4t.version}</version>
    </dependency>
    <dependency>
        <groupId>org.dd4t</groupId>
        <artifactId>dd4t-providers</artifactId>
        <version>${dd4t.version}</version>
    </dependency>
    <dependency>
        <groupId>org.dd4t</groupId>
        <artifactId>dd4t-caching</artifactId>
        <version>${dd4t.version}</version>
    </dependency>

Addionally, dd4t-2-java comes with a Maven archetype, which is also available on Maven Central. It is recommended to get started with the Archetype for quick and painless setup of your web application.

###Creating a bare dd4t-2-java Spring MVC web application

To create a complete, but minimal Spring MVC web application to develop with, create a new project based on a Maven archetype:

####Command Line:

  1. Create an empty directory where you want to develop the web application in

  2. Execute the following command after replacing the parameters in between the brackets ([com.example] and [mywebapp]):

     mvn archetype:generate -DgroupId=[com.example] -DartifactId=[mywebapp] -DarchetypeGroupId=org.dd4t -DarchetypeArtifactId=dd4t-spring-mvc-archetype -DarchetypeVersion=1.5  -DarchetypeCatalog=remote
    
  3. Enter the requested information. Maven will ask you to specify a version (defaults to 1.0-SNAPSHOT) and will then ask you to confirm the settings.

  4. The web application project is created if you see the following Maven output:

     $ mvn archetype:generate -DgroupId=com.example -DartifactId=mywebapp -DarchetypeGroupId=org.dd4t -DarchetypeArtifactId=dd4t-spring-mvc-archetype -DarchetypeVersion=1.5  -DarchetypeCatalog=remote -DarchetypeCatalog=http://repo1.maven.org/maven2
     [INFO] Scanning for projects...
     [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
                                                                      
     [INFO]  ------------------------------------------------------------------------
     [INFO] Building Maven Stub Project (No POM) 1
     [INFO] ------------------------------------------------------------------------
     [INFO] 
     [INFO] >>> maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom >>>
     [INFO] 
     [INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom <<<
     [INFO] 
     [INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom ---
     [INFO] Generating project in Interactive mode
     [INFO] Using property: groupId = com.example
     [INFO] Using property: artifactId = mywebapp
     Define value for property 'version':  1.0-SNAPSHOT: : 
     [INFO] Using property: package = com.example
     Confirm properties configuration:
     groupId: com.example
     artifactId: mywebapp
     version: 1.0-SNAPSHOT
     package: com.example
     Y: : Y
     [INFO] ----------------------------------------------------------------------------
     [INFO] Using following parameters for creating project from Archetype: dd4t-spring-mvc-archetype:1.4
     [INFO] ----------------------------------------------------------------------------
     [INFO] Parameter: groupId, Value: com.example
     [INFO] Parameter: artifactId, Value: mywebapp
     [INFO] Parameter: version, Value: 1.0-SNAPSHOT
     [INFO] Parameter: package, Value: com.example
     [INFO] Parameter: packageInPathFormat, Value: com/example
     [INFO] Parameter: version, Value: 1.0-SNAPSHOT
     [INFO] Parameter: package, Value: com.example
     [INFO] Parameter: groupId, Value: com.example
     [INFO] Parameter: artifactId, Value: mywebapp
     [INFO] project created from Archetype in dir: /your-dir/mywebapp
     [INFO] ------------------------------------------------------------------------
     [INFO] BUILD SUCCESS
     [INFO] ------------------------------------------------------------------------
    
  5. You can now open the project using your favourite IDE.

####IDE

For setting up a webapp based on the dd4t-2-java through your IDE, you will need to enter the following information:

  1. Archetype GroupId=org.dd4t

  2. Archetype ArtifactId=dd4t-spring-mvc-archetype

  3. ArchetypeVersion=1.5

Using the DD4T dependencies standalone

It's of course also possible to just load the DD4T dependencies in your POM. The following dependencies give you a minimum dd4t-2 setup:

	<dependencies>
		<dependency>
            <groupId>org.dd4t</groupId>
            <artifactId>dd4t-api</artifactId>
            <version>${dd4t.version}</version>
        </dependency>
        <dependency>
            <groupId>org.dd4t</groupId>
            <artifactId>dd4t-core</artifactId>
            <version>${dd4t.version}</version>
        </dependency>
        <dependency>
            <groupId>org.dd4t</groupId>
            <artifactId>dd4t-databind</artifactId>
            <version>${dd4t.version}</version>
        </dependency>
        <dependency>
            <groupId>org.dd4t</groupId>
            <artifactId>dd4t-mvc-support</artifactId>
            <version>${dd4t.version}</version>
        </dependency>
        <dependency>
        	<groupId>org.dd4t</groupId>
        	<artifactId>dd4t-providers</artifactId>
        	<version>${dd4t.version}</version>
    	</dependency>
    <dependencies>

dd4t-compatibility

For backwards compatibility with DD4T 1, add the following dependency:

	<dependencies>
        <dependency>
        	<groupId>org.dd4t</groupId>
        	<artifactId>dd4t-compatibility</artifactId>
        	<version>${dd4t.version}</version>
    	</dependency>
    <dependencies>

Other dd4t-2 dependencies

DD4T 2 requires quite a few sub dependencies. Depending on your need, you will need to adjust them and add or change them in your POM. In general, the minimal list of dependencies can be found in the dependencyManagement section of dd4t-2-java's parent pom, located here: https://raw.githubusercontent.com/dd4t/dd4t-2-java/release/pom.xml

Web Application and Tridion dependencies

In addition to dd4t-2's native dependencies, your web application and embedded Tridion stack may require extra dependencies. You can check the set dependencies in the following projects as a guide for establishing your set:

Note on ActiveMQ 5.12+

Note: if you use JMS invalidation with ActiveMQ, you need to whitelist packages which can be serialized. This is done by adding the following Java startup parameter to wherever you are using this:

-Dorg.apache.activemq.SERIALIZABLE_PACKAGES=com.tridion.cache,org.apache.activemq,com.thoughtworks.xstream

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages