summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/servlet/profile
diff options
context:
space:
mode:
authorcfu <cfu@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-01-29 16:31:54 +0000
committercfu <cfu@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-01-29 16:31:54 +0000
commit3c58749d65e77227e455d70e170aa9cb2de8afac (patch)
treebdce40cf55f24e423589b2041cf634bc26d18bfa /pki/base/common/src/com/netscape/cms/servlet/profile
parent13715dc6c17c55dd36a6c6bfe8ad12a775f5bc50 (diff)
downloadpki-3c58749d65e77227e455d70e170aa9cb2de8afac.tar.gz
pki-3c58749d65e77227e455d70e170aa9cb2de8afac.tar.xz
pki-3c58749d65e77227e455d70e170aa9cb2de8afac.zip
482733 - support xmlOutput param in profiles; missing request number in XML response to submitted request
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@200 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/servlet/profile')
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSelectServlet.java1
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/profile/ProfileServlet.java1
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java22
3 files changed, 16 insertions, 8 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSelectServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSelectServlet.java
index dd1860ee4..8267a1434 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSelectServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSelectServlet.java
@@ -334,6 +334,7 @@ public class ProfileSelectServlet extends ProfileServlet {
args.set(ARG_INPUT_LIST, inputlist);
args.set(ARG_INPUT_PLUGIN_LIST, inputPluginlist);
args.set(ARG_IS_RENEWAL, profile.isRenewal());
+ args.set(ARG_XML_OUTPUT, profile.isXmlOutput());
// (5) return info as template
outputTemplate(request, response, args);
diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileServlet.java
index 9ce0d55bc..ca1d1b088 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileServlet.java
@@ -108,6 +108,7 @@ public class ProfileServlet extends CMSServlet {
public final static String ARG_INPUT_NAME = "inputName";
public final static String ARG_INPUT_VAL = "inputVal";
public final static String ARG_IS_RENEWAL = "renewal";
+ public final static String ARG_XML_OUTPUT = "xmlOutput";
public final static String ARG_OUTPUT_LIST = "outputList";
public final static String ARG_OUTPUT_ID = "outputId";
public final static String ARG_OUTPUT_SYNTAX = "outputSyntax";
diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java
index 3e270a036..995ca5e33 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java
@@ -417,8 +417,12 @@ public class ProfileSubmitServlet extends ProfileServlet {
boolean xmlOutput = false;
String v = request.getParameter("xmlOutput");
- if (v != null && v.equals("true"))
+ if ((v != null) && (v.equalsIgnoreCase("true"))) {
+ CMS.debug("xmlOutput true");
xmlOutput = true;
+ } else {
+ CMS.debug("xmlOutput false");
+ }
IStatsSubsystem statsSub = (IStatsSubsystem)CMS.getSubsystem("stats");
if (statsSub != null) {
@@ -898,7 +902,7 @@ public class ProfileSubmitServlet extends ProfileServlet {
e.toString());
// authentication error
if (xmlOutput) {
- outputError(response, AUTH_FAILURE, CMS.getUserMessage(locale, "CMS_AUTHENTICATION_ERROR"));
+ outputError(response, CMS.getUserMessage(locale, "CMS_AUTHENTICATION_ERROR"));
} else {
args.set(ARG_ERROR_CODE, "1");
args.set(ARG_ERROR_REASON, CMS.getUserMessage(locale,
@@ -960,7 +964,7 @@ public class ProfileSubmitServlet extends ProfileServlet {
reqs = profile.createRequests(ctx, locale);
} catch (EProfileException e) {
CMS.debug(e);
- CMS.debug("ProfileSubmitServlet: 1 createRequests " + e.toString());
+ CMS.debug("ProfileSubmitServlet: createRequests " + e.toString());
if (xmlOutput) {
outputError(response, e.toString());
} else {
@@ -1059,7 +1063,7 @@ public class ProfileSubmitServlet extends ProfileServlet {
// no profile set found
CMS.debug("ProfileSubmitServlet: no profile policy set found");
if (xmlOutput) {
- outputError(response, CMS.getUserMessage("CMS_PROFILE_NO_POLICY_SET_FOUND"));
+ outputError(response, FAILED, CMS.getUserMessage("CMS_PROFILE_NO_POLICY_SET_FOUND"), reqs[k].getRequestId().toString());
} else {
args.set(ARG_ERROR_CODE, "1");
args.set(ARG_ERROR_REASON,
@@ -1092,7 +1096,7 @@ public class ProfileSubmitServlet extends ProfileServlet {
} catch (EProfileException e) {
CMS.debug("ProfileSubmitServlet: populate " + e.toString());
if (xmlOutput) {
- outputError(response, e.toString());
+ outputError(response, FAILED, e.toString(), reqs[k].getRequestId().toString());
} else {
args.set(ARG_ERROR_CODE, "1");
args.set(ARG_ERROR_REASON, e.toString());
@@ -1108,7 +1112,7 @@ public class ProfileSubmitServlet extends ProfileServlet {
// throw new IOException("Profile " + profileId +
// " cannot populate");
if (xmlOutput) {
- outputError(response, CMS.getUserMessage(locale, "CMS_INTERNAL_ERROR"));
+ outputError(response, FAILED, CMS.getUserMessage(locale, "CMS_INTERNAL_ERROR"), reqs[k].getRequestId().toString());
} else {
args.set(ARG_ERROR_CODE, "1");
args.set(ARG_ERROR_REASON, CMS.getUserMessage(locale,
@@ -1135,14 +1139,15 @@ public class ProfileSubmitServlet extends ProfileServlet {
///////////////////////////////////////////////
// submit request
///////////////////////////////////////////////
+ String requestIds = ""; // deliminated with double space
for (int k = 0; k < reqs.length; k++) {
try {
// reset the "auditRequesterID"
auditRequesterID = auditRequesterID(reqs[k]);
-
// print request debug
if (reqs[k] != null) {
+ requestIds += " "+reqs[k].getRequestId().toString();
Enumeration reqKeys = reqs[k].getExtDataKeys();
while (reqKeys.hasMoreElements()) {
String reqKey = (String)reqKeys.nextElement();
@@ -1244,7 +1249,8 @@ public class ProfileSubmitServlet extends ProfileServlet {
if (errorCode != null) {
if (xmlOutput) {
- outputError(response, errorReason);
+ // when errorCode is not null, requestIds should have >=1
+ outputError(response, errorCode, errorReason, requestIds);
} else {
ArgList requestlist = new ArgList();