# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /Users/ludo/acvs/v3/admin/rest/src/main/java/org/glassfish/admin/rest # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: ResourceUtil.java --- ResourceUtil.java Base (BASE) +++ ResourceUtil.java Locally Modified (Based On LOCAL) @@ -211,7 +211,7 @@ * @param habitat the habitat * @return ActionReport object with command execute status details. */ - public static ActionReport runCommand(String commandName, +/* public static ActionReport runCommand(String commandName, Properties parameters, Habitat habitat, String typeOfResult) { CommandRunner cr = habitat.getComponent(CommandRunner.class); ActionReport ar = new RestActionReporter(); @@ -222,7 +222,7 @@ cr.getCommandInvocation(commandName, ar).parameters(p).execute(); return ar; - } + }*/ /** @@ -990,7 +990,15 @@ public static void addMethodMetaData(ActionReport ar, Map mmd) { List methodMetaData = new ArrayList(); + MethodMetaData getMetaData = mmd.get("GET"); methodMetaData.add(new HashMap() {{ put("name", "GET"); }}); + if (getMetaData != null) { //are they extra params for a GET command? + Map getMetaDataMap = new HashMap(); + if (getMetaData.sizeParameterMetaData() > 0) { + getMetaDataMap.put(MESSAGE_PARAMETERS, buildMethodMetadataMap(getMetaData)); + } + methodMetaData.add(getMetaDataMap); + } MethodMetaData postMetaData = mmd.get("POST"); Map postMetaDataMap = new HashMap(); Index: resources/TemplateExecCommand.java --- resources/TemplateExecCommand.java Base (BASE) +++ resources/TemplateExecCommand.java Locally Modified (Based On LOCAL) @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -127,7 +127,9 @@ RestActionReporter actionReport = ResourceUtil.runCommand(commandName, data, habitat, ResourceUtil.getResultType(requestHeaders)); ActionReport.ExitCode exitCode = actionReport.getActionExitCode(); - ActionReportResult results = new ActionReportResult(commandName, actionReport, options().getMetaData()); + ActionReportResult option = options(); + ActionReportResult results = new ActionReportResult(commandName, actionReport, option.getMetaData()); + results.getActionReport().setExtraProperties(option.getActionReport().getExtraProperties()); results.setCommandDisplayName(commandDisplayName); int status =HttpURLConnection.HTTP_OK; /*200 - ok*/ if (exitCode == ActionReport.ExitCode.FAILURE) { @@ -185,6 +187,8 @@ renameParameter(data, "id", "DEFAULT"); } } + data.remove("jsoncallback"); //these 2 are for JSONP padding, not needed for CLI execs + data.remove("_"); } }