Darwino InstallationGuide
Darwino InstallationGuide
Introduction 1.1
Home 1.2
Installation 1.3
Setting Up 1.3.1
2
Introduction
3
Home
Welcome to Darwino!
This guide will show you how to install a development environment to create Darwino
based applications.
4
Installation
Installation
5
Setting Up
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.
Android applications
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.)
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.
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
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
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.
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.
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
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.
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"/>
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
Select your Tomcat environment and eventually change the server name, and hit 'Finish'
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/
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:
Password: postgres
17
Configuring PostgreSQL
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
The Darwino JavaScript assets are distributed through the central NPM registry and
don't require any special configuration.
19
Installing Eclipse
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:
20
Installing Eclipse
2. In the "Work With:" field, enter the following URL, depending on the edition you
selected:
5. In the next window, you'll see a list of the tools to be downloaded. Click Next.
7. If you get a security warning saying that the authenticity or validity of the software
can't be established, click OK.
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:
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
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
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:
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.
Instructions: https://multi-os-engine.org/start/
25
Maven Settings
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:
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
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.
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:
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.
By starting TOMCAT using the Maven plugin. This is the simplest solution to start
with.
By installing the application within a full TOMCAT
31
Running the Contacts Samples
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.
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:
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.
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
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-
39
Running the News Samples
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
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
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.
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:
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
Then run the app by right clicking the application and select 'Run As... Android
Application' or 'Run As...iOS xxx' depending on your platform.
46
Creating a new Darwino Project
Adding business logic Business logic can be added to the shared project
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:
That should list any available signing profiles, and valid ones will contain "iPhone
Developer" or "iOS Development".
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
50