params.put("i18n", i18n);
try
{
String body = ComponentAccessor.getVelocityManager().getBody("templates/", "conferr.vm", params);
return Response.ok(new HtmlEntity(body)).status(500).build();
}
catch (VelocityException vex)
{
log.error("QueryFieldsService::setJcl - Velocity parsing error", vex);
return Response.ok(i18n.getText("queryfields.error.internalerror")).status(500).build();
}
}
String proj = reserveData.substring(0, inx);
String cfName = reserveData.substring(inx + 1);
jqlQuery = String.format(Consts.TEST_QUERY_PATTERN, proj, cfName);
}
SearchService.ParseResult parseResult = searchService.parseQuery(user, jqlQuery);
if (parseResult.isValid())
{
qfMgr.setQueryFieldData(cfId, prId, data);
if (Utils.isValidStr(jqlnull) && jqlnull.equals("on"))
{
qfMgr.setAddNull(cfId, prId, true);
}
else
{
qfMgr.setAddNull(cfId, prId, false);
}
if (Utils.isValidStr(autocompleteView) && autocompleteView.equals("on"))
{
qfMgr.setAutocompleteView(cfId, prId, true);
}
else
{
qfMgr.setAutocompleteView(cfId, prId, false);
}
List<String> optList = new ArrayList<String>();
if (options != null)
{
for (String option : options)
{
optList.add(option);
}
}
qfMgr.setLinkerFieldOptions(cfId, prId, optList);
}
else
{
MessageSet ms = parseResult.getErrors();
Set<String> errs = ms.getErrorMessages();
Map<String, Object> params = new HashMap<String, Object>();
params.put("errs", errs);
params.put("i18n", i18n);
try
{
String body = ComponentAccessor.getVelocityManager().getBody("templates/", "conferr.vm", params);
return Response.ok(new HtmlEntity(body)).status(500).build();
}
catch (VelocityException vex)
{
log.error("QueryFieldsService::setJcl - Velocity parsing error", vex);
return Response.ok(i18n.getText("queryfields.error.internalerror")).status(500).build();