JBoss.orgCommunity Documentation

JBoss Tools 4.1 User Guide

Information about using the plug-ins comprising JBoss Tools

Abstract

This document details how to use and customize the individual plug-ins comprising JBoss Tools.


Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. Getting Help and Giving Feedback
I. Tools for Every Project
1. JBoss Central and the JBoss Perspective
1.1. Overview of JBoss Central and the JBoss Perspective
1.1.1. About JBoss Central
1.1.2. About the JBoss Perspective
1.2. Features of JBoss Central and the JBoss Perspective
1.2.1. Features Overview
1.2.2. View JBoss Central
1.2.3. Access Project Wizards in JBoss Central
1.2.4. Meet the Requirements of JBoss Central Project Examples
1.2.5. Access Information in JBoss Central
1.2.6. Install Software in JBoss Central
1.2.7. Open the JBoss Perspective
1.2.8. Manage the JBoss Perspective
1.2.9. View Cheat Sheets
1.3. Customizing JBoss Central and the JBoss Perspective
1.3.1. Customizing Overview
1.3.2. Change the Behavior of JBoss Central on IDE Start
1.3.3. Customize the Default Views, Menus and Toolbars of the JBoss Perspective
1.3.4. Use Project Examples when Working Offline
1.3.5. Install Software when Working Offline
1.3.6. Set Cheat Sheet Behavior
1.3.7. Set Usage Reporting
2. JBoss Server Tools
2.1. Overview of JBoss Server Tools
2.1.1. About JBoss Server Tools
2.1.2. About IDE Server Definitions
2.2. Features of JBoss Server Tools
2.2.1. Features Overview
2.2.2. Download a JBoss Community Application Server
2.2.3. Create a Default Local Server Definition with Runtime Detection
2.2.4. Create an Additional Server Runtime Environment
2.2.5. Define an Additional Local Server
2.2.6. Define a Remote Server
2.2.7. Manage Server Settings
2.3. Customizing JBoss Server Tools
2.3.1. Customizing Overview
2.3.2. Enable Runtime Detection on IDE Start
2.3.3. Set a Default Server
2.3.4. Default File Sets
2.3.5. Default Classpath Entries
3. Forge Tools
3.1. Overview of Forge Tools
3.1.1. About Forge
3.1.2. About Forge Tools
3.2. Features of Forge Tools
3.2.1. Features Overview
3.2.2. Manage the Forge Console
3.2.3. Manage the Forge Runtime Server
3.2.4. Navigate to Project Resources on the Forge Command Line
3.2.5. Background Actions Invoked by Forge Commands
3.2.6. Access a List of Forge Commands
3.2.7. Use Forge Wizards
3.3. Customizing Forge Tools
3.3.1. Customizing Overview
3.3.2. Customize the Forge Start
3.3.3. Manage Forge Runtime Servers
II. Tools for Creating Web Interfaces
4. LiveReload Tools
4.1. Overview of LiveReload Tools
4.1.1. About LiveReload
4.1.2. About LiveReload Tools
4.2. Features of LiveReload Tools
4.2.1. Features Overview
4.2.2. Create a LiveReload Server
4.2.3. Configure the LiveReload Server
4.2.4. View Resources in LiveReload-enabled Browsers
4.2.5. View Resources in LiveReload-enabled BrowserSim
III. Tools for Creating Mobile Applications
5. Mobile Web Tools
5.1. Overview of Mobile Web Tools
5.1.1. About Mobile Web Tools
5.2. Features of Mobile Web Tools
5.2.1. Features Overview
5.2.2. Create a Mobile Web Project
5.2.3. Use a HTML5 jQuery Mobile File Template
5.2.4. Access the jQuery Mobile Palette
5.2.5. Insert a jQuery Mobile Palette Widget into a HTML5 File
5.2.6. Get Assistance with jQuery Mobile Programming
5.2.7. View jQuery Mobile Pages in a Browser
5.3. Customizing Mobile Web Tools
5.3.1. Customizing Overview
5.3.2. Customize jQuery Mobile File Templates
6. BrowserSim
6.1. Overview of BrowserSim
6.1.1. About BrowserSim
6.1.2. System Requirements for BrowserSim
6.2. Features of BrowserSim
6.2.1. Features Overview
6.2.2. View a Web Application on BrowserSim
6.2.3. Manage Web Applications on BrowserSim
6.2.4. Change the Appearance of a Simulated Device
6.2.5. View a Web Page in Different Browsers and Simulated Devices
6.2.6. Generate a Screen Capture of a Simulated Device
6.2.7. Activate LiveReload for BrowserSim
6.2.8. View the Source of a Web Page
6.3. Customizing BrowserSim
6.3.1. Customizing Overview
6.3.2. Make BrowserSim the Default Browser
6.3.3. Add BrowserSim to the Global Toolbar
6.3.4. Set a Shortcut for the Run BrowserSim Action
6.3.5. Add or Modify Devices in BrowserSim
6.3.6. Change the Default Behavior when a Device does not Fit the Display
6.3.7. Change the Default LiveReload Port
6.3.8. Set the Location for Saved Screen Captures
6.3.9. Change the Default Settings for Weinre
7. Hybrid Mobile Tools and CordovaSim
7.1. Overview of Hybrid Mobile Tools and CordovaSim
7.1.1. About Apache Cordova
7.1.2. About Hybrid Mobile Tools
7.1.3. About CordovaSim
7.1.4. System Requirements for Hybrid Mobile Tools
7.1.5. System Requirements for CordovaSim
7.1.6. Install Hybrid Mobile Tools and CordovaSim
7.2. Features of Hybrid Mobile Tools and CordovaSim
7.2.1. Features Overview
7.2.2. Create a Hybrid Mobile Project
7.2.3. Enable Cordova Plug-ins for an Application
7.2.4. Manage Cordova Settings of a Hybrid Mobile Project
7.2.5. Run a Hybrid Mobile Application on Devices and Simulators
7.2.6. Manage Hybrid Mobile Project Run Configurations
7.2.7. Export a Hybrid Mobile Project
7.3. Customizing Hybrid Mobile Tools and CordovaSim
7.3.1. Customizing Overview
7.3.2. Set the Android SDK Location
IV. Tools for Deployment and Maintenance
8. OpenShift Tools
8.1. Overview of OpenShift Tools
8.1.1. About OpenShift
8.1.2. About OpenShift Tools
8.2. Features of OpenShift Tools
8.2.1. Features Overview
8.2.2. Create an OpenShift Online User Account
8.2.3. Connect to OpenShift
8.2.4. Manage a Connection
8.2.5. Generate and Upload SSH Keys to OpenShift
8.2.6. Manage SSH Keys
8.2.7. Create a Domain
8.2.8. Manage a Domain
8.2.9. Deploy a New or Existing Application on OpenShift
8.2.10. Import a Deployed OpenShift Application into the IDE
8.2.11. Generate a Server Adapter for an Application
8.2.12. View a Deployed Application and Associated Information
8.2.13. Manage a Deployed Application
8.2.14. Debug a Deployed Application
8.3. Customizing OpenShift Tools
8.3.1. Customizing Overview
8.3.2. Change the Timeout Behavior of OpenShift Requests
A. Revision History

This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information.

In PDF and paper editions, this manual uses typefaces drawn from the Liberation Fonts set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later include the Liberation Fonts set by default.

Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows.

Mono-spaced Bold

Used to highlight system input, including shell commands, file names and paths. Also used to highlight keys and key combinations. For example:

The above includes a file name, a shell command and a key, all presented in mono-spaced bold and all distinguishable thanks to context.

Key combinations can be distinguished from an individual key by the plus sign that connects each part of a key combination. For example:

The first example highlights a particular key to press. The second example highlights a key combination: a set of three keys pressed simultaneously.

If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in mono-spaced bold. For example:

Proportional Bold

This denotes words or phrases encountered on a system, including application names; dialog-box text; labeled buttons; check-box and radio-button labels; menu titles and submenu titles. For example:

The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context.

Mono-spaced Bold Italic or Proportional Bold Italic

Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example:

Note the words in bold italics above: username, domain.name, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system.

Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example:

Do You Need Help?

If you experience difficulty with a procedure described in this documentation, visit the JBoss Tools website at http://www.jboss.org/tools. Through the JBoss Tools website, you can:

  • search or browse through a knowledgebase of technical support articles in the wiki.

  • view video tutorials on how to use the tools.

  • participate in discussions in the user forum.

  • keep up to date with changes via the blog, mailing list and News and Noteworthy web page.

Give us Feedback

If you find a typographical error or have a suggestion for improving this documentation, we would love to hear from you. Submit a report in JIRA against the project Documentation for JBoss Tools and Developer Studio (TOOLSDOC). The following link will take you to a pre-filled bug report for this product: https://issues.jboss.org.

Fill out the following template in JIRA's Description field. Be as specific as possible when describing the issue; this will help ensure that we can fix it quickly.

Document URL:

Section Number and Name:

Describe the issue:

Suggestions for improvement:

Additional information:

Be sure to give us your name so that you can receive full credit for reporting the issue.

Table of Contents

1. JBoss Central and the JBoss Perspective
1.1. Overview of JBoss Central and the JBoss Perspective
1.1.1. About JBoss Central
1.1.2. About the JBoss Perspective
1.2. Features of JBoss Central and the JBoss Perspective
1.2.1. Features Overview
1.2.2. View JBoss Central
1.2.3. Access Project Wizards in JBoss Central
1.2.4. Meet the Requirements of JBoss Central Project Examples
1.2.5. Access Information in JBoss Central
1.2.6. Install Software in JBoss Central
1.2.7. Open the JBoss Perspective
1.2.8. Manage the JBoss Perspective
1.2.9. View Cheat Sheets
1.3. Customizing JBoss Central and the JBoss Perspective
1.3.1. Customizing Overview
1.3.2. Change the Behavior of JBoss Central on IDE Start
1.3.3. Customize the Default Views, Menus and Toolbars of the JBoss Perspective
1.3.4. Use Project Examples when Working Offline
1.3.5. Install Software when Working Offline
1.3.6. Set Cheat Sheet Behavior
1.3.7. Set Usage Reporting
2. JBoss Server Tools
2.1. Overview of JBoss Server Tools
2.1.1. About JBoss Server Tools
2.1.2. About IDE Server Definitions
2.2. Features of JBoss Server Tools
2.2.1. Features Overview
2.2.2. Download a JBoss Community Application Server
2.2.3. Create a Default Local Server Definition with Runtime Detection
2.2.4. Create an Additional Server Runtime Environment
2.2.5. Define an Additional Local Server
2.2.6. Define a Remote Server
2.2.7. Manage Server Settings
2.3. Customizing JBoss Server Tools
2.3.1. Customizing Overview
2.3.2. Enable Runtime Detection on IDE Start
2.3.3. Set a Default Server
2.3.4. Default File Sets
2.3.5. Default Classpath Entries
3. Forge Tools
3.1. Overview of Forge Tools
3.1.1. About Forge
3.1.2. About Forge Tools
3.2. Features of Forge Tools
3.2.1. Features Overview
3.2.2. Manage the Forge Console
3.2.3. Manage the Forge Runtime Server
3.2.4. Navigate to Project Resources on the Forge Command Line
3.2.5. Background Actions Invoked by Forge Commands
3.2.6. Access a List of Forge Commands
3.2.7. Use Forge Wizards
3.3. Customizing Forge Tools
3.3.1. Customizing Overview
3.3.2. Customize the Forge Start
3.3.3. Manage Forge Runtime Servers

JBoss Central provides access to wizards for generating projects. There are two types of project wizards available in JBoss Central: Start from scratch and Start from a sample.

To create a project from one of the wizards, in JBoss Central select the Getting Started tab. Click one of the links below Start from scratch or Start from a sample. Alternatively, click FileNew and select a project from the list. A wizard opens to guide you through the process of creating the project.

Additionally, access is provided to the comprehensive TicketMonster tutorial, part of JBoss Developer Framework. The tutorial guides you through developing a complex web application utilizing JBoss technologies from within the IDE. To view the tutorial, in JBoss Central select the Getting Started tab and click the TicketMonster link. The JBoss Developer Framework website opens in the default IDE browser.


The project wizards under Start from scratch and Start from a sample in JBoss Central generate projects that are designed to work best with specific platform and plug-in versions. Information about the platform and plug-in requirements is listed on the first page of each project wizard and, in the case that they are missing from your system, you can initiate downloading and installing of required components from within the wizard.


The Found? check box is selected when a requirement is met by your system. In the case that a required component is missing from your system, you must follow one of these options:

  • Click Install and follow the wizard instructions to inform the IDE about the availability of the required components on your system.

  • Click Download and Install and follow the wizard instructions to download missing components and subsequently inform the IDE about their availability.

Some of the common platform and plug-in requirements are detailed here:

  • JBoss Application Server, which is distributed separately from JBoss Tools, is supported for deploying and running many of the project examples

  • m2e and m2e-wtp, which are packaged as part of JBoss Central and provide core Apache Maven support in the IDE and connectors for configuring Java EE Maven projects as web projects

  • JBoss Maven Tools, which is packaged as part of JBoss Central and provides additional Maven support for developing Java EE applications deployed to JBoss Application Server

JBoss Central enables you to install and update a range of IDE plug-ins. The available plug-ins comprise JBoss and third-party plug-ins that have been specifically tested for use with the IDE. These plug-ins include ones for mobile and web development, source control management, utilities and Maven.

For all actions listed below, open JBoss Central and select the Software/Update tab.

View available software

The available software is listed in the table. To refresh the list of available plug-ins, click the Refresh icon .

View installed plug-ins

Select the Show Installed check box. The installed plug-ins are listed in the table as disabled.


Install available software

In the Find field, type the name of the software or scroll through the list to locate it. Select the check box corresponding to the software you want to install and click Install or click the Install icon .


In the Install wizard, ensure the check boxes are selected for the software you want to install and click Next.


Review the details of the items listed for installing and click Next. After reading and agreeing to the license(s), click I accept the terms of the license agreement(s) and click Finish. The Installing Software window opens and reports the installation progress.

During the installation process you may receive warnings about installing unsigned content. If this is the case, check the details of the content and if satisfied click OK to continue with the installation.


Once installing is complete, you are prompted to restart the IDE. Click Yes to restart now and No if you need to save any unsaved changes to open projects. Note that changes do not take effect until the IDE is restarted.

Check for software updates

Click the Check for Updates icon . The Contacting Software Sites window opens and reports the progress of checking. Once checking is complete, a prompt informs you of any new software found. Click OK to close the prompt.


You can customize the views, menus and toolbars displayed by the JBoss perspective, as with any perspective.

For all actions listed below, ensure the JBoss perspective is the current perspective.

Customize views

Open or close views as desired and click WindowSave Perspective As. From the Existing Perspectives list, select JBoss and click OK. At the prompt asking if you want to overwrite the existing JBoss perspective, click Yes.


Customize menu and toolbar elements

Click WindowCustomize Perspective. In the Tool Bar Visibility tab, select or clear the check boxes corresponding to the individual toolbars and icons visible in the global toolbar of the JBoss perspective as appropriate. In the Menu Visibility tab, select or clear the check boxes corresponding to the menus and menu items visible in the JBoss perspective as appropriate. Disabled items in the Tool Bar Visibility and Menu Visibility tabs can be activated in the Command Groups Availability tab. Click OK to save any changes and close the window.



Reorder the individual toolbars comprising the global toolbar

Click the vertical dashed line indicating the beginning of an individual toolbar and drag the toolbar to its new location in the global toolbar.


Revert all perspective customizations

Click WindowReset Perspective. At the prompt asking if you want to reset the JBoss perspective to its saved state, select the Also discard perspective's customization check box and click Yes.


When a project wizard in JBoss Central is used, the IDE searches online repositories for the most recent versions of project dependencies. JBoss Central enables you to create a cache of the necessary project dependencies when you are online so that you can still use the project wizards offline. As detailed below, this is achieved by first creating the cache and then informing the IDE to use that cache.

Important

Maven must be correctly configured for all of the project wizards before the cache script is run. The JBoss Public Maven repository must be specified in settings.xml.

To create the cache, click WindowPreferences. Expand JBoss ToolsProject Examples and select Offline Support. To run the cache generating script, click Copy to Clipboard and paste the selected text on a command line outside the IDE. The script downloads and builds all of the project examples in a new directory offline. The script may take some time to complete.

Once the cache is generated, copy offline/.jbosstools/cache to the directory where you want to keep the project examples cache. Copy the contents of offline/.m2/repository to your local maven repository.

To inform the IDE to use the generated project examples cache, click WindowPreferences. Expand JBoss ToolsProject Examples and select Offline Support. Select the Enable offline mode for project examples check box. Ensure the correct cache location is specified in the Offline directory field. Click Apply and click OK to close the Preferences window.


You can install the JBoss and third-party plug-ins listed in JBoss Central in offline mode using the JBoss Central .zip file, as detailed below. This feature is useful if you regularly work offline or if you are installing these auxiliary plug-ins in a number of JBoss Developer Studio installations as it removes the need to repeatedly download the same plug-ins.

Note that the JBoss Central .zip file is a snapshot of the plug-ins at the time of the given JBoss Developer Studio release and updated versions of the plug-ins must be installed from JBoss Central in online mode.

Procedure 1.1. Install from JBoss Central .zip File

  1. Click HelpInstall New Software.

  2. In the Work with field, enter the path of the JBoss Central .zip file. Alternatively, click Add and click Archive to locate the file.

  3. Clear the Group items by category check box. This action makes the contents of the JBoss Central .zip file visible in the table of components.

  4. From the table of components, select the software to be installed and click Next.

  5. Review the details of the items listed for install and click Next.

  6. After reading and agreeing to the license(s), click I accept the terms of the license agreement(s) and click Finish. The Installing Software window opens and reports the progress of the installation.

  7. During the installation process you may receive warnings about installing unsigned content. If this is the case, review the details of the content and if satisfied click OK to continue with the installation.

  8. Once installing is complete, you are prompted to restart the IDE. Click Yes to restart now and No if you need to save any unsaved changes to open projects. Note that changes do not take effect until the IDE is restarted.

A server definition is a description of how the IDE is to use an application server. It informs the IDE of configuration information with which to start, communicate and manage an application server, including application deployment. As such, a server definition is an essential element for working with an application server in the IDE.

A complete server definition is composed of two items, as listed here.

You must generate at least one complete server definition for an application server before you can use it in the IDE. To assist you with this, JBoss Server Tools provides runtime detection that automatically generates a complete default server definition for any installed application servers found in a given local system search path.

Application servers must be installed on your system in order to deploy applications to local and remote instances of them. Many application servers must be downloaded from outside the IDE. But JBoss Server Tools can assist you to download JBoss community application servers from within the IDE, as detailed in the procedure below.

Once downloading is complete, the application server archive is extracted and several automated actions occur:

Before the IDE can use an application server, you must create a server definition for it. JBoss Server Tools provides runtime detection that automatically generates a complete default server definition for any installed application servers found in a given local system search path, as detailed in the procedure below. Note that complete server definitions are also automatically generated for JBoss community servers downloaded with JBoss Server Tools.

Generated server runtime environments are listed in Preferences under ServerRuntime Environments. A default server adapter is automatically created for each generated server runtime environment to complete the server definition. Server adapters are listed in the Servers view.


Note

Alternatively, you can manually define servers by using the IDE server functions to create a server runtime environment and then to create a server adapter.

Runtime detection creates a server runtime environment as part of the default server definition for each application server it discovers in given search paths on your system. But you may want to create additional server runtime environments that specify a variety of JREs or configuration files for a given installed application server. The procedure below details the process for creating new server runtime environments. For older versions of application servers, you can also create a new runtime server by cloning an existing one as explained below.

Procedure 2.3. Create a Server Runtime Environment

  1. Click WindowPreferences, expand Server and select Runtime Environments.


  2. Click Add.

  3. Complete the fields and options as detailed:

  4. Click Next.

  5. Complete the fields and options as detailed:

  6. Click Next if the button is enabled, otherwise click Finish. The Next button is only enabled if you selected the Create a new local server check box earlier. On the presented page, complete the appropriate information and click Finish.


    The new server runtime environment is listed in the Server runtime environments table of the Runtime Environments pane in the Preferences window.

Runtime detection defines a local server as part of the default server definition for each application server it discovers in given search paths on your system. But you may want to create additional server adapters that have different configurations for a given server runtime environment in order to define multiple servers. To create a new server adapter to define a local server, you must use the new server wizard as detailed in the procedure below.

Procedure 2.4. Define a Local Server

  1. Click the Servers view. If the Servers view is not visible, click WindowShow ViewServers.

  2. Depending on the number of existing servers, follow the appropriate step:

    • If there are no existing servers, click Click this link to create a new server.

    • If there are one or more existing servers, right-click an existing server and click NewServer.

  3. Complete the fields and options as detailed:

  4. Click Next.

  5. The server behavior options displayed vary depending on the selected application server type. Complete the fields and options as detailed:


  6. Click Next.

  7. To select applications to deploy with this server, from the Available list select the applications and click Add. Applications to be deployed are detailed in the Configured list.


  8. Click Finish to create the server. The server is listed in the Servers view, with the information in brackets detailing the server status.

You can define remote servers for JBoss community application servers. To complete a server definition, you must create a server adapter, or server, that informs the IDE how to communicate and manage the remote server, as detailed in the procedure below.

Procedure 2.5. Define a Remote Server

  1. Click the Servers view. If the Servers view is not visible, click WindowShow ViewServers.

  2. Depending on the number of existing servers, follow the appropriate step:

    • If there are no existing servers, click Click this link to create a new server.

    • If there are one or more existing servers, right-click an existing server and click NewServer.

  3. Complete the fields and options as detailed:

  4. Click Next.

  5. The server behavior options displayed vary depending on the selected application server type. Complete the options as detailed:

  6. Complete the additional fields and options for the remote server as detailed:

  7. Click Next.

  8. To select applications to deploy with this server, from the Available list select the applications and click Add. Applications to be deployed are detailed in the Configured list.


  9. Click Finish to create the server. The server is listed in the Servers view, with the information in brackets detailing the server status.

JBoss Server Tools provides the JBoss Server Editor for managing the settings of servers. This editor has two tabs: Overview and Deployment. As described below, each tab enables you to configure fundamental server settings.

The Overview tab details the settings for the server. Within this tab you can provide management information, specify application publishing and reload behavior, and customize port settings.


The Deployment tab lists applications deployed to the server. Within this tab you can specify the general publishing behavior for applications and provide deployment settings for individual applications.


To open the JBoss Server Editor for a specific server, in the Servers view double-click the server. All changes to the settings of a server must be saved before the results will take effect. To save changes made to server settings in the JBoss Server Editor, press Ctrl+S. You may be required to enter the server management password when making changes to certain settings.

The Overview tab of the JBoss Server Editor enables you to vary the management and behavior settings of an individual server. Each section of the Overview tab is outlined below. All changes to server settings must be saved before the results will take effect. To save, press Ctrl+S.

General information

This section details essential information comprising the server definition: the name by which the server is identified in the IDE, the hostname of the server and the server runtime environment.


To change the server runtime environment, from the Runtime Environment list select a server runtime environment. Alternatively, to create and assign a new server runtime environment click Runtime Environment and follow the instructions.

To view or edit the server launch configuration, click Open launch configuration.

Management login credentials

This section holds credentials, specifically username and password, necessary for the IDE to successfully communicate management commands with the server. The password is obscured and stored in Eclipse Secure Storage for security. Incorrect management credentials can cause the IDE to not detect when a server is started.


Server behavior

This section enables you to customize server behavior that encompasses how the IDE communicates with the server.


To specify that the server life cycle will be managed from outside the IDE, select the Server is externally managed check box.

To specify that the server should be launched to respond to requests on all hostnames, select the Listen on all interfaces to allow remote web connections check box. This option is most useful for remote servers and adds the -b 0.0.0.0 argument to the server launch command.

To enable management commands sent by the IDE to be successfully received by the server, select the Expose your management port as the server's hostname check box. This option is useful for remote servers and unnecessary for local servers.

Warning

The Expose your management port as the server's hostname feature should be used carefully for servers on production as it leaves the server open for anyone to access.

To specify the location of the server, from the list select Local or Remote System Deployment. For remote systems, there are further details that must be specified: the host, the path of the remote application server, and the remote application server configuration file.


Publishing

This section details the publishing action the IDE should take in response to modifications to local resources of deployed applications. Publishing involves replacing changed project resources in the dedicated deployment location of a server and the IDE action options are Never publish automatically, Automatically publish when resources change, and Automatically publish after a build event. Additionally, you can specify a minimum time interval that must occur between consecutive automated publish actions by the IDE to control the frequency of publishing.


Timeouts

This section specifies the maximum length of time, in seconds, the IDE should wait for server actions to complete before aborting. The server actions are specifically starting and stopping.


Deployment scanner

This section enables you to customize the behavior of deployment scanners, which detect the applications deployed to a server. You can manage deployment scanners or allow the IDE to do it for you. The management options available are Add missing deployment scanners after server startup and Remove added deployment scanners before shutdown.


Application reload behavior

This section details the application reload action the IDE should take in response to changed published resources of deployed applications. Application reload involves undeploying and redeploying an application and this action is necessary when you make changes to project resources that will not be detected by the server. By default, the application reload behavior is set to invoke application redeployment when .jar files are changed.


To customize which changes invoke application redeployment, select the Customize application reload behavior on changes to project resources check box. In the Force module restart on following regex pattern field, type a regex pattern indicating the changed resources that you want to trigger redeployment.

To disable application reload, select the Customize application reload behavior on changes to project resources check box and ensure the Force module restart on following regex pattern field is empty.

Server state detectors

This section specifies which method the IDE should use to verify the started and stopped status of the server.


There are four methods from which to choose:

  • Web Port, which pings the web port on the host to see if the server responds

  • Timeout, which waits for a specified time duration and then declares the start or stop operation a success without any actual verification

  • Process Terminated (available for Shutdown Poller of local servers only), which checks if a server process is still alive and sets the server status to stopped when it is terminated

  • JMX, which polls JMX, the JBoss Management service

Note that server state detection options are disabled if the Server is externally managed check box under Server Behavior is selected.

Server ports

This section details the ports and port offset that the IDE should use for communication with the server.


Port offset is typically offered by newer application servers and it enables multiple servers to run on the same system without port conflicts. JBoss Server Tools uses information in the server configuration file, typically XPath values, to automatically detect the correct ports and port offset for communicating with the server but you can perform further customization.

To view the configuration file information used by JBoss Server Tools for automatic port detection, click Configure corresponding to the appropriate tool. The information used is displayed in the Current Value field. To change this value, click Edit XPath. Click OK to close the window.


To manually specify the server ports or port offset, clear the Detect from Local Runtime check box corresponding to the appropriate tool and edit the port value.

The Deployment tab of the JBoss Server Editor enables you to vary the deployment settings of an individual server. Each section of the Deployment tab is outlined below. All changes to server settings must be saved before the results will take effect. To save, press Ctrl+S.

Default settings for the server

This section specifies where deployments are kept and how they are packaged.


You can customize the deployment location and packaging type:

  • To select the workspace deployment folder for the server, click Use workspace metadata.

  • To select the deployment folder of the application server, click Use the JBoss deploy folder.

  • To select a folder of your choice, click Use a custom deploy folder. With this option, complete the Deploy directories and Temporary Deploy Directory fields. The temporary folder must be on the same file system as the final deploy location otherwise publishing often fails.

  • For all modules to be archived for deployment, select the Deploy projects as compressed archives check box. This avoids exploded deployments and reduces the amount of memory deployments occupy but may result in slower deployment.

Settings per module

This section shows deployment settings for all modules in the workspace regardless of whether they are deployed on the server under consideration.


To filter the module list in the case that you have many modules, from the Filter by list select the criteria for the filter. If you select the By Module Name filter option, in the text field enter the part or whole name of the module.

To change the Deployment Location and Temporary Deploy Directory on a per module basis, in the table click the value to be changed and enter an alternative value. Ensure the values for these variables are specified use absolute paths or paths relative to the default deploy directory.

Forge Tools invokes background actions in the IDE in response to commands issued on the command line in the Forge Console view. For example, if you create a project file or directory on the Forge command line, the Project Explorer view is automatically refreshed to show the newly created project resource. A list of Forge commands that result in additional background actions is given below.

cd

The command navigates to the project directory and selects it in the Project Explorer and Package Explorer views.

pick-up

The command navigates to the project resource and in the case that the resource is a file it is opened in an editor within the IDE. The project resource is selected and expanded in the Project Explorer and Package Explorer views. If the resource resides outside the workspace, it is selected and expanded in the Remote Systems Explorer view, providing this is installed.

open

The command opens a file in an editor within the IDE. The project resource is selected and expanded in the Project Explorer and Package Explorer views. If the resource resides outside the workspace, it is selected and expanded in the Remote Systems Explorer view, providing this is installed.

new-project

The command creates a new project in a specified location. The project is automatically imported into the workspace and it is visible in the Project Explorer and Package Explorer views.

persistence setup

The command creates a persistence.xml file. This file is selected in the Project Explorer and Package Explorer views and it is automatically opened in an editor within the IDE.

entity

The command creates a new entity and associated Java file. This file is selected in the Project Explorer and Package Explorer views and it is automatically opened in the Java editor within the IDE.

field

The command creates a new field for an entity. The Java file associated with the entity is selected in the Project Explorer and Package Explorer views and it is automatically opened in an editor within the IDE and the field selected. The field is also selected in the Outline view.

Forge Tools is distributed with a Forge runtime server but you may want to use different versions of Forge runtime servers. Forge Tools provides the ability to manage the Forge runtime servers that are available in the IDE, as detailed below.

To manage the available Forge runtime servers, click WindowPreferences, expand Forge and select Installed Forge Runtimes.


Click OK to close the Preferences window.

The LiveReload server is integral to the LiveReload integration with the IDE. In its default configuration, the server receives information from the IDE when resources change and sends notifications for refresh actions to be taken. The server may also be further configured to inject the necessary JavaScript code snippets into HTML files or enable remote connections. The procedure below guides you through creating a default LiveReload server.

A LiveReload client must be inserted into HTML files in order for it to receive the LiveReload server notifications about changed resources. LiveReload Tools provides additional configuration options so that the LiveReload server can inject the necessary <script> element into the HTML resources. Furthermore, the LiveReload server can be configured to allow access from external devices, enabling LiveReload to function in browsers of remote devices.

The details below outline how to set the configuration options using the Server Editor. To open the Server Editor for a LiveReload server, in the Servers view double-click the LiveReload server. Alternatively, right-click the LiveReload server and click Open or press F3.


Insert JavaScript code snippet to resources

In the Server Editor under LiveReload Server Configuration, select the Inject the livereload.js script in HTML pages check box.

Enable LiveReload in external device browsers

In the Server Editor under LiveReload Server Configuration, select the Allow Remote Connections check box. This option is disabled by default when a LiveReload server is created as it exposes your workspace files, which may not always be desirable.

All changes to the settings of a LiveReload server must be saved and the server restarted before the results will take effect. To save setting changes, press Ctrl+S or click FileSave or click the Save icon. To restart the server, in the Servers view right-click the LiveReload server and click Restart.

You can use the actions of LiveReload Tools to open HTML, XHTML and AsciiDoc resources in LiveReload-enabled browsers, as detailed below. If the requisite LiveReload server does not exist or is not correctly configured, you are prompted by LiveReload Tools, which can complete the necessary requirements for you. Note that LiveReload Tools functionality may only work with deployed XHTML resources due to their dynamic nature.

Note

To use LiveReload Tools with AsciiDoc files, you must install the AsciiDoctor.js browser extension from http://asciidoctor.org/news/2013/09/18/introducing-asciidoctor-js-live-preview/ on the Asciidoctor website. The browser extension renders AsciiDoc files as HTML and it is available for Chrome and FireFox.

View workspace resources in a web browser

In the Project Explorer view, right-click the resource file and click Open WithWeb Browser via LiveReload Server.

This requires the server to be configured to Inject the livereload.js script in HTML pages and, if the server is not correctly configured, you are prompted to enable this option.


The IDE-specified external web browser opens, with LiveReload activated, and displays the workspace resource.

View deployed resources in a web browser

Ensure the server and application of the deployed resources are started. In the Servers view, right-click the application and click Show InWeb Browser via LiveReload Server.


This requires the server to be configured to Inject the livereload.js script in HTML pages and, if the server is not correctly configured, you are prompted to enable this option.


The IDE-specified external web browser opens, with LiveReload activated, and displays the deployed resource.

Note

To change the IDE-specified external web browser, click WindowPreferences and expand GeneralWeb Browser. From the External web browsers list, select the browser to use for actions involving external web browsers. Click Apply and click OK to close the Preferences window.

View deployed resources on an external device

Ensure the server and application of the deployed resources are started. In the Servers view, right-click the application and click Show InWeb Browser on External Device.


This requires the server to be configured to Inject the livereload.js script in HTML pages and Allow Remote Connections and, if the server is not correctly configured, you are prompted to enable these options.


A QR code and LiveReload server port URL corresponding to the deployed application are displayed and these can be input into external device browsers.


The LiveReload server can be used in conjunction with BrowserSim. In this case, the server sends notifications about changed resources and BrowserSim inserts the JavaScript code, which invokes the simulated device browser window to refresh. The procedure below outlines how to enable LiveReload in BrowserSim for workspace and deployed resources.

Table of Contents

5. Mobile Web Tools
5.1. Overview of Mobile Web Tools
5.1.1. About Mobile Web Tools
5.2. Features of Mobile Web Tools
5.2.1. Features Overview
5.2.2. Create a Mobile Web Project
5.2.3. Use a HTML5 jQuery Mobile File Template
5.2.4. Access the jQuery Mobile Palette
5.2.5. Insert a jQuery Mobile Palette Widget into a HTML5 File
5.2.6. Get Assistance with jQuery Mobile Programming
5.2.7. View jQuery Mobile Pages in a Browser
5.3. Customizing Mobile Web Tools
5.3.1. Customizing Overview
5.3.2. Customize jQuery Mobile File Templates
6. BrowserSim
6.1. Overview of BrowserSim
6.1.1. About BrowserSim
6.1.2. System Requirements for BrowserSim
6.2. Features of BrowserSim
6.2.1. Features Overview
6.2.2. View a Web Application on BrowserSim
6.2.3. Manage Web Applications on BrowserSim
6.2.4. Change the Appearance of a Simulated Device
6.2.5. View a Web Page in Different Browsers and Simulated Devices
6.2.6. Generate a Screen Capture of a Simulated Device
6.2.7. Activate LiveReload for BrowserSim
6.2.8. View the Source of a Web Page
6.3. Customizing BrowserSim
6.3.1. Customizing Overview
6.3.2. Make BrowserSim the Default Browser
6.3.3. Add BrowserSim to the Global Toolbar
6.3.4. Set a Shortcut for the Run BrowserSim Action
6.3.5. Add or Modify Devices in BrowserSim
6.3.6. Change the Default Behavior when a Device does not Fit the Display
6.3.7. Change the Default LiveReload Port
6.3.8. Set the Location for Saved Screen Captures
6.3.9. Change the Default Settings for Weinre
7. Hybrid Mobile Tools and CordovaSim
7.1. Overview of Hybrid Mobile Tools and CordovaSim
7.1.1. About Apache Cordova
7.1.2. About Hybrid Mobile Tools
7.1.3. About CordovaSim
7.1.4. System Requirements for Hybrid Mobile Tools
7.1.5. System Requirements for CordovaSim
7.1.6. Install Hybrid Mobile Tools and CordovaSim
7.2. Features of Hybrid Mobile Tools and CordovaSim
7.2.1. Features Overview
7.2.2. Create a Hybrid Mobile Project
7.2.3. Enable Cordova Plug-ins for an Application
7.2.4. Manage Cordova Settings of a Hybrid Mobile Project
7.2.5. Run a Hybrid Mobile Application on Devices and Simulators
7.2.6. Manage Hybrid Mobile Project Run Configurations
7.2.7. Export a Hybrid Mobile Project
7.3. Customizing Hybrid Mobile Tools and CordovaSim
7.3.1. Customizing Overview
7.3.2. Set the Android SDK Location

Project wizards are available to assist you in generating new mobile web applications. The project wizards are listed in JBoss Central:

The jQuery Mobile palette contains wizards for the HTML5 and jQuery Mobile user interface widgets commonly used in mobile web applications. The widgets are grouped in the palette by functionality, with tooltips providing widget descriptions.

To insert a palette widget in a file open in the JBoss Tools HTML Editor, drag the widget icon to the appropriate place in the file. Alternatively, ensure the text cursor is located at the desired insertion point in the file and click the widget icon. For widgets with no attributes that can be customized, such as JS/CSS and Field Container, the code snippets are immediately inserted into the file. For widgets with attributes that can be customized, a widget wizard opens allowing you to input attribute information. Once you have completed the customizable fields, click Finish and the code snippet is inserted into the file.


The widget wizards have three common aspects:

Design fields

These fields are unique to each widget. They allow you to customize the attributes of the widget by providing names, actions, numbers of elements, and styling themes. All widget wizards assign automatically generated values to the ID attribute in the case that you do not specify a value. Content assist is available for the URL (href) field by placing the text cursor in the field and pressing Ctrl+Space.

Add references to JS/CSS

This check box provides the ability to automatically add any missing library references to the HTML5 file that are required by the widget.

Preview Panes

These panes show previews of the code snippet for the widget and of the rendered widget. The preview panes can be shown and hidden by clicking Show Preview and Hide Preview, respectively.

The overall system requirements of JBoss Tools are applicable for BrowserSim and can be viewed at https://community.jboss.org/wiki/MatrixOfSupportedPlatformsRuntimesAndTechnologiesInJBossToolsJBDS on the JBoss Tools website. But, as reiterated below, there are additional system requirements and restrictions when using BrowserSim on Microsoft Windows operating systems.

BrowserSim depends on WebKit and, consequently, requires Apple Safari to be installed on Microsoft Windows operating systems. Only a 32-bit version of Apple Safari is available for Microsoft Windows operating systems. To work around this restriction for 64-bit Microsoft Windows operating systems, you must set BrowserSim to use a 32-bit JVM when running in 64-bit versions of Eclipse. Note that 32-bit JVM choice is limited to Oracle 32-bit JRE 1.6, JDK 1.6, or JDK 1.7 on Microsoft Windows operating systems because Oracle 32-bit JRE 1.7 is incompatible with Apple Safari.

To set BrowserSim to use a 32-bit JVM, click WindowPreferences. Expand JBoss Tools and select BrowserSim/CordovaSim. Under Select JRE to run BrowserSim, click Select and from the list select a 32-bit JRE or Java developer kit. Click Apply and click OK to close the Preferences window.


LiveReload for BrowserSim refreshes web pages open in simulated device browser windows as the source is edited in the IDE. A LiveReload server sends notifications as resources are changed in the IDE and BrowserSim inserts the JavaScript code, which invokes the simulated device browser window to refresh. The procedures below outline how to create a LiveReload server and how to enable LiveReload in BrowserSim for workspace and deployed resources.

You may wish to preview a web application on a simulated mobile device that is not predefined in BrowserSim. You can add more devices to BrowserSim and modify the existing devices, as detailed below.

To modify existing devices in BrowserSim, right-click the simulated device and click Preferences. In the Devices table, select a device and click Edit. Once you have finished editing the fields, click OK. Click OK to close the Preferences window.

Apache Cordova is a framework for hybrid mobile application development. It simplifies mobile application development by enabling developers to use device-independent APIs, in place of native code, to access device functionality.

Cordova consists of plug-ins, each providing a wrapper API to gain access to corresponding native device APIs. Cordova APIs are available for a range of device functionality, including cameras, accelerometers, and filesystems. All of the Cordova APIs have a JavaScript interface and native backing code to support a variety of different device operating systems, including Android and iOS.

The JavaScript interface of Cordova APIs provides consistent methods for accessing native device functionality regardless of operating system. Applications using Cordova are written once and packaged using native software development kits (SDKs) to produce hybrid mobile applications.

Cordova applications have a distinctive project structure:

Apache Cordova is an open source project, of which there are various distributions. PhoneGap, in addition to being the originator of Cordova, and IBM Worklight are such distributions.

Hybrid Mobile Tools provides tooling for developing Cordova-based hybrid mobile applications within the IDE. It simplifies the process of getting started with the Cordova technology that can be used for these types of applications and provides workflows for developing Cordova-based hybrid mobile applications.

Hybrid Mobile Tools consists of the Apache Cordova API and wizards, a dedicated editor and actions for developing Cordova-based hybrid mobile applications for Android and iOS operating systems:

Hybrid Mobile Tools, together with CordovaSim, provides a rounded hybrid mobile development and testing environment.

CordovaSim is a mobile application simulator. It enables you to view and test Cordova-based hybrid mobile applications through a mobile device simulator.

CordovaSim consists of a device input panel based on an extended version of Apache Ripple, teamed with BrowserSim. The input panel provides the ability to give sample input for device features to the application, such as camera, geolocation and accelerometer data. BrowserSim displays and enables user interaction with the application.

Extensions to the device input panel for CordovaSim include the following:

The overall system requirements of JBoss Tools are applicable for Hybrid Mobile Tools and can be viewed at https://community.jboss.org/wiki/MatrixOfSupportedPlatformsRuntimesAndTechnologiesInJBossToolsJBDS on the JBoss Tools website. But, as reiterated below, there are additional system requirements and restrictions when using Hybrid Mobile Tools.

Hybrid Mobile Tools actions involving Android and iOS require the associated SDKs to be installed on your system.

Note

CordovaSim is a standalone simulator for mobile device operating systems, including Android and iOS. It does not require native SDKs to be installed in order to simulate successfully.

Android SDK (including emulator)

This is available as part of Android Development Tools. For further information see http://developer.android.com/sdk/index.html on the Android Developers website. Note that for Android actions in Hybrid Mobile Tools it is only necessary to install the Android SDK, which includes the Android Emulator.

Once downloaded, you must use the included Android SDK Manager to further download necessary APIs and set up Android virtual devices (AVDs).

Important

You must have Android API 17 or later installed on your system to use the Hybrid Mobile Tools Run on Android Emulator action. You are prompted by an error message when only Android API 16 or earlier is available. In the event that multiple Android API of 17 and later are available, Hybrid Mobile Tools uses the latest version.

Further, once Hybrid Mobile Tools is installed, you must set the Android SDK location in the IDE before you can use Hybrid Mobile Tools actions involving Android.

iOS SDK (including simulator)

This is available as part of Apple XCode. For further information see https://developer.apple.com/xcode/ on the Apple website.

The overall system requirements of JBoss Tools are applicable for CordovaSim and can be viewed at https://community.jboss.org/wiki/MatrixOfSupportedPlatformsRuntimesAndTechnologiesInJBossToolsJBDS on the JBoss Tools website. But CordovaSim uses BrowserSim and, as reiterated below, there are additional system requirements and restrictions when using BrowserSim on Microsoft Windows operating systems.

BrowserSim depends on WebKit and, consequently, requires Apple Safari to be installed on Microsoft Windows operating systems. Only a 32-bit version of Apple Safari is available for Microsoft Windows operating systems. To work around this restriction for 64-bit Microsoft Windows operating systems, you must set BrowserSim to use a 32-bit JVM when running in 64-bit versions of Eclipse. Note that 32-bit JVM choice is limited to Oracle 32-bit JRE 1.6, JDK 1.6, or JDK 1.7 on Microsoft Windows operating systems because Oracle 32-bit JRE 1.7 is incompatible with Apple Safari.

If BrowserSim is already installed, it can be set to use a 32-bit JVM either before or after installing CordovaSim. To set BrowserSim to use a 32-bit JVM, click WindowPreferences. Expand JBoss Tools and select BrowserSim/CordovaSim. Under Select JRE to run BrowserSim, click Select and from the list select a 32-bit JRE or Java developer kit. Click Apply and click OK to close the Preferences window.


Hybrid Mobile Tools and CordovaSim are not packaged as part of JBoss Tools installations. These plug-ins must be installed independently through JBoss Central, as detailed in the procedure below.

Procedure 7.1. Install Hybrid Mobile Tools and CordovaSim

  1. To install these plug-ins, drag the following link into JBoss Central: http://download.jboss.org/jbosstools/central/install?connectors=org.jboss.tools.aerogear.hybrid. Alternatively, in JBoss Central select the Software/Update tab. In the Find field, type JBoss Hybrid Mobile Tools or scroll through the list to locate JBoss Hybrid Mobile Tools + CordovaSim. Select the corresponding check box and click Install.



  2. In the Install wizard, ensure the check boxes are selected for the software you want to install and click Next. It is recommended that you install all of the selected components.

  3. Review the details of the items listed for install and click Next. After reading and agreeing to the license(s), click I accept the terms of the license agreement(s) and click Finish. The Installing Software window opens and reports the progress of the installation.

  4. During the installation process you may receive warnings about installing unsigned content. If this is the case, check the details of the content and if satisfied click OK to continue with the installation.


  5. Once installing is complete, you are prompted to restart the IDE. Click Yes to restart now and No if you need to save any unsaved changes to open projects. Note that changes do not take effect until the IDE is restarted.

Once installed, you must inform Hybrid Mobile Tools of the Android SDK location before you can use Hybrid Mobile Tools actions involving Android.

A project wizard is available to assist you in generating new hybrid mobile applications, as demonstrated in the procedure below. It creates a Cordova project with structure compatible with projects generated by the Cordova command-line interface (CLI).

Procedure 7.2. Create a Hybrid Mobile Project

  1. Click FileNewProject.

  2. Expand Mobile, select Hybrid Mobile (Cordova) Application Project and click Next.


  3. Complete the following fields:


  4. By default, the project is created in a subdirectory of the workspace that is named according to the project name. To change the default location, clear the Use default location check box. From the Choose file system list, select the default or RSE (Remote System Explorer) as appropriate. In the Location field, type the path where the project is to be created or click Browse to navigate to the location.

  5. To create the project, click Finish.

During project creation, the wizard imports project dependencies and populates a config.xml file. Once created, the project is listed in the Project Explorer view and the config.xml file is automatically opened in the Cordova Configuration Editor.

Plug-ins, or features, provide the application with access to the necessary Cordova APIs at runtime. Hybrid Mobile Tools provides actions for installing and removing plug-ins associated with applications, as detailed here.

Add a plug-in

In the Project Explorer view, right-click the plugins folder of the project and click Install Cordova Plug-in.

The Cordova Plug-in Discovery wizard opens. The Cordova Plug-in Discovery wizard can install Cordova plug-ins from Cordova registries, Git locations and system directories:


After installing the plug-in, configuration files are automatically updated with relevant settings for the plug-in. Note that the config.xml file is only updated with features and param entries if an installed plug-in has native parts.

Important

Some plug-ins require you to define preference values. At the time of installing such a plug-in, Hybrid Mobile Tools creates an item in the Preference table with the appropriate preference name but with a value of PLEASE_DEFINE. You must edit the preference and provide the required value.

Remove a plug-in

In the Project Explorer view, in the plugins folder right-click the plug-in and click Remove Cordova Plug-in.

The Cordova Configuration Editor is available for managing the settings of Cordova projects that are specified in the config.xml file. This editor has three tabs: Overview, Platform Properties, and config.xml. As described below, the first two tabs provide interfaces for configuring the settings specified in the config.xml file and the third tab enables direct editing of the file.

The Overview tab details explanatory application information. Within this tab you can specify the name and description of the project, the content source of the application, and author details.


The Platform Properties tab specifies Cordova project functionality, such as features (plug-ins and parameters), preferences and access.


The config.xml tab provides an editor in which to view and modify the config.xml file directly.


To open the Cordova Configuration Editor for a specific hybrid mobile project, in the Project Explorer view right-click the config.xml file. Click Open WithCordova Configuration Editor. All changes to the Cordova settings of a project must be saved before the results take effect. To save, press Ctrl+S.

The Platform Properties tab of the Cordova Configuration Editor enables you to specify the Cordova settings in your hybrid mobile project. Features, parameters, preferences and access can be added and removed as detailed below.

Add a feature

Features are the Cordova API plug-ins required by the application in order to access native APIs at runtime. Examples include Camera, Contacts and Geolocation.

To add a feature, click Add for the Features table. The Cordova Plug-in Discovery wizard opens. Follow the instructions as appropriate for the plug-in source:

To add the feature, click Finish.

Add a parameter

All parameters are associated with a feature and provide information about the specific mapping of Cordova and native APIs.

To add a parameter, from the Features table select an item for which to create a parameter. For the Params table, click Add. In the name and value fields, type the service name and Java class full name (including namespace), respectively. To add the parameter, click OK.

Add a preference

Preferences details the global, cross-platform and platform-specific behaviors for the web view of the hybrid mobile application.

To add a preference, click Add for the Preference table. Complete the name and value fields as appropriate. To add the parameter, click OK.

By default for an application created with the Hybrid Mobile Tools project wizard, the Preferences table has two entries. The fullscreen and webviewbounce elements specify whether the application is fullscreen and bounces when pulled down in iOS devices, respectively. For a full list of available preferences see http://cordova.apache.org/docs/en/edge/config_ref_index.md.html#The%20config.xml%20File on the Apache Cordova website.

Add access

Access entries specify the external network resources to which the application has access, also referred to as whitelisting.

To add an access entry, click Add for the Access table. In the required Origin field, type the URL to which access is granted, using * as a wildcard character. Select the Allow Subdomains and Browser Only check boxes as appropriate. These items enable access to subdomains and cause links to open in browsers rather than the application window, respectively. To add the access entry, click OK.

By default for an application created with the Hybrid Mobile Tools project wizard, the Access table has an entry allowing access to all networks, <access origin="*" />. You are advised to declare access to specific network resources.

Remove a feature, parameter, preference or access

In the appropriate table, select the item to be removed and click Remove. Note that removing a feature also removes the associated parameters.

All changes to config.xml must be saved before the results take effect. To save, press Ctrl+S.

You can use the actions of Hybrid Mobile Tools to run applications on devices and simulators, as detailed below.

Run on an Android device

In the Project Explorer view, right-click the project name and click Run AsRun on Android Device. This option calls the external Android SDK to package the workspace project and run it on an Android device if one is attached. Note that Android APIs and AVDs must be installed and the IDE correctly configured to use the Android SDK for this option to execute successfully.

Run on an Android emulator

In the Project Explorer view, right-click the project name and click Run AsRun on Android Emulator. This option calls the external Android SDK to package the workspace project and run it on the Android emulator. Note that Android APIs and AVDs must be installed and the IDE correctly configured to use the Android SDK for this option to execute successfully.

Run on iOS Simulator

In the Project Explorer view, right-click the project name and click Run AsRun on iOS Emulator. This option calls the external iOS SDK to package the workspace project into an XCode project and run it on the iOS Simulator.

Run with CordovaSim

In the Project Explorer view, right-click the project name and click Run AsRun with CordovaSim. This opens the application in CordovaSim, which is composed of a BrowserSim simulated device and a device input panel.


Note

JavaScript output for applications running on CordovaSim, including error messages, can be reviewed in the Console view.

Run configurations inform simulators how to run the application associated with a project. Hybrid Mobile Tools generates a default run configuration for a project the first time it is run by a specific simulator. This default run configuration is simulator-specific and named according to the project name. You can create and customize multiple run configurations for your projects using the Run Configurations manager.

The information below details how to manage run configurations using the Run Configurations manger. To open the Run Configurations manger for a project, in the Project Explorer view right-click the project name and click Run AsRun Configurations. Note that run configurations are organized by simulator within the Run Configurations manager, namely CordovaSim, Android and iOS Simulator.


Create a run configuration

From the list of run environments, right-click the simulator and click New. Complete the fields as appropriate. To save the new run configuration, click Apply.

View and edit a run configuration

From the list of run environments, expand the simulator. This shows a list of the run configurations associated with the simulator.

Details for a run configuration are organized in tabs. All simulators have the same Common tab. These options include where to save the run configuration information and how standard input and output are managed. Additional customizable options vary according to simulator:

  • For Android, you can specify details about the virtual device to be used by the emulator and the values of environment variables. Additionally, you can customize which of the information returned by the Android emulator is shown in the IDE console.

  • For CordovaSim, you can customize default values including the location of the root folder containing key device-independent files, the application start page opened when CordovaSim starts, and the server port used by CordovaSim to host the application.

To change the value of any variables listed in the tabs, click the appropriate field and edit the content. To save changes, click Apply.

Run an application using a run configuration

From the list of run environments, expand the simulator and select a run configuration. Click Run. This starts the simulator, which runs the application associated with the project using the specified configuration settings.

Hybrid Mobile Tools provides actions for exporting workspace projects from the IDE. Projects can be exported as native projects and ready-to-sign applications, as detailed in the procedure below.

OpenShift is Red Hat's Platform as a Service (PaaS) for applications. It consists of an application platform in the cloud, enabling you to build, test and run applications in a cloud architecture. OpenShift provides disk space, CPU resources, network connectivity, and a runtime environment.

OpenShift is available in three versions: OpenShift Online, Enterprise and Origin. OpenShift Online is the public cloud offering, with free and paid plans, hosted at https://openshift.redhat.com. OpenShift Enterprise is the private cloud offering, obtained through a Red Hat OpenShift subscription and hosted in a private data center. OpenShift Origin is the community and local cloud offering, available to download and install locally for development and testing purposes.

OpenShift has a number of key features to assist you in developing and deploying applications:

  • Unique domain names, or namespaces, support the hosting of your applications. A user account provides you with access to domains, the latter having the potential to be associated with multiple applications.

  • Numerous cartridges give you access to predefined build and runtime environments with popular languages, database and management frameworks. OpenShift can also be extensively customized with the Do-It-Yourself (DIY) cartridge.

  • Different sized gears provide RAM and disk space for your applications and cartridges. You can use a set number of small gears as part of OpenShift Online with Free Plan, a free OpenShift user account, and extend to more gears and bigger gears with OpenShift Online with Silver Plan or OpenShift Enterprise.

  • Built-in administrative and stack management frees you up to focus on code development. OpenShift manages the intricate details of deploying your application to the stack and interfacing with middleware technologies for you.

  • Automatic or manual scaling of the resources supporting your applications ensures that application performance does not suffer as usage increases. OpenShift can create additional instances of your application across more gears and enable clustering.

OpenShift can be accessed via the web interface at https://www.openshift.com/ on the OpenShift website or via the OpenShift command line interface.

Once you have an OpenShift user account, you can connect to OpenShift and then create domains and applications. The procedure below guides you through connecting to OpenShift for the first time in the IDE.

Procedure 8.1. Connect to OpenShift

  1. In the OpenShift Explorer view, click the Connect to OpenShift icon .

  2. Complete the fields and options as detailed:


  3. Click Finish for OpenShift Tools to connect to OpenShift.

    1. If your credentials are incorrect, the Sign in to OpenShift wizard remains open for you to change your authentication information.

    2. If you selected for your password to be saved, you are prompted to enter your secure storage password or, if this is your first use of secure storage, you are prompted to set a secure storage password.

    Once your credentials are verified as correct, the wizard closes and a live OpenShift connection is listed in the OpenShift Explorer view.


When you close the IDE, any live OpenShift connections will be disconnected but they can be easily reestablished. OpenShift Tools lists previous connections in the OpenShift Explorer view until cleared by you. In the OpenShift Explorer view, double-click or expand the appropriate connection to open an automatically completed connection wizard. Type your password or, if using the saved password facility, the master password and click Finish.

SSH keys are essential when working with OpenShift. They enable you to develop and access deployed applications. SSH keys are also used to control access of other contributors to your OpenShift applications. SSH keys must be uploaded to the OpenShift server and, as detailed in the procedure below, OpenShift Tools can assist with both the generation and uploading of SSH keys to OpenShift.

Procedure 8.2. Generate and Upload SSH Keys to OpenShift

  1. In the OpenShift Explorer view, right-click the connection and click Manage SSH Keys.

  2. To create a new SSH private-public key pair, click New.

  3. Complete the fields and options as detailed:

    • In the Name field, type a name for the key pair that will be used by OpenShift to distinguish this key pair from others associated with your account.

    • From the Key Type list, select SSH_RSA.

    • Ensure the SSH2 Home field contains the location where you want to create the files associated with the key pair. To change the location, clear the Default check box and click Browse to navigate to the desired location.

      Note

      The default location for creating SSH key files is determined by the SSH information for the IDE. The default location can be altered by clicking WindowsPreferences, expanding GeneralNetwork Connections, selecting SSH2 and changing the location in the SSH2 home field of the General tab.

    • In the Private Key File Name field, type a name for the private key file.

    • In the Private Key Passphrase field, type a passphrase for use in accessing the private key. This field is not mandatory and can be left empty if you want.

    • In the Public Key File Name field, type a name for the public key file. Typically the file name of the public key is that of the private key with .pub appended.


  4. Click Finish. The SSH key pair is generated and the public key automatically uploaded to OpenShift.

  5. Click OK to close the Manage SSH Keys window.

OpenShift Tools provides actions for managing the SSH keys of your OpenShift account.

Upload an existing public SSH key to OpenShift

In the OpenShift Explorer view, right-click the connection and click Manage SSH Keys. Click Add Existing. In the Name field, type a name for the key that will be used by OpenShift to distinguish the key from others associated with your account. Click Browse to navigate to and select the public key file. Click Finish and click OK to close the Manage SSH Keys window.

You must also inform the IDE of the location of the private key file. Click WindowPreferences, expand GeneralNetwork Connections and selecting SSH2. Click Add Private Key and locate the private key file. Click Apply and click OK to close the Preferences window.

Remove a public SSH key from OpenShift

In the OpenShift Explorer view, right-click the connection and click Manage SSH Keys. From the SSH Public Keys table select the key you want to remove from your OpenShift account and click Remove. At the prompt asking if you are sure you want to remove the key, click OK. Click OK to close the Manage SSH Keys window.

Refresh the SSH key information associated with OpenShift

In the OpenShift Explorer view, right-click the connection and click Manage SSH Keys. Click Refresh and click OK to close the Manage SSH Keys window. It may be necessary to use this action if you make changes to your OpenShift SSH key settings through the OpenShift web interface while the IDE is open with a live OpenShift connection.

OpenShift Tools provides actions for managing the domains of your OpenShift account.

OpenShift Tools provides the OpenShift Application wizard to assist you in creating and deploying OpenShift applications.

As detailed in the procedure below, OpenShift applications can be created using three sources: an existing workspace project, a Git source or a default project template. For an existing workspace project, the wizard merges the existing project contents with the key metadata files from a new OpenShift application so that the application can be deployed on OpenShift. For a Git source, the wizard uses the source as the new OpenShift application so the source must be OpenShift-enabled, namely have a .openshift directory and have the openshift profile specified in the pom.xml. For a project template, the templates are provided by OpenShift.

In addition to deploying your OpenShift applications, the wizard assists you in setting up linked remote (OpenShift server) and local Git repositories containing the original and clone of your project, respectively. You can then push project changes to OpenShift via Git or allow the OpenShift server adapter to do it for you.

Procedure 8.4. Create and Deploy an Application on OpenShift

  1. In the OpenShift Explorer view, right-click the connection or domain and click NewApplication. Alternatively, in JBoss Central click OpenShift Application, after which you are prompted to select an OpenShift connection and provide your user authentication information.


  2. If you do not have a domain associated with the connection, the wizard prompts you to create one. In the Domain Name field, type the name of the domain you would like to use and click Finish. Domain names must be unique so if the name you have chosen is already in use you will see a warning. In this case, choose another name and try again until you have a unique one.

  3. Complete the fields and options about the OpenShift application as detailed:


  4. Click Next.

  5. Complete the fields and options as detailed:

  6. Click Next.

  7. The Git Clone Destination field shows the location to be used for the local Git repository. The location must already exist to be able to proceed with the wizard. To change the location, clear the Use default clone location check box and type the location in the Git Clone Destination field or click Browse to navigate to the location.


  8. Click Finish. If you are prompted that the authenticity of the host cannot be established and asked whether you want to continue connecting, check that the host name matches that of your application and domain and click Yes.

  9. At the prompt asking if you want to publish committed changes to OpenShift, click Yes. The progress of the application creation process is visible in the Console view.

Once created, the application is listed under the connection and domain in the OpenShift Explorer view. The application type proceeds the application name. The project is also listed in the Project Explorer and Git Repositories views, where the details proceeding the application name indicate the current Git branch and status compared to the remote repository. Additionally, the server adapter for the application is visible in the Servers view.

All applications deployed on OpenShift are listed under live connections in the OpenShift Explorer view. But only the project files of OpenShift applications created through the IDE are immediately available in the Project Explorer and Git Repositories views. If you want to work on the project files associated with an application, you must first import the application. OpenShift Tools can assist you to import your deployed OpenShift applications into the IDE, as detailed in the procedure below.

Procedure 8.5. Import an OpenShift Application

  1. Click FileImport, expand OpenShift and double-click Existing OpenShift Application. Alternatively, in the OpenShift Explorer view, right-click the application and click Import Application.

  2. Complete the fields and options as detailed:

    • From the Domain list, select the domain of the application.

    • Ensure the Use existing application check box is selected and type the name of the application in the text field. This field has an automatic completion feature to assist you in typing the application name or click Browse to see a list of all of your applications associated with the domain.

      Important

      Project names in the IDE workspace must be unique. If the name of the application you want to import is identical to an existing project in the workspace, the OpenShift Tools will not complete the import. To work around this constraint, you can import the OpenShift application to another workspace or change the name of either the conflicting project or application.


  3. Click Next.

  4. Complete the fields and options as detailed:

  5. Click Next.

  6. The Git Clone Destination field shows the location to be used for the local Git repository. The location must already exist to be able to proceed with the wizard. To change the location, clear the Use default clone location check box and type the location in the Git Clone Destination field or click Browse to navigate to the location.

  7. Click Finish. If you are prompted that the authenticity of the host cannot be established and asked whether you want to continue connecting, check that the host name matches that of your application and domain and click Yes.

  8. OpenShift Tools modifies the .gitignore file on importing the application. At the prompt asking if you want to publish committed changes to OpenShift, click Yes. The progress of the import process is visible in the Console view.

Once imported, the project is listed in the Project Explorer and Git Repositories veiws, where the details proceeding the application name indicate the current Git branch and status compared to the remote repository. Additionally, the server adapter for the application is visible in the Servers view.

In order to easily publish changes to a deployed OpenShift application, each application needs a server adapter. The OpenShift Application wizard can automatically generate server adapters for new or imported OpenShift applications if you select the Create and set up a server for easy publishing check box. But OpenShift also provides an action to assist you in generating server adapters for OpenShift application that already exist in the IDE, as detailed in the procedure below. You can use this action if you need to regenerate a deleted server adapter for an OpenShift application or if you create or import an OpenShift application and do not select the Create and set up a server for easy publishing check box.

Procedure 8.6. Generate a server adapter for an application

  1. In the OpenShift Explorer view, right-click the application and click Create a Server Adapter.

  2. Complete the fields and options as detailed:

    • From the list of server types, expand OpenShift and select OpenShift Server.

    • The Server's host name and Server name field are automatically completed. The Server's host name field contains the host name of the server and the Server name field contains the name by which the server adapter is know in the Servers view. You can edit these values as appropriate by typing in the fields.


  3. Click Next.

  4. Complete the fields and options as detailed:


  5. Click Next.

  6. From the Available list, select the project for which the server adapter is being generated and click Add. The application is now listed under Configured.

  7. Click Finish for OpenShift Tools to generate the server adapter. Once generated, the server adapter is listed in the Servers view.


OpenShift Tools provides actions for viewing deployed OpenShift applications and information about them.

View a deployed application

In the OpenShift Explorer view, right-click the application and click Web Browser. A browser tab opens displaying your deployed application. Alternatively, in the Servers view, right-click the server adapter for the application and click Show InWeb Browser.

View information about an application

In the OpenShift Explorer view, right-click the application and click Details. The displayed information includes the public URL of the application, application type, and remote Git repository location. Click OK to close the Details window.


View output from the OpenShift server

In the OpenShift Explorer view, right-click the application and click Tail files. Alternatively, in the Servers view right-click the server adapter of the application and click OpenShiftTail files. The Tail Log Files window opens, with either the default retrieval syntax or last used syntax for this application in the Tail options field.

To change the retrieval command, in the Tail options field type the appropriate syntax. To specify the gears for which to show the server logs, from the table select the check boxes of the appropriate gears. Click Finish for OpenShift to retrieve the output, which is displayed in a distinct Console view for each gear.


View values of variables associated with an application

In the OpenShift Explorer view, right-click the application and click All Environment Variables. Variable names and values are listed in the Console view. Alternatively, in the Servers view, right-click the server adapter of the application and click OpenShiftAll Environment Variables.


View properties of cartridges associated with an application

In the OpenShift Explorer view, right-click the cartridge and click properties. The Properties view opens and lists information about the cartridge.

View information about the server of an application

In the Servers view, double-click the server adapter for the application. A Server Editor opens, enabling viewing and editing of server details. To save any changes, press Ctrl+S or click FileSave or click the Save icon.

Refresh information about an application

In the OpenShift Explorer view, right-click the connection, domain, application or cartridge and click Refresh. Information is retrieved from OpenShift and the OpenShift Explorer view is updated as appropriate. This action is useful if you are simultaneously making changes in the IDE and the OpenShift web interface or command line interface to your domain and applications. Additionally, it may be used to recover from errors.

OpenShift Tools provides actions for developing and managing deployed OpenShift applications.

Upload modifications to a deployed application

In the Servers view, right-click the server adapter for the application and click Publish. At the prompt asking if you want to publish to OpenShift by committing changes to Git, you can customize the default commit message Commit from JBoss Tools. Click Yes and the changes, together with the commit message, are pushed to the remote Git repository. Additionally, the application is automatically updated on the OpenShift server and the Console view displays OpenShift server output.

Edit environment variables associated with an application

In the OpenShift Explorer view, right-click the application and click Edit Environment Variables. Click Add, Edit or Remove to customize the environment variables. Click Finish to close the window.

Add or remove markers associated with an application

In the Project Explorer view, right-click the application and click OpenShiftConfigure Markers. Select or clear the check boxes of markers as desired. Information about markers is given in the Marker Description section of the Configure OpenShift Markers Window. Click OK for your marker choice to be applied to the application.


Add or remove cartridges associated with an application

In the OpenShift Explorer view, right-click the application and click Edit Embedded Cartridges. Select or clear the check boxes of cartridges as desired. Click Finish for your cartridge choice to be applied to the application. You are prompted if the cartridges you have chosen to add or remove require further action, such as the addition of prerequisite cartridges or removal of conflicting cartridges. You can choose to ignore or apply the suggestions of the prompt.


Restart an application

In the OpenShift Explorer view, right-click the application and click Restart Application. Alternatively, in the Servers tab right-click the server adapter of the application and click OpenShiftRestart Application.

Forward remote ports

You can forward the remote ports of the OpenShift server to your system to enable access to various services, such as MySQL. Port forwarding is available for all OpenShift applications, including scalable ones.

In the OpenShift Explorer view, right-click the application and click Port forwarding. Alternatively, in the Servers view right-click the server adapter of the application and click OpenShiftPort forwarding.


After checking the authenticity of SSH keys, the Application port forward window opens. Before commencing port forwarding, there are a number of options you can set:

  • By default, the local address is 127.0.0.1. If this is unavailable, a random available address is allocated. To set the local address to be the same as the remote address, clear the Use '127.0.0.1' as the local address for all Services check box.

  • By default, the local port numbers are the same as the remote port numbers. To set independent local port numbers, select the Find free ports for all Services check box.

To commence port forwarding, click Start All. Click OK to close the Application port forward window.

Delete a server adapter for an OpenShift application

In the Servers view, right-click the server adapter for the application and click Delete. At the prompt asking if you are sure you want to delete the server adapter, click OK.

Delete an application

In the OpenShift Explorer view, right-click the application and click Delete Application. At the prompt asking if you are sure you want to destroy the application, select OK. The progress of the deleting process is shown in the activity bar in the lower right of the IDE window. To open the Progress view and see more detailed progress information or cancel the deleting process, double-click on the activity bar.

OpenShift Tools enables you to debug your deployed OpenShift applications within the IDE through port forwarding. A number of configuration steps are required both locally and remotely to achieve this. You must first set the Enable JPDA (Java Platform Debugger Architecture) marker in your application source code that configures the virtual machine running the server on which your application is deployed for debugging. You must then configure port forwarding for the local and remote debug ports and connect the IDE debugger. The procedures below guide you through each of these configuration requirements and must be completed in the order given.

Revision History
Revision 1.0.0-1Thu Mar 20 2014Michelle Murray
Built from Content Specification: 22477, Revision: 622892 by mmurray