Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • 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

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 /

Add note-taking functionality to a folio

by Derek Lu

Derek Lu
  • Adobe

Content

  • Overview of the example
  • Modifying the example for your use
  • Important considerations about local storage
  • Where to go from here

Created

29 May 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
digital publishingHTML5InDesignJavaScript
Was this helpful?
Yes   No

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

 
Thanks for your feedback.

Requirements

Prerequisite knowledge

This article will describe how to add note taking functionality to a folio using HTML and JavaScript. Familiarity with Adobe Digital Publishing Suite, HTML, and JavaScript is assumed.

User level

All

Required products

  • InDesign (Download trial)

Sample files

  • note-taking.zip

This article provides example files to implement note-taking for items in your folio using HTML and JavaScript. By implementing this functionality, you can enable users to take notes on items and review them at a later time. Use cases can range anywhere from instructional material to catalogs. This example uses two HTML pages: one for taking notes and another to view all notes. Note that data is stored locally in an HTML5 database that is available to all iOS webviews.

Overview of the example

Figures 1–3 show the example files in the viewer.

Figure 1. A screenshot of the viewer of a very simple stack that displays two buttons. The first button enables a user to add a note. The second button enables a user to view all notes. When a user clicks either button, a slide-up webview will display. These buttons are purely for illustration purposes. The only thing that is needed to link to the slide up webviews is to set the URL from the Hyperlinks panel in InDesign.
Figure 1. A screenshot of the viewer of a very simple stack that displays two buttons. The first button enables a user to add a note. The second button enables a user to view all notes. When a user clicks either button, a slide-up webview will display. These buttons are purely for illustration purposes. The only thing that is needed to link to the slide up webviews is to set the URL from the Hyperlinks panel in InDesign.
Figure 2. After a user clicks Add Note from Figure 1, a form is displayed for the user to enter notes. There must be one form for each item that has note-taking enabled.
Figure 2. After a user clicks Add Note from Figure 1, a form is displayed for the user to enter notes. There must be one form for each item that has note-taking enabled.
Figure 3. After a user clicks View All Notes from figure 1, an HTML page is displayed that enables a user to remove all notes, email notes, or delete a note.
Figure 3. After a user clicks View All Notes from figure 1, an HTML page is displayed that enables a user to remove all notes, email notes, or delete a note.

File Structure

If you unzip notes.zip, you will see the file structure displayed in Figure 4.

Figure 4. File structure of notes.zip.
Figure 4. File structure of notes.zip.

Here are the files and folders:

  • stack_v.indd: example INDD with hyperlinks to the HTML files.
  • HTMLResources: folder that will be zipped and uploaded to Folio Producer.
  • HTMLResources/addNote.1.1.html, addNote.1.2.html, addNote.1.3.html: files used to add notes for a particular item. Naming convention for this file is addNote.folio-id.item-id.html. folio-id and item-id are specific to the local database, not what is stored on Adobe's DPS servers. There must be one of these files per item for which you would like to have note–taking enabled.
  • HTMLResources/notes.html: file used to display all notes.
  • HTMLResources/styles: folder containing the CSS styles for this example.
  • HTMLResources/js/AddNote.js: JavaScript file included in the addNote HTML files. This file includes the code to add a note to the database.
  • HTMLResources/js/ConfirmDialog.js: file used to display a confirmation dialog box, since JavaScript alert() dialogs are suppressed.
  • HTMLResources/js/DatabaseDelegate.js: JavaScript file used for database operations.
  • HTMLResources/js/jquery-1.7.1.min.js: jQuery file included in HTML pages.
  • HTMLResources/js/Notes.js: JavaScript file included in notes.html. This file includes the code to display all of the notes on the page.

Modifying the example for your use

To make use of the example files with your own content, you will have to complete the following steps.

  1. Update js/DatabaseDelegate.js.
  2. Create addNote for each item.
  3. Update Notes.js.
  4. Test in Safari.
  5. Create a folio.
  6. Zip and upload HTMLResources.
  7. Test on device.

The following sections explain these steps in more detail.

  1. Update js/DatabaseDelegate.js:

On line 13, set a value for FOLIO_ID. This ID does not have to match the ID from Folio Producer. This is an ID you assign to the folio for which you are adding note-taking functionality.

On line 16, modify the records array so it matches the items for which you would like note-taking functionality. Be sure to close each item with curly braces, { }, and separate them with commas. Each itemId must be unique.

  1. Create addNote for each item:

For each item in your folio that you would like note-taking functionality, create a new version of addNote using the format addNote.folio-id.item-id.html. For example, in step 1 if you set FOLIO_ID = f1 and you have an item with itemId = 1, the file name would be addNote.f1.1.html. You do not have to modify the contents of the file. The reason why a copy of this file has to be created for each item is because it's impossible to pass URL parameters to local hyperlinks in InDesign. For example, ideally you would use addNote.html?folioId=f1&itemId=1, but instead you have to use addNote.f1.1.html.

  1. Update Notes.js:

On line 3, set the value for FOLIO_ID to the same value set in step 1.

  1. Test in Safari:

Open an addNote HTML page in Safari to test. Verify a title and description is displayed for the item. If nothing is displayed, there was probably a formatting error introduced when modifying the JavaScript. Open the debug console and see where the error occurred, and then go back to the appropriate JavaScript file and fix the formatting. If there aren't any problems, enter a note.

Open notes.html to view the note entered from addNote.

  1. Create a folio:

Create a folio that contains an INDD file that links to an addNote HTML file (created in step 2) and notes.html. The hyperlink should have the path "HTMLResources/" followed by the name of the file. For example, to create a hyperlink that opens notes.html, in the Hyperlinks panel set URL= HTMLResources/notes.html.

  1. Zip and upload HTMLResources:

Zip the contents of HTMLResources, name it HTMLResources and upload to your folio in Folio Producer. Make sure to zip at the content level of the folder, not the folder level of HTMLResources—otherwise, there will be an extra path to your files. To upload your zip to your folio, in Folio Producer, locate your folio, click "open," and then click the "HTML" button.

  1. Test on device:

Open your device and verify that everything works.

Important considerations about local storage

Data is stored locally in an HTML5 database that is available to all iOS WebViews, although as of iOS 5.1 the data could be erased at any time. For more info, you can view this blog post from Sencha. In my own development, I did not see any data loss, although if any is experienced in your testing it is recommended that a server-side solution is implemented that complements local storage.

Where to go from here

This article has provided example files on how to implement note-taking functionality. To learn more about Adobe Digital Publishing, visit the Digital Publishing Suite Developer Center.

More Like This

  • Using Urban Airship as a DPS Push Provider
  • Integrated social sharing with Digital Publishing Suite
  • 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
  • Build a horizontal swipe storefront with folio preview – Version 1

Products

  • Adobe Creative Cloud
  • Creative Suite
  • 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 | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement