TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s...

24
TIBCO Spotfire ® Deployment Kit for Apple iPad Version 2.0 – User’s Manual

Transcript of TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s...

Page 1: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad Version 2.0 – User’s Manual

Page 2: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Important Information SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN LICENSE_TIBCOSPOTFIREMOBILEFRAMEWORK.PDF) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc. TIBCO and Spotfire are either registered trademarks or trademarks of TIBCO Software Inc. and/or subsidiaries of TIBCO Software Inc. in the United States and/or other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only. This software may be available on multiple operating systems. However, not all operating system platforms for a specific software version are released at the same time. Please see the readme.txt file for the availability of this software version on a specific operating system platform. THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME. Copyright © 1996 - 2013 TIBCO Software Inc. ALL RIGHTS RESERVED. THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES. TIBCO Spotfire is covered by U.S. Patent No. 6,014,661 and U.S. Patent No. 7, 216,116. Other patent(s) pending. TIBCO Software Inc. Confidential Information Adobe Photoshop are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Apple, iPad, Xcode, iTunes, Apple App Store, Macintosh, OS X, Snow Leopard, Lion, and Finder are trademarks of Apple Inc., registered in the U.S. and other countries. Intel is a trademark of Intel Corporation in the U.S. and/or other countries. IOS is a trademark or registered trademark of Cisco in the U.S. and other countries and is used under license.

Page 3: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

iii

Table of Contents

1 OVERVIEW ...............................................................................................................1 1.1 Major Features of the Framework ..................................................................................... 1

1.2 System Requirements ........................................................................................................ 1

1.3 Deployment Requirements ................................................................................................ 1

2 CUSTOMIZATION .....................................................................................................2 2.1 Step 1: Load the Project in Xcode ..................................................................................... 2

2.2 Step 2: Customize Basic App Information ........................................................................ 4

2.3 Step 3: Customize App Strings .......................................................................................... 9

2.4 Step 4: Customize App Settings ...................................................................................... 12

2.5 Step 5: Configure App Features ...................................................................................... 18

Page 4: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

1

1 Overview 1.1 Major Features of the Framework

TIBCO Spotfire Deployment Kit for Apple iPad 2.0 is a framework you can use to create a customized version of the mobile Spotfire application for the iPad, with your unique branding. You can customize the app icon, startup screen, name, the strings presented in the app, as well as the settings exposed to the user. You can also specify how the app behaves at startup, what server connections it uses to populate screens for analysis selection, and what screens in the app should be available to the user.

You can do this customization, without writing any code, simply by changing string values in the provided Xcode project file. After you have customized the app, you can build a standard iTunes-ready version with your Apple Developer certificate and upload to the Apple App Store.

This document details the steps involved in customizing the app using the provided Xcode compatible project. The steps are easy and quick, and all the details are included in this document.

Note: We recommend that you follow the steps in this manual, and that you do not modify any settings other than those mentioned, unless you are an experienced user.

1.2 System Requirements You need an Apple Macintosh computer with an Intel® processor that is running OS X 10.6 Snow Leopard or higher. Although no coding is required, you must have Apple’s development IDE Xcode 4.2 or higher installed on your Macintosh. You can download Xcode 4.2 for OS X 10.7 Lion from Apple’s App Store at: http://itunes.apple.com/us/app/xcode/id448457090?mt=12.

1.3 Deployment Requirements To deploy your customized app to the Apple App Store or to an enterprise, you must register in the iOS Developer Program or the iOS Developer Enterprise Program. Details about the programs can be found at: http://developer.apple.com/programs/which-program/.

Page 5: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

2

2 Customization The following sections provide step-by-step instructions for customizing the app.

2.1 Step 1: Load the Project in Xcode Using Xcode 4.2 or higher, open the Xcode project file SpotfireFrameworkClient.xcodeproj by double-clicking the file in Finder. When you do, the project window appears as below:

Project Folders The project file SpotfireFrameworkClient.xcodeproj contains several folders. You can see these folders in the project outline pane on the left side of the Xcode window. The folders group similar files to make it easy to see the files corresponding to the ways you can customize the app. The following image shows the folders in the project outline pane:

Page 6: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

3

The following folders contain files and values that you can modify when you customize the app:

• Artwork: Contains the app icon and app startup images, as well as the icon that appears in iTunes for the app (iTunesArtwork). See Changing the App Icon and Startup Screens to learn more.

• Metadata: Contains app metadata like the display name of the app that appears below the icon in the iPad home screen.

• Strings: Contains all the string values that appear in the app, like the strings in dialogs and other views.

• Settings: Contains the files that specify the settings exposed to the user in the Settings app. You can change which settings are available to the user, as well as the names of these settings.

• Configure Features: Contains files you use to specify the features that are enabled and disabled, as well as other controls over how the app starts up, and so on.

Note: Do not modify or remove from the project the folders named Code, Frameworks, and Products. These folders are important for the app to function properly.

First Test Build This project now is set up and ready to build, so without additional customizations, you can build and test this app now.

To build and test the app

1. In the scheme selector at the top left of the Xcode screen (next to the Run and Stop buttons), ensure that iPad Simulator appears next to the scheme name SpotfireFrameworkClient.

2. Open the Product menu and select Build For > Build For Running, or use the shortcut ⇧⌘R:

You can see the completion status of the build in the status display area at the top center of the Xcode window.

3. After the build completes, press the Run button (which looks like a tape recorder play button) at the top left corner of the Xcode window.

You have successfully built a customized version of Spotfire for iPad. Later in this document, you will learn how to completely customize the interface and behavior of this app.

Page 7: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

4

2.2 Step 2: Customize Basic App Information 2.2.1 Customizing the Company Name

The first thing to customize is the company name associated with this app.

To customize the company name

1. Click the project entry at the top of the project outline pane. This is the first entry with a small blue project icon next to the project name SpotfireFrameworkClient:

This project has one target, called MySpotfire, which is listed under the TARGETS heading in the Project and Targets list pane, as seen below:

2. If it is not already selected, click the MySpotfire target, and then, in the details pane

located in the center of the Xcode window, open the Summary tab:

The first field in the Summary view is the Identifier field.

Page 8: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

5

3. Select the default MyCompany part of the text in the edit field and replace it with your company name.

The name should contain no spaces, and the whole identifier should follow the reverse-URL convention: com.[CompanyName].[ProductName].

To change the default MySpotfire value for the [ProductName] in the reverse-URL field, see Changing the App Target Name below.

2.2.2 Changing the App Target Name The app target name is the app product name. It appears as the file name on disk of the app package. This is the target of building this project. The default value is MySpotfire. • To change the default, under the TARGETS heading, click the MySpotfire target, and then

type a new name in the field:

2.2.3 Changing the Version and Build Information In the Summary view, you can also change the app Version and Build information. The initial defaults are 1.0 for Version, and 0 for Build.

• The Version field represents the major and minor version of this release of the app. You can type any major and minor version number in the Version field.

• The Build field represents the actual build number of this release. You can reset the Build field by providing a number for it at the Summary screen. Then the next time you generate a build, it will be incremented by one.

A script is attached to this project in the Build Phases tab view. It automatically increments this Build field by one every time a build is generated.

Note: Do not modify this script unless you are an experienced Xcode developer and you want to change the way the Build field is updated.

2.2.4 Other Settings in the Summary View When you are working in the Summary view of Xcode, make sure you do not change any other settings than the ones mentioned above. The TIBCO Spotfire Deployment Kit for Apple iPad does not support modification of any other settings than the ones mentioned. If you make changes to any other settings, your app may cease to work.

Page 9: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

6

2.2.5 Changing the App Icon and Startup Screens • The app icon is the image representing the app, which a user touches or clicks to start the

app.

• The app startup screen is displayed when the app starts, before the interface of the app is ready to display. There is one startup screen for each orientation of the device: portrait and landscape.

The default images that we provide have a logo displayed in the center. You can replace this with your unique logo.

To change the app icon and startup screens, you must edit the existing image files that are stored in the Artwork project folder.

To change the app icon and startup screens

1. In the left-most pane of the Xcode window, expand the Artwork folder.

2. Right-click the icon.png file, and then, from the menu, select Show in Finder, as seen in the following image:

A Finder window opens, displaying the app icon file (icon.png) as well as the files used for the app startup screens: Default-Landscape~iPad.png and Default-Portrait~iPad.png.

3. Open these files in your preferred graphics editing program to change them.

4. Save your changes, taking care to follow these rules:

• Save your changes to the same file name, thus replacing the existing file.

• Make sure that you save the files as PNG files.

• Do not change the number of colors in the images.

• Do not change the size of the images.

2.2.6 Editing the Icon Displayed in iTunes The icon displayed when the app is copied into iTunes, and the large icon displayed next to the app in the iTunes App Store, are controlled by the file iTunesArtwork in the Artwork folder. The iTunesArtwork file is a PNG format graphics file. However, the file extension is removed from the file so that the icon is properly displayed when it is included in the app package file. To modify the icon

1. In the left-most pane of the Xcode window, expand the Artwork folder.

2. Right-click the file iTunesArtwork, and then select Show in Finder from the menu.

Page 10: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

7

3. Using Finder, duplicate the file iTunesArtwork.

4. Right-click the duplicated file (which has the name iTunesArtwork copy), and from the pop-up menu, select Get Info.

5. In the resulting info window, change the Name & Extension field to iTunesArtwork.png.

You can now open and edit the icon in your preferred graphics editing program.

1. When you finish editing the icon, make sure you save it to the same file name, and that you do not change the format, color configuration, or size of the file.

2. Return to Finder and delete the iTunesArtwork file with no extension.

Note that if you have Xcode open at the time you delete this file, you might see a warning dialog in Xcode asking you whether you want to save the file or close it. Make sure to close the file in Xcode. When you do, the file iTunesArtwork displayed in the project outline pane is displayed as empty.

3. Right-click the newly-saved iTunesArtwork.png file that you edited, and from the pop-up menu, select Get Info. Remove the file extension .png from the file name in the Name & Extension field so it reads iTunesArtwork.

The file reappears in the project outline pane in Xcode.

2.2.7 Changing the App Display Name The app display name is shown below the app icon in the iPad home screen and in the Settings app category for this app’s settings.

To edit the app display name

1. In the left-most pane of the Xcode window, expand the Metadata folder.

Note: The file named InfoPlist.strings contains strings that override those in the built-in app metadata. The built-in app metadata contains such information as the company name, the version information, the build number, as well as other information such as the app name and device capabilities. Each of these metadata values is in the form of a string that you can override in the InfoPlist.strings files for your particular language.

By default, InfoPlist.strings is localized to English and French, which is why two entries appear below the top entry in the project outline.

2. To edit the English version file, click the file name. This opens a text editor in the center of the Xcode window, displaying the contents of the file:

Page 11: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

8

The text editor displays the following text string: “CFBundleDisplayName” = “My Spotfire”;

Currently the app name is set to “My Spotfire”, but you can change this name to any string. We recommend that you keep this string short, preferably twelve characters or fewer, to avoid the iPad truncating the display name.

Important: You must maintain the syntax in this file:

• The double quotation marks surrounding the values and the semicolon at the end of the line should not be removed.

• Comments in this file are specified by text surrounded by a slash and an asterisk (/*) and closed by an asterisk and slash (*/), much like in C or C++ source code files.

Make your changes, and then on the File menu select Save.

2.2.8 Adding and Removing InfoPlist.strings Localizations

Adding a Language By default, the InfoPlist.strings file contains localized sub-files for English and for French, but you can add more languages.

To add languages

1. In the left-most pane of the Xcode window, open the Metadata folder, and then select the top-most node called InfoPlist.strings.

2. In the Localization pane on the right-hand side of the Xcode window, click the small plus (+) button at the bottom.

Page 12: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

9

3. In the menu that appears, select the language of interest from the list:

An additional entry for the selected language is addedto the project outline pane, below InfoPlist.strings. By default, this new language version file contains copies of all the strings in the English version of the InfoPlist.strings file. To localize, select this file and, in the Xcode editor, change the strings to the appropriate language.

Removing a Language You can easily remove a localization language from the project.

To remove a localization language

1. In the left-most pane of the Xcode window, open the Metadata folder, and then select the top-most node called InfoPlist.strings.

2. In the Localization pane on the right-hand side of the Xcode window, select the language you want to remove, and then press the small minus (-) button at the bottom.

After you confirm the operation, the language specific InfoPlist.strings file is removed from the project outline pane.

2.3 Step 3: Customize App Strings 2.3.1 Overview

You can customize nearly every string displayed in the app by editing the app strings files that are located in the Strings folder in the project outline pane.

Page 13: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

10

2.3.2 String Editing Workflow Hundreds of strings comprise the messages displayed in the app during normal operation.

To find and customize a message string

1. Note the exact string that appears in the app at the location you want to change.

2. Open the Strings folder and expand the tree to find the Localizable.strings file for your language.

3. Select that file, and then open it in a text editor in Xcode.

4. In the editor window, search for the string in question.

5. When you find the string, change it and save the file.

6. Rebuild the project and see your new string at the location you changed in the running app.

2.3.3 Strings Files Organization The strings files are organized by sections based on the name of the screens in the app. There are two major app contexts of operation:

• Explore • Analyze

When you run the app, you use the segmented button in the upper left corner of the app screen to switch the app context from Explore to Analyze and back. The two contexts represent the two major tasks that a user of the app wants to accomplish: to explore the available analyses from various sources to select one to focus on, and to work with the selected analysis to reveal new information and share with others.

The default non-customized app contains several action screens associated with the Explore context: • Servers • Favorites • Most Recent • Featured

Likewise, the Analyze context contains several action screens associated with it: • Add To Favorites Popup • Annotation Mode • Email Popup

These contexts and actions divide the strings that correspond to them in the Localizable.strings files. In the files, you can find comments that use the context and the

Page 14: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

11

action name to mark sections of strings. This design makes it easier to locate the string you want to change, based on the context and action screen where it resides.

2.3.4 String Syntax You must follow the important syntax rules when you edit string values in the Localizable.strings files.

• Each line in the files consists of a key value, an equal (=) sign, and an assigned value.

• Double quotation marks (" ") must surround the key value (the value on the left side of the equal sign) and the assigned value (the value on the right side of the equal sign).

• Each key-value string line must end with a semi-colon.

• Comments in this file are specified by text surrounded by a slash and asterisk (/*) and closed by an asterisk and slash (*/), much like in C or C++ source code files.

Note: Some assigned values in key-value string lines contain special formatting characters, such as %d, %@, and so on. Do not remove these formatting characters. Doing so may cause the app to crash. These formatting characters are placeholders for values that the app automatically substitutes in the string when they are displayed in the app.

2.3.5 Adding and Removing Localizations Adding a Language By default, there are localized strings files for English and for French, but you can easily add more languages. Select the top-most node in the Strings folder called Localizable.strings. In the Localization pane on the right-hand side of the Xcode window, press the small plus (+) button at the bottom. In the menu that appears, select the language to add.

An additional entry for the selected language is added below Localizable.strings in the project outline pane. By default, this new language version file contains copies of all the strings in the

Page 15: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

12

English version of the Localizable.strings file. You can select this file, and in the Xcode editor, you can change the strings to the appropriate language.

Removing a Language To remove a localization language, select the top-most node in the Strings folder called Localizable.strings. In the Localization pane on the right-hand side of the Xcode window, select the language to remove, and then press the small minus (-) button at the bottom.

After you confirm the operation, the language-specific Localizable.strings file is removed from the project outline pane.

2.4 Step 4: Customize App Settings 2.4.1 Overview

The Settings folder contains the app’s settings bundle, which is used to present various preferences and settings to the user in the iPad Settings app. You can customize which settings are exposed to the user, and which are not, by commenting out selected settings in the settings XML file. You can also override the strings used to describe the settings in the Settings app, changing them to strings that better represent the settings in your customized version of the app. Just like all the other customizable strings in the app, these can be localized to your language, and you can add additional languages.

2.4.2 Organization of the Settings If you expand the Settings folder in the project outline pane in Xcode, you see the hierarchical layout of the settings files:

By default, there are two localization folders (en.lproj and fr.lproj: English, and French, respectively). In these folders, files are called Root.strings. These files are like the Localization.strings files you worked with previously for customizing app string values. By default, these files are empty. Any entries you add to these files override the settings titles that appear for settings in the Settings app on the iPad.

Page 16: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

13

2.4.3 Customizing Settings Workflow To determine which settings to expose to the user through the iPad Settings app, edit the file Root.plist. This is an XML file located in the Settings.bundle file the Settings folder in the project outline. (See the image in Section 2.4.2.)

You can edit Root.plist either in the built-in editor in Xcode, or in another XML editor.

2.4.3.1 Built-in Editor To open the built-in editor in Xcode, click the file to edit: Root.plist. This opens the built-in editor so you can easily specify values and change parameters for settings.

This editor is useful if you want to edit the parameters of each setting in a user-friendly way. However, if you want to hide settings, you should probably use an XML editor (see below), because you can remove settings in the built-in editor only by permanently deleting them.

Note: If you decide to edit settings using this editor, take care to not change the Identifier or the Type of any setting. The app depends on this information being consistent, and if those settings are changed, it can cause the app to crash.

You can safely change the Default Value and Title entries of any setting.

2.4.3.2 Multi Value Types For settings that are of Type Multi Value, you can safely change the number of, and values of, the Titles array and the Values array. Just make sure that the number of title values in the Titles array matches exactly the number of values in the Values array.

An example of a Multi Value setting is the Timeout setting:

Page 17: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

14

Notice the total of nine (9) items for both the Titles array and the Values array. For Multi Value settings:

• Use the Titles array to specify the strings that appear in the popup list in the iPad Settings app.

• Use the Values array to specify the actual string or numeric values that are sent to the app when the user selects one of the entries in the Titles array.

Each array’s order matches so that if the user selects the third item (named Item 2) from the Titles array (10 Seconds), as an example, then the third entry (named Item 2) from the Values array (10) is sent to the app as the value for this setting. Once again, it is important not to change the data types of any of the Titles or Values array items. If they are specified as String, as in this example, you must leave them all as String. If the type is changed, the app may crash.

2.4.3.3 XML Editor If you editing the settings in the Root.plist file as an XML file, it is easier to hide settings (or, for that matter, to edit the values without having to select them from select lists, for example).

From the project outline pane, right-click the Root.plist file and select Open As > Source Code from the pop-up menu:

Page 18: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

15

This opens a different editor in the Xcode window and allows you to modify the XML file directly:

The same care must be exercised to not change data types and also to keep the syntax of changes you make consistent with the basic XML structure of this file. For additional technical information about the structure of a settings file and the possible entry values and syntax, consult the Apple documentation at:

http://developer.apple.com/library/IOS/#documentation/Cocoa/Conceptual/UserDefaults/Preferences/Preferences.html#//apple_ref/doc/uid/10000059i-CH6-SW5.

(You must be a registered Apple developer to access this documentation.)

Page 19: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

16

2.4.3.4 Removing a Setting To remove a setting, just comment out one of the <dict></dict> groups in this XML file, as in this example: <!-- <dict> <key>DefaultValue</key> <string>http://spotfire.tibco.com/demo</string> <key>Key</key> <string>featured_url</string> <key>Title</key> <string>Featured List URL</string> <key>Type</key> <string>PSTextFieldSpecifier</string> </dict> -->

The comment markers <!- - and - -> are used to comment out sections of the XML file. Each setting in the file is contained within one of these <dict> … </dict> groups.

2.4.3.5 Changing Settings Titles In addition to changing a setting’s Title property in the Root.plist file, you can also change the setting’s title in the localized string files that are part of the Settings.bundle file in the Settings folder in the project outline. This is useful when you want a specific string title displayed in a particular language. Also, it is much easier to use to simply change a setting title without having to edit the settings file directly.

By default, there are two localization folders (en.lproj and fr.lproj: English and French, respectively). In these folders, the files are called Root.strings. These files are like the Localization.strings files you worked with previously for customizing app string values. Any entries you make to these files (which are empty by default) overrides the settings Title values specified in the Root.plist file.

As an example, suppose you want to change the Title value that is displayed for the setting group, whose current title, in English, is Server Connections:

Click the Root.strings file, located in the sub-folder en.lproj for English language. The editor opens and shows a file that is empty, except for a comment at the top. Specify string overrides to the Title properties in this file in a fashion similar to the localizable strings in the app. The syntax of each Title property line in this file is as follows:

[Current Settings Title] = [New overridden Title].

For our example, add the following line:

"Server Connections" = "My Server Connections";

Because the existing group setting to change has the Title property value Server Connections, specify that value on the left side of the equals sign. On the right side, specify the new Title value. Both the key and value in this line must be enclosed in double quotation marks. Like before, each line must end with a semi-colon.

If you rebuild the app and display the iPad Settings for it, you see the changed setting title:

Page 20: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

17

2.4.3.6 Adding and Removing Settings Localizations To add and remove localizations in the Settings.bundle, you must perform a few more steps than those described for Localizable.strings in the Strings folder.

To display the contents of the Settings.bundle file

1. In the project outline pane in Xcode, under the Settings folder, right-click Settings.bundle. (The file Settings.bundle is an Apple package file, which is a special kind of folder.)

2. From the pop-up menu, click Show in Finder.

3. Right-click the Settings.bundle file in the Finder to display its contents in the Finder window.

4. From the resulting pop-up menu, select Show Package Contents. The structure in the file is similar to what you see in the project outline pane in Xcode.

To add a new localization for strings in the settings file

1. Select one of the existing folders (either en.lproj or fr.lproj).

2. Create a duplicate.

3. Rename the duplicated folder to the two letters representing the desired language, followed by the .lproj extension.

Note: The folder must be named in this way to be found by iOS when the language is changed on the iPad.

For more information on the language designations for these folder names, see the Apple developer article at: http://developer.apple.com/library/ios/#documentation/MacOSX/Conceptual/BPInternational/Articles/LanguageDesignations.html#//apple_ref/doc/uid/200

Page 21: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

18

02144-BBCEGGFF. (You must be a registered Apple developer to view this article.)

4. In your new localized language folder, make sure that it contains the strings file named Root.strings.

The file Root.plist contains a field that ties it to the Root.strings file, a required file in each localized language folder in the Settings.bundle.

To remove a localization

• Simply delete the localized folder that corresponds to the language to remove.

2.5 Step 5: Configure App Features 2.5.1 Overview

With the TIBCO Spotfire Deployment kit, you can also change how the app behaves when it is opened, or how the user interface appears. You can do this by customizing the entries in the MyConfiguration.plist file, located in the Configure Features folder in the project outline pane in Xcode.

Specifically:

• You can control which tabs are displayed in the Explore context view of the app.

• You can specify the tab the app switches to when it starts up.

• You can also customize the app to load a particular analysis and display it immediately in the Analyze context view.

• You can define your own custom tabs that can display a custom web page, given a URL you provide, or a specific Spotfire library page with a URL to the library page that you provide.

The MyConfiguration.plist file is an XML file that has entries to control these features and allow you to define the Explore tabs and startup behavior following a specific value syntax, which is discussed in this section.

2.5.2 Structure and Syntax of the Configuration File From the Configure Features folder in the project outline pane in Xcode, select the MyConfiguration.plist file to open a property list editor, as seen below:

The file has two configuration entries that control how the app features behave:

Page 22: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

19

• APP_STARTUP_ACTION - string property • EXPLORE_TABS - array of hierarchical values

2.5.2.1 Explore Tabs Property The EXPLORE_TABS property is an array of elements you can use to override which tabs are displayed in the Explore context view of the app. You can have up to five tabs in the app. Any combination of predefined tabs and custom tabs that you define in this file can be displayed in the app, but only the first five items in this property array are used; additional items are ignored.

Each item in this property array is a dictionary type item. It contains at least one String item with a key value of Type, which can be one of the following predefined type strings:

• SERVERS_TAB

• FAVORITES_TAB

• RECENTS_TAB

• FEATURED_TAB

Also, it can be the type string CUSTOM_TAB, which indicates that this item defines a custom tab that you create. For CUSTOM_TAB tab types, you must specify additional keys in the dictionary for the tab item:

• Identifier: A user-defined string used to identify this custom tab item. The value for Identifier cannot start with a number and must not contain special characters, other than the dash and underscore. Also, it must not contain spaces. Similar rules apply for variable names in Objective-C and other programming languages.

• Title: The tab text that appears in the user interface for this tab item. We recommend that this text is no longer than 15 characters, so the iPad does not truncate the text when the tab is displayed.

• Url: The fully-qualified URL to the custom web page or Spotfire library page to display in this tab view.

• Icon: The file name of an icon file that you have added to your project. The icon should be in the PNG file format. It should be 32 pixels in width by 32 pixels in height. You can add it to any project group. You can also create a new group specifically for tab icons in the project outline pane. For instance, in the example image below, a new group called Tab Images is added to the project, and two tab icon files are in that group.

• IconSelected: The file name of an icon used for showing that the tab is selected when you

press it. Like the Icon file, this should be a PNG file that is 32 pixels in width by 32 pixels in height. To match the built-in icons for tabs, it should be a solid color mask over the original Icon image. The project includes example Icon and IconSelected Adobe® Photoshop® files for custom tabs, so that you can see how they are created.

In addition to simply specifying the value directly in the Key field, all of these configuration key values (Identifier, Title, Url, Icon, and IconSelected) can contain special keywords that allow the values to reference values defined in your Localizable.strings files or in your Settings.bundle file. The following keywords and syntax apply:

Page 23: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

TIBCO Spotfire® Deployment Kit for Apple iPad 2.0 – User’s Manual

20

• setting: [setting Identifier] The keyword setting: is followed by the Identifier value of a setting to control the value to use for this tab value. You can use it to specify a setting in your Settings.bundle to use for the value of this parameter for the tab.

• string: [string Identifier] The keyword string: is followed by the Identifier value of a localized string to control the value to use for this tab value. You can use it to specify a string in your Localizable.strings file to use for the value of this parameter for the tab.

Here is an example to illustrate the proper syntax of entries for predefined and custom tabs in the EXPLORE_TABS section of the configuration file:

This example shows four tabs to display in the Explore context view: The predefined Servers tab, the predefined Featured tab, and two custom tabs.

• The first custom tab is identified by my_custom_tab1 and is entitled My Tab 1 (this title appears below the tab icon in the user interface). The Title property is from the string my_custom_tab1_title. defined in the Localizable.strings file. The Icon and IconSelected properties also refer to strings defined in the Localizable.strings file. This tab uses a setting in the Settings.bundle file identified by my_custom_tab1_url to set the fully qualified URL for this tab.

• The second custom tab is called my_custom_tab2 and is entitled My Tab 2, which displays the URL https://myserver.com/mycustomdir/mydxpfile when it is selected. This tab has an Icon property set to tab2.png, which is in the Tab Images group in the project outline pane.

• The APP_STARTUP_ACTION specifies that the app switches to the custom tab called my_custom_tab1 when it starts up, and that tab displays the URL pointed to by the setting my_custom_tab1_url.

• App Startup Action Property The APP_STARTUP_ACTION property specifies the app’s behavior when it starts up. Possible values are:

• tab: [tab type name or identifier]

Page 24: TIBCO Spotfire Deployment Kit for Apple iPad · Deployment Kit for Apple iPad 2.0 – User’s Manual 6 . 2.2.5 Changing the App Icon and Startup Screens • The app icon is the image

Customization

21

The keyword tab: is followed by either the Type name of the tab to switch to at startup, or the Identifier of a custom tab (explained above in the section on CUSTOM_TAB type tab items).

• tab: LAST_TAB_DISPLAYED The keyword tab: is followed by the additional predefined symbol LAST_TAB_DISPLAYED to indicate that the app should switch to the tab that was last displayed in the Explore context view when the app was closed.

• tab: setting: [setting Identifier] The keyword tab: is followed by the additional keyword setting:. This set of keywords is followed by the Identifier of a setting property that points to the Type name or Identifier of the tab to switch to when the app starts up.

• tab: string: [string Identifier] The keyword tab: is followed by the additional keyword string:. This set of keywords is followed by the Identifier of a Localizable.strings file string that points to the Type name or Identifier of the tab to switch to when the app starts up.

• analysis: [url to dxp analysis file] The keyword analysis: is followed by the fully-qualified URL to a Spotfire DXP file on a server to open and display in the Analyze context view when the app starts up.

• analysis: setting: [setting Identifier] The keyword analysis: is followed by the additional keyword setting:. This set of keywords is followed by the Identifier of a setting property that points to the fully-qualified URL to a Spotfire DXP file on a server to open and display in the Analyze context view when the app starts up.

• analysis: string: [string Identifier] The keyword analysis: is followed by the additional keyword string:. This set of keywords is followed by the Identifier of a Localizable.strings file string that points to the fully-qualified URL to a Spotfire DXP file on a server to open and display in the Analyze context view when the app starts up.