diff --git a/extensions/freebase/module/MOD-INF/controller.js b/extensions/freebase/module/MOD-INF/controller.js index 7ea1c7fb1..d7049792c 100644 --- a/extensions/freebase/module/MOD-INF/controller.js +++ b/extensions/freebase/module/MOD-INF/controller.js @@ -53,8 +53,6 @@ function init() { RS.registerCommand(module, "save-protograph", new Packages.com.google.refine.freebase.commands.SaveProtographCommand()); RS.registerCommand(module, "check-authorization", new Packages.com.google.refine.freebase.commands.auth.CheckAuthorizationCommand()); - RS.registerCommand(module, "authorize", new Packages.com.google.refine.freebase.commands.auth.AuthorizeCommand()); - RS.registerCommand(module, "deauthorize", new Packages.com.google.refine.freebase.commands.auth.DeAuthorizeCommand()); RS.registerCommand(module, "user-badges", new Packages.com.google.refine.freebase.commands.auth.GetUserBadgesCommand()); RS.registerCommand(module, "upload-data", new Packages.com.google.refine.freebase.commands.UploadDataCommand()); diff --git a/extensions/freebase/module/scripts/util/sign.js b/extensions/freebase/module/scripts/util/sign.js index b23526a9a..d0b1fd2c4 100644 --- a/extensions/freebase/module/scripts/util/sign.js +++ b/extensions/freebase/module/scripts/util/sign.js @@ -102,7 +102,7 @@ if (typeof window.Sign == 'undefined') { }, signin : function(success, provider, width, height) { - var newwin = window.Sign.popup("/command/freebase/authorize/" + provider, width, height); + var newwin = window.Sign.popup("/command/core/authorize/" + provider, width, height); if (newwin !== null) { newwin.opener = window; @@ -138,7 +138,7 @@ if (typeof window.Sign == 'undefined') { signout : function(success,provider) { $.ajax({ - url: "/command/freebase/deauthorize/" + provider, + url: "/command/core/deauthorize/" + provider, success: function() { if (typeof success == 'undefined') { window.location.reload(); diff --git a/extensions/freebase/src/com/google/refine/freebase/commands/auth/AuthorizeCommand.java b/main/src/com/google/refine/commands/auth/AuthorizeCommand.java similarity index 98% rename from extensions/freebase/src/com/google/refine/freebase/commands/auth/AuthorizeCommand.java rename to main/src/com/google/refine/commands/auth/AuthorizeCommand.java index 529796bb3..d414c48e1 100644 --- a/extensions/freebase/src/com/google/refine/freebase/commands/auth/AuthorizeCommand.java +++ b/main/src/com/google/refine/commands/auth/AuthorizeCommand.java @@ -31,7 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package com.google.refine.freebase.commands.auth; +package com.google.refine.commands.auth; import java.io.IOException; import java.io.PrintWriter; @@ -163,6 +163,6 @@ public class AuthorizeCommand extends Command { throw new RuntimeException("neither the 'host' nor 'referer' headers were present in the HTTP response, I can't determine what URL Google Refine is listening to."); } } - return "http://" + host + "/command/freebase/authorize/" + provider.getHost(); + return "http://" + host + "/command/core/authorize/" + provider.getHost(); } } diff --git a/extensions/freebase/src/com/google/refine/freebase/commands/auth/DeAuthorizeCommand.java b/main/src/com/google/refine/commands/auth/DeAuthorizeCommand.java similarity index 98% rename from extensions/freebase/src/com/google/refine/freebase/commands/auth/DeAuthorizeCommand.java rename to main/src/com/google/refine/commands/auth/DeAuthorizeCommand.java index d346d8123..5e02ceedd 100644 --- a/extensions/freebase/src/com/google/refine/freebase/commands/auth/DeAuthorizeCommand.java +++ b/main/src/com/google/refine/commands/auth/DeAuthorizeCommand.java @@ -31,7 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package com.google.refine.freebase.commands.auth; +package com.google.refine.commands.auth; import java.io.IOException; diff --git a/main/webapp/modules/core/MOD-INF/controller.js b/main/webapp/modules/core/MOD-INF/controller.js index cd1591c4e..a6b1d6c95 100644 --- a/main/webapp/modules/core/MOD-INF/controller.js +++ b/main/webapp/modules/core/MOD-INF/controller.js @@ -137,6 +137,9 @@ function registerCommands() { RS.registerCommand(module, "get-all-preferences", new Packages.com.google.refine.commands.GetAllPreferencesCommand()); RS.registerCommand(module, "set-preference", new Packages.com.google.refine.commands.SetPreferenceCommand()); RS.registerCommand(module, "open-workspace-dir", new Packages.com.google.refine.commands.OpenWorkspaceDirCommand()); + + RS.registerCommand(module, "authorize", new Packages.com.google.refine.commands.auth.AuthorizeCommand()); + RS.registerCommand(module, "deauthorize", new Packages.com.google.refine.commands.auth.DeAuthorizeCommand()); } function registerOperations() {