protected HashMap<String,String> convertFormStrings(Form params) { HashMap<String,String> converted = new HashMap<String,String>(); for (String key : params.getNames()) { Matcher matcher = xmlnsRE.matcher(key); if (matcher.matches()) { // nop } else { converted.put(key, params.getFirstValue(key)); } } return converted; }
protected HashMap<String,String> bindingsFromForm(Form params) { HashMap<String,String> bindings = new HashMap<String,String> (); for (String key : params.getNames()) { Matcher matcher = xmlnsRE.matcher(key); if (matcher.matches()) { bindings.put(matcher.group(1), params.getFirstValue(key)); } } return bindings; }
protected HashMap<String,String> convertFormStrings(Form params) { HashMap<String,String> converted = new HashMap<String,String>(); for (String key : params.getNames()) { Matcher matcher = xmlnsRE.matcher(key); if (matcher.matches()) { // nop } else { converted.put(key, params.getFirstValue(key)); } } return converted; }
protected HashMap<String,String> bindingsFromForm(Form params) { HashMap<String,String> bindings = new HashMap<String,String> (); for (String key : params.getNames()) { Matcher matcher = xmlnsRE.matcher(key); if (matcher.matches()) { bindings.put(matcher.group(1), params.getFirstValue(key)); } } return bindings; }
/** * Reads parameter names from the form returned {@link #getForm()}. * */ @Override public Iterator<String> getParameterNamesIterator() { return getForm().getNames().iterator(); }
public RequestParametersForm(Form form) { super(); for (String key : form.getNames()) { // For each parameter in the form, add the parameter name and value // to the Map<String, Object>. keyValuePairs.put(key, form.getFirst(key).getValue()); } }
protected HashMap<QName,String> convertForm(Form params) { HashMap<QName,String> converted = new HashMap<QName,String>(); HashMap<String,String> bindings = bindingsFromForm(params); for (String key : params.getNames()) { Matcher matcher = xmlnsRE.matcher(key); if (matcher.matches()) { // nop } else { QName name = qnameFromForm(key, bindings); converted.put(name, params.getFirstValue(key)); } } return converted; }
protected HashMap<QName,String> convertForm(Form params) { HashMap<QName,String> converted = new HashMap<QName,String>(); HashMap<String,String> bindings = bindingsFromForm(params); for (String key : params.getNames()) { Matcher matcher = xmlnsRE.matcher(key); if (matcher.matches()) { // nop } else { QName name = qnameFromForm(key, bindings); converted.put(name, params.getFirstValue(key)); } } return converted; }
if (form.getNames().isEmpty()) { object.setClassName(httpServletRequest.getParameter(CLASSNAME_FIELD_NAME)); object.setClassName(form.getFirstValue(CLASSNAME_FIELD_NAME)); for (String name : form.getNames()) { if (name.startsWith(PROPERTY_PREFIX)) { Property property = objectFactory.createProperty();
if (form.getNames().isEmpty()) { try { comment.setReplyTo(Integer.parseInt(httpServletRequest.getParameter(COMMENT_REPLYTO_FIELD_NAME)));
List<AnnotationField> annotationFields = new ArrayList<AnnotationField>(); AnnotationRequest.Request requestedFields = new AnnotationRequest.Request(); for (String name : form.getNames()) { if (StringUtils.startsWith(name, ANNOTATION_REQUEST_FILTER_PARAMETER_PREFIX)) { for (String value : form.getValuesArray(name)) {
public Page readFrom(Class<Page> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { ObjectFactory objectFactory = new ObjectFactory(); Page page = objectFactory.createPage(); HttpServletRequest httpServletRequest = (HttpServletRequest) Context.getCurrent().getAttributes().get(Constants.HTTP_REQUEST); Representation representation = new InputRepresentation(entityStream, org.restlet.data.MediaType.APPLICATION_WWW_FORM); Form form = new Form(representation); /* * If the form is empty then it might have happened that some filter has invalidated the entity stream. Try to * read data using getParameter() */ if (form.getNames().isEmpty()) { page.setTitle(httpServletRequest.getParameter(TITLE_FIELD_NAME)); page.setParent(httpServletRequest.getParameter(PARENT_FIELD_NAME)); page.setContent(httpServletRequest.getParameter(CONTENT_FIELD_NAME)); } else { page.setTitle(form.getFirstValue(TITLE_FIELD_NAME)); page.setParent(form.getFirstValue(PARENT_FIELD_NAME)); page.setContent(form.getFirstValue(CONTENT_FIELD_NAME)); } return page; }
for (String paramName : form.getNames()) { if (paramName.startsWith(prefix)) { Literal value = FF.literal(form.getFirstValue(paramName));
if (form.getNames().isEmpty()) { String text = httpServletRequest.getParameter(TAGS_FIELD_NAME); if (text != null) {
Set<String> paramNames = form.getNames(); String prefix = "parameter_"; for (String name : paramNames) {