summaryrefslogtreecommitdiffstats
path: root/gui-editors/gui-editor-apex/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'gui-editors/gui-editor-apex/src/main/java')
-rw-r--r--gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResource.java8
-rw-r--r--gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/plugin/upload/PolicyUploadHandler.java2
2 files changed, 8 insertions, 2 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResource.java b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResource.java
index ba3d5e7..dc27d49 100644
--- a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResource.java
+++ b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResource.java
@@ -32,9 +32,11 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
+import org.apache.commons.lang3.StringUtils;
import org.onap.policy.apex.model.modelapi.ApexApiResult;
import org.onap.policy.apex.model.modelapi.ApexApiResult.Result;
import org.onap.policy.common.utils.resources.TextFileUtils;
+import org.onap.policy.gui.editors.apex.rest.ApexEditorMain;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
@@ -229,11 +231,15 @@ public class ApexEditorRestResource implements RestCommandHandler {
/**
* Uploads a TOSCA Policy Model to a configured endpoint.
*
+ * @param userid the userid to use for upload
* @return an ApexAPIResult that contains the operation status and success/error messages
*/
@GET
@Path("Model/Upload")
- public ApexApiResult uploadModel() {
+ public ApexApiResult uploadModel(@QueryParam("userId") final String userid) {
+ if (!StringUtils.isBlank(userid)) {
+ ApexEditorMain.getParameters().setUploadUserid(userid);
+ }
return processRestCommand(RestCommandType.MODEL, RestCommand.UPLOAD);
}
diff --git a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/plugin/upload/PolicyUploadHandler.java b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/plugin/upload/PolicyUploadHandler.java
index 5e3cf56..6d8b803 100644
--- a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/plugin/upload/PolicyUploadHandler.java
+++ b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/plugin/upload/PolicyUploadHandler.java
@@ -56,7 +56,7 @@ public class PolicyUploadHandler {
if (StringUtils.isBlank(ApexEditorMain.getParameters().getUploadUrl())) {
final ApexApiResult apexApiResult = new ApexApiResult(Result.FAILED);
- apexApiResult.addMessage("Model download is disabled, parameter upload-url is not set on server");
+ apexApiResult.addMessage("Model upload is disabled, parameter upload-url is not set on server");
LOGGER.exit(MODEL_UPLOAD_NOT_OK);
return apexApiResult;