Skip to content

Support for form creation #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed

Conversation

dschulten
Copy link
Contributor

Quite a pull request, I know, but focused to form creation :-)

  • Added support for form creation. The general idea is: Configure a HtmlResourceMessageConverter and point to a form handler method like this:

    ActionDescriptor form = ControllerActionBuilder.createActionFor(
            methodOn(SamplePersonController.class).showPerson(defaultPersonId), 
    
  • Bumped up Spring version to get support for mvc tests -> see HtmlResourceMessageConverterTest with HtmlResourceMessageConverterTest-context.xml and SamplePersonController for usage of form creation.

  • Fixed an issue in ControllerLinkBuilder with handler methods having both path variables and request params

  • Added a method getBoundMethodParameterValues to AnnotatedParametersParameterAccessor which allows me to get the full info about the recorded method invocation parameters, not just the value. This is needed during form creation, e.g. to support hidden fields and input types.

…a target controller

added ControllerLinkBuilder.linksToResources method which collects all resources on a controller and provides link templates for them, as preparation for automatic creation of xhtml forms for resources with request params.
Started work on HtmlFormMessageConverter
Conflicts:
	pom.xml

Resolved conflicts in pom, removed httpclient
Reordered ControllerLinkBuilder.java, removed unused code
Conflicts:
	pom.xml
	template.mf
Conflicts:
	src/main/java/org/springframework/hateoas/jaxrs/JaxRsLinkBuilder.java
	src/main/java/org/springframework/hateoas/mvc/ControllerLinkBuilder.java
	src/main/java/org/springframework/hateoas/mvc/ControllerLinkBuilderFactory.java
	src/test/java/org/springframework/hateoas/mvc/ControllerLinkBuilderUnitTest.java
Support for default field values based on methodOn invocation
Introduced MethodParameterValue as container for invocation parameter info
Moved form creation stuff from ControllerLinkBuilder to new ControllerFormBuilder
added test for ControllerFormBuilder
…a type level request mapping and a method level request mapping with template variables.

Bumped up Spring version to 3.2.0.RELEASE in order to get spring-test-mvc support.
Streamlined the form descriptor attribute names after removal of LinkTemplate
Added SamplePersonController and related classes for demonstration of ControllerFormBuilder.java in ControllerFormBuilderMvcTest
Finalized support for form input default values, see ControllerFormBuilderMvcTest
moved forms stuff to hateoas.action package. The term action is used both by Siren and Html forms, therefore the package name
renamed invocation value in MethodParameterValue to callValue to avoid confusion with linkTo(methodOn), where methodOn is called invocationValue
…ved in the actionLink property. Using RequestMethod as parameter type for the request method.

Changed method name changePerson to editPerson in SamplePersonController.java
…, reflecting its potential purpose to create a Html representation of a resource with or without forms. Actions are just an optional facility of a resource.
Streamlined terminology: using action instead of form
…erter.java

brushed up javadoc to reflect name change
@dschulten
Copy link
Contributor Author

pull request for #34

Added support for html5 form input types. By default we distinguish number and text, the Input annotation can be used to specify a more exact type, incl. hidden. The Input annotation gives clients information about expected types, self-describing the necessary input parameter, and it allows the server to control which data should be entered into the form and which data should be submitted as-is.
Conflicts:
	pom.xml
	src/main/java/org/springframework/hateoas/core/LinkBuilderSupport.java
	src/main/java/org/springframework/hateoas/mvc/ControllerLinkBuilder.java
	src/main/java/org/springframework/hateoas/mvc/ResourceAssemblerSupport.java
	src/test/java/org/springframework/hateoas/mvc/ControllerLinkBuilderUnitTest.java
@dschulten
Copy link
Contributor Author

Closed, the pull request contains too many changes at once

@dschulten dschulten closed this May 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant