xnat open source

Upload: jose-moragar

Post on 14-Apr-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 XNAT Open Source

    1/44

    XNAT Custom Features

    & Open Source DevelopmentJohn Paulett

    [email protected]

    June 30, 2010

  • 7/27/2019 XNAT Open Source

    2/44

    Goal

    Introduce potential contributors to the

    methods and tools for contributing to XNAT

    2

  • 7/27/2019 XNAT Open Source

    3/44

    XNAT is Open Source!

    3

  • 7/27/2019 XNAT Open Source

    4/44

    XNAT is Open Source!

    Freedom

    Leverage others work

    Contribute

    4

  • 7/27/2019 XNAT Open Source

    5/44

    HOW CAN I CONTRIBUTE?

    5

  • 7/27/2019 XNAT Open Source

    6/44

    Bug Reports & Feature Requests

    [email protected]

    For sensitive issues, [email protected]

    Provide details!

    Environment

    Versions

    Steps to reproduce

    Screenshots

    Logs

    6

  • 7/27/2019 XNAT Open Source

    7/44

    Report a problem

    7

  • 7/27/2019 XNAT Open Source

    8/44

    Share Custom Schemas

    (Jenny Gurneys previous Customizations talk)

    8

  • 7/27/2019 XNAT Open Source

    9/44

    Create Something New

    Leverage the REST API

    Examples: PyXNAT, xnatfs

    9

  • 7/27/2019 XNAT Open Source

    10/44

    Develop XNAT

    Fix Bugs

    Add Features

    10

  • 7/27/2019 XNAT Open Source

    11/44

    XNAT ECOSYSTEM

    11

  • 7/27/2019 XNAT Open Source

    12/44

    12

  • 7/27/2019 XNAT Open Source

    13/44

    XNAT Internals

    xdat_core - org.nrg.xft

    translates between XML schema & otherformats

    XFTItem.java

    xdat_core - org.nrg.xdat

    admin, security, search infrastructure aroundXFT

    Web app structure

    13

  • 7/27/2019 XNAT Open Source

    14/44

    XNAT Internals

    xdat_release/plugin_resources - org.nrg.xnat

    REST API

    Uploading & Downloading

    Neuroimaging specific models

    xdat_release/projects

    Site customizations

    14

  • 7/27/2019 XNAT Open Source

    15/44

    3 TOOLS OF A XNAT DEVELOPER

    15

  • 7/27/2019 XNAT Open Source

    16/44

    #1 Version Control with Mercurial

    hg.xnat.org

    Replacement for CVS & Subversion

    Distributed (everyone has full repo & can commit)

    Sane branching & merging

    16

  • 7/27/2019 XNAT Open Source

    17/44

    Why Leave CVS?

    Network connectivity required

    Lack of support for renaming/moving files

    Lack of atomic commitsSingle point of failure

    Expensive branch operations

    Day-long merges

    17

  • 7/27/2019 XNAT Open Source

    18/44

    Mercurial Quick Start

    hg clone http://hg.xnat.org/xdat_release

    # view differences

    hg diff

    # commit and send changes to remote repo

    hg commit

    hg push

    # get the latest remote changes

    hg pull --update

    18

  • 7/27/2019 XNAT Open Source

    19/44

    hg.xnat.org

    19

  • 7/27/2019 XNAT Open Source

    20/44

    Integration Manager Workflow

    20

    blessed

    repository

    integrationmanager developerprivate

    developer

    public

    developerprivate

    developer

    public

  • 7/27/2019 XNAT Open Source

    21/44

    Mercurial Resources

    mercurial.selenic.com

    hgbook.red-bean.com

    hginit.com

    21

  • 7/27/2019 XNAT Open Source

    22/44

    #2 Maven

    Build & Dependency Management

    Migrating to Maven 2 xdat_release & pipelines still use Maven 1

    (hidden behind bin/setup.sh)

    New projects should use Maven 2

    22

  • 7/27/2019 XNAT Open Source

    23/44

    Why not Ant?

    Dependency management

    Reduce blobs in version control system

    Standardized project layout & commands

    23

  • 7/27/2019 XNAT Open Source

    24/44

    xdat_core & Maven

    $ cd xdat_core

    $ mvn clean install

    [INFO] Scanning for projects...

    ...[INFO] BUILD SUCCESSFUL

    24

  • 7/27/2019 XNAT Open Source

    25/44

    #2 Eclipse IDE

    25

  • 7/27/2019 XNAT Open Source

    26/44

    Useful Eclipse Plugins

    Mercurial

    Maven

    XML Schema Editor Velocity

    26

  • 7/27/2019 XNAT Open Source

    27/44

    HELPFUL TOOLS

    27

  • 7/27/2019 XNAT Open Source

    28/44

    Debugging with JPDA

    Connect to external Tomcat & Applet

    processes with Eclipse debugger

    Set breakpoints, examine state

    28

  • 7/27/2019 XNAT Open Source

    29/44

    Connect Tomcat process with Eclipse debugger

  • 7/27/2019 XNAT Open Source

    30/44

    DEMO: FIX A BUG & SUBMIT A PATCH

    30

  • 7/27/2019 XNAT Open Source

    31/44

    1) Clone & Set up Projects

    hg clone http://hg.xnat.org/xdat_core

    mvn clean install

    hg clone http://hg.xnat.org/xdat_release

    ...

    bin/setup.sh -Ddeploy=true

    ...

    31

  • 7/27/2019 XNAT Open Source

    32/44

    2) Register in Eclipse

    cp sample.classpath .classpath

    cp sample.project .project

    32

  • 7/27/2019 XNAT Open Source

    33/44

    3) Fix Code

    33

  • 7/27/2019 XNAT Open Source

    34/44

  • 7/27/2019 XNAT Open Source

    35/44

  • 7/27/2019 XNAT Open Source

    36/44

    4) Test it!

    36

  • 7/27/2019 XNAT Open Source

    37/44

    5) Commit

    37

  • 7/27/2019 XNAT Open Source

    38/44

    6) Publish the Change

    Options include:

    Sending patch file

    Forking on Bitbucket

    38

  • 7/27/2019 XNAT Open Source

    39/44

  • 7/27/2019 XNAT Open Source

    40/44

    40

  • 7/27/2019 XNAT Open Source

    41/44

    41

  • 7/27/2019 XNAT Open Source

    42/44

  • 7/27/2019 XNAT Open Source

    43/44

    Go Forth and Develop

    http://nrg.wikispaces.com/XNAT+2010+Workshop+-

    +Custom+Features+and+Open+Source+Development

    43

  • 7/27/2019 XNAT Open Source

    44/44