27 Commits

Author SHA1 Message Date
Shawn Pearce
c8e96ad49d Wait for UI plugins to load
If a screen is registered by a plugin this registration needs to be
completed before the dispatcher tries to parse the token.  Wait for
plugin scripts to finish loading and evaluating.  The old method of
injecting a script tag was not waiting correctly, especially for GWT
based plugins.

JavaScript plugins are now required to use Gerrit.install() as this
method updates internal Gerrit state tracking the script.  Not using
install() will eventually cause the UI to report the plugin as failing
to load.

GWT plugins must override onPluginLoad() not onModuleLoad().  All
plugins must recompile with the new glue code, as there is now a
handshake between the GWT plugin and the main Gerrit code.

All plugins must load within 5 seconds, otherwise the page marks them
as failed and reports loading errors.  During loading a glass pane is
used to prevent the user from interacting with a partial initialized
UI.  Plugins may be making critical contributions that need to be
registered before use.

A chunk of the API glue code was moved around to make each JSNI block
smaller, and better isolate purpose.  Plugin is now declared in its
own Java class.

Plugin instances are now tracked in the map $wnd.Gerrit.plugins.
This allows the main code to later figure out if any instance failed
to load. Any loading errors are usually reported on the JavaScript
console as script failures, and may include stack traces.

Change-Id: Id03581437ae1010cf995ef7ba8626ece37dfc2f4
2013-12-10 23:37:13 -08:00
David Pursehouse
93dbaa2782 Fix the API build
In 28694a09c9c05dc7f74a5e15f6210bb69bf72aa0 a conflict in the merge
from stable-2.8 was not resolved properly and the API build was broken.

Add back the missing part to fix the build.

Change-Id: I2b0295212631ffad0ba4b57c77b5935b8200d384
2013-12-06 09:48:11 +00:00
Edwin Kempin
24047a1ead Merge "Merge branch 'stable-2.8'" 2013-12-06 08:25:51 +00:00
David Pursehouse
28694a09c9 Merge branch 'stable-2.8'
* stable-2.8:
  Buck: add build for gerrit-plugin-gwtui
  Fix configuration for plugin and extension API artifact deployment

Conflicts:
	BUCK
	gerrit-plugin-gwtui/BUCK
	tools/maven/BUCK

Change-Id: I4267b0a6397823a00a11db268b02a50c4f79d4ed
2013-12-06 15:04:07 +09:00
Edwin Kempin
368fa1e17a Merge "Enable GWT plugins to go to and refresh screens" 2013-12-06 05:56:02 +00:00
Edwin Kempin
6349374ca2 Enable GWT plugins to go to and refresh screens
Change-Id: I9b8f63845c5b5e605ce108357a08abb616d80537
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-12-05 20:46:24 +01:00
David Ostrovsky
1f26ed2b8a Buck: Fix gerrit-plugin-gwtui API build
Change-Id: Ie1bd1443cb7fa8d414b542a2fd82bbb7a3374486
2013-12-05 14:46:54 +01:00
David Ostrovsky
acc959d645 Buck: add build for gerrit-plugin-gwtui
This plugin module was left out during Buck migration.

  $>buck build api

produces now plugin-gwtui.jar and plugin-gwtui-src.jar.

Buck Maven bridge was enhanced to {install|deploy} the new artifact to
remote or local Maven repositories:

  $>buck build install_api

deployes

  gerrit-plugin-gwtui-2.9-SNAPSHOT-sources.jar
  gerrit-plugin-gwtui-2.9-SNAPSHOT.jar

to local Maven repository.

Change-Id: Idae18f6df2e67fe53d57b8c35caa4226333e269b
(cherry picked from commit c8cffc8e928a9277621ffff6cb740f79cd662195)
2013-12-05 17:20:26 +09:00
Shawn Pearce
93e4e9ce14 buck targets: Fix bad reference to //lib/gwt:user_lib
The GWT libraries must be compile_deps for a gwt_module(), not deps.

Change-Id: I42a7a3edd30bda1b570b3784b7967730a0087256
2013-12-04 15:00:25 -08:00
David Pursehouse
11f7168688 Set version to 2.8
Set the version to 2.8 in the VERSION file and in the plugin
archetypes' pom files.

Change-Id: I47f95e8786645ef29e31383cac97f70232882ee1
2013-12-04 14:06:13 +09:00
Shawn Pearce
72fb6cc514 Remove unused .gitignore
These were necessary only for the Maven based build.

Change-Id: Ie26669e6ccae60a52d2db1b8ad362e2fa88a26f2
2013-11-28 22:56:51 -08:00
David Ostrovsky
c53fd3ae49 Delete eclipse left-over files from the Maven poop era
Change-Id: Ie3a75e8c6a2d274cd39e362259ab20cff474eb8d
2013-11-28 22:55:09 -08:00
David Ostrovsky
bb360ebe06 Buck: generate javadocs for plugin and extension API
buck build api

generates now javadocs.

  buck build api_install

installs all plugin/extension related artifacts with javadocs in the
local Maven repository.

Change-Id: Ifa6a8eb469f388e16449576ff2bff01a5dce67dd
2013-11-24 02:04:51 +01:00
Edwin Kempin
c7598d2b6d Fix JavaScript syntax error in NativeString
Change-Id: I16278e16428eaec0007e37fae7cb89a5f12b0666
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-10 08:37:43 +01:00
Edwin Kempin
1a31722152 Allow GWT plugins to invoke the REST API
The package 'com.google.gerrit' in 'gerrit-plugin-gwtui' is renamed
to 'com.google.gerrit.plugin' since Eclipse doesn't like to have the
RestApi and Natives classes once again in the same package as in
'gerrit-gwtui'.

Change-Id: I37e28dfc52bce90204cf067b543ef91abead8e27
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-09 11:26:59 -08:00
David Ostrovsky
c301f7ab2b gerrit-plugin-gwtui: delete maven driven build
Change-Id: I02458e5d1ab1026ca6df10ab3037d42c6661cbd2
2013-11-08 07:40:46 +01:00
David Ostrovsky
c8cffc8e92 Buck: add build for gerrit-plugin-gwtui
This plugin module was left out during Buck migration.

  $>buck build api

produces now plugin-gwtui.jar and plugin-gwtui-src.jar.

Buck Maven bridge was enhanced to {install|deploy} the new artifact to
remote or local Maven repositories:

  $>buck build install_api

deployes

  gerrit-plugin-gwtui-2.9-SNAPSHOT-sources.jar
  gerrit-plugin-gwtui-2.9-SNAPSHOT.jar

to local Maven repository.

Change-Id: Idae18f6df2e67fe53d57b8c35caa4226333e269b
2013-11-07 19:52:15 +01:00
Edwin Kempin
f900b444fc Merge branch 'stable-2.8'
* stable-2.8:
  Restore pom.xml for gerrit-plugin-gwtui
  Generate javadoc for gerrit-plugin-gwtui

The version in gerrit-plugin-gwtui/pom.xml is updated to 2.9-SNAPSHOT.

Change-Id: I580c1dff33609bfbff923f381c40326cb048b5f9
2013-11-06 07:59:56 +01:00
Edwin Kempin
a04edc9610 Generate javadoc for gerrit-plugin-gwtui
This artifact is required for GWT plugins. To make the consumption of
gerrit-plugin-gwtui easier for plugin developers it should be
published to Maven central. For this having javadocs generated is
required.

Change-Id: I10749b83a7f56c26593371d57abc3862fc1bc289
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-06 07:42:06 +01:00
Edwin Kempin
697f24d9e6 Restore pom.xml for gerrit-plugin-gwtui
This artifact is required for GWT plugins. There is no BUCK build
for it yet and the pom.xml was accidentally deleted by dcee57212f.

Change-Id: Ib417fb3308135285248fb7a97ee3bdbba2e49089
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-06 07:31:20 +01:00
David Ostrovsky
dcee57212f Delete Maven based build
The Maven build does not work since the introduction of CodeMirror.
Remove the build until to prevent people from trying to use a broken
build process.  If buck is rejected this commit will be reverted, and
we will attempt to fix the Maven build to include CodeMirror.  If buck
is accepted, we just saved time by avoiding a messy Maven change.

Change-Id: I147d8d1741d52f59de1d2ddce8e5e82583990c14
2013-05-21 20:28:56 -07:00
Shawn Pearce
9240c299f0 Begin 2.8
Change-Id: Ie0bc733853be435fba147dd64ef8cbc5a0027ee0
2013-05-06 19:39:10 -07:00
Shawn Pearce
d47ca8a66d Start 2.7 development
Change-Id: I08dc590bb1f62af67d88eb11313d5d4cfe2423c4
2013-03-21 12:12:47 -07:00
Dariusz Luksza
035ac8f3c8 Bump GWT version to 2.5.0
Additional minor changes to ChangesApi was required. This version bump
could fix problems with IE9.

Change-Id: I19af7125c696ef9a962f10260feb73c095d2b11d
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
2012-11-17 05:20:19 +01:00
Dariusz Luksza
df52478ca9 Do not call onModuleLoad() second time
onModuleLoad() method is automatically called by GWT framework. Calling
it once again in PluginGenerator cause double plugin initialization.

Change-Id: I86b179f0a2da99121c74d1c095281bdd7de30636
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
2012-11-12 19:55:40 +01:00
David Pursehouse
0d5090acb3 gerrit-plugin-gwtui/gerrit-war: Enable lifecycle plugin in pom.xml
Due to changes in the m2e Eclipse plugin for Indigo (3.7), plugin
execution no longer happens directly, but rather must be configured
through m2e's lifecycle-mapping plugin.

In order for a plugin to be invoked within Eclipse, a pluginExecution
must be defined in the lifecycle-mapping plugin corresponding to the
execution tag in the plugin definition itself.

To achieve this, a new section is added in the build section of the
POM files.

See http://goo.gl/2WCNW for details.

Change-Id: Id37cd53bea434cb9ecf8f509de8da558516e8303
2012-10-29 22:42:11 +09:00
Dariusz Luksza
cd4fc1c239 JavaScipt and GWT based UI plugin support
Adds support for extending Gerrit's web UI using either pure
JavaScript or GWT compiled with a modified CrossSiteIframeLinker.

To add code to the web UI plugins should bind WebUiPlugin to either
GwtPlugin or JavaScriptPlugin in their plugin's Web-Module. This
tells the UI bootstrap code where to find additional JavaScript to
inject into the page before displaying content.

For a GWT based plugin:

  * com.google.gerrit.client.Plugin class should be extended,
  * inheritance from com.google.gerrit.Plugin should be added
    to gwt.xml,
  * subclass of client.Plugin should be set as entry point,
  * dependency from com.google.gerrit/gerrit-plugin-gwtui should
    be added to pom.xml,
  * webappDirectory option for gwt-maven-plugin should be
    set to ${project.build.directory}/classes/static

For JavaScript based plugins the source code should be put into
the static/ directory of the plugin's JAR file.

Currently there are no extension points for either JS or GWT plugins
to interact with. Some will be added in a future commit. With this
commit only simple modification of the UI is possible, for example
calling window.alert() or adding extra elements to page contents
based on the existing element ids.

Change-Id: I3558991ba4a1477d6cde64eb0a761a7e4c399ec3
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
2012-10-21 16:50:03 -07:00