You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/02/25 07:21:18 UTC
[04/50] [abbrv] git commit: Removed commented out code,
then merged in the existing export code to work.
Removed commented out code, then merged in the existing export code to work.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b658aa3f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b658aa3f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b658aa3f
Branch: refs/pull/60/merge
Commit: b658aa3f8a15472e72cd01707ca845a9c62eb51f
Parents: c142a9b
Author: GERey <gr...@apigee.com>
Authored: Wed Feb 5 21:12:55 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Wed Feb 5 21:12:55 2014 -0800
----------------------------------------------------------------------
.../rest/management/ManagementResource.java | 56 +++++---------------
1 file changed, 14 insertions(+), 42 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b658aa3f/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java b/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
index fb06067..b50b101 100644
--- a/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
+++ b/stack/rest/src/main/java/org/usergrid/rest/management/ManagementResource.java
@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
+import org.usergrid.management.ExportInfo;
import org.usergrid.management.UserInfo;
import org.usergrid.management.exceptions.DisabledAdminUserException;
import org.usergrid.management.exceptions.UnactivatedAdminUserException;
@@ -453,18 +454,23 @@ public class ManagementResource extends AbstractContextResource {
@QueryParam( "callback" ) @DefaultValue( "" ) String callback){
+ OAuthResponse response = null;
+ try {
- //access_info.setProperty( "user", management.getAdminUserOrganizationData( user, loadAdminData ) );
+ //parse the json into some useful object (the config params)
+ ExportInfo objEx = new ExportInfo(json);
- String errorDescription = "User must be confirmed to authenticate";
- //logger.warn( "Responding with HTTP 403 forbidden response for unconfirmed user {}" , user);
- OAuthResponse response = null;
+ exportService.schedule(objEx);
+ exportService.doExport( objEx );
+ }
+ catch (Exception e) {
+ //TODO:throw descriptive error message and or include on in the response
+ return Response.status( SC_BAD_REQUEST ).build();
+ }
+
+ //TODO: make schedule or doExport return a response? Or create one.
try {
-// response = OAuthResponse.errorResponse( SC_FORBIDDEN )
-// .setError( OAuthError.TokenResponse.INVALID_GRANT )
-// .setErrorDescription( errorDescription )
-// .buildJSONMessage();
response = OAuthResponse.status( SC_OK ).buildJSONMessage();
}
catch ( OAuthSystemException e ) {
@@ -472,40 +478,6 @@ public class ManagementResource extends AbstractContextResource {
}
return Response.status( response.getResponseStatus() ).type( jsonMediaType( callback ) )
.entity( wrapWithCallback( response.getBody(), callback ) ).build();
- // return Response.ok().build();
-// return Response.status( SC_OK ).type( jsonMediaType( callback ) )
-// .entity( wrapWithCallback( access_info, callback ) ).build();
-
- //return Response.status( SC_OK ).build();
-
-// try {
-//
-//
-// //parse the json into some useful object (the config params)
-// //ExportInfo objEx = new ExportInfo(json);
-//
-//
-// //exportService.schedule(objEx);
-// //exportService.doExport( objEx );
-// }
-// catch (Exception e) {
-// //TODO:throw descriptive error message and or include on in the response
-// return Response.status( SC_BAD_REQUEST ).build();
-// }
-//
-// //TODO: make schedule or doExport return a response? Or create one.
-// return Response.status( SC_OK ).build();
-
-
-// String path = (String) json.get("path");
-// Map<String, Object> properties = (Map) json.get("properties");
-// String storage_provider = (String) properties.get ("storage_provider");
-// Map<String, Object> storage_info = (Map) properties.get("storage_info");
-// String s3_token = (String) storage_info.get("s3_token");
-// String s3_key = (String) storage_info.get("s3_key");
-// String bucket_location = (String) storage_info.get("bucket_location");
-//
- //objEx.setPathQuery( path );
}