On 4 June 2014 22:53, Juan Martin Buireo <[email protected]> wrote: > Thanks for the answer, it worked perfectly what you said.
[snip] I have another question. Does Apache Isis have a plugin for mobile apps or > something similar? What I am trying to say is an example of what OpenXava > has: http://www.openxava.org/xavaphone. > Not right now, at least not out of the box and as polished as OpenXava would seem to have. > This allows to make a web application and after it's finished with that > plugin I can turn it into a mobile web application. Is Apache Isis > considering to do it in a not distant future? > > Our direction is to build on the REST API provided by our Restful Objects viewer [1], which implements the RO spec [2]. The intent is then for client-side Javascript apps to consume this API. The "next-gen" Isis viewer will probably be written in AngularJS or similar. I'm guessing that XavaPhone looks more like a PhoneGap'd webapp? It would certainly be possible to adapt and reskin the Wicket viewer to support this, but it would probably take a good few weeks working full time to do so... Not on the roadmap for me. Going back to RO client apps, last year we had two Google Summer of Coders write generic viewers against RO. One was a native Android viewer, the other was PhoneGap/JQueryMobile. Both would need some tidy up, but the JQM one is most similar to OpenXava (albeit a different architecture); see [3] HTH Dan [1] http://isis.apache.org/documentation.html#restfulobjects-viewer [2] http://restfulobjects.org [3] http://isis.apache.org/documentation.html#other-topics --- in the right-most column ~~~~~~~ > Hi Juan, > (two requests: could you send just to users@ rather than to both users@ > and also dev@; also could you subscribe to users@ so that I don't have to > approve your posting and can make sure you get any replies. Thanks). > OK, this is easy to achieve enough to achieve. Several ways to accomplish > it, in fact. > given: > public class Clients { > > public Client create(final @Named("Nombre") String name, final > @Named("Apellido") String surname, final @Named("Direccion") String > address, final @Named("Pais") Country country) { > final Client client = newTransientInstance(Client.class); > client.setName(name); > client.setSurname(surname); > client.setAddress(address); > client.setCountry(country); > persist(client); > return client; > } > ... > } > > Option 1 [1]: if the list of Countrys is bounded and immutable (which it > probably is), then just add @Bounded as an annotation to Country class: > @Bounded > public class Country { ... } > ~~~ > Option 2 [2]: if the list of Countries is the same in every context, but > is quite long and you want to filter by name, then provide an autoComplete > repository method: > @AutoComplete(repository=Customers.class) > public class Country { > ... > } > > public class Countries { > ... > @Hidden > public List<Property> autoComplete(String searchPhrase) { > return ... > } > } > > ~~~ > Option 3 [3]: if the list of Countries varies by context, and you don't > want to filter by name, then provide a supporting choices method: > > public class Clients { > > public Client create(final @Named("Nombre") String name, final > @Named("Apellido") String surname, final @Named("Direccion") String > address, final @Named("Pais") Country country) { ... } > public Collection<Country> choices3Create() { > ... > } > ... > } > ~~~ > Option 4 [4]: if the list of Countries varies by context and you want to > filter by name, then provide a supporting autoComplete method: > public class Clients { > > public Client create(final @Named("Nombre") String name, final > @Named("Apellido") String surname, final @Named("Direccion") String > address, final @Named("Pais") Country country) { ... } > public Collection<Country> choices3AutoComplete(String > searchPhrase) { > ... > } > ... > } > > Let us know how you get on, > Dan > > PS: I saw you had @ActionSemantics(Of.SAFE) for some actions - like create > - that produce side-effects, ie are not safe. Recommend you change > accordingly. (In the REST API, the @ActionSemantics is translated into > either an HTTP GET, PUT or POST). > > [1] > http://isis.apache.org/how-tos/how-to-03-030-How-to-specify-that-a-class-of-objects-has-a-limited-number-of-instances.html > [2] > http://isis.apache.org/how-tos/how-to-03-040-How-to-find-an-entity-(for-an-action-parameter-or-property)-using-auto-complete.html > [3] > http://isis.apache.org/how-tos/how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.html > [4] > http://isis.apache.org/how-tos/how-to-03-025-How-to-specify-an-autocomplete-for-an-action-parameter.html > Thank you > Juan > > > On 4 June 2014 22:53, Juan Martin Buireo <[email protected]> wrote: > Thanks for the answer, it worked perfectly what you said. I have already > subscribed to [email protected]. I have another question. > Does Apache Isis have a plugin for mobile apps or something similar? What I > am trying to say is an example of what OpenXava has: > http://www.openxava.org/xavaphone. This allows to make a web application > and after it's finished with that plugin I can turn it into a mobile web > application. Is Apache Isis considering to do it in a not distant future? > > Thank you > Juan > > > 2014-06-03 19:43 GMT-03:00 Dan Haywood <[email protected]>: > > Hi Juan, >> >> (two requests: could you send just to users@ rather than to both users@ >> and also dev@; also could you subscribe to users@ so that I don't have >> to approve your posting and can make sure you get any replies. Thanks). >> >> OK, this is easy to achieve enough to achieve. Several ways to >> accomplish it, in fact. >> >> given: >> >> public class Clients { >> public Client create(final @Named("Nombre") String name, final >> @Named("Apellido") String surname, final @Named("Direccion") String >> address, final @Named("Pais") Country country) { >> final Client client = newTransientInstance(Client.class); >> client.setName(name); >> client.setSurname(surname); >> client.setAddress(address); >> client.setCountry(country); >> persist(client); >> return client; >> } >> >> ... >> } >> >> >> Option 1 [1]: if the list of Countrys is bounded and immutable (which it >> probably is), then just add @Bounded as an annotation to Country class: >> >> @Bounded >> public class Country { ... } >> >> ~~~ >> >> Option 2 [2]: if the list of Countries is the same in every context, but >> is quite long and you want to filter by name, then provide an autoComplete >> repository method: >> >> @AutoComplete(repository=Customers.class) >> public class Country { >> ... >> } >> >> >> public class Countries { >> ... >> @Hidden >> public List<Property> autoComplete(String searchPhrase) { >> return ... >> } >> } >> >> >> ~~~ >> Option 3 [3]: if the list of Countries varies by context, and you don't >> want to filter by name, then provide a supporting choices method: >> >> >> public class Clients { >> public Client create(final @Named("Nombre") String name, final >> @Named("Apellido") String surname, final @Named("Direccion") String >> address, final @Named("Pais") Country country) { ... } >> >> public Collection<Country> choices3Create() { >> ... >> } >> >> ... >> } >> >> ~~~ >> >> Option 4 [4]: if the list of Countries varies by context and you want to >> filter by name, then provide a supporting autoComplete method: >> >> public class Clients { >> public Client create(final @Named("Nombre") String name, final >> @Named("Apellido") String surname, final @Named("Direccion") String >> address, final @Named("Pais") Country country) { ... } >> >> public Collection<Country> choices3AutoComplete(String >> searchPhrase) { >> ... >> } >> >> ... >> } >> >> >> Let us know how you get on, >> >> Dan >> >> >> PS: I saw you had @ActionSemantics(Of.SAFE) for some actions - like >> create - that produce side-effects, ie are not safe. Recommend you change >> accordingly. (In the REST API, the @ActionSemantics is translated into >> either an HTTP GET, PUT or POST). >> >> >> [1] >> http://isis.apache.org/how-tos/how-to-03-030-How-to-specify-that-a-class-of-objects-has-a-limited-number-of-instances.html >> [2] >> http://isis.apache.org/how-tos/how-to-03-040-How-to-find-an-entity-(for-an-action-parameter-or-property)-using-auto-complete.html >> [3] >> http://isis.apache.org/how-tos/how-to-03-020-How-to-specify-a-set-of-choices-for-an-action-parameter.html >> [4] >> http://isis.apache.org/how-tos/how-to-03-025-How-to-specify-an-autocomplete-for-an-action-parameter.html >> >> >> >> >> >> >> On 3 June 2014 23:17, Juan Martin Buireo <[email protected]> wrote: >> >>> Hi, I am with a problem trying to implement something on Apache Isis. >>> Here is what I want to do: >>> I have a class Country that has a String with the name of the country. >>> Also I have a class called Client which represents a client with the >>> following variables: String name, String surname, String address, Country >>> country. I made the setters and getters for all the properties. I also have >>> the classes Countries and Clients. Both of this classes have the methods >>> create and listAll. My problem is: I want to create a new Client and when I >>> create it, I want to have a select with the countries that I already >>> persisted. The problem is that I can't achieve this. I send the classes >>> done on attachment to understand how I am doing it. But basically is that >>> what I want, that when I create a new client, this one has a name, surname >>> and address to complete and a select with the countries that I already >>> persisted. >>> Thank you >>> >> >> >
