/** * Merges the transform and its parameters with other parameters * of the request. * * Ordinarily, and application does not need to call this method. * @param currentParams the other parameters * @return the union of the other parameters and the transform parameters */ public Map<String,List<String>> merge(Map<String,List<String>> currentParams) { Map<String,List<String>> params = (currentParams != null) ? currentParams : new RequestParameters(); params.put("transform", Arrays.asList(getName())); for (Map.Entry<String, List<String>> entry: entrySet()) { params.put("trans:"+entry.getKey(), entry.getValue()); } return params; } }
/** * Merges the transform and its parameters with other parameters * of the request. * * Ordinarily, and application does not need to call this method. * @param currentParams the other parameters * @return the union of the other parameters and the transform parameters */ public Map<String,List<String>> merge(Map<String,List<String>> currentParams) { Map<String,List<String>> params = (currentParams != null) ? currentParams : new RequestParameters(); params.put("transform", Arrays.asList(getName())); for (Map.Entry<String, List<String>> entry: entrySet()) { params.put("trans:"+entry.getKey(), entry.getValue()); } return params; } }
void addParams() { String directory = queryDef.getDirectory(); if (directory != null) { params.add("directory", directory); } params.add("collection", queryDef.getCollections()); String optionsName = queryDef.getOptionsName(); if (optionsName != null && optionsName.length() > 0) { params.add("options", optionsName); } ServerTransform transform = queryDef.getResponseTransform(); if (transform != null) { if (responseTransform != null) { if ( ! transform.getName().equals(responseTransform.getName()) ) { throw new IllegalStateException("QueryDefinition transform and DocumentManager transform have different names (" + transform.getName() + ", " + responseTransform.getName() + ")"); } logger.warn("QueryDefinition and DocumentManager both specify a ServerTransform--using params from QueryDefinition"); } transform.merge(params); } else if (responseTransform != null) { responseTransform.merge(params); } if (transaction != null) { params.add("txid", transaction.getTransactionId()); } }