Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Installing and Running Cortex API Tutorials 1-4

Installing and Running Cortex API Tutorials 1-4

The following instructions describe how to install and run Cortex API tutorials 1-4. The installation instructions for tutorials 5 and 9 are described in their documents. The tutorial code is distributed with the Cortex API source code, see Release Structure and Source Code Organization for more information.

To install and run tutorials 1-4:

  1. In the Cortex API resource-configuration project that you generated in Generate Cortex Projects, add the tutorials' Bundle-Symbolic names to the commerce-api-resource-integrations\src\main\resources\OSGI-INF\blueprint\resource-configuration-blueprint.xml as shown in the example below:
        <blueprint
                xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
            <!-- export services -->
            <serviceid="requiredResourceServerBundles"interface="java.util.List">
                <beanclass="java.util.ArrayList">
                    <argument>
                        <array value-type="java.lang.String">
                            ...
                        <!-- Add extension resources to be loaded by Cortex Webapp here. -->
                        <value>com.elasticpath.rest.example.rest-resource-helloworld</value> 
    					<value>com.elasticpath.rest.example.rest-resource-extensionprofile</value>
    					<value>com.elasticpath.rest.example.rest-resource-corelookup</value> 
                        <value>com.elasticpath.rest.example.rest-resource-stopcondition</value>
                            ...
                        </array>
                    </argument>
                </bean>
            </service>
        </blueprint>
    
  2. In rest-tutorials\webapp\pom.xml, change the POM to reference your resource-configuration project following the example below. You will need to change the group-id, artifiact-id, and version to the values of your resource-configuration POM; these are just examples.
                
                ...
                	<properties>
    		             <!-- Just use Cortex DCE resource configuration -->
    		             <resource-configuration-group-id>com.company.commerce-api.resource-integrations</resource-configuration-group-id>
    		             <resource-configuration-artifact-id>commerce-api-resource-integrations</resource-configuration-artifact-id>
    		             <resource-configuration-version>1.0-SNAPSHOT</resource-configuration-version>
    	           </properties>
                ...
                
             
  3. Rebuild the following projects using mvn clean install in this order:
    1. Cortex API resource-configuration project
    2. Cortex API rest-tutorials web application
  4. Run the tutorial's web application: in your command line, navigate to rest-tutorials\webapp and run the following:
    mvn tomcat:run-war