[JBoss JIRA] (FORGE-1892) REST endpoint should also consume/produce JSon
by Vineet Reynolds (JIRA)
[ https://issues.jboss.org/browse/FORGE-1892?page=com.atlassian.jira.plugin... ]
Vineet Reynolds reassigned FORGE-1892:
--------------------------------------
Assignee: Vineet Reynolds
> REST endpoint should also consume/produce JSon
> ----------------------------------------------
>
> Key: FORGE-1892
> URL: https://issues.jboss.org/browse/FORGE-1892
> Project: Forge
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Scaffold
> Affects Versions: 2.6.0.Final
> Reporter: Antonio Goncalves
> Assignee: Vineet Reynolds
> Fix For: 2.x Future
>
>
> When a REST endoint is generated, there is only support for XML MIMETYPE
> {code}
> @GET
> @Produces("application/xml")
> public List<Book> listAll(@QueryParam("start") Integer startPosition, @QueryParam("max") Integer maxResult)
> {code}
> It would be good to have both XML and JSON
> {code}
> @GET
> @Produces({"application/xml","application/json"})
> public List<Book> listAll(@QueryParam("start") Integer startPosition, @QueryParam("max") Integer maxResult)
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 6 months
[JBoss JIRA] (FORGE-1925) Forge fails to assign values to UIInputMany instances
by Vineet Reynolds (JIRA)
Vineet Reynolds created FORGE-1925:
--------------------------------------
Summary: Forge fails to assign values to UIInputMany instances
Key: FORGE-1925
URL: https://issues.jboss.org/browse/FORGE-1925
Project: Forge
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: UI - Shell
Affects Versions: 2.7.0.Final
Environment: Fedora 20, Oracle Java 8
Reporter: Vineet Reynolds
Assignee: Vineet Reynolds
When I have a UIInputMany instance like so:
{noformat}
@Inject
@WithAttributes(label = "Content Type", defaultValue = MediaType.APPLICATION_JSON, required = true)
private UIInputMany<String> contentType;
{noformat}
with an auto-completor configured as:
{noformat}
contentType.setCompleter(new UICompleter<String>() {
@Override
public Iterable<String> getCompletionProposals(UIContext context, InputComponent<?, String> input, String value) {
List<String> options = new ArrayList<>();
options.add(MediaType.APPLICATION_XML);
options.add(MediaType.APPLICATION_JSON);
return options;
}
});
{noformat}
then, when I execute a command that contains the {{UIInputMany}} field, the value entered by the end-user to the named parameter is not assigned to the component, resulting in an error:
{noformat}
[demo]$ rest-generate-endpoints-from-entities --targets org.demo.model.Customer --contentType application/oml
***ERROR*** Content Type must be specified.
{noformat}
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 6 months
[JBoss JIRA] (FORGE-1273) REST NOT_FOUND should be NO_CONTENT
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1273?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-1273.
----------------------------------
Fix Version/s: (was: 2.x Future)
Resolution: Won't Fix
After some discussion in the #forge channel, we decided that this will not be fixed.
It's clear to us that when accessing a URL like {{/rest/book/1}} and this ID doesn't exist, it should return NOT_FOUND(404) (the intention is to say to the caller that he made a wrong call).
If querying from a collection resource is made {{/rest/books?id=1}}, then it's fine to return NO_CONTENT.
> REST NOT_FOUND should be NO_CONTENT
> -----------------------------------
>
> Key: FORGE-1273
> URL: https://issues.jboss.org/browse/FORGE-1273
> Project: Forge
> Issue Type: Enhancement
> Security Level: Public(Everyone can see)
> Components: Java EE, Scaffold
> Affects Versions: 1.4.2.Final
> Reporter: Antonio Goncalves
> Attachments: rest.tiff, rest2.tiff
>
>
> Hi,
> In the REST endpoint generated code we have the following methods that return a Status.NOT_FOUND status in case the entity is not found :
> {code}
> @DELETE
> @Path("/{id:[0-9][0-9]*}")
> public Response deleteById(@PathParam("id") Long id)
> {
> Book entity = em.find(Book.class, id);
> if (entity == null)
> {
> return Response.status(Status.NOT_FOUND).build();
> }
> em.remove(entity);
> return Response.noContent().build();
> }
> @GET
> @Path("/{id:[0-9][0-9]*}")
> @Produces("application/xml")
> public Response findById(@PathParam("id") Long id)
> {
> TypedQuery<Book> findByIdQuery = em.createQuery("SELECT DISTINCT b FROM Book b WHERE b.id = :entityId ORDER BY b.id", Book.class);
> findByIdQuery.setParameter("entityId", id);
> Book entity;
> try
> {
> entity = findByIdQuery.getSingleResult();
> }
> catch (NoResultException nre)
> {
> entity = null;
> }
> if (entity == null)
> {
> return Response.status(Status.NOT_FOUND).build();
> }
> return Response.ok(entity).build();
> }
> {code}
> In both cases it should be a Status.NO_CONTENT. The resource exists (otherwise it would have been impossible to invoke it) it just happens that it returns an empty body (with a no content status)
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 6 months
[JBoss JIRA] (FORGE-1555) Autocomplete should display options without requiring a user to type in a double hyphen --
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1555?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-1555.
----------------------------------
> Autocomplete should display options without requiring a user to type in a double hyphen --
> ------------------------------------------------------------------------------------------
>
> Key: FORGE-1555
> URL: https://issues.jboss.org/browse/FORGE-1555
> Project: Forge
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: UI - Shell
> Affects Versions: 2.0.0.Final
> Reporter: Vineet Reynolds
> Fix For: 2.x Future
>
>
> When I key in
> {noformat}
> [Order.java]$ jpa-new-field --named description <TAB>
> {noformat}, I do not get to see the options available for the command, until I key in a double-hyphen, like so:
> {noformat}
> [Order.java]$ jpa-new-field --named description --
> --targetEntity --type --length --lob
> {noformat}
> I think a tying a TAB after a space should display the options for a command.
> Note that this issue is limited in scope (and is different from FORGE-1554) to ensuring that parameter names are displayed as autocomplete options without requiring a {{--}} to be keyed in by the user.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 6 months
[JBoss JIRA] (FORGE-1053) Create a Spring Furnace container
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1053?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-1053.
----------------------------------
Resolution: Won't Fix
No need to have a Spring container, since CDI should be promoted instead.
> Create a Spring Furnace container
> ---------------------------------
>
> Key: FORGE-1053
> URL: https://issues.jboss.org/browse/FORGE-1053
> Project: Forge
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Furnace (Container)
> Affects Versions: 2.0.0.Alpha8
> Reporter: George Gastaldi
> Priority: Optional
> Labels: container, di, spring
> Fix For: 2.x Future
>
>
> It would be interesting to have a Spring addon to demonstrate that Furnace is "dependency injection agnostic". It would be nice to envolve the Snowdrop Team on this task
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
10 years, 6 months