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.

Managing Assets

Managing Assets

Application Assets

Application assets are located in <EPsource>/ep-assets/application-assets/src/main/assets. These resources are required to run the Elastic Path Commerce Manager application. These assets include:

  • cmassets - Commerce Manager assets, containing velocity templates used in the Commerce Manager client.
  • content-wrappers
  • import - Commerce Manager .csv files, (used for importing products, jobs, catalogs, etc)

Store Assets

Store assets are located in <EPsource>/stores/snapitup-assets/src/main/assets. These resources are required to run the Storefront and the Cortex. These assets include:

  • dynamiccontent (assets used by your Dynamic Content)
  • images (images used by your catalog data)
  • storeassets (Miscellaneous store assets)
  • themes (the look-and-feel related resources, including Velocity templates, CSS files, Javascript files, and storefront images)
  • digital assets (downloadable binaries, such as software, images, etc) located in <EPsource>/store-data/camera-stores/data/iepackage/digitalassets

Deploying Assets Locally

The following command builds your assets directory on your local computer at C:\users\<username>\ep-assets. The command creates the ep-assets folder with symbolic links that link to the application and storefront assets in your source release.

  • From the source root run:
    mvn -f asset-repository/pom.xml generate-resources
    

Deploying Assets for Production

The following command builds your assets (application and storefront) into a zip file and deploys the zip file to your Maven repository. You can either deploy the assets.zip on your production server, or, if you have a Nexus server available, you can deploy your assets from there. To build and deploy the assets.zip,

  • In the command line, navigate to <EPSource>\asset-repository\assets\assets-zip and run the following command:
    mvn package 
    The assets.zip containing the Store Assets and Application Assets builds to your target folder and is deployed to your Maven repository at ..\.m2\repository\com\elasticpath\assets-zip

Specifying the Asset Path

By default, assets are built into the C:\users\<username>\ep-assets directory. You can change this default by modifying the assetLocation setting in the Commerce Manager Client.

To change the assetLocation setting:
  1. Log on to the Commerce Manager Client.
  2. In the Activity menu, choose Configuration.
  3. In the Configuration menu, choose System Configuration.
  4. In the Filter, enter COMMERCE/STORE/ASSETS/assetLocation
  5. In the Setting Name menu, select the assetLocation setting
  6. Under Defined Values, select the default setting and click the Edit... button.
  7. Under Value, enter your new asset location.
  8. Click Save to apply your changes.
  9. From the source root, run the following Maven command to build symbolic links to your new asset location:
    mvn -f stores/snapitup-populate-database/pom.xml process-resources -P update-settings

Configuring the Asset Path Before Building

You can configure the asset location before you build by adding the following profile in your .m2\settings.xml file and replacing the location to point to your preferred directory:

<profile>
    <id>ep-asset-path</id>
	<properties>
		<ep.local.asset.path>${user.home}/ep-assets</ep.local.asset.path> 
	</properties>
</profile>

Make sure you add this profile in your .m2\settings.xml active profiles:

<activeProfiles>
	<activeProfile>ep-asset-path </activeProfile>

... 
Note:

Demo catalogs, (mobee, snapitup, etc) have different assetServerBaseUrl settings. If you switch between demo stores, your asset URLs will change.

Specifying the Assets Server URL

The assetServerBaseUrl setting defines the URL where your media assets are located. For example, if www.samplestore.com's assetServerBaseUrl was https://media.samplestore.comhttp://mobee.elasticpath.com:8080;then image URLs would look like: https://media.samplestore.com/thumbnail_hd.jpg.

To change the Asset Server URL:

  1. Log on to the Commerce Manager Client.
  2. In the Activity menu, choose Configuration.
  3. In the Configuration menu, choose System Configuration.
  4. In the Filter, enter COMMERCE/STORE/ASSETS/ assetServerBaseUrl.
  5. In the Setting Name menu, select the assetServerBaseUrl setting.
  6. Under Defined Values, click the New... button.
  7. Under Context, enter your StoreCode.
  8. Under Value, enter your asset server URL.
  9. Click Save to apply your changes.