Re: Wicket atmosphere

2014-05-18 Thread Emond Papegaaij
Could you create a JIRA issue for this, so we (and other users) can track
this issue? A short sample is not needed, because I can see in the code
that this can indeed go wrong. I'll make sure this gets fixed in the next
version.

Best regards,
Emond


On Sat, May 17, 2014 at 3:59 PM, Olivier Dutrieux <
olivier.dutri...@pasteur.fr> wrote:

> Hello Emond,
>
> Very thanks to the update but I found a problem when I use long polling
> for the transport :
>
> When the EventBus loop to the list of AtmosphereResource (on post
> method) and if the update is too long of each AtmosphereResource, the
> list of AtmosphereResource is update and reorder (because atmosphere
> remove and registry the AtmosphereResource due to long polling) and then
> the loop on EventBus never stop and update is infinitie.
>
> To solve the probleme I do that on line 366 of EventBus.java :
>
> for (AtmosphereResource resource :
> ImmutableList.copyOf(broadcaster.getAtmosphereResources()))
>
> rather than
>
> for (AtmosphereResource resource : broadcaster.getAtmosphereResources())
>
>
> I can if you want attach I short sample.
>
> Duto
>
>
> Le 17/05/2014 01:22, Papegaaij [via Apache Wicket] a écrit :
> > I replied to your mail already, but it seems my message was lost in
> > the mail
> > outage. Atmosphere and the JS are upgraded on the wicket-6.x and
> > master branches. I've also fixed the filter.
> >
> > https://issues.apache.org/jira/browse/WICKET-5589
> >
> > Best regards,
> > Emond
> >
> > On Monday 05 May 2014 14:08:20 Olivier Dutrieux wrote:
> > > Could you please update the wicket-atmosphere with the last release
> > 2.1.4 :
> > > I know that this version depend of jquery 2.0.3+ but there is a pure
> > > javascript version (no jquery depend) :
> > >
> > > https://github.com/Atmosphere/atmosphere-javascript
> > >
> > > And I notice that's your version of TrackMessageSizeFilter don't extend
> > the
> > > org.atmosphere.client.TrackMessageSizeFilter but it's necessary to be
> > use
> > > everywhere my atmosphere : check line 72 of this JavaScriptProtocol
> > file
> > for
> > > why :
> > >
> > >
> >
> https://github.com/Atmosphere/atmosphere/blob/atmosphere-project-2.1.4/modul
> > >
> > es/cpr/src/main/java/org/atmosphere/interceptor/JavaScriptProtocol.java#L
> > 72
> >
> > >
> > > I can pull a request if you want.
> > >
> > > Duto
> > >
> > > -
> > > Duto
> > > --
> > > View this message in context:
> > >
> >
> http://apache-wicket.1842946.n4.nabble.com/Wicket-atmosphere-tp4665687.html
> > > Sent from the Users forum mailing list archive at Nabble.com.
> > >
> > > -
> > > To unsubscribe, e-mail: [hidden email]
> > 
> > > For additional commands, e-mail: [hidden email]
> > 
> >
> >
> >
> > 
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://apache-wicket.1842946.n4.nabble.com/Wicket-atmosphere-tp4665687p4665902.html
> >
> > To unsubscribe from Wicket atmosphere, click here
> > <
> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665687&code=b2xpdmllci5kdXRyaWV1eEBwYXN0ZXVyLmZyfDQ2NjU2ODd8LTExODI0MjM1MTg=
> >.
> > NAML
> > <
> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
> --
> Olivier Dutrieux
> Groupe Projets (Tél : 31 62)
>
>
> -
> Duto
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-atmosphere-tp4665687p4665909.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Wicket atmosphere

2014-05-18 Thread Martin Grigorov
Hi,


On Sat, May 17, 2014 at 4:59 PM, Olivier Dutrieux <
olivier.dutri...@pasteur.fr> wrote:

> Hello Emond,
>
> Very thanks to the update but I found a problem when I use long polling
> for the transport :
>
> When the EventBus loop to the list of AtmosphereResource (on post
> method) and if the update is too long of each AtmosphereResource, the
> list of AtmosphereResource is update and reorder (because atmosphere
> remove and registry the AtmosphereResource due to long polling) and then
> the loop on EventBus never stop and update is infinitie.
>
> To solve the probleme I do that on line 366 of EventBus.java :
>
> for (AtmosphereResource resource :
> ImmutableList.copyOf(broadcaster.getAtmosphereResources()))
>
> rather than
>
> for (AtmosphereResource resource : broadcaster.getAtmosphereResources())
>
>
> I can if you want attach I short sample.
>

Yes, please.
If a fix or an improvement is needed in Wicket then create a ticket in Jira
and attach a demo app or a unit test if possible.
Thanks!


>
> Duto
>
>
> Le 17/05/2014 01:22, Papegaaij [via Apache Wicket] a écrit :
> > I replied to your mail already, but it seems my message was lost in
> > the mail
> > outage. Atmosphere and the JS are upgraded on the wicket-6.x and
> > master branches. I've also fixed the filter.
> >
> > https://issues.apache.org/jira/browse/WICKET-5589
> >
> > Best regards,
> > Emond
> >
> > On Monday 05 May 2014 14:08:20 Olivier Dutrieux wrote:
> > > Could you please update the wicket-atmosphere with the last release
> > 2.1.4 :
> > > I know that this version depend of jquery 2.0.3+ but there is a pure
> > > javascript version (no jquery depend) :
> > >
> > > https://github.com/Atmosphere/atmosphere-javascript
> > >
> > > And I notice that's your version of TrackMessageSizeFilter don't extend
> > the
> > > org.atmosphere.client.TrackMessageSizeFilter but it's necessary to be
> > use
> > > everywhere my atmosphere : check line 72 of this JavaScriptProtocol
> > file
> > for
> > > why :
> > >
> > >
> >
> https://github.com/Atmosphere/atmosphere/blob/atmosphere-project-2.1.4/modul
> > >
> > es/cpr/src/main/java/org/atmosphere/interceptor/JavaScriptProtocol.java#L
> > 72
> >
> > >
> > > I can pull a request if you want.
> > >
> > > Duto
> > >
> > > -
> > > Duto
> > > --
> > > View this message in context:
> > >
> >
> http://apache-wicket.1842946.n4.nabble.com/Wicket-atmosphere-tp4665687.html
> > > Sent from the Users forum mailing list archive at Nabble.com.
> > >
> > > -
> > > To unsubscribe, e-mail: [hidden email]
> > 
> > > For additional commands, e-mail: [hidden email]
> > 
> >
> >
> >
> > 
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://apache-wicket.1842946.n4.nabble.com/Wicket-atmosphere-tp4665687p4665902.html
> >
> > To unsubscribe from Wicket atmosphere, click here
> > <
> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665687&code=b2xpdmllci5kdXRyaWV1eEBwYXN0ZXVyLmZyfDQ2NjU2ODd8LTExODI0MjM1MTg=
> >.
> > NAML
> > <
> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
> --
> Olivier Dutrieux
> Groupe Projets (Tél : 31 62)
>
>
> -
> Duto
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-atmosphere-tp4665687p4665909.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


RE: Question / Best Practise / (List)Model vs. (List)DataProvider

2014-05-18 Thread Colin Rogers
The way I see (right or wrong!) is,

You create/manage Models for individual components on a case-by-case basis.

For Repeaters which internal components are dynamically created, you need a 
DataProvider to create and manage those Models for the components and the 
Collections that comprise their data.

DataProvider could be described as a 'Model Factory', and is not a Model in 
itself.

Cheers,
Col.

-Original Message-
From: Sven Meier [mailto:s...@meiers.net]
Sent: Friday, 16 May 2014 6:17 AM
To: users@wicket.apache.org
Subject: Re: Question / Best Practise / (List)Model vs. (List)DataProvider

IDataProvider is all about efficiency, it provides efficient access to a subset 
of the data.

Perhaps we can make it even more efficient with the recent proposal on the @dev 
list.

Regards
Sven


On 05/08/2014 01:37 PM, Patrick Davids wrote:
> Hi all,
>
> what I often think about, and I cannot really say is; when to use
> Model or DataProvider as data providing object for components they
> repeat some thing?
>
> Javadoc says, DataProvider are (good) for DataViews.
> Hmm... ok, and they allow easer iterating (first index, count).
>
> I also can achieve this by using a LoadableDetachableModel>
> combined with a ModelIteratorAdapater.
>
> Both have detaching logic... both featuring extension, both have a
> sort of "load"-method (getObject() vs. getData()).
>
> Sometimes I think, they are so similar to each other... where is the
> key difference?
>
> Would be cool if some of yours just reply his "two cents" of daily
> programming experience... so I can get some new point of views.
>
> When do you use DataProvider or Model>?
> Did you experienced the same, not to exactly know which one you will
> use for your new page/panel/component?
> And often think about pro and cons using it with RepeatingViews? And
> later on, you see... "I could have used both... hmm..."
>
> thanx a lot for feedback and kind regards Patrick
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and with 
authority, states them to be the considered view, opinion, conclusions, advice 
or statement of this company. Every care is taken but we recommend that you 
scan any attachments for viruses.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-18 Thread Paul Borș
Are you not using a LoadableDetacheble model?
And are you familiar with Hibernate's laizy loading?

Have a great day,
Paul Bors

> On May 18, 2014, at 6:08 AM, Piratenvisier  wrote:
> 
> Am 17.05.2014 23:08, schrieb mscoon:
>> I don't understand what these lines are doing. Are you reloading whatever
>> is already stored in your modelObject.kunde and setting it again to your
>> model object? Why?
> all ONETOMANY relationships which are set before I open the form
> cause problem with hibernate when I save the Model after I close the Form.
> When I set them once more as described below everything is OK.
> all ONETOMANY relationships which are set by the Form by DropDownChoices 
> don't cause any problem.
> 
> 
>> 
>> On Thu, May 8, 2014 at 7:50 AM, Piratenvisier 
>> wrote:
>> 
>>> If I include the folowing lines :
>>> 
>>> if(NachweiseForm.this.getModelObject().getKunde()!=null) {
>>> Kunde kunde = kundeManager.get(NachweiseForm.this.
>>> getModelObject().getKunde().getId());
>>> NachweiseForm.this.getModelObject().setKunde(kunde);
>>> kunde.addNachweis(NachweiseForm.this.getModelObject());
>>> System.err.println("Kunde");
>>> }
>>> 
>>> before the save
>>> 
>>>  everything is fine
>>> 
>>> But I hoped to avoid such lines by AbstractEntityModel.
>>> 
>>> My idea was to implant Kunde through the form.
>>> 
>>> But how could you do it only  by a Label.
>>> 
>>> Am 05.05.2014 20:40, schrieb mscoon:
>>> 
 ​Actually what I said below is wrong because this line is after the line
 
 that throws the exception. But my explanation still holds. Something
 before
 the line that is throwing the exception is causing an object with a
 reference to a new ​Nachweise
 to be saved while the Nachweise is still unsaved. You need to search at
 what is happening before the line with the exception, maybe even before
 the
 page is created.
 
 
 
  Now, a wild guess (I may well be wrong) is that the following line:
> nachweiseform.getModelObject().getKunde().addNachweis(nachwe
> iseform.getModelObject());
> 
> may be causing the problem if hibernate tries to save kunde with
> nachweiseform.getModelObject()
> which is a new object with a null id.
> 
> You  may try to move this line to saveNachweise().
> 
> 
> On Mon, May 5, 2014 at 2:54 PM, Yahoo 
> wrote:
> 
>  Am 05.05.2014 11:05, schrieb mscoon:
>>   In a previous message you sent the following snippets:
>> 
>>> //@XmlTransient
>>> @ManyToOne(cascade = CascadeType.MERGE,fetch=FetchType.LAZY)
>>> @JoinColumn(name="NachKundNr",insertable=false, updatable=false)
>>>   public Kunde getKunde(){
>>>  return this.kunde;
>>>   }
>>> 
>>> recursive Part for Kunde
>>> 
>>> 
>>> @XmlTransient
>>> @OneToMany(cascade={CascadeType.MERGE},fetch=FetchType.LAZY)
>>> @JoinColumn(name="NachKundNr",insertable=false, updatable=false )
>>> 
>>>  when I remove this I get the error :
>> org.hibernate.TransientObjectException: object references an unsaved
>> transient instance - save the transient instance before flushing:
>> braunimmobilien.model.Nachweise
>>   at org.hibernate.engine.internal.ForeignKeys.
>> getEntityIdentifierIfNotUnsaved(ForeignKeys.java:249)
>>   at org.hibernate.type.EntityType.getIdentifier(EntityType.java:
>> 459)
>>   at org.hibernate.type.ManyToOneType.nullSafeSet(
>> ManyToOneType.java:132)
>>   at org.hibernate.persister.collection.
>> AbstractCollectionPersister.
>> writeElement(AbstractCollectionPersister.java:867)
>>   at org.hibernate.persister.collection.
>> AbstractCollectionPersister.
>> insertRows(AbstractCollectionPersister.java:1475)
>>   at org.hibernate.action.internal.CollectionUpdateAction.execute(
>> CollectionUpdateAction.java:86)
>>   at org.hibernate.engine.spi.ActionQueue.execute(
>> ActionQueue.java:362)
>>   at org.hibernate.engine.spi.ActionQueue.executeActions(
>> ActionQueue.java:354)
>>   at org.hibernate.engine.spi.ActionQueue.executeActions(
>> ActionQueue.java:278)
>>   at org.hibernate.event.internal.AbstractFlushingEventListener.
>> performExecutions(AbstractFlushingEventListener.java:326)
>>   at org.hibernate.event.internal.DefaultFlushEventListener.
>> onFlush(
>> DefaultFlushEventListener.java:52)
>>   at org.hibernate.internal.SessionImpl.flush(SessionImpl.
>> java:1213)
>>   at org.hibernate.internal.SessionImpl.managedFlush(
>> SessionImpl.java:402)
>>   at org.hibernate.engine.transaction.internal.jdbc.
>> JdbcTransaction.
>> beforeTransactionCommit(JdbcTransaction.java:101)
>>   at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.
>> commit(AbstractTransactionImpl.java:175)
>>   at org

Re: Page rendering from quartz job

2014-05-18 Thread Paul Borș
You want wicket's page renderer to render some HTML for your email content when 
you have it run inside a quartz thread?

Why can't you just simply use a different template engine like Apache Velocity?

Have a great day,
Paul Bors

> On May 15, 2014, at 3:27 PM, Sandor Feher  wrote:
> 
> Hi,
> 
> I fired up some quartz jobs for sending notification emails at given time.
> The job controller class is launched from my Application wget it get
> initialized.
> Almost everything works except of rendering mail's html body.
> I would like to do it with wicket's pagerenderer but it throws the following
> error:
> 
> org.apache.wicket.WicketRuntimeException: There is no application attached
> to current thread DefaultQuartzScheduler_Worker-5
> 
> I know it has not happen by chance but my class knows nothing about page
> rendering.
> The question is how to achieve some elegant way ? 
> I can choose different way but if possible I do it with wicket's page
> renderer.
> So please advice!
> 
> Regards., Sandor
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Page-rendering-from-quartz-job-tp4665860.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-18 Thread Piratenvisier

Am 17.05.2014 23:08, schrieb mscoon:

I don't understand what these lines are doing. Are you reloading whatever
is already stored in your modelObject.kunde and setting it again to your
model object? Why?

all ONETOMANY relationships which are set before I open the form
cause problem with hibernate when I save the Model after I close the Form.
When I set them once more as described below everything is OK.
all ONETOMANY relationships which are set by the Form by DropDownChoices 
don't cause any problem.





On Thu, May 8, 2014 at 7:50 AM, Piratenvisier wrote:


If I include the folowing lines :

if(NachweiseForm.this.getModelObject().getKunde()!=null) {
 Kunde kunde = kundeManager.get(NachweiseForm.this.
getModelObject().getKunde().getId());
 NachweiseForm.this.getModelObject().setKunde(kunde);
 kunde.addNachweis(NachweiseForm.this.getModelObject());
 System.err.println("Kunde");
 }

before the save

  everything is fine

But I hoped to avoid such lines by AbstractEntityModel.

My idea was to implant Kunde through the form.

But how could you do it only  by a Label.

Am 05.05.2014 20:40, schrieb mscoon:


​Actually what I said below is wrong because this line is after the line

that throws the exception. But my explanation still holds. Something
before
the line that is throwing the exception is causing an object with a
reference to a new ​Nachweise
to be saved while the Nachweise is still unsaved. You need to search at
what is happening before the line with the exception, maybe even before
the
page is created.



  Now, a wild guess (I may well be wrong) is that the following line:

nachweiseform.getModelObject().getKunde().addNachweis(nachwe
iseform.getModelObject());

may be causing the problem if hibernate tries to save kunde with
nachweiseform.getModelObject()
which is a new object with a null id.

You  may try to move this line to saveNachweise().


On Mon, May 5, 2014 at 2:54 PM, Yahoo 
wrote:

  Am 05.05.2014 11:05, schrieb mscoon:

   In a previous message you sent the following snippets:


//@XmlTransient
@ManyToOne(cascade = CascadeType.MERGE,fetch=FetchType.LAZY)
@JoinColumn(name="NachKundNr",insertable=false, updatable=false)
   public Kunde getKunde(){
  return this.kunde;
   }

recursive Part for Kunde


@XmlTransient
@OneToMany(cascade={CascadeType.MERGE},fetch=FetchType.LAZY)
@JoinColumn(name="NachKundNr",insertable=false, updatable=false )

  when I remove this I get the error :

org.hibernate.TransientObjectException: object references an unsaved
transient instance - save the transient instance before flushing:
braunimmobilien.model.Nachweise
   at org.hibernate.engine.internal.ForeignKeys.
getEntityIdentifierIfNotUnsaved(ForeignKeys.java:249)
   at org.hibernate.type.EntityType.getIdentifier(EntityType.java:
459)
   at org.hibernate.type.ManyToOneType.nullSafeSet(
ManyToOneType.java:132)
   at org.hibernate.persister.collection.
AbstractCollectionPersister.
writeElement(AbstractCollectionPersister.java:867)
   at org.hibernate.persister.collection.
AbstractCollectionPersister.
insertRows(AbstractCollectionPersister.java:1475)
   at org.hibernate.action.internal.CollectionUpdateAction.execute(
CollectionUpdateAction.java:86)
   at org.hibernate.engine.spi.ActionQueue.execute(
ActionQueue.java:362)
   at org.hibernate.engine.spi.ActionQueue.executeActions(
ActionQueue.java:354)
   at org.hibernate.engine.spi.ActionQueue.executeActions(
ActionQueue.java:278)
   at org.hibernate.event.internal.AbstractFlushingEventListener.
performExecutions(AbstractFlushingEventListener.java:326)
   at org.hibernate.event.internal.DefaultFlushEventListener.
onFlush(
DefaultFlushEventListener.java:52)
   at org.hibernate.internal.SessionImpl.flush(SessionImpl.
java:1213)
   at org.hibernate.internal.SessionImpl.managedFlush(
SessionImpl.java:402)
   at org.hibernate.engine.transaction.internal.jdbc.
JdbcTransaction.
beforeTransactionCommit(JdbcTransaction.java:101)
   at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.
commit(AbstractTransactionImpl.java:175)
   at org.springframework.orm.hibernate4.
HibernateTransactionManager.
doCommit(HibernateTransactionManager.java:554)
   at org.springframework.transaction.support.
AbstractPlatformTransactionManager.processCommit(
AbstractPlatformTransactionManager.java:755)
   at org.springframework.transaction.support.
AbstractPlatformTransactionManager.commit(
AbstractPlatformTransactionMan
ager.java:724)
   at org.springframework.transaction.interceptor.
TransactionAspectSupport.commitTransactionAfterReturnin
g(TransactionAspectSupport.java:475)
   at org.springframework.transaction.interceptor.
TransactionAspectSupport.invokeWithinTransaction(
TransactionAspectSupport.java:270)
   at org.springframework.transaction.interceptor.
TransactionInterceptor.invoke(TransactionInterceptor.java:94)
   at org.springframework