Re: Application Tenancy

2015-11-26 Thread Stephen Cameron
Hi, I think I've read somewhere that domain services aren't always injected into entities by default and you sometimes have to trigger this yourself? Is this a correct? Thank On Thu, Nov 26, 2015 at 10:00 AM, Stephen Cameron < steve.cameron...@gmail.com> wrote: > I cannot try alternatives til

Re: Application Tenancy

2015-11-26 Thread Dan Haywood
If you just new them up: Customer cust = new Customer(); then the framework doesn't know about it and any services will be null. You can then use: domainObjectContainer.injectServicesInto(cust); ~~~ Alternatively, use: Customer cust = container.newTransientInstance(Customer.class); to do bo

Re: Application Tenancy

2015-11-26 Thread Stephen Cameron
That is not the problem then, Its a bit bizarre actually, I generated some logging and added some messages, I see that two objects Participation and Participant do have their region value set but the Person object doesn't. All these objects extend the same base class, but the SQL insert created

Re: Application Tenancy

2015-11-26 Thread Stephen Cameron
My silly mistake! On Thu, Nov 26, 2015 at 8:40 PM, Stephen Cameron wrote: > That is not the problem then, > > Its a bit bizarre actually, I generated some logging and added some > messages, I see that two objects Participation and Participant do have > their region value set but the Person objec

Re: Thinking about re-introducing UML in our workflow

2015-11-26 Thread Dan Haywood
Just to pull this thread apart a little: - there are various tools candidates for Oscar's original use case, ie to model class diagrams then forward generate into Java, thereafter ideally to allow reverse engineering. Eclipse Papyrus looks promising for this - for old-fashioned visualization of e

Re: Thinking about re-introducing UML in our workflow

2015-11-26 Thread Óscar Bou - GOVERTIS
Hi, Dan for this summary. I agree with Cesar that Eclipse Papyrus can be of help for the initial use case. Just needing to know if it’s only a matter of configuring their profiles or primitive types definition to generate entities, properties, actions, etc. annotated with JDO and Isis annotatio

Re: Application Tenancy

2015-11-26 Thread Stephen Cameron
Yes, I still had a variable region declared in Person that was over-riding the one in the base class I guess, so the setter was setting the super class but the subclass value was being persisted. On Thu, Nov 26, 2015 at 8:45 PM, Stephen Cameron wrote: > My silly mistake! > > On Thu, Nov 26, 2015

Re: Application Tenancy

2015-11-26 Thread Dan Haywood
Might be worth using Project Lombok, then... less boilerplate so easier to spot such issues. http://isis.apache.org/guides/cg.html#_cg_ide_project-lombok On 26 November 2015 at 10:08, Stephen Cameron wrote: > Yes, I still had a variable region declared in Person that was over-riding > the one

Re: Application Tenancy

2015-11-26 Thread Stephen Cameron
True, I created the error by tidying my code! The current set of issues has been thrown up by removing some TODOs one of which was to improve the compareTo() by adding in region to the list of compare fields. I have another one to sort out now. On Thu, Nov 26, 2015 at 9:10 PM, Dan Haywood w

Overly complex compareTo()

2015-11-26 Thread Stephen Cameron
Hi, I am trying to improve the compareTo() functions that I have written and ran into the following error. - java.lang.ArrayIndexOutOfBoundsException - 31 - org.datanucleus.state.StateManagerImpl#isLoaded(StateManagerImpl.java:2893) - au.com.scds.chats.dom.module.activity.Recurring

Re: Overly complex compareTo()

2015-11-26 Thread Dan Haywood
Only time I've seen these sorts of index issues is when the enhancer didn't run correctly over the entire codebase. With respect to compareTo implementations, in Estatio we've got away with using the ObjectContracts.compareTo method. So, for example, in LeaseItem, whose parent is Lease and which

Re: Overly complex compareTo()

2015-11-26 Thread Stephen Cameron
Hi Again Thanks for your thoughts, looks like another silly mistake on my part explains the error, I had to override getter in a child class to be able to position it differently on the page and did not use super.getStartDateTime(). I should use the JSON layouts for that kind of thing. The bookma

Re: Overly complex compareTo()

2015-11-26 Thread Óscar Bou - GOVERTIS
Hi Stephen. You can also use Guava’s ComparisonChain as detailed in [1]. Cheers, Oscar [1] http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ComparisonChain.html > El 26 nov 2015, a las 12:30, Stephen Cameron > escribió: > > Hi Again > > Thanks for your tho

Re: Overly complex compareTo()

2015-11-26 Thread Jeroen van der Wal
@Stephen: the sole responsibility of compareTo is to provide a natural ordering based on comparing the values of it's own members against another object of the same type. If you have ordering requirements beyond that scope I suggest you add an order clause to the JDOQL query or use Guava's Ordering

Re: Overly complex compareTo()

2015-11-26 Thread Stephen Cameron
On Thu, Nov 26, 2015 at 10:39 PM, Jeroen van der Wal wrote: > @Stephen: the sole responsibility of compareTo is to provide a natural > ordering based on comparing the values of it's own members against another > object of the same type. If you have ordering requirements beyond that > scope I sugg

RE: isis maven plugin

2015-11-26 Thread Cesar Lugo
Dan, I'm not having any issues, everything is working just fine. Its just the POM shows those dependencies as "red" but works fine, probably could just delete those dependencies from the POM. > org.apache.isis.tools artifact isis-maven-plugin . > org.apache.isis.example-appplication artifact sim

Re: collection of similar types

2015-11-26 Thread Dan Haywood
Hi Vladimir, thanks for pulling together that test case (though perhaps next time, just create a repo with just the simpleapp, rather than all of Isis?!?) Anyway... the issue is a programming error, but easily made. In some of your actions you are accessing fields directly, instead you should AL

Re: collection of similar types

2015-11-26 Thread Vladimir Nišević
Hi Dan, thank you for your support! Comments inline. Vladimir > Am 26.11.2015 um 16:11 schrieb Dan Haywood : > > Hi Vladimir, > > thanks for pulling together that test case (though perhaps next time, just > create a repo with just the simpleapp, rather than all of Isis?!?) > Ok, will do so

Re: Domain object as a parameter in action methods

2015-11-26 Thread Dan Haywood
Hmm, it's a good question. Ultimately what goes in the autoComplete is up to you... it takes a string but that doesn't have to map to any particular property. As a little experiment, I just tweaked the todoapp's ToDoItem#autoComplete for adding dependencies. Normally this searches on the descrip

Re: Domain object as a parameter in action methods

2015-11-26 Thread Dan Haywood
Actually, let me have a second go at answering this... I think you probably just want a dependent choices... public CustomerOrder addCustomerOrderPayment( CustomerOrder customerOrder, CustomerSubscription customerSubscription) { ... } public List autoComplete0A