Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite 6
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions
  • Government

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Digital publishing /

Implementing the iPhone library / store template using new DPS APIs

by Derek Lu

Derek Lu
  • Adobe

Content

  • Overview of the template
  • Understanding the store and library APIs
  • Modifying the template for your projects
  • Where to go from here
  • Change log

Modified

11 February 2013

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Antdigital publishingDigital Publishing Suitee-commerceInDesign CCiOSmobile
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.
Prerequisite knowledge
Experience working with JavaScript, HTML, XML, and the Adobe Digital Publishing Suite is required. This article also assumes you have access to a web server and have published public folios.

User level: Beginning

Original publication date: 08/08/2012

Modified: 02/11/2013 (Change log)

Adobe products
  • InDesign (Download trial)
  • Digital Publishing Suite, Enterprise Edition
Other required products
  • Mac OS X - Used to view the template on the desktop with Safari.
Documentation
Library and Store API v2

Library and Store API v2 [zip file for offline viewing]

Sample files iphone_library_store.zip
By downloading software from the Adobe Web site you agree to the terms of our license agreement. Please read it before downloading.
(File last updated on 02/11/2013)

The sample files in this article contain a template you can implement in your DPS viewer. The template enables you to add a custom tab in the viewer that functions as a store and library on the iPhone using version 2 of the library and store APIs. This functionality is available to all enterprise users of the Adobe Digital Publishing Suite through the use of custom navigation slots. With r22, publishers can replace the default library using their own implementation. These custom slots are implemented using HTML, CSS, and JavaScript. Using code, you can access APIs that allow you to duplicate e-commerce functionality found in the default library and customize it to fit your project design.

Overview of the template

Begin by downloading the sample files provided at the beginning of this article. The sample files contain a template that offers an alternate view of the default library. Using source code, you can change the appearance of the interface to publish a custom user experience. Figures 1-5 shows the various views of the template implementation.

Figure 1. Users can swipe horizontally to navigate between folios.
Figure 1. Users can swipe horizontally to navigate between folios.
Figure 2. Clicking the settings icon displays the settings view.
Figure 2. Clicking the settings icon displays the settings view.

Note: The Auto Archive option is only displayed if auto-archive is enabled for the viewer.

Figure 3. Clicking Restore Purchases lets users restore purchases.
Figure 3. Clicking Restore Purchases lets users restore purchases.
Figure 4. Clicking Subscribe enables a user choose a subscription.
Figure 4. Clicking Subscribe enables a user choose a subscription.

The Subscribe button is only displayed if the following conditions are true:

  • Subscriptions are available
  • The user does not already own the most recent folio
  • The user does not already have an active subscription
Figure 5. Clicking Subscriber Login displays a login view.
Figure 5. Clicking Subscriber Login displays a login view.

The Subscriber Login button is used for entitlement viewers. It is displayed if a flag, isEntitlementViewer, is set to true in the JavaScript source code.

Understanding the store and library APIs

In order to use this template you must have folios which are 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 in 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 notorganize the files into folders.

Development considerations

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.

To enable the Develop menu option, select Safari > Preferences > Advanced and then choose Show Develop menu in menu bar. Once the Develop menu is displayed, select Develop > Start Debugging JavaScript and then click Console to see if there are any errors. After you've confirmed that your store is running as expected on the desktop, always test the store again on your device.

The following list contains descriptions of the key files in the template:

  • HTMLResources.zip – The file that is uploaded to the Viewer Builder. It is included as an example. This file can be uploaded to Viewer Builder as-is for testing purposes.
  • assets/AdobeLibraryAPI.js – The file that contains the library and store APIs.
  • assets/backbone-min.js – An open source application framework.
  • assets/index.html — The HTML file used to display the custom slot.
  • assets/jquery-1.7.2.min.js — The jQuery library.
  • assets/library.css – the styles for the template.
  • assets/main.js — The main JavaScript file that starts the application.
  • assets/underscore-min.js — JavaScript library used by Backbone.
  • assets/.png – the images for the template.
  • assets/.js – the JavaScript files for the template.

Note: Files in the “assets” directory should be included in the custom slot Zip file you upload to Viewer Builder.

Modifying the template for your projects

To use this template with your own DPS content, you'll complete the following steps:

  1. Modify AppView.js
  2. Upload files to Viewer Builder.

The following sections describe each of these steps in more detail.

  1. Modify assets/AppView.js.

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 20, 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 24, 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.

  1. Upload the files to the Viewer Builder.

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 Viewer Builder and navigate to the Navigation Toolbar section. For more information on 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 select the Hide Title Bar checkbox.

Figure 6. The Navigation Toolbar section of the Viewer Builder.
Figure 6. The Navigation Toolbar section of the Viewer Builder.

When your IPA has finished building, install the content on your device and begin testing.

Where to go from here

In this article you learned how to modify a sample template to create a library and store custom slot. To get more information about the JavaScript libraries used, check out the documentation for Backbone, jQuery and Underscore. Additional articles and videos are also available for Digital Publishing Suite.

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License+Adobe Commercial Rights

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.

Change log

12/12/2012

  • Changed FULFILLMENT_URL so it uses a proxy.
  • Added condition to check for folio.isArchivable when archiving a folio.

10/15/2012

  • API updates.

More Like This

  • Using Urban Airship as a DPS Push Provider
  • Integrated social sharing with Digital Publishing Suite
  • Add note-taking functionality to a folio
  • Customer-agency DPS workflows
  • Enhance your DPS folios with HTML animations using Adobe Edge
  • Using XML to automate production of digital publications
  • Using Apple push notifications with Digital Publishing Suite
  • Integrate publishing workflows and editorial systems with DPS
  • Distributing enterprise iOS viewer applications with Digital Publishing Suite
  • Targeting the Kindle Fire using Adobe Digital Publishing Suite

Products

  • Adobe Creative Cloud
  • Creative Suite 6
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy (Updated) | Cookies

Ad Choices