11 February 2013
User level: Intermediate
Original publication date: 08/08/2012
Modified: 02/11/2013 (Change log)
Begin by downloading the sample files that are provided at the beginning of this article. The sample file contain the combined library / store custom template that offers an alternate view of the default library. Using source code, you can change the e-commerce interface to create a custom user experience. Figures 1-5 show the various views of the template.
The Subscribe button is only displayed if the following conditions are true:
To use the provided library and store templates you must have some folios published as public.
Where does the data come from?
The template uses the new library and store APIs to display folio data and images. All other images are packaged with your viewer.
Download and uncompress the sample files folder to see the contents. Currently, Viewer Builder does not allow nested folders in HTMLResources. Because of this limitation, the template does not organize the files into folders.
During development, it is a best practice to build and test your content on the desktop using Safari. When testing on the desktop, the API file is not available so data is loaded from the Adobe fulfillment XML feed. Using Safari allows local files to access data across domains, which is required when testing your project on the desktop.
While testing on the desktop, be sure to remove the include for AdobeLibraryAPI.js —otherwise you will be unable to view the files in your desktop browser. When testing on the desktop, if nothing is displayed open the debugger to check if there are any file paths that can't be resolved.
The following list contains descriptions of the key files in the template:
Note: Files in the “assets” directory should be included in the custom slot Zip file you upload to the Viewer Builder.
To make use of this template with your own content, you'll complete the following steps:
The following sections describe each of these steps in more detail.
This modification is only necessary if you would like to test your account on the desktop. Since the API file is not available on the desktop, this XML feed is used to display the folios.
Open AppView.js in your code editor. On line 41, modify FULFILLMENT_URL to match the accountId parameter with your accountId. If you need help finding your accountId, see the section titled Connecting to fulfillment in Building a custom storefront. Once you have located your accountId, modify the value after http://edge.adobe-dcfs.com/ddp/issueServer/issues?accountId=.
On line 45, modify isEntitlementViewer to true or false, based on whether or not this is an entitlement viewer. This setting determines whether or not the Subscriber Login button is displayed.
To upload your files to the Viewer Builder, you must first create an archive that contains the files from the “assets” directory. When the archive is created, be sure to zip the files at the file level rather than the directory level of the assets directory.
Once your files are compressed, open the Viewer Builder and navigate to the Navigation Toolbar section. For more information on the Viewer Builder, watch the Viewer Builder tutorial video.
In the Navigation Toolbar section, select the option to Use Custom Viewer Library. Navigate to the zip file you created above and use the Lock Orientation menu to choose Portrait. Select the checkboxes to Hide Title Bar and Auto Launch.
When your IPA has finished building, install the viewer on your device and begin testing.
To learn more about how to extend Adobe DPS to meet your business needs, watch the video of Klaasjan Tukker's MAX 2013 session, Extending and Integrating Digital Publishing Suite.
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.