Beyond Domino Designer

46
September 2013 Paul Withers Intec Systems Ltd Beyond Domino Designer

description

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

Transcript of Beyond Domino Designer

Page 1: Beyond Domino Designer

September 2013

Paul Withers

Intec Systems Ltd

Beyond Domino Designer

Page 2: 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

Page 3: Beyond Domino Designer

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Page 4: Beyond Domino Designer

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

Page 5: Beyond Domino Designer

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

Page 6: Beyond Domino Designer

OpenLog Example

Page 7: Beyond Domino Designer

Source

Page 8: Beyond Domino Designer

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

Page 9: Beyond Domino Designer

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

Page 10: Beyond Domino Designer

How to Generate

• Put Javadoc in root

• Run As > Ant Build…

• Point to JDK

Page 11: Beyond Domino Designer

Javadoc.xml

• destdir – where to output files

• packagenames – packages to generate

• sourcepath – path file of packages

• stylesheetfile – path to stylesheet

Page 12: Beyond Domino Designer

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

Page 13: Beyond Domino Designer

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Page 14: Beyond Domino Designer

Why Eclipse?

• Domino Designer built on Eclipse 3.4.2

• Mature Java development platform

• Plugin development platform

• Pluggable development platform

Page 15: Beyond Domino Designer

Why Not Just DDE?

Page 16: Beyond Domino Designer

Download Eclipse 4.3.1 (Kepler)

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

Page 17: Beyond Domino Designer

Eclipse Marketplace

• Eclipse Modeling Tools

• MercurialEclipse 2.1

• EGit – Git Team Provider 3.1.0

Page 18: Beyond Domino Designer

Graphical Modeling Framework Tooling

• Allows visual creation of design

Page 19: Beyond Domino Designer

Model Your Application Visually

• Classes

• Enums

• Relationships

• Inheritance

• Properties and datatypes

• Methods, parameters and return types

• Generate model code

• Datatypes will require changes

Page 20: Beyond Domino Designer

Example

Page 21: Beyond Domino Designer

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

Page 22: Beyond Domino Designer

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

Page 23: Beyond Domino Designer

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Page 25: Beyond Domino Designer

Setting up Environment

Page 26: Beyond Domino Designer

XPages Starter Kit

• Blank packages for all possible plugins

• Rename packages

• Update any string references to names

• Remove what’s not required

• Build

Page 27: Beyond Domino Designer

Structure of Plugins

• Plugin project holds your code

• Feature project groups plugins

• Update Site manages deployment of one or more features

Page 28: Beyond Domino Designer

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

Page 29: Beyond Domino Designer

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Page 30: Beyond Domino Designer

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

Page 31: Beyond Domino Designer

Project Code

Page 32: Beyond Domino Designer

Project Code

Page 33: Beyond Domino Designer

Debug Configuration

Page 34: Beyond Domino Designer

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Page 35: Beyond Domino Designer

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

Page 36: Beyond Domino Designer

Atlassian SourceTree

Page 37: Beyond Domino Designer

Easy Processing

• Use buttons or Terminal

Page 38: Beyond Domino Designer

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

Page 39: Beyond Domino Designer

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

Page 40: Beyond Domino Designer

Agenda

• Automatic Documentation

• Eclipse

• Modeling

• Plugin Development

• Java Agent Debugging

• SourceTree

• Perforce P4Merge

Page 41: Beyond Domino Designer

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

Page 42: Beyond Domino Designer

Perforce P4Merge

• After install, set up link in Tools > Options

Page 43: Beyond Domino Designer

Perforce P4Merge

Page 44: Beyond Domino Designer

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

Page 45: Beyond Domino Designer

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

Page 46: Beyond Domino Designer

Thank You

• Paul Withers

[email protected]

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

• @paulswithers