KEMBAR78
Darwino InstallationGuide | PDF | Eclipse (Software) | Postgre Sql
0% found this document useful (0 votes)
26 views50 pages

Darwino InstallationGuide

The Darwino Installation Guide provides detailed instructions for setting up a development environment for Darwino applications, including installation of required tools like Java JDK, Eclipse, and PostgreSQL. It outlines configurations for various servers such as Apache Tomcat and IBM Websphere Liberty, as well as the necessary steps for setting up NodeJS and NPM. The guide emphasizes the importance of using the Darwino Studio for easier installation and validation of the development environment.

Uploaded by

mihai.andreicut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views50 pages

Darwino InstallationGuide

The Darwino Installation Guide provides detailed instructions for setting up a development environment for Darwino applications, including installation of required tools like Java JDK, Eclipse, and PostgreSQL. It outlines configurations for various servers such as Apache Tomcat and IBM Websphere Liberty, as well as the necessary steps for setting up NodeJS and NPM. The guide emphasizes the importance of using the Darwino Studio for easier installation and validation of the development environment.

Uploaded by

mihai.andreicut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Table of Contents

Introduction 1.1
Home 1.2

Installation 1.3

Setting Up 1.3.1

Configuring TOMCAT 1.3.1.1


Configuring IBM Websphere Liberty 1.3.1.2
Configuring PostgreSQL 1.3.1.3

Configuring NPM 1.3.1.4


Installing Eclipse 1.3.2

Maven Settings 1.3.2.1


Getting Started 1.4
Running the Contacts Samples 1.4.1

Running the News Samples 1.4.2


Running the Domino Discussion Samples 1.4.3
Creating a new Darwino Project 1.4.4

Packaging Mobile Applications 1.5


iOS Applications 1.5.1

2
Introduction

Darwino Installation Guide

3
Home

Welcome to Darwino!
This guide will show you how to install a development environment to create Darwino
based applications.

To get started, go to Setting Up page.

4
Installation

Installation

5
Setting Up

Setting Up Your environment


Darwino is a flexible development platform that supports IDE or command line based
development. The platform itself is built using Apache Maven. Maven is also the
recommended build tool for Darwino applications, but other systems can also be used,
including Gradle, Eclipse PDE, etc. The following instructions assume that you are
using:

Eclipse J2EE as your IDE

Maven as your build tool.

NodeJS and NPM for JavaScript client development

Unless specified otherwise, all the installation instructions assume a Microsoft Windows
environment, with the software being installed on c:\Darwino . However, most of the
instructions work identically on other platforms such as Apple macOS or Linux.

Darwino currently supports the following target platforms:

Web applications through a Java EE server

Android applications

Apple iOS applications

OSGi environments, like Eclipse rich client or IBM Domino

Notes: Based on Apple requirements, an Apple Mac computer running macOS is


required for developing Apple iOS applications. Currently, only Android applications can
be developed and tested using Microsoft Windows or Linux.

Darwino Installation
In order to develop with the Darwino Studio, the following components should be
installed:

Java JDK: The minimum version is Java 7, but it is advised to use the latest one
(Java 8 as of today)
Eclipse for J2EE or other IDE
Web application server is required to run the web applications. Although any servlet

6
Setting Up

container 2.5+ would work, these instructions show how to install/run the demo
projects using Apache TOMCAT
Database server: These instructions document the use of Postgres 9.4+ database
server. Although other databases may be used, the demo applications are pre-
configured to work with PostgreSQL. (Note that a future version of Darwino might
use a embedded database and thus this step won't be necessary.)

Also, a few configuration actions has to be taken:

Configure the Maven settings to point to Darwino repository


Configure the NPM settings to point to Darwino repository
Configure the Darwino beans and properties

Note that since Darwino 1.5.1, the Darwino Eclipse studio features a configuration
module that makes the installation process easier. It is highly recommended to use this
helper.

The following instructions describe the installation of each component.

Installing the Java JDK


If you already have Java JDK 7 or higher installed (Java 8 is highly recommended), you
can skip this step.

A full Java JDK is required by the maven tools to compile the Java. A Java JRE is not
sufficient.

The Java SDK can be downloaded from the Oracle web site:
http://www.oracle.com/technetwork/java/javase/downloads/index.html. An IBM JDK will
also work. Once installed, make sure that the development environment variable
JAVA_HOME is pointing to you Java environment. Make also sure that the JVM is
available from the command line (Terminal on macOS or Linux) by using the command
java -version .

7
Setting Up

Installing the Android application


development tools
Developing for the Android platform requires the Android Software Development Kit to
be installed. It is available from: http://developer.android.com/sdk/index.html#Other. The
'SDK Tools only' package is sufficient if you plan to use Eclipse or Maven from the
command line.

Using the SDK manager Android SDK manager, select and install at least the entire
"Android 4.2.2 (API 17)" & "Android 4.4.2 (API 19)" folders.

Additionally, set the path to the Android SDK root (e.g. c:\Android\SDK ) in an
environment variable named ANDROID_HOME . Also do not forget, when installing maven,
to add the android libraries to your local repository, as described in the documentation
on installing Maven. The Studio configuration module will also report an error if this is not
properly defined.

Note: using the stock Android emulator, it is likely that the applications will be too slow to
provide a great developer experience. This is particularly true if you launch the emulator
from a virtual machine. It is then better to run the demo applications on real hardware or
in a faster emulator/virtual machine. See: http://blog.riand.com/2014/08/running-android-
apps-for-development.html

Installing the iOS application development


tools

8
Setting Up

As stated earlier, developing for iOS requires an Apple Mac computer running OS X. To
compile, run in a simulator or deploy the application, the Apple Xcode development
environment is required. It is available freely from the Mac App Store
(https://itunes.apple.com/us/app/xcode/id497799835?mt=12).

PostgreSQL
Postgresql is a free and popular relational database featuring well suited JSON
extensions for Darwino. The instructions bellow show how to install Postgreql for
development and test purposes. Other databases, like IBM DB2 10.5 FP8 or MS
SqlServer 2016, are also supported.

See: Configuring PostgreSQL

Installing Eclipse for J2EE


We advise developers to use Eclipse as the development IDE. Moreover, starting with
Darwino 1.5.1, the Darwino Eclipse plugins feature an installation validation module that
checks for the pre-requisites, and helps fixing the potential issues.

If you plan to use Eclipse, or already do, please ensure that you first ensure that you
follow the [instructions] (Installing Eclipse) for downloading and configuring Eclipse, and
the Darwino Studio Eclipse add-on component. These instructions assume that you
will use the Eclipse for J2EE version (Not Eclipse for Java).

NPM Installation
NPM should be configured to point to the Darwino repository for Darwino libraries,
identified by @darwino.

You should first install NodeJS and NPM following the instructions here:
https://www.npmjs.com/get-npm

Then you should configure NPM to connect to the Darwino private repository. See:
Configuring NPM

Manual configuration

9
Setting Up

These steps are only required if they were not achieved through the Studio configuration
module.

Maven Configuration
Maven should be configured to point to the Darwino repository for Darwino libraries. If
you are using Eclipse, please see the following instructions after installing Eclipse:
Setting Up Maven.

(If you are using the command line tools, then you should first install maven (latest
recommended) and configure it as described in the instructions.)

Apache TOMCAT
Apache Tomcat is a free, easy to use, Java servlet container. The instructions bellow
explain how to configure it for development and test purposes. Any servlet 3.0 compliant
web server can also be used.

See: Configuring TOMCAT

Note that TOMCAT can also be launch from Maven. Most of the demo projects, as well
as the new application wizard, now integrate the TOMCAT Maven plugin. As a result,
TOMCAT can be launched using a maven commend without going though a full
installation: mvn tomcat7:run

IBM Websphere Liberty


Alternatively, you can use IBM Websphere Liberty as the application server, on premises
and on the cloud through IBM Bluemix.

See: Configuring IBM Websphere Liberty

10
Configuring TOMCAT

If you plan to use Tomcat as the development web application server, then you have to
both install it in the file system and eventually configure Eclipse to use it.

Installing Apache Tomcat


Download the latest Tomcat server (8.x or 8.5x) from the Apache Web Site:
https://tomcat.apache.org/download-80.cgi. Just unzip the server under your installation

directory:

If you plan to use the demo applications, then you need to add some demo users with
roles in your tomcat environment. Add the following content to {tomcat install

dir}\conf\tomcat-users.xml :

<role name="user"/>
<user password="darwino" roles="user" username="atinov"/>
<user password="darwino" roles="user" username="amass"/>
<user password="darwino" roles="user" username="aboucher"/>
<user password="darwino" roles="user" username="acalder"/>
<user password="darwino" roles="user" username="agardner"/>
<user password="darwino" roles="user" username="bchapot"/>
<user password="darwino" roles="user" username="blemercier"/>
<user password="darwino" roles="user" username="bchris"/>
<user password="darwino" roles="user" username="bbright"/>
<user password="darwino" roles="user" username="larmatti"/>
<user password="darwino" roles="user" username="lbros"/>
<user password="darwino" roles="user" username="mdavis"/>
<user password="darwino" roles="user" username="pcollins"/>
<user password="darwino" roles="user" username="rjordan"/>

Configuring Eclipse with Tomcat

11
Configuring TOMCAT

Eclipse J2EE comes with a set of tools called WTP, which allows the configuration and
use of application servers. To configure Apache TOMCAT, you have to create a new
'Runtime Environment' from the Eclipse 'Window->Preferences...':

Once the runtime environment is configured, you should create a new server. For this,
you should either make visible the Eclipse 'Servers' view (Window->Show
View...Servers) or switch to the J2EE perspective (Window->Open Perspective...Java
EE). In the server view, create a new server by hitting the link bellow. If the view displays

12
Configuring TOMCAT

a list instead, right click and select 'New->Server...'

Select your Tomcat environment and eventually change the server name, and hit 'Finish'

Download the darwino-beans.xml and darwino.properties files to the Tomcat install


directory.

13
Configuring TOMCAT

Now you have your server ready for the Darwino applications

14
Configuring IBM Websphere Liberty

If you plan to use IBM Websphere Liberty as the development web application server,
then you have to install it and configure the Eclipse accordingly. The easiest is to drop
the install site to the Eclipse toolbar, as explained here:
https://developer.ibm.com/wasdev/getstarted/

Configuring Eclipse with IBM Websphere


Liberty
Eclipse J2EE comes with a set of tools called WTP, which allows the configuration and
use of application servers. To configure WAS Liberty, you have to create a new 'Runtime
Environment' from the Eclipse 'Window->Preferences...':

Download the darwino-beans.xml and darwino.properties files to the Webphere Liberty


install directory, under /etc (if the optional directory does not exist, just create it).

15
Configuring IBM Websphere Liberty

Now you have your server ready for the Darwino applications

16
Configuring PostgreSQL

PostgreSQL is a free, open source database with great capability. It is particularly suited
to Darwino because, since 9.4, it features a native JSON data type with query
capabilities. Moreover, it comes with an integrated full text search engine.

Installing PostgreSQL
If you just started with PostgreSQL, the we strongly advise you to run one of the
predefined installers. See: http://www.postgresql.org/download/. Please, choose the
latest version, or at least version 9.4.

By default, the pre-packaged Darwino configuration files (see: TOMCAT installation) look
for a PostgreSQL database on the local host using the user/password and port below:

Port: 5432 (default)


Username: postgres

Password: postgres

Configuring PostgreSQL for the Demo


Application
The demo projects use a specific database called dwodemo , which should be created by
either using the PostgreSQL command line tools, or the easiest UI admin 'pgAdmin III',
installed by the PostgreSQL installer.

Here are the steps:

1. Launch pgAdmin III


2. Right click on the server and select 'Connect'. If asked, enter the password
'postgres'

17
Configuring PostgreSQL

3. Right click on the database and select 'New Database...'

4. Name it dwodemo and hit ok. All the other default settings

Once done, you should see the database created after double clicking it in the list:

18
Configuring NPM

Basic NPM Settings


Darwino requires NodeJS and NPM to compile the new generation of JavaScript
applications.

The Darwino JavaScript assets are distributed through the central NPM registry and
don't require any special configuration.

19
Installing Eclipse

Installing the Eclipse IDE


Although the use of an IDE, and in particular Eclipse, is not a requirement, it certainly
eases the development of Darwino applications. In particular, it also helps validate that
all the requirements are met (installed software, configuration files...)

In order to configure web servers and get the best web development experience, please
download and install the latest version of 'Eclipse IDE for Java EE Developers‘ (NOT
Eclipse IDE for Java Developers). http://www.eclipse.org/downloads/

Darwino run best with the latest Eclipse version, currently Neon-1. Although it has been
tested with earlier versions like Mars-1, the maven integration definitively works best with
Neon.

Installing Eclipse is achieved by unzipping the archive in its target directory. The
following directory structure shows eclipse unzipped into the c:\Darwino directory:

Launching Eclipse for the first time


When Eclipse is launched for the first time, it prompts for a workspace directory. The
default value is fine, but well, you could also make this directory a peer of the eclipse
one, to get the whole environment contained within c:\Darwino :

20
Installing Eclipse

Installing the Darwino Studio add-on


The first module to install is the Darwino Studio. Bellow are the instructions:

1. Select Help > Install New Software.

2. In the "Work With:" field, enter the following URL, depending on the edition you
selected:

Enterprise Edition: https://eclipse.darwino.com/darwino/studio/enterprise/


Community edition: https://eclipse.darwino.com/darwino/studio/community/
Note that you can also install the nightly builds by using the URLs bellow. The
nightly builds provide access to the latest version, under development

Enterprise Edition: https://eclipse.darwino.com/darwino/studio/enterprise-


nightly/
Community edition: https://eclipse.darwino.com/darwino/studio/community-
nightly/
3. When prompted, enter your Darwino user and password, as provided during the
registration process.

4. In the Available Software dialog, select the Darwino Studio checkbox.

5. In the next window, you'll see a list of the tools to be downloaded. Click Next.

6. Read and accept the license agreements, then click Finish.

7. If you get a security warning saying that the authenticity or validity of the software
can't be established, click OK.

8. When the installation completes, restart Eclipse.

Validating the configuration

21
Installing Eclipse

The Darwino studio, once installed, features an installation validation module available
under Window->Preferences / Darwino :

This module checks your environment and gives you guidance on the next actions:

Having Maven settings.xml properly configured


Having the Darwino configuration files at the right place
Making sure that the Eclipse dependencies are installed

Windows Eclipse JRE/JDK


On Windows, Eclipse will sometimes pick up on an installed JRE instead of the full JDK,
which will manifest during a Maven build with a error about not finding a Java compiler.
To rectify this, go to Eclipse's preferences, then Java → Installed JREs :

22
Installing Eclipse

Select the currently-active one, click "Edit…" and point it at a "jdk" directory, usually
within "C:\Program Files\Java":

23
Installing Eclipse

Manually Configuring Eclipse


The configuration validator exposed above should give you all the necessary information
but some details are exposed bellow.

Darwino requires some extra plug-ins bellow to be installed on top of the version of
Eclipse. These plug-ins can generally be installed from the Eclipse Marketplace or by
selecting Help → Install New Software... , then use the provided update site URL

If Android is a desired target platform:

Andmore (successor to Google's ADT), Select Help → Eclipse →

Marketplace... and search for andmore . It will be called something like


"Andmore: Development Tools for Android"
Note: during the process for installing m2e adapters (as with Tycho below), the
m2e adapter for Android may prompt you to install the earlier Android

24
Installing Eclipse

Development Toolkit. If so, and you already have Andmore installed, deselect
those plugins during the m2e setup.
If iOS is a desired target platform:

Multi-OS Engine. The current update site is http://dl.bintray.com/multi-os-


engine/eclipse
If IBM Domino is a desired target platform

The Darwino project wizard as well as the sample applications use Tycho to
target OSGi platforms (Eclipse, IBM Domino...). As a result, it requires the
Tycho m2e connector to be installed. The easiest way to get it installed is to
wait from Eclipse to display a build problem (see bellow), right click on the issue
and choose quick fix. Eclipse will automatically propose to download and install
the connector.

Eclipse Add-ons Information


Darwino Studio

Update site URL: https://eclipse.darwino.com/darwino/studio/enterprise/


https://eclipse.darwino.com/darwino/studio/community/
https://eclipse.darwino.com/darwino/studio/enterprise-nightly/
https://eclipse.darwino.com/darwino/studio/community-nightly/
Andmore (Android Tools)

Install from the Eclipse Marketplace


Multi-OS Engine

Instructions: https://multi-os-engine.org/start/

Update site URL: http://dl.bintray.com/multi-os-engine/eclipse

25
Maven Settings

Basic Maven Settings


Darwino projects require Maven to be properly configured to point to the Darwino
repository. This is best done by modifying Maven's settings file, which is a file called
settings.xml located in the .m2 directory in your home folder.

If you're using Eclipse and this file already exists, you can open it for editing by going to
the Maven → User Settings pane in Eclipse's Preferences and clicking "Open File":

If the file does not yet exist, this link will be absent. In that case, create a new file in a
text editor and, when saving, browse to your home directory (e.g. C:\Users\yourname on
Windows, ~/ on a mac), create a folder named ".m2" (with the leading dot), and save
the file as "settings.xml". If it is a new file, use the following content or merge it with the
existing file. This file can be downloaded here.

Of course, you have to set your own user and password and, depending on the edition
you are willing to use, set the repository URL to:

Enterprise Edition https://maven.darwino.com/darwino-enterprise-edition


Community Edition https://maven.darwino.com/darwino-community-edition These
maven repositories contain both the production builds and the nightly ones (aka
xxxx-SNAPSHOTS)

To validate that your maven settings are correct, display the Maven Repositories view in
eclipse ( Window->Show View->Other... ). Hit the refresh button to make the Darwino
repository appear. Finally, right click on this repository and select Rebuild Index ,. As a
result, you should see the Darwino assets like in:

26
Maven Settings

IBM Domino Specific Settings


If you will be working on Domino-related projects, it is necessary to download and install
and reference the IBM Domino Update Site for Build Management from openntf.org. It
contains the OSGi plugins required by Domino.

The Update Site can be downloaded here. Expand the download zip file and place the
contents in the Java install directory.

In Eclipse Preferences, add the Update Site to the target platform. To do this, under
'Plug-in Development\Target Platform' select the Running Platform and choose 'Edit...'.
In the resulting dialog, choose 'Add...', then 'Directory', then point to the Update Site
directory and click 'Finish'.

27
Maven Settings

The important information to add to your Maven settings is the location of the Darwino
repository, which contains the core Darwino components as well as needed third-party
dependencies.

Here is an example of a complete settings.xml containing the remote repository using


the generic repo accessor username. If your settings.xml file didn't exist previously, you
can use this as the file's contents. If you will be working on Domino-related projects,
change the file path specified in the notes-platform property to your Java directory. If you
will NOT be working on Domino-related projects, you can delete the notes-platform
property altogether.

28
Maven Settings

<?xml version="1.0"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.
org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/
1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>darwino-repository-profile</id>
<properties>
<notes-platform>
file:///*path to Java installation*/DominoBuildManagementUpdat
eSite/UpdateSite
</notes-platform>
</properties>
<repositories>
<repository>
<id>darwino-repository</id>
<name>Darwino Platform</name>
<url>https://maven.darwino.com/darwino-enterprise-edition</url
>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>darwino-repository</id>
<name>Darwino Platform</name>
<url>https://maven.darwino.com/darwino-enterprise-edition</url
>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>darwino-repository-profile</activeProfile>
</activeProfiles>
<servers>
<server>
<id>darwino-repository</id>
<username>[username]</username>
<password>[password]</password>
</server>
</servers>
</settings>

To merge this into an existing settings.xml, the pertinent components are the
<profile>...</profile> block, including the named profile in the activeProfiles ,
specifying the credentials used when accessing the repository, and adding the notes-
platform property (if you will be working on Domino-related projects).

29
Getting Started

Getting Started

30
Running the Contacts Samples

The Contacts sample is a simple project showing the capabilities of the Darwino
platform:

Sample view/form based application


Runs as a web app as well as mobile hybrid on mobile devices
Leverages the UI code generator for the UI

Installing the Contacts application in Eclipse


The Contacts application is provided by the darwino-demo Github repository as a set of
maven enabled projects. To import them in Eclipse once the Git repository has been
cloned, select Import...->Existing Maven Projects and choose darwino-demo/contacts .

The result should be a set of projects in your workspace:

Note: if this is the first project you import, you might be prompted by Eclipse to install
some M2E connectors. If this happens, just install the connectors and reboot Eclipse.

Running the Web Application


There are two ways to run the contact application:

By starting TOMCAT using the Maven plugin. This is the simplest solution to start
with.
By installing the application within a full TOMCAT

The URL to the application is: http://localhost:8080/contacts/mobile/index.html

31
Running the Contacts Samples

The application rendering, with no data, should look like this:

Running the application through Maven


You first have to build the project using Maven. For this, right click on the contacts root
project and select Maven install :

32
Running the Contacts Samples

Once done, right click on the contacts-j2ee project and select Maven build... . In the
goal field, enter tomcat7:run :

If this is the first time TOMCAT is run this way, then all the dependencies will be
downloaded by Maven, which will take a few minutes.

Running the application using Eclipse WTP

This will launch the app in Tomcat and open up the default landing page for the
application.

33
Running the Contacts Samples

Android Applications
The Android application is contacts-android-hybrid . To run it, right-click the project and
choose Run As → Android Application:

iOS Applications
If you are running on a Mac, you can run the iOS application, which is contacts-moe-

native . To do so, right-click on the project and choose one of the Run As → iOS
Simulator App options:

Adding data from IBM Notes/Domino

34
Running the Contacts Samples

If you're an IBM Domino developer, then the Contacts application is a great example for
setting up the replication with an existing NSF database

This assumes that you have some IBM Notes/Domino knowledge and both the Darwino
runtime, as well as the Sync Admin database are properly installed on an IBM Domino
server. It also assumes that the Darwino configuration files (beans ,properties) are
setup, and finally the database JDBC driver in added to the Domino JVM. Be careful, as
the Domino server can be executed as a system user and thus the user.home directory
can be C:\Windows\System32\config\systemprofile .

As a first, create a new NSF based on the template 'DarwinoContacts.ntf. This template
has an XPages UI that you can reach using a URL like:
http://localhost/DarwinoContacts.nsf

Then, from the header bar of the XPages application, click the 'Admin' option and
generate contacts documents by hitting 'Create 500 fake contacts'.

Once done, you can setup the synchronization between the Domino database and the
Darwino one. For this, launch the synchronization admin UI, running on your Domino
server: http://localhost/DarwinoSync.nsf

First, create an adapter: name it contacts to match the Darwino database name.
Generate the definition by clicking 'Generate From Database' and selecting
DarwinoContacts.nsf.

35
Running the Contacts Samples

Once done, create a schedule service for this adapter and the proper Darwino
connection bean:

You can schedule the replication, or execute it once from the main replication service
view. After the replication is run, then the Darwino application should show the data:

36
Running the News Samples

The News applications are an example of a syncing news-reader app with randomly-
generated article content. It contains a J2EE application with two UI examples and which
can act as a remote server for its mobile applications. It also includes pairs of examples
for both Android and iOS: native UIs and hybrid (HTML-based) UIs.

Installing the news application in Eclipse


The new application is provided by the darwino-demo Github repository as a set of
maven enabled projects. To import them in Eclipse once the Git repository has been
cloned, select Import...->Existing Maven Projects and choose parent-dwo-demo-news .

The result should be a set of project in your workspace:

37
Running the News Samples

J2EE Application
The J2EE application is named dwo-demo-news-j2ee . To run it using a configured
Tomcat server inside Eclipse, right-click on the project and choose Run As → Run On
Server:

This will launch the app in Tomcat and open up the default landing page for the
application. In addition to the default JSF-based UI, there is also an Angular-based UI,
which is shared with the hybrid mobile applications.

This application can serve as a central server for replication with the mobile demo apps.

It connects to PostgreSQL for its data storage. By default, it uses the port and
credentials specified on the [[Preparing the Development Environment]] page. If needed,
this can be modified by changing either the

38
Running the News Samples

src/main/resources/darwino_default.properties file in the dwo-demo-commons project


(which affects the other demos as well) or by creating a copy of this file named
src/main/resources/darwino.properties in the dwo-demo-news-j2ee project itself.

Android Applications
The two Android applications are dwo-demo-news-android-hybrid and dwo-demo-news-

android-native . To run either of these apps, right-click the project and choose Run As →
Android Application:

iOS Applications
If you are running on a Mac, you can run the iOS applications, which are dwo-demo-news-

moe-native and dwo-demo-news-moe-hybrid . To do so, right-click on the project and


choose one of the Run As → iOS Simulator App options:

39
Running the News Samples

Connecting to the J2EE App from Mobile


To connect to a running instance of the J2EE application from either the Android or iOS
applications, modify the connection settings in the
src/main/resources/predefined_connections_default.json file in the dwo-demo-commons-

mobile project, replacing {0} with the base URL of your Tomcat server in the first
settings block. For example, where the Tomcat server is "10.0.1.8" and running on port
8081:

{
"enabled": true,
"local": false,
"name": "Local Server - http://10.0.1.8:8081",
"url": "http://10.0.1.8:8081",
"userId": "amass",
"password": "floflo",
"dn": "cn=al mass,o=triloggroup",
"cn": "Al Mass"
}

These settings can also be modified from within the mobile applications when running by
going to the settings for the app, which is available by tapping "Settings" in the bottom-
right corner of the iOS native app and in the top-right drop-down menu otherwise:

40
Running the News Samples

41
Running the Domino Discussion Samples

The Domino Discussion applications are an example of replicating with a standard


Domino NSF-based discussion database.

J2EE Application
The J2EE application is named dwo-demo-dominodisc-j2ee . To run it using a configured
Tomcat server inside Eclipse, right-click on the project and choose Run As → Run On
Server:

This will launch the app in Tomcat and open up the default landing page for the
application.

This application can serve as a central server for replication with the mobile demo apps.

To configure its connection to a Domino server running the Darwino sync service, which
is required for proper usage, modify the src/main/webapp/WEB-INF/web.xml file in the
dwo-demo-dominodisc-j2ee project.

It connects to PostgreSQL for its local data storage. By default, it uses the port and
credentials specified on the [[Preparing the Development Environment]] page. If needed,
this can be modified by changing either the
src/main/resources/darwino_default.properties file in the dwo-demo-commons project
(which affects the other demos as well) or by creating a copy of this file named
src/main/resources/darwino.properties in the dwo-demo-dominodisc-j2ee project itself.

Android Application

42
Running the Domino Discussion Samples

The Android application is dwo-demo-dominodisc-android-hybrid . To run this app, right-


click the project and choose Run As → Android Application:

iOS Application
If you are running on a Mac, you can run the iOS application, which is dwo-demo-

dominodisc-moe-hybrid . To do so, right-click on the project and choose one of the Run As
→ iOS Simulator App options:

43
Creating a new Darwino Project

Although Darwino does not require the use of any IDE to work, the Darwino studio is the
fastest way to get started with a new project.

Using the Darwino Application Wizard


From the Eclipse main menu. select File...New...Project... and the search for Darwino:

Select 'New Darwino Application' hit Next.

For your first project, you can live the default values as is

44
Creating a new Darwino Project

Note: the first generation might take several minutes, as Eclipse is downloading all the
necessary dependencies from the maven repositories. Subsequent runs of the wizard
will be a lot faster :-)

This will create a Darwino Application that can run on a J2EE server, an Android mobile
device and an iOS mobile device. To support all these platforms while sharing code, the
wizard generated several projects in the Eclipse workspace:

Running the Web Application


If you're using a TOMCAT server, then you should add it in Eclipse from the 'Servers'
view. Right click on the server, select 'Add and Remove...'. Select the new application,
add it to the list of configured applications and hit 'Finish'.

45
Creating a new Darwino Project

Then, right click on the server, select 'Publish'. Finally right click another time on the
server and hit 'Start'.

You should be able to hit the application from your browser by using a URL like:
http://localhost:8080/demoapp/main.html

Running the Mobile Applications


Before running the mobile applications, you have to configure the server URL that the
applications are using. This is not required, but heavily recommended to avoid every
single user to have to configure the mobile application. To do this, open the
predefined_connections.json file and ensure that the server address is available from the
device or emulator running the application:

Then run the app by right clicking the application and select 'Run As... Android
Application' or 'Run As...iOS xxx' depending on your platform.

Extending the Generated Application

46
Creating a new Darwino Project

There are different places where the application can be extended

Developing the UI A simple AngularJS based UI is located in the webui project:

Adding business logic Business logic can be added to the shared project

And of course, everything can be customized!

47
Packaging Mobile Applications

Installation

48
iOS Applications

Building the iOS demo application requires a Mac with a valid iOS developer profile
registered via Xcode's Accounts preference panel. To see if your computer has any
active profiles, run:

security find-identity -v -p codesigning

That should list any available signing profiles, and valid ones will contain "iPhone
Developer" or "iOS Development".

Running in the Simulator


To run iOS applications in the simulator, right-click the iOS project in Eclipse and choose
Run As → Multi-OS Engine iOS Application:

To change the device or OS version used in the simulator, choose "Run Configurations"
and select a different target device from the list:

49
iOS Applications

Running on an iOS Device


Running an application on a physical iOS device can be done by adjusting the Run
Configuration as above, but instead choosing a physical device from the list.

50

You might also like