Top Banner
UKLUG 2012 Cardiff, Wales @zeromancer1972 21.+22.09.2015 1 Oliver Busse The Workflow in Bluemix Development “Out of the Blue”
66

Out of the Blue - the Workflow in Bluemix Development

Jan 22, 2018

Download

Software

Oliver Busse
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20151

Oliver Busse

The Workflow in Bluemix Development

“Out of the Blue”

Page 2: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20152

Promise

No coding (Code? Yes, maybe) – but tools

Page 3: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20153

Agenda

Introduction

Glossary

Tools used

Start on Bluemix

Continue on your PC

XPages on Bluemix – the basics

Extending XPages with Plugins – on Bluemix

Page 4: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20154

Introduction

Oliver Busse

• „Bleeding Yellow“ since R4.5

• Certified Lotus Instructor since 2001

• IBM Champion for ICS in 2015

• OpenNTF Contributor Director

• XPages Advocate

• IBM Bluemix curious

Page 5: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20155

Glossary – what is…?

• Bluemix?• PaaS (platform only, no software preconfigured, based on CloundFoundry)

• a Runtime?• Environment in which your application will run

• a Service?• Functionality for your application e.g. Database, Security, Watson or „Internet of

Things“

• DevOps?• „Development & Operations“, tools for testing, building and deploying apps

• JazzHub?• Repository for your application source code, issue tracking and documentation

• a Stage?• block in DevOps‘ deployment process

• a Pipeline?• combination of stages when deploying an application

• the CF-Tool?• CloudFoundry command line tool, manage your application via the console

Page 6: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20156

Tools used in this presentation

• Git-SCM

• common source code control system

• CMDER with inline Git

• Powerful command line replacement with Git support

• Eclipse

• IDE for Java Developers

• Bluemix Plugin

• Deployment console for Eclipse on Bluemix

• Websphere Liberty Profile (WLP)

• Local application server runtime

• CF Commandline Tool

• CloudFoundry command for deploying apps

• Extlib v14 / Bluemix plugin for Domino Designer

Page 7: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20157

Start on IBM Bluemix

Page 8: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20158

Start on Bluemix

Page 9: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.20159

Choose application type „WEB“

Page 10: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201510

Choose a runtime

Page 11: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201511

Let Bluemix do the work…

Wait until the application is created

The following page shows some basic information about the

runtime and lets you download a sample application code

You can download this code and start over with it

We don‘t download the starter code

We are creative for ourselves

Page 12: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201512

Read the intro and scroll down

Page 13: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201513

Add a Git repository

Page 14: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201514

Don‘t use the starter code

Uncheck this!

Page 15: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201515

Check the repository

You will also receive an email that tells you about your new repository on JazzHub

Page 16: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201516

Edit code: with DevOps

Page 17: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201517

Create and edit your code locally

The starter code give you a basic example of a project

DevOps code editors are versatile and flexible

Helps you to start over without installing anything on your PC

• Editing your code with a local IDE is of course more

convenient though

• You can preview your changes much faster on your local

server

• You can use 3rd party tools and add-ons in your IDE

but...

Page 18: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201518

Clone the (empty) repository

Using the Git

command line

The folder with

the repository

will be created

automatically

Page 19: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201519

Continuing on your local PC

Install/setup your IDE, e.g. Eclipse

Create a new or use an existing project

Make sure you place the project files in the prior created

repository folder on

your disk

For a simple JSP/JSF

based web app you

can also use my

boilerplate

https://bitbucket.org/zeromancer1972/bluemix-liberty-boilerplate

Page 20: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201520

Verify project structure, use the project

Check the extracted files (overwrite files

from the ZIP if you are asked for it)

Import the project into Eclipse

Download the IBM Bluemix plugin and the

Websphere Liberty Runtime from Eclipse

Marketplace

Test run the app on the local WLP server

Page 21: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201521

Importing the project into Eclipse

Page 22: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201522

Importing the project into Eclipse

Notice the arrows in the folder tree. Theysay „hey, I am not up-to-date in the Gitrepository, yet“. The question marks say„hey, I am not part of the repo, yet – addme!“

Page 23: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201523

Push changes to Bluemix

The imported project is a „change“ in the repository

You have to commit these changes to the repository

Then push the changes to Bluemix DevOps

-A = Add just all changes

-m = your commit message

upload the commit to DevOps

Page 24: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201524

Setting up the build and deploy pipeline

Just hit the „play“ button as our

demo is using ANT build*. For

other configurations hit the gear

icon

*) ANT is the default build system in DevOps

Page 25: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201525

Watch Bluemix DevOps doing the work

Building process

Deploying process

All green –Finished!

Page 26: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201526

Show log output during build and deployment

Just click here to see a

detailed log output

Page 27: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201527

Log outputs during „staging“

Page 28: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201528

Test the deployed app

• Open the URL of your application

• Remember: URLs for both data centers

are different:

• myapp.nybluemix.net (US)

• myapp.eu-gb.mybluemix.net (UK)

Continue to make changes and bring your app to „life“.

Happy coding!

Page 29: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201529

Continue on your PC

Page 30: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201530

Using the Bluemix Eclipse plug-in

Get the plug-in and install it in your Eclipse IDE

Once you set it up you‘ll find the plug-in in the server tab in

Eclipse

If the server tab isn‘t displayed then open it with „Window,

Show View, Server“ or „Other“ and search for it

Usually you start with a new project and deploy without using

the Bluemix browser UI

Page 31: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201531

Setting up the Bluemix plug-in

Double click on the entry in the server tab to open the

configuration*

*) https://developer.ibm.com/wasdev/downloads/#asset/tools-IBM_Eclipse_Tools_for_Bluemix

Page 32: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201532

Adding a complete new application to Eclipse

Get a sample project or create a new Java WLP project

If you use an existing project, import it into Eclipse

Add it to the IBM Bluemix plug-in (RMB, „Add and Remove“)

Setup application name and domain for the application

Check the console

*) A simple JSP application can be found here: https://bitbucket.org/zeromancer1972/bluemix-word-counter/downloads

Page 33: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201533

Add the application to the Bluemix plug-in

Page 34: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201534

Setting application properties for Bluemix

Page 35: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201535

Check the console

This is what we are

looking for!

Page 36: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201536

Check the Dashboard

A new application

was created!

Page 37: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201537

View the result

Page 38: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201538

XPages on Bluemix

Page 39: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201539

Preparations & Considerations

Update your Notes/Domino Designer to 9.0.1

Get the latest Extension Library (V14, August 2015)

Install the Extlib in DDE and on your local Domino server

(updatesite recommended)

Think different: separate the design from the data

• create a copy of your application that contains the design only on your local server

It‘s easier to start with an existing application

• use the demo app or use your own!

And: remember the !! notation

Page 40: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201540

Architecture & Ingredients

NSF

Design

XSP Runtime

NSFNSF

NSF

Data

Domino NoSQL Service

Page 41: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201541

Preparations (continued)

Create a Domino NoSQL Service

Grab your Bluemix Notes-ID

Setup a location document for Bluemix

If you don‘t have access to your local server‘s certifier ID then

create a separate local Domino server

• cross-certify the Bluemix Notes-ID on this machine

• always use the Bluemix Notes-Id during development

Or: use your default Notes-ID for development

• sign the applications prior to deployment on Bluemix with

the Bluemix Notes-ID

Page 42: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201542

Creating the Domino NoSQL Service

Page 43: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201543

Creating the Domino NoSQL Service

Page 44: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201544

Gathering Domino‘s information & your ID

Download the ID file

Notice the NSF filename!

Page 45: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201545

Deployment process: the data part

Test the connection to the Bluemix Domino server

• It‘s name is „slaney/Bluemix“* under the IP you just saw

• Just hit CTRL+O and type in the IP

• A connection document will be created automatically

Create a copy of your data NSF on the Bluemix Domino server

Tweak the ACL

Create other web users via the Domino dashboard

*) Texas Datacenter, in the UK Datacenter the server is named lagan/Bluemix

Page 46: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201546

Hello, Domino

Page 47: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201547

Current Restrictions

No access to names.nsf

No access to DDM

No access to log.nsf

No admin access, no console access

No authentication to names.nsf, just ?login

No replicas, just copies allowed

Page 48: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201548

Outlook

Usage of DA

Usage of other LDAP services such as Domino and AD

Replicas

Cross-certification

On-prem access

Page 49: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201549

Deployment process: the design part

Examine your XPages, Custom Controls and SSJS

for static access to the „current“ database

Change all occurrences to a dynamic access to

the data part of your application

• use the Bluemix examples in the documentation

• or: use a bean to compute server !! filepath toyour data NSF (the „DAOBean“ *)

Recommended: separate design from data on your

local development environment, too!

*) http://openntf.org/XSnippets.nsf/snippet.xsp?id=daobean-for-xsp-on-bluemix

Page 50: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201550

Intoducing the BluemixContext

New SSJS object / Java class to access the Bluemix

environment

Provides the DataService object / class

The DataService object / class provides the server and filepath

to the data NSF

import com.ibm.xsp.bluemix.util.context.BluemixContext;import com.ibm.xsp.bluemix.util.context.BluemixContextManager;import com.ibm.xsp.bluemix.util.context.DataService;

public class DAOBean {public String getBluemixFilepath(){

BluemixContext bc = BluemixContextManager.getInstance();DataService ds = bc.getDataService();String serverAndFilePath = ds.getServerName() + "!!" + ds.getAppPath();return serverAndFilePath;

}}

Page 51: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201551

Example: modifying the document data source

<xp:view xmlns:xp="http://www.ibm.com/xsp/core“ xmlns:xc="http://www.ibm.com/xsp/custom"><xp:this.data>

<xp:dominoDocumentvar="document1"formName="frmBookmark"databaseName="#{javascript:dao.getBluemixFilepath()}">

</xp:dominoDocument></xp:this.data>

• Assuming that the DAOBean class is defined as „dao“ in faces-

config.xml

• You also should calculate the local server and filepath if not running on

Bluemix

Page 52: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201552

Deploying the design part

You can use the DDE Bluemix plug-in

or

Deploy the application for yourself with the CF tool (aka what

the DDE plugin does)

Page 53: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201553

Use the DDE Bluemix plug-in

Page 54: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201554

Page 55: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201555

Use the CF tool to deploy (what the plug-in does)

Create a folder on your disk

Create a copy (or replica) of your design part database in that

folder (DO NOT encrypt the local copy!)

Create a text file called manifest.yml

• this is the key part!

Don‘t forget to set the web launch option to an XPage!

You should end up with something like this:

Page 56: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201556

manifest.yml

---applications:- name: iconukdemohost: iconukdemoinstances: 1memory: 512Mtimeout: 180buildpack: xpages_buildpackcommand: /app/launch_xpages_webcontainerenv:APP_HOME_URL: /iconukdemo.nsfAPP_PRELOAD_DB: iconukdemo.nsfAPP_VERBOSE_STAGING: 1

services:- IBM XPages NoSQL Database-UK

Name and hostname of your application that

will be used on Bluemix

The NSF filename on your disk

The Domino NoSQL service on your Bluemix

environment

Page 57: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201557

CF tool: 3 steps

Name it whatever you want (or use

an existing applicartion name)

Page 58: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201558

Check application health

Page 59: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201559

Extending XPages with Plugins

Page 60: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201560

Plug-in Examples

OpenNTF Domino API

Bootstrap for XPages

Extension Library Relational

ViewGrid

XPages DebugToolbar

Page 61: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201561

A few steps

Create a folder in the deployment

directory called

shared-plugins

Download the extension

Unzip it until you find the plugins

folder

Copy all JAR files to the folder

shared-plugins

Upload the application with the CF

tool

Page 62: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201562

Observe the plug-in deployment

Page 63: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201563

Resources CMDER http://cmder.net/

Blank Liberty for Bluemix Boilerplate: https://bitbucket.org/zeromancer1972/bluemix-liberty-

boilerplate/downloads

Eclipse: http://www.eclipse.org

IBM Bluemix: http://bluemix.net

Eclipse Bluemix Plugin: https://marketplace.eclipse.org/content/ibm-eclipse-tools-bluemix

XPages Extension Library: http://extlib.openntf.org

OpenNTF Domino API: http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API

Domino NoSQL Service:

https://www.ng.bluemix.net/docs/services/XPagesNoSQLDatabase/index.html#xpservice_portexisting

How-tos: http://XPag.es/?2022 and http://XPag.es/?2026

DAO Bean: http://openntf.org/XSnippets.nsf/snippet.xsp?id=daobean-for-xsp-on-bluemix

CF Tool: https://github.com/cloudfoundry/cli/releases

BB-8: http://www.sphero.com/starwars

Thanks to the IBM Ireland XPages / Bluemix Development Team & Pete Janzen

Page 64: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201564

Q & A

Page 65: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201565

Visit our booth and attend our other sessions:

• Tuesday, 10:20, Room 2

Matthew Fyleman - “Oranges are not the only fruit”

• Tuesday, 13:30, Room 1

Simon Peek - „Need XPages apps fast? Need apps on

Mobile devices? Don’t have XPages knowledge? We4IT

brings you Aveedo!”

Attend this session to win a BB-8 Sphero!

Page 66: Out of the Blue - the Workflow in Bluemix Development

UKLUG 2012 – Cardiff, Wales@zeromancer1972 21.+22.09.201566

Nominate your IBM Champions

http://XPag.es/?202A