Beyond Domino Designer

Preview:

DESCRIPTION

Presentation on JavaDocs, EMF, Plugin development, Java agent debugging, SourceTree and Perforce P4Merge at DanNotes November 2013

Citation preview

September 2013

Paul Withers

Intec Systems Ltd

Beyond Domino Designer

Paul Withers

• XPages Developer since 2009

• IBM Champion

• Author of XPages Extension Library

• Co-Developer of OpenNTF Domino API

• Developed OSGi plugins for OpenNTF

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Automated Documentation

• No such thing as a free lunch

• But Javadocs can make life easier

• HTML-based navigable package details

• Add <br/> to force line breaks

• Use <ul> and <ol> for lists

• Use <pre> for code samples

What To Document?

• Document parameters and return values

• Add links to other classes

• Mark deprecated classes

• Add version comments

• Make it easier for other developers to consume your code

• Include examples

OpenLog Example

Source

How to Write

• http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html

• @author, @version, @since

• @param, @return, @throws

• {@link class#method()} for links

• Enter HTML to format comments

• Ctrl + Shift + J to autogenerate comment blocks

How to Generate

• Requires Java JDK

• http://www.oracle.com/technetwork/java/

javasebusiness/downloads/java-archive-

downloads-javase6-419409.html#jdk-

6u45-oth-JPR

• Doesn’t attempt to install Ask Toolbar!

• Download and install

How to Generate

• Put Javadoc in root

• Run As > Ant Build…

• Point to JDK

Javadoc.xml

• destdir – where to output files

• packagenames – packages to generate

• sourcepath – path file of packages

• stylesheetfile – path to stylesheet

How to write javadoc.xml

• http://ant.apache.org/manual/Tasks/javadoc.html

• access = private / public / protected – which classes and members to show

• use – create class and package usage pages

• doctitle, windowtitle – titles

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Why Eclipse?

• Domino Designer built on Eclipse 3.4.2

• Mature Java development platform

• Plugin development platform

• Pluggable development platform

Why Not Just DDE?

Download Eclipse 4.3.1 (Kepler)

• http://www.eclipse.org/downloads

Eclipse Marketplace

• Eclipse Modeling Tools

• MercurialEclipse 2.1

• EGit – Git Team Provider 3.1.0

Graphical Modeling Framework Tooling

• Allows visual creation of design

Model Your Application Visually

• Classes

• Enums

• Relationships

• Inheritance

• Properties and datatypes

• Methods, parameters and return types

• Generate model code

• Datatypes will require changes

Example

Creating an Ecore Model

• Create > New > Empty EMF Project

• Create new Ecore Model in model folder

• Set values for root element

• Right-click .ecore and select Initialize Ecore Diagram File…

• Create diagram

Generating Code

• Right-click .ecore and select New > Other > EMF Generator Model

• .ecore needs to be valid

• Attributes need types etc.

• Open .genmodel

• Right-click top-level and select Generate Model Code

• Refresh and validate .ecore after changes

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Setting up Environment

XPages Starter Kit

• Blank packages for all possible plugins

• Rename packages

• Update any string references to names

• Remove what’s not required

• Build

Structure of Plugins

• Plugin project holds your code

• Feature project groups plugins

• Update Site manages deployment of one or more features

To See More…

• Check out OpenNTF Projects

• XPages OpenLog Logger

• OpenNTF Domino API

• OpenNTF Essentials

• XPages Extension Library / SBT

• Not just OSGi plugins

• File Navigator, Wildfire

• Some changes between 8.0.x and 8.5.1

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Java Agent Debugging Environment

• Java Agents can be debugged in Eclipse

• Create > New > Java Project

• Select JRE

• Already set up by XPages SDK

• Add Agent Code and breakpoint

• Create Debug Configuration for Java Application

• Run As > Java > Application

• Also can test Java code in plugins

Project Code

Project Code

Debug Configuration

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Atlassian SourceTree

• http://www.sourcetreeapp.com/

• Git / Mercurial client for Windows and Mac

• Integrates with BitBucket, Stash and GitHub

• GitFlow / HgFlow built in

• Can’t currently “group” repositories

• FREE, FREE, FREE

Atlassian SourceTree

Easy Processing

• Use buttons or Terminal

Setting Up Repository

• Create repository in DSCM

• Clone the repository

• Create folder structure in Windows Explorer (to avoid .git file syncing to NSF)

• Create NSF

• Team > Set up Source Control for this Application

• Create ODP in folder of repository

Setting up Git-Flow / Hg-Flow

• Commit to DSCM

• Repository > Git Flow > Initialise Repository

• Branches automatically created

• Start feature, release, hotfix

• Hotfixes automatically merged into branches

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Perforce P4Merge

• http://www.perforce.com/product/components/perforce-visual-merge-and-diff-tools

• Merge conflicts happen

• Consolidating from text file is not easy

• Visual tool to compare

• Integrates with SourceTree

• Right-click > Resolve Conflicts > Launch External Merge Tool

Perforce P4Merge

• After install, set up link in Tools > Options

Perforce P4Merge

Merging Conflicts

• Make change to design element

• Save and close P4Merge

• Process next

• Once all complete, Commit the merge

• Remove the .orig files

• You don’t want them in your NSF

More on Source Control?

• Source Control 101 : Implementing An End-To-End Solution

• IBM Connect 2014 Show and Tell

• So every step we do will have slides

• Setting up Stash / JIRA

• Setting up Redmine

• Bitbucket / GitHub overview

• SourceTree and Perforce P4Merge

• Full examples of Git flow / Hg Flow

Thank You

• Paul Withers

• pwithers@intec.co.uk

• http://www.intec.co.uk/blog

• @paulswithers

Recommended