gerrit javascript plugins

Download Gerrit JavaScript Plugins

If you can't read please download the document

Upload: dariusz-luksza

Post on 26-May-2015

493 views

Category:

Technology


0 download

DESCRIPTION

Quick overview of building plugins using pure JavaScript or Google Web Toolkit (GWT), and a group discussion to identify important UI extension points for Gerrit contributors to make available.

TRANSCRIPT

  • 1. JavaScript Plugins IntroductionCurrent status: Native JS plugins Generate plugin stub from Maven artifact Important parts of JS plugin Build and deployment GWT plugins Generate plugin stub from Maven artifact Important parts of GWT plugin Build and deploymentTo be defined: Client side extension points Registering server side services Dariusz uksza (@dluksza) CollabNet Engineering Office Potsdam, GermanyENTERPRISE CLOUD DEVELOPMENT

2. What is Gerrit?2 Copyright 2012 CollabNet, Inc. All Rights Reserved. 3. What is Gerrit? 4. What is Gerrit? 5. 2.5 Plugin infrastructure5 Copyright 2012 CollabNet, Inc. All Rights Reserved. 6. What can be done in 2.5?Extension points: Stable API Listen for events Register new SSH command Register new HTTP servletsPlugins: API is strongly coupled with Gerrit internals... because they are Gerrit internals Can do all the rest... 7. What can be done in 2.5?Extension points: Stable API Listen for events Register new SSH command Register new HTTP servletsPlugins: API is strongly coupled with Gerrit internals... because they are Gerrit internals Can do all the rest... except of thins that it cannot do. 8. What can be done in 2.5?Extension points: Stable API Listen for events Register new SSH command Register new HTTP servletsPlugins: API is strongly coupled with Gerrit internals... because they are Gerrit internals Can do all the rest... except of thins that it cannot do: Cannot define own authentication method, Cannot change Web UI 9. JavaScript Plugins9 Copyright 2012 CollabNet, Inc. All Rights Reserved. 10. Generate JS plugin stub *$ mvn archetype:generate -DarchetypeGroupId=com.google.gerrit -DarchetypeArtifactId=gerrit-plugin-js-archetype -DarchetypeVersion=2.6-SNAPSHOT -DgroupId=com.collabnet -DartifactId=gerrit-js-plugin-stub 11. GWT Plugins13 Copyright 2012 CollabNet, Inc. All Rights Reserved. 12. Generate GWT plugin stub *$ mvn archetype:generate -DarchetypeGroupId=com.google.gerrit -DarchetypeArtifactId=gerrit-plugin-gwt-archetype -DarchetypeVersion=2.6-SNAPSHOT -DgroupId=com.collabnet -DartifactId=gerrit-gwt-plugin-stub 13. Extension API19 Copyright 2012 CollabNet, Inc. All Rights Reserved. 14. Requirements for extension APIRequirements:Client side: Easy to consume Easily accessible from GWT and JavaScript Allow cross-plugin interactions/dependencies (?)Server side: Automatically bind services Support server side dependency injection Use common protocol for GWT and JavaScript (?) Use JSON Or provide JavaScript API for GWT base protocol (RequestFactory?) 15. First idea of client extension APIFirst draft idea of GWT client side extension point API:import com.google.gwt.user.client.ui.Widget;public interface GerritUi {// we should also consider here async calls// and somehow provide data from UIpublic interface ExtensionListener {boolean performAction();}public interface Actions {void addOnChangeSubmittListener(ExtensionListener l);void removeOnChangeSubmittListener(ExtensionListener l);}public interface Containers {void appendToMainMenu(Widget widget);void removeFromMainMenu(Widget widget);} Actions getActions(); 16. JavaScript Plugins Dariusz uksza (@dluksza) CollabNet Engineering Office Potsdam, GermanyENTERPRISE CLOUD DEVELOPMENT