You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Stephen Cameron <st...@gmail.com> on 2015/05/25 07:51:10 UTC

Modifying SimpleApp

Hello,

I am trying to modify the SimpleApp archetype in Eclipse, but I am not very
familiar with Maven. When I modifiy the myapp-dom project, by copying the
SimpleObject and renaming it I need to make the changes flow through to the
webapp project. At the moment I am getting an Isis error message, in the
jetty:run target, telling me I have two 'SIMPLE' objects.

Sorry this is a basic question, but can someone please point  me to a guide
that explains how to work with Maven in this project group in
Eclipse situation.

Thanks
Steve Cameron

Re: Modifying SimpleApp

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 28 May 2015 at 04:40, Stephen Cameron <st...@gmail.com> wrote:

>
>
> A question: I have a collection inside an entity, can I via the
> Wicket viewer show an action that creates a new entity member of the
> collection? In my case I have Activities and these have 0:N Clients as
> Participants, is it possible to create a new Client as I add Client
> Participants to an Activity? I have the list of exising Clients as my
> drop-down choose list, but want to make a new Client if its not in the
> list.
>
>
Sorry, missed this one.

Short answer is no, we don't have support for this.  But you could provide
a different action to create a new Client and associate them as a
Participant:

public class Activity {

    public SortedSet<Client> getParticipants() { ... }

    public Activity addParticipant(Client client) {
        getParticipants().add(client);
        return this;
    }
    public Collection<Client> autoComplete0AddParticipant() { ... }

    public Activity addNewClientAsParticipant( ...lot of args used to
create a client ... ) {
        Client newClient = container.newTransientInstance(Client.class)
         newClient.setThis(...);
         newClient.setThat(...);
         newClient.setTheOther(...);
         container.persist(newClient);
         return addParticipant(newClient);
    }
}

If you associate both the actions with the Participants collection it'll
probably provide a "good-enough" UI.

HTH
Dan









> Thanks
> Steve Cameron
>
>
> On Tue, May 26, 2015 at 5:54 PM, Dan Haywood <dan@haywood-associates.co.uk
> >
> wrote:
>
> > If you use the m2e plugin for Eclipse then it should reverse engineer the
> > .classpath and  .project file for you.
> >
> > Also be aware that you need to set up the DataNucleus enhancer; there's
> div
> > on the Isis website.
> >
> > HTH
> > Dan
> > On 26 May 2015 02:36, "Stephen Cameron" <st...@gmail.com>
> > wrote:
> >
> > > Hi Dan, You are close, but I think its simply that the class version in
> > the
> > > myapp-webapp project is not being replaced after I made the change you
> > > suggested, so when I try to run the app I get the runtime error
> message,
> > > and when I go to the webpage also. I think I have to make the
> > myapp-webapp
> > > dependant on the myapp-dom project in Eclipse itself, rather than
> > thinking
> > > Maven does everything when I change the dom.
> > >
> > > I'm trying to get someone interested in Isis with a demo, but I am a
> bit
> > > out of practice with Java :(
> > >
> > >
> > > On Mon, May 25, 2015 at 5:22 PM, Dan Haywood <
> > dan@haywood-associates.co.uk
> > > >
> > > wrote:
> > >
> > > > My guess is that it isn't a Maven error, but instead is an Isis one.
> > > >
> > > > The @DomainObject(objectType=..) annotation defines an alias for the
> > > Class
> > > > that is used in the Restful Objects REST API (as well as elsewhere);
> > Isis
> > > > requires that it is unique across all entities. So just change the
> > value
> > > of
> > > > this in your copy and try again.
> > > >
> > > > Cheers, Dan
> > > > On 25 May 2015 06:51, "Stephen Cameron" <st...@gmail.com>
> > > > wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I am trying to modify the SimpleApp archetype in Eclipse, but I am
> > not
> > > > very
> > > > > familiar with Maven. When I modifiy the myapp-dom project, by
> copying
> > > the
> > > > > SimpleObject and renaming it I need to make the changes flow
> through
> > to
> > > > the
> > > > > webapp project. At the moment I am getting an Isis error message,
> in
> > > the
> > > > > jetty:run target, telling me I have two 'SIMPLE' objects.
> > > > >
> > > > > Sorry this is a basic question, but can someone please point  me
> to a
> > > > guide
> > > > > that explains how to work with Maven in this project group in
> > > > > Eclipse situation.
> > > > >
> > > > > Thanks
> > > > > Steve Cameron
> > > > >
> > > >
> > >
> >
>

Re: Modifying SimpleApp

Posted by Stephen Cameron <st...@gmail.com>.
I have it working by doing a mvn clean install on the dom project, then mvn
jetty:run on the dom project.

Probably not correct, but it works. I am used to Dynamic Web Projects in
Eclipse, but will persist with Maven as I need to understand it better, as
well as learning Apache Isis!!

The DataNucleus enhancer is installed and working.

A question: I have a collection inside an entity, can I via the
Wicket viewer show an action that creates a new entity member of the
collection? In my case I have Activities and these have 0:N Clients as
Participants, is it possible to create a new Client as I add Client
Participants to an Activity? I have the list of exising Clients as my
drop-down choose list, but want to make a new Client if its not in the list.

Thanks
Steve Cameron


On Tue, May 26, 2015 at 5:54 PM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> If you use the m2e plugin for Eclipse then it should reverse engineer the
> .classpath and  .project file for you.
>
> Also be aware that you need to set up the DataNucleus enhancer; there's div
> on the Isis website.
>
> HTH
> Dan
> On 26 May 2015 02:36, "Stephen Cameron" <st...@gmail.com>
> wrote:
>
> > Hi Dan, You are close, but I think its simply that the class version in
> the
> > myapp-webapp project is not being replaced after I made the change you
> > suggested, so when I try to run the app I get the runtime error message,
> > and when I go to the webpage also. I think I have to make the
> myapp-webapp
> > dependant on the myapp-dom project in Eclipse itself, rather than
> thinking
> > Maven does everything when I change the dom.
> >
> > I'm trying to get someone interested in Isis with a demo, but I am a bit
> > out of practice with Java :(
> >
> >
> > On Mon, May 25, 2015 at 5:22 PM, Dan Haywood <
> dan@haywood-associates.co.uk
> > >
> > wrote:
> >
> > > My guess is that it isn't a Maven error, but instead is an Isis one.
> > >
> > > The @DomainObject(objectType=..) annotation defines an alias for the
> > Class
> > > that is used in the Restful Objects REST API (as well as elsewhere);
> Isis
> > > requires that it is unique across all entities. So just change the
> value
> > of
> > > this in your copy and try again.
> > >
> > > Cheers, Dan
> > > On 25 May 2015 06:51, "Stephen Cameron" <st...@gmail.com>
> > > wrote:
> > >
> > > > Hello,
> > > >
> > > > I am trying to modify the SimpleApp archetype in Eclipse, but I am
> not
> > > very
> > > > familiar with Maven. When I modifiy the myapp-dom project, by copying
> > the
> > > > SimpleObject and renaming it I need to make the changes flow through
> to
> > > the
> > > > webapp project. At the moment I am getting an Isis error message, in
> > the
> > > > jetty:run target, telling me I have two 'SIMPLE' objects.
> > > >
> > > > Sorry this is a basic question, but can someone please point  me to a
> > > guide
> > > > that explains how to work with Maven in this project group in
> > > > Eclipse situation.
> > > >
> > > > Thanks
> > > > Steve Cameron
> > > >
> > >
> >
>

Re: Modifying SimpleApp

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
If you use the m2e plugin for Eclipse then it should reverse engineer the
.classpath and  .project file for you.

Also be aware that you need to set up the DataNucleus enhancer; there's div
on the Isis website.

HTH
Dan
On 26 May 2015 02:36, "Stephen Cameron" <st...@gmail.com> wrote:

> Hi Dan, You are close, but I think its simply that the class version in the
> myapp-webapp project is not being replaced after I made the change you
> suggested, so when I try to run the app I get the runtime error message,
> and when I go to the webpage also. I think I have to make the myapp-webapp
> dependant on the myapp-dom project in Eclipse itself, rather than thinking
> Maven does everything when I change the dom.
>
> I'm trying to get someone interested in Isis with a demo, but I am a bit
> out of practice with Java :(
>
>
> On Mon, May 25, 2015 at 5:22 PM, Dan Haywood <dan@haywood-associates.co.uk
> >
> wrote:
>
> > My guess is that it isn't a Maven error, but instead is an Isis one.
> >
> > The @DomainObject(objectType=..) annotation defines an alias for the
> Class
> > that is used in the Restful Objects REST API (as well as elsewhere); Isis
> > requires that it is unique across all entities. So just change the value
> of
> > this in your copy and try again.
> >
> > Cheers, Dan
> > On 25 May 2015 06:51, "Stephen Cameron" <st...@gmail.com>
> > wrote:
> >
> > > Hello,
> > >
> > > I am trying to modify the SimpleApp archetype in Eclipse, but I am not
> > very
> > > familiar with Maven. When I modifiy the myapp-dom project, by copying
> the
> > > SimpleObject and renaming it I need to make the changes flow through to
> > the
> > > webapp project. At the moment I am getting an Isis error message, in
> the
> > > jetty:run target, telling me I have two 'SIMPLE' objects.
> > >
> > > Sorry this is a basic question, but can someone please point  me to a
> > guide
> > > that explains how to work with Maven in this project group in
> > > Eclipse situation.
> > >
> > > Thanks
> > > Steve Cameron
> > >
> >
>

Re: Modifying SimpleApp

Posted by Stephen Cameron <st...@gmail.com>.
Hi Dan, You are close, but I think its simply that the class version in the
myapp-webapp project is not being replaced after I made the change you
suggested, so when I try to run the app I get the runtime error message,
and when I go to the webpage also. I think I have to make the myapp-webapp
dependant on the myapp-dom project in Eclipse itself, rather than thinking
Maven does everything when I change the dom.

I'm trying to get someone interested in Isis with a demo, but I am a bit
out of practice with Java :(


On Mon, May 25, 2015 at 5:22 PM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> My guess is that it isn't a Maven error, but instead is an Isis one.
>
> The @DomainObject(objectType=..) annotation defines an alias for the Class
> that is used in the Restful Objects REST API (as well as elsewhere); Isis
> requires that it is unique across all entities. So just change the value of
> this in your copy and try again.
>
> Cheers, Dan
> On 25 May 2015 06:51, "Stephen Cameron" <st...@gmail.com>
> wrote:
>
> > Hello,
> >
> > I am trying to modify the SimpleApp archetype in Eclipse, but I am not
> very
> > familiar with Maven. When I modifiy the myapp-dom project, by copying the
> > SimpleObject and renaming it I need to make the changes flow through to
> the
> > webapp project. At the moment I am getting an Isis error message, in the
> > jetty:run target, telling me I have two 'SIMPLE' objects.
> >
> > Sorry this is a basic question, but can someone please point  me to a
> guide
> > that explains how to work with Maven in this project group in
> > Eclipse situation.
> >
> > Thanks
> > Steve Cameron
> >
>

Re: Modifying SimpleApp

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
My guess is that it isn't a Maven error, but instead is an Isis one.

The @DomainObject(objectType=..) annotation defines an alias for the Class
that is used in the Restful Objects REST API (as well as elsewhere); Isis
requires that it is unique across all entities. So just change the value of
this in your copy and try again.

Cheers, Dan
On 25 May 2015 06:51, "Stephen Cameron" <st...@gmail.com> wrote:

> Hello,
>
> I am trying to modify the SimpleApp archetype in Eclipse, but I am not very
> familiar with Maven. When I modifiy the myapp-dom project, by copying the
> SimpleObject and renaming it I need to make the changes flow through to the
> webapp project. At the moment I am getting an Isis error message, in the
> jetty:run target, telling me I have two 'SIMPLE' objects.
>
> Sorry this is a basic question, but can someone please point  me to a guide
> that explains how to work with Maven in this project group in
> Eclipse situation.
>
> Thanks
> Steve Cameron
>

Re: Modifying SimpleApp

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Please paste the error message with its stacktrace.
It could be that you use the same table [1], or the same unique constraint
[2], or something else.


1.
https://github.com/apache/isis/blob/a106383e34899a67605c1192d18254b2e70f1716/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java#L42
2.
https://github.com/apache/isis/blob/a106383e34899a67605c1192d18254b2e70f1716/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java#L61

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, May 25, 2015 at 8:51 AM, Stephen Cameron <steve.cameron.62@gmail.com
> wrote:

> Hello,
>
> I am trying to modify the SimpleApp archetype in Eclipse, but I am not very
> familiar with Maven. When I modifiy the myapp-dom project, by copying the
> SimpleObject and renaming it I need to make the changes flow through to the
> webapp project. At the moment I am getting an Isis error message, in the
> jetty:run target, telling me I have two 'SIMPLE' objects.
>
> Sorry this is a basic question, but can someone please point  me to a guide
> that explains how to work with Maven in this project group in
> Eclipse situation.
>
> Thanks
> Steve Cameron
>