Ch. 020b. Override Pressero DAM with a custom Asset URL

EDOCBUILDER > eDocBuilder Documentation Manual & Videos

Override Assets URL Feature

The intent of this feature is to provide a way for eDocBuilder users to override the Assets sent by Pressero to eDocBuilder. It is assumed that the person setting this up is a developer who knows how to create a URL that returns data using JSON. 

Technical Background

Pressero sends to eDocBuilder a list of images to be used by eDocBuilder Orders using an Asset URL. This URL is generated dynamically by Pressero and sent to eDocBuilder every time a new session is created or opened for editing.

Aleyant eDocBuilder Orders expects the Asset URL to be in a certain format in order to be able to read the image, thumbnail, name, description and category for each asset. The JSON format is described on the iFrame Interface document.
 
Here is a sample result of an URL generated by Aleyant Pressero extracted from that documentation.
 
{
 "assetImages" : [
   {
     "url":"http://blah.com/assetImages/aircraft/0001.jpg",
     "thumbUrl":"http://blah.com/assetImages/aircraft-thumb/0001-thumb.jpg",
     "name": "0001.jpg",
     "category": "aircraft",
     "description": "Velit leberkas ut, eu ball tip ad duis."
   },
   {
     "url":"http://blah.com/assetImages/aircraft/0002.jpg",
     "thumbUrl":"http://blah.com/assetImages/aircraft-thumb/0002-thumb.jpg",
     "name": "0002.jpg",
     "category": "aircraft-blue",
     "description": "Prosciutto tri-tip magna exercitation excepteur."
   }
 ],
 "categories" : [
   {
     "name":"aircraft",
     "parent":""
   },
   {
     "name":"aircraft-blue",
     "parent":"aircraft"
   }
 ]
}
 

Feature Description

The Override Assets URL feature aims to provide a way for eDocBuilder users to specify a URL that will be used for a specific template, other than the one sent by Pressero. This URL should be created, hosted and maintained by the eDocBuilder user and Aleyant is not responsible for the content provided by it.

The feature also provides a way to make the Assets URL searchable by allowing user to specify a template field that can be sent as a Query String value to the provided asset URL. For example, if the template has a field named Location, the value of this field can be sent along with the request to the provided URL.

How to Setup the Template

Anyone can benefit from this feature and override the assets URL that is sent from Pressero, even self hosted customers that do not integrate with Pressero. To setup the template, the user has to go to the Template Info page and look for the input for the Assets URL.

 

An example of an Asset URL can be: http://flickr-assetsurl.azurewebsites.net/. The "Query this field" dropdown is optional and not required for this feature to work. If no field is selected, the assets URL will be requested as it is.

If the Query this field dropdown is selected, then the Orders page will append the field name and its value to the end of the URL. For example, if the template has a field Location, the Orders page will append ?location=123456, where location is the field number and 123456 is the field value. The final will look like the following:

http://flickr-assetsurl.azurewebsites.net/?location=123456

How to Create an Asset URL Provider

To help illustrate how this feature works, we created a sample Microsoft ASP.NET MVC application, that will generate an Asset URL with photos from Flickr and will use any query parameter that is sent to it, as a search term.

The source code can be found at https://github.com/vmrocha/flickr-assetsurl/.