Re: GWT + GILEAD OR REQUEST FACTORY?

2011-01-11 Thread Richard Berger
FWIW, I made the switch from Gilead to RequestFactory and was pleased
with the outcome.  I am sure that both will work fine, but I seem to
recall fewer setup/configuration issues with RequestFactory.  Gilead
is wonderful, but perhaps because RequestFactory is built-in it is a
little easier to get started with.

RB

On Jan 10, 5:36 am, bond daniele.re...@gmail.com wrote:
 Hi,
 actually I'm using gwt 2.1.1 with hibernate and gilead. Gilead is very
 comfortable because I don't have to create DTO class for my domain.
 I would like an opinion on the new system RequestFactory  compared
 with Gilead. What do you recommend?

 Thanks very much

 Best regards

 Daniele

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Exposing my GWT API via web/RESTful service - can it be done (easilyish)?

2010-12-26 Thread Richard Berger
Thanks to all for the feedback - just wanted to share some
reactions
1. I was surprised by the lack of responses re: restlets - that seemed
to be a promising technology
2. Some of the suggestions/links seemed a little bit over my head -
but that is probably just because my head is at a pretty low place :).

But, pondering this a little more, I thought of a different approach
that might make a lot more sense.  The bottom line is that my
application will need an API that can be called by many clients,
including the GWT UI that we would like to build.  I was thinking of
trying to expose the Service API that is in the GWT application.  But
wouldn't another approach be to build a RESTful interface to my data
as the API and then use that API from my GWT application (as there
seem to be standard ways of accessing REST APIs from the GWT server
side).  Other apps could get to the REST API using whatever method
they chose and I don't have to end up implementing the API twice.

Thoughts and comments are definitely appreciated!  Esp those using
short words :).

RB

On Dec 21, 9:40 pm, zixzigma zixzi...@gmail.com wrote:
 Two great open-source projects I came across today are:

 RestyGWThttp://restygwt.fusesource.org/documentation/index.html

 GWT-JSON-CommandPatternhttp://code.google.com/p/gwt-json-commandpattern/

 they are pretty straight forward with clean API.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Title: EntityProxyChange not being called?

2010-12-20 Thread Richard Berger
Problem resolved.  The issue was that I had declared two eventBus
properties - and not noticed.  So the real event bus wasn't getting
any handlers assigned, so although the hasVersionChanged() was being
called (and was returning true), the doFire method in SimpleEventBus
did not have any handlers to invoke.

Bottom line - nothing to do with Objectify, no problems with GWT, just
the usual user error.

Thanks again for the pointers to that code - helped me work through
things more carefully.

RB

On Dec 19, 11:21 pm, Richard Berger richardlan...@gmail.com wrote:
 Sorry for not noticing this reply earlier.  Thank you for the
 explanation as to when the event fires.  I did try incrementing the
 version number in my persist() method - something very simple, just
 incrementing the version by 1 before putting it back to the
 datastore.  I will restore that code and debug it as you suggest and
 post back with results (and probably questions :) ).

 Thanks again!
 RB

 On Dec 15, 6:35 am, David Chandler drfibona...@google.com wrote:







  Hi Richard,

  It looks like AbstractRequestContext.processReturnRecord() fires an
  EntityProxyChange event only when the version has changed. See lines
  270-285 here:

 http://code.google.com/p/google-web-toolkit/source/browse/tags/2.1.0/...

  The answer to your question likely lies in the implementation of
  hasVersionChanged() in the same file. Perhaps you could set a
  breakpoint on the server or client to confirm that the version has
  indeed changed for the entity?

  HTH,
  /dmc

  On Sun, Dec 12, 2010 at 5:52 PM, Richard Berger richardlan...@gmail.com 
  wrote:
   I am following the model of DynaTableRf in building a sample app
   combining RequestFactory, EditorFramework, CellTable, and Objectify.
   In tracing the code for DynaTableRf after a new Person is created
   (when the user clicks on New Person), the onPersonChanged method is
   called, since it was registered using the following code:

   EntityProxyChange.registerForProxyType(eventBus, PersonProxy.class,
      new EntityProxyChange.HandlerPersonProxy() {
        public void onProxyChange(EntityProxyChangePersonProxy event)
   {
          SummaryWidget.this.onPersonChanged(event);
        }
      });

   However, in my code (which is essentially identical - same type of
   workflow, usage of RequestFactory, cellTable) my onProxyChange() is
   NOT being called.  My code is shown below - yes, it looks quite
   similar :).
   EntityProxyChange.registerForProxyType(eventBus,
   CommitmentProxy.class,
      new EntityProxyChange.HandlerCommitmentProxy() {
        public void onProxyChange(EntityProxyChangeCommitmentProxy
   event) {
          SummaryWidget.this.onCommitmentChanged(event);
          System.out.println(In onCommitmentChanged);
        }
      });

   In both cases (DynaTableRf, my code) the new objects (Person,
   Commitment) are created - it is a matter of how to get the
   EntityProxyChange to be called to update the display.

   Two things I Hadn't noticed at first (but which had no effect when I
   tried them):
   1. To my CommitmentProxy class, I added the following line to match
   the equivalent in PersonProxy
          EntityProxyIdCommitmentProxy stableId();  // For 
   EntityProxyChange
   - but no help
   2. To my persist() method, I added a manual update to the version
   field, thinking that might be necessary to trigger the
   EntityProxyChange.

   The one significant difference between my code and DynaTableRf is that
   I am using Objectify, whereas DynaTableRf appears to use an in-memory
   datastore.

   So my questions are:
   1. What is it that should trigger the EntityProxyChange event?  The
   code for when the user presses the New Person button is:
   PersonRequest context = requestFactory.personRequest();
   AddressProxy address = context.create(AddressProxy.class);
   PersonProxy person = context.edit(context.create(PersonProxy.class));
   person.setAddress(address);
   context.persist().using(person);
   eventBus.fireEvent(new EditPersonEvent(person, context));

   My code for the new Commitment button is:
   CommitmentRequest context = requestFactory.commitmentRequest();
   CommitmentProxy commitment =
   context.edit(context.create(CommitmentProxy.class));
   commitment.setPhase(Negotiation);
   context.persist(currentCommitUserProxy).using(commitment);
   eventBus.fireEvent(new EditCommitmentEvent(commitment, context));

   2. Is Objectify the problem?  Does it interfere with the magic that
   triggers EntityProxyChange?

   Thanks so much for any assistance!
   RB

   --
   You received this message because you are subscribed to the Google Groups 
   Google Web Toolkit group.
   To post to this group, send email to google-web-tool...@googlegroups.com.
   To unsubscribe from this group, send email to 
   google-web-toolkit+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/google-web-toolkit?hl=en.

  --
  David

Exposing my GWT API via web/RESTful service - can it be done (easilyish)?

2010-12-20 Thread Richard Berger
Apologies in advance if I am not using the right terminology in
describing my question.  English is my first language.  But COBOL was
my first programming language :).

I am investigating using GWT/GAE for an upcoming project and one of
the requirements is that we provide an engine that will be used by our
GWT front-end as well as potentially being used by other clients -
perhaps over a web service (or a RESTful interface).

In creating the GWT application, one obviously has to define an API
between the client side and the server side.  This appears to be
precisely the API I would want to expose to others.  It would also
seem to be redundant to have a second implementation of the API that
works with non-GWT front ends.

Thus, I am guessing there is a way to expose my GWT API to others.
More specifically, since I am using RequestFactory, I am talking about
exposing the methods defined in the RequestContext for each of my
entities (and implemented in the entity itself - at least as of GWT
2.1.0).

I have looked at the restlet project and it seems that that *might* be
what I need.  But it's hard for an ex-COBOL programmer to know for
sure :).

Thanks in advance for your help!
RB

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Title: EntityProxyChange not being called?

2010-12-19 Thread Richard Berger
Sorry for not noticing this reply earlier.  Thank you for the
explanation as to when the event fires.  I did try incrementing the
version number in my persist() method - something very simple, just
incrementing the version by 1 before putting it back to the
datastore.  I will restore that code and debug it as you suggest and
post back with results (and probably questions :) ).

Thanks again!
RB


On Dec 15, 6:35 am, David Chandler drfibona...@google.com wrote:
 Hi Richard,

 It looks like AbstractRequestContext.processReturnRecord() fires an
 EntityProxyChange event only when the version has changed. See lines
 270-285 here:

 http://code.google.com/p/google-web-toolkit/source/browse/tags/2.1.0/...

 The answer to your question likely lies in the implementation of
 hasVersionChanged() in the same file. Perhaps you could set a
 breakpoint on the server or client to confirm that the version has
 indeed changed for the entity?

 HTH,
 /dmc









 On Sun, Dec 12, 2010 at 5:52 PM, Richard Berger richardlan...@gmail.com 
 wrote:
  I am following the model of DynaTableRf in building a sample app
  combining RequestFactory, EditorFramework, CellTable, and Objectify.
  In tracing the code for DynaTableRf after a new Person is created
  (when the user clicks on New Person), the onPersonChanged method is
  called, since it was registered using the following code:

  EntityProxyChange.registerForProxyType(eventBus, PersonProxy.class,
     new EntityProxyChange.HandlerPersonProxy() {
       public void onProxyChange(EntityProxyChangePersonProxy event)
  {
         SummaryWidget.this.onPersonChanged(event);
       }
     });

  However, in my code (which is essentially identical - same type of
  workflow, usage of RequestFactory, cellTable) my onProxyChange() is
  NOT being called.  My code is shown below - yes, it looks quite
  similar :).
  EntityProxyChange.registerForProxyType(eventBus,
  CommitmentProxy.class,
     new EntityProxyChange.HandlerCommitmentProxy() {
       public void onProxyChange(EntityProxyChangeCommitmentProxy
  event) {
         SummaryWidget.this.onCommitmentChanged(event);
         System.out.println(In onCommitmentChanged);
       }
     });

  In both cases (DynaTableRf, my code) the new objects (Person,
  Commitment) are created - it is a matter of how to get the
  EntityProxyChange to be called to update the display.

  Two things I Hadn't noticed at first (but which had no effect when I
  tried them):
  1. To my CommitmentProxy class, I added the following line to match
  the equivalent in PersonProxy
         EntityProxyIdCommitmentProxy stableId();  // For EntityProxyChange
  - but no help
  2. To my persist() method, I added a manual update to the version
  field, thinking that might be necessary to trigger the
  EntityProxyChange.

  The one significant difference between my code and DynaTableRf is that
  I am using Objectify, whereas DynaTableRf appears to use an in-memory
  datastore.

  So my questions are:
  1. What is it that should trigger the EntityProxyChange event?  The
  code for when the user presses the New Person button is:
  PersonRequest context = requestFactory.personRequest();
  AddressProxy address = context.create(AddressProxy.class);
  PersonProxy person = context.edit(context.create(PersonProxy.class));
  person.setAddress(address);
  context.persist().using(person);
  eventBus.fireEvent(new EditPersonEvent(person, context));

  My code for the new Commitment button is:
  CommitmentRequest context = requestFactory.commitmentRequest();
  CommitmentProxy commitment =
  context.edit(context.create(CommitmentProxy.class));
  commitment.setPhase(Negotiation);
  context.persist(currentCommitUserProxy).using(commitment);
  eventBus.fireEvent(new EditCommitmentEvent(commitment, context));

  2. Is Objectify the problem?  Does it interfere with the magic that
  triggers EntityProxyChange?

  Thanks so much for any assistance!
  RB

  --
  You received this message because you are subscribed to the Google Groups 
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-web-toolkit?hl=en.

 --
 David Chandler
 Developer Programs Engineer, Google Web 
 Toolkithttp://googlewebtoolkit.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Exposing RequestContext methods to non-GWT clients.... (newbie question)...

2010-12-16 Thread Richard Berger
In building very simple learning application using GWT-RPC and then
RequestFactory, I was wondering whether it was possible to expose the
methods that are in my RequestContext interface (in the RequestFactory-
based app).  In particular, I have:

public interface CommitmentRequest extends RequestContext {
  // bunch of useful methods
}

These methods are obviously what my GWT client side needs to get the
job done.  But now let's say I want some other type of client to
access the same functionality that is provided by the engine (GWT
server side).  Perhaps an iPhone client or an Android client, or some
other application (Java, .Net, something else) wants to use my
engine's capabilities.

Is there some way to expose the methods in CommitmentRequest so that
they can used from those other clients?  It seems to me that this
would not be an uncommon request.

I have started looking at the RESTlet project - but didn't want to go
too far in case I was going in the wrong direction.

Thanks so much for any guidance you can provide!
RB

PS - If it matters, I was also planning on hosting this on GAE and am
using Objectify for persistence.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Title: EntityProxyChange not being called?

2010-12-12 Thread Richard Berger
I am following the model of DynaTableRf in building a sample app
combining RequestFactory, EditorFramework, CellTable, and Objectify.
In tracing the code for DynaTableRf after a new Person is created
(when the user clicks on New Person), the onPersonChanged method is
called, since it was registered using the following code:

EntityProxyChange.registerForProxyType(eventBus, PersonProxy.class,
new EntityProxyChange.HandlerPersonProxy() {
  public void onProxyChange(EntityProxyChangePersonProxy event)
{
SummaryWidget.this.onPersonChanged(event);
  }
});

However, in my code (which is essentially identical - same type of
workflow, usage of RequestFactory, cellTable) my onProxyChange() is
NOT being called.  My code is shown below - yes, it looks quite
similar :).
EntityProxyChange.registerForProxyType(eventBus,
CommitmentProxy.class,
new EntityProxyChange.HandlerCommitmentProxy() {
  public void onProxyChange(EntityProxyChangeCommitmentProxy
event) {
SummaryWidget.this.onCommitmentChanged(event);
System.out.println(In onCommitmentChanged);
  }
});

In both cases (DynaTableRf, my code) the new objects (Person,
Commitment) are created - it is a matter of how to get the
EntityProxyChange to be called to update the display.

Two things I Hadn't noticed at first (but which had no effect when I
tried them):
1. To my CommitmentProxy class, I added the following line to match
the equivalent in PersonProxy
EntityProxyIdCommitmentProxy stableId();  // For EntityProxyChange
- but no help
2. To my persist() method, I added a manual update to the version
field, thinking that might be necessary to trigger the
EntityProxyChange.

The one significant difference between my code and DynaTableRf is that
I am using Objectify, whereas DynaTableRf appears to use an in-memory
datastore.

So my questions are:
1. What is it that should trigger the EntityProxyChange event?  The
code for when the user presses the New Person button is:
PersonRequest context = requestFactory.personRequest();
AddressProxy address = context.create(AddressProxy.class);
PersonProxy person = context.edit(context.create(PersonProxy.class));
person.setAddress(address);
context.persist().using(person);
eventBus.fireEvent(new EditPersonEvent(person, context));

My code for the new Commitment button is:
CommitmentRequest context = requestFactory.commitmentRequest();
CommitmentProxy commitment =
context.edit(context.create(CommitmentProxy.class));
commitment.setPhase(Negotiation);
context.persist(currentCommitUserProxy).using(commitment);
eventBus.fireEvent(new EditCommitmentEvent(commitment, context));

2. Is Objectify the problem?  Does it interfere with the magic that
triggers EntityProxyChange?

Thanks so much for any assistance!
RB

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Request factory: java.lang.NoClassDefFoundError: org/json/JSONException

2010-12-07 Thread Richard Berger
Just noting that this does solve the problem and that the gwt-servlet-
deps.jar is in the GWT 2.1 distribution.  (I hit this problem today
and adding the jar resolved the issue).

RB

On Nov 28, 1:42 am, Thomas Broyer t.bro...@gmail.com wrote:
 On 27 nov, 15:46, Simon Majou si...@majou.org wrote:

  Hello,

  I am trying to run the dynatablerf example for request factory, and I
  get :

  bodyh2HTTP ERROR: 500/h2preorg/json/JSONException/pre
  pRequestURI=/gwtRequest/ph3Caused by:/
  h3prejava.lang.NoClassDefFoundError: org/json/JSONException
 [...]
  Can you tell which jar to use to resolve that ? Shouldn't the classes
  be included into GWT 2.1 ?

 They are in gwt-servlet-deps.jar (which the build.xml should correctly
 copy to war/WEB-INF/lib, but maybe the Google Plugin for Eclipse
 doesn't –can't tell, I'm using Maven for my 2.1 projects–)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Modeling a simple 1 to Many relationship using Request Factory, Objectify...

2010-11-29 Thread Richard Berger
With much help from web sources and others, I got this working - won't
be of any help to the smart folks out there - just the Morons Like Me
(tm) :).

Here's a link - don't make fun of my ancient MovableType blog - it was
all the rage in the late 90s -
http://landisfamily.dnsalias.org:90/rblog/2010/11/one_to_many_relationships_with.html

Enjoy,
RB

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory - A request is already in progress

2010-11-28 Thread Richard Berger
Similar problem, but I was not able to implement your solution - any
guidance is suggested.  And I promise, once I get my simple app
working, I will write the GWT/Objectify 1-to-Many Relationships for
Moron Like Me guide :).

The problem in the small...
CommitUsers can have Commitments.  I create a new Commitment and try
to associate that with the CommitUser.  But the properties on the
CommitUser (even just a string) are not persisted.  So, following:
http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html#relationships
in the section on Using RequestFactory, I figure I must be falling
into the trap of not having an editable CommitUser (since I didn't
create it, the CommitUser already exists).

So I change my code from:
  RequestVoid createReq =
commitmentRequest.persist(currentCommitUserProxy).using(newCommitment);

To:
  CommitUserProxy editableCommitUserProxy =
commitUserReq.edit(currentCommitUserProxy);
  RequestVoid createReq =
commitmentRequest.persist(editableCommitUserProxy).using(newCommitment);

Where:
  commitUserReq is:
private CommitUserRequest commitUserReq =
requestFactory.commitUserRequest();
  request Factory is:
CommitmentSystemRequestFactory requestFactory =
GWT.create(CommitmentSystemRequestFactory.class);

This gives me the error:
Caused by: java.lang.IllegalStateException: A request is already in
progress
at
com.google.gwt.requestfactory.client.impl.AbstractRequestContext.checkLocked(AbstractRequestContext.java:
307)

Following the advice you provided, I tried to create a new
RequestContext, so my code became...
  CommitUserRequest commitUserReq2 =
requestFactory.commitUserRequest();
  CommitUserProxy editableCommitUserProxy =
commitUserReq2.edit(currentCommitUserProxy);
  RequestVoid createReq =
commitmentRequest.persist(editableCommitUserProxy).using(newCommitment);
But that gave me the error:

Caused by: java.lang.IllegalArgumentException: Attempting to edit an
EntityProxy previously edited by another RequestContext
  at
com.google.gwt.requestfactory.client.impl.AbstractRequestContext.checkStreamsNotCrossed(AbstractRequestContext.java:
334)

Stepping back a little bit, the slightly bigger picture is that I am
following the article at:
http://www.ibm.com/developerworks/java/library/j-javadev2-13/index.html
(Java development 2.0: Twitter mining with Objectify-Appengine, Part
1).  But that article doesn't use GWT.  But the idea is that the
Commitment stores a KeyCommitUser so that I can query the
Commitment.class to find all the Commitments whose Key matches the Key
of the current user.  When I save a Commitment, I first save the
Commitment itself and then establish the relationship by modifying the
CommitUser (as the article demonstrates).  So, my persist method
(fired above) is...

  public void persist(CommitUser commitUser) {
// Save commitment first
DAO dao = new DAO();
Objectify ofy = dao.ofy();
ofy.put(this);
dao = null;
// Then establish relationship
commitUser.addCommitment(this);  // Owner is in charge
  }

And the addCommitment method on the CommitUser is:
  public  void addCommitment(Commitment commitment) {
DAO dao = new DAO();
Objectify ofy = dao.ofy();
commitment.setRequesterKey(this);
commitment.setDescription(Updated in addCommitment);
ofy.put(this);
dao = null;
  }

And finally, the commitment.setRequestKey() is:
  public void setRequesterKey(CommitUser commitUser) {
this.requesterKey = new KeyCommitUser(CommitUser.class,
commitUser.getId());
  }

In the debugger I can see that all the properties - e.g. Description
get set, but they are not persisted to the Datastore.

I am sure this is common, but it seems that I am very close to getting
this simple example to work - so any assistance is greatly appreciated
and I will do my best to provide assistance to the community.  I think
my qualifications as a moron have to be helpful in some way.  I am
also old if that helps :) :).

Thanks all!
RB




On Nov 9, 7:01 am, Ramon Buckland ra...@thebuckland.com wrote:
 Thanks Tobias,

 That explanation was good. I had it right logically, but omitted
 calling one of my special - create me a new  methods, that replaced
 my RequestContext for me.

 All good niow. it saves data!

 On Nov 9, 2:28 pm, Tobias thaberm...@gmail.com wrote:







  I *think* that happens after you have fired a RequestContext. From
  looking at the code, which is a bit hard because of the
  DeferredBinding that's going on there, the locked variable in a
  RequestContext gets only reset to false, if the firedRequestfails.
  So I think you need to use a new RequestContext.

  Regards,
  Tobias

  On Nov 9, 12:48 pm, Ramon Buckland ra...@thebuckland.com wrote:

   Hi All,

   I am currently in the process of building an app, initally based off
   the Roo framework.
   I am getting a Arequestisalreadyinprogress at the point where I
   call create for a child entity.

   Is there a way I can see what requestcontexts are 

Re: RequestFactory - A request is already in progress

2010-11-28 Thread Richard Berger
Problem solved...
I was confused about two key points (sadly confusion is an
occupational hazard for us morons):
1) When to reuse a RequestContext vs. creating a new RequestContext
2) What Objectify.put() actually does

For #1, I believe that the same dynatablerf code put it as using the
given RequestContext to accumulate the edits.  My usage had been
somewhat random prior to that.  So, when calling the persist() I now
made sure to use the right RequestContext.

For #2, I had been making the change to the Commitment, then calling
put() and then making a change to the CommitUser, and then calling
put() again.  Now I make the changes to both entities and call put()
once.  This seemed to be the more important of the two.

These items may be obvious to all others, but on the off-chance there
are other old folks trying to write code

Enjoy,
RB

On Nov 28, 2:04 pm, Richard Berger richardlan...@gmail.com wrote:
 Similar problem, but I was not able to implement your solution - any
 guidance is suggested.  And I promise, once I get my simple app
 working, I will write the GWT/Objectify 1-to-Many Relationships for
 Moron Like Me guide :).

 The problem in the small...
 CommitUsers can have Commitments.  I create a new Commitment and try
 to associate that with the CommitUser.  But the properties on the
 CommitUser (even just a string) are not persisted.  So, 
 following:http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.h...
 in the section on Using RequestFactory, I figure I must be falling
 into the trap of not having an editable CommitUser (since I didn't
 create it, the CommitUseralreadyexists).

 So I change my code from:
  RequestVoid createReq =
 commitmentRequest.persist(currentCommitUserProxy).using(newCommitment);

 To:
   CommitUserProxy editableCommitUserProxy =
 commitUserReq.edit(currentCommitUserProxy);
  RequestVoid createReq =
 commitmentRequest.persist(editableCommitUserProxy).using(newCommitment);

 Where:
   commitUserReq is:
         private CommitUserRequest commitUserReq =
 requestFactory.commitUserRequest();
  requestFactory is:
         CommitmentSystemRequestFactory requestFactory =
 GWT.create(CommitmentSystemRequestFactory.class);

 This gives me the error:
 Caused by: java.lang.IllegalStateException: Arequestisalreadyinprogress
     at
 com.google.gwt.requestfactory.client.impl.AbstractRequestContext.checkLocke 
 d(AbstractRequestContext.java:
 307)

 Following the advice you provided, I tried to create a new
 RequestContext, so my code became...
   CommitUserRequest commitUserReq2 =
 requestFactory.commitUserRequest();
   CommitUserProxy editableCommitUserProxy =
 commitUserReq2.edit(currentCommitUserProxy);
  RequestVoid createReq =
 commitmentRequest.persist(editableCommitUserProxy).using(newCommitment);
 But that gave me the error:

 Caused by: java.lang.IllegalArgumentException: Attempting to edit an
 EntityProxy previously edited by another RequestContext
   at
 com.google.gwt.requestfactory.client.impl.AbstractRequestContext.checkStrea 
 msNotCrossed(AbstractRequestContext.java:
 334)

 Stepping back a little bit, the slightly bigger picture is that I am
 following the article 
 at:http://www.ibm.com/developerworks/java/library/j-javadev2-13/index.html
 (Java development 2.0: Twitter mining with Objectify-Appengine, Part
 1).  But that article doesn't use GWT.  But the idea is that the
 Commitment stores a KeyCommitUser so that I can query the
 Commitment.class to find all the Commitments whose Key matches the Key
 of the current user.  When I save a Commitment, I first save the
 Commitment itself and then establish the relationship by modifying the
 CommitUser (as the article demonstrates).  So, my persist method
 (fired above) is...

   public void persist(CommitUser commitUser) {
     // Save commitment first
     DAO dao = new DAO();
     Objectify ofy = dao.ofy();
     ofy.put(this);
     dao = null;
     // Then establish relationship
     commitUser.addCommitment(this);  // Owner is in charge
   }

 And the addCommitment method on the CommitUser is:
   public  void addCommitment(Commitment commitment) {
     DAO dao = new DAO();
     Objectify ofy = dao.ofy();
     commitment.setRequesterKey(this);
     commitment.setDescription(Updated in addCommitment);
     ofy.put(this);
     dao = null;
   }

 And finally, the commitment.setRequestKey() is:
   public void setRequesterKey(CommitUser commitUser) {
     this.requesterKey = new KeyCommitUser(CommitUser.class,
 commitUser.getId());
   }

 In the debugger I can see that all the properties - e.g. Description
 get set, but they are not persisted to the Datastore.

 I am sure this is common, but it seems that I am very close to getting
 this simple example to work - so any assistance is greatly appreciated
 and I will do my best to provide assistance to the community.  I think
 my qualifications as a moron have to be helpful in some way.  I am
 also old if that helps :) :).

 Thanks all!
 RB

 On Nov 9, 7

Re: Gilead AND GWT

2010-11-27 Thread Richard Berger
I had some difficulties getting Gilead/Hibernate/GWT working together,
but here is something I posted about 11 months ago after I got it all
working - hope it helps you... 
http://www.mail-archive.com/google-web-toolkit@googlegroups.com/msg34602.html

Enjoy,
RB

On Nov 25, 12:00 pm, Noor baken...@gmail.com wrote:
 Hi, thanks, yes i think i should place there as well. I just hope to
 get out of this problem. We here are almost all programmers, when we
 get a problem its a fun to debug it. When u have tried to debug for
 one whole, at end of the one day it become a stress and then at the
 end of the second, it is hopeless case if time is limited, and that's
 my case fooo!!

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory, Objectify, saving a new object with collections

2010-11-24 Thread Richard Berger
Thanks again - I will give that a try RB

On Nov 23, 2:44 pm, David Chandler drfibona...@google.com wrote:
 You're welcome, Richard, glad to help.

 My understanding is that Objectify always uses Keys to express
 relationships. If you want to retrieve the entity directly, you can
 add a getter/setter that calls Objectify to get / put an entity by its
 Key. These helper methods are likely what you would expose in the
 EntityProxy so client-side code won't have any references to Key. This
 works today.

 /dmc

 On Tue, Nov 23, 2010 at 5:23 PM, Richard Berger richardlan...@gmail.com 
 wrote:
  Thank you for the quick and clear reply which completely fixed my
  problem.  On a higher level, when support for Keys is added, should I
  use the Key or the Entity?  I can see that there may be some value in
  just having the Key and getting the Entity when I need it - although
  it seems like I will nearly always be needing the Entity.  But perhaps
  I am missing some key distinction.

  Thanks so much for taking the time to share your advice!
  RB

  On Nov 23, 12:26 pm, David Chandler drfibona...@google.com wrote:
  Hi Richard,

  RequestFactory doesn't yet support arrays. Use ListT instead. Also
  ensure that your Proxy doesn't expose the Objectify Key type, as only
  entity types and a few value types are supported until 2.1.1.

  /dmc

  On Tue, Nov 23, 2010 at 2:23 PM, Richard Berger richardlan...@gmail.com 
  wrote:
   Goal: Save an object an associated collection
   How to do this with Request Factory and Objectify?

   I have an object that looks like:
   Commitment.java (in com.br.commit2.server.domain)
   public class Commitment {
   �...@id private Long id;
          private String title;
    // other simple fields
    private Integer version;

    // Methods exposed through Request factory

    // Getters, setters
   }

   Since I am trying to use RequestFactory, I also have:
   CommitmentProxy.java (in com.rb.commit2.shared)
   @ProxyFor (Commitment.class)
   public interface CommitmentProxy extends EntityProxy {
          public String getTitle();
          public void setTitle(String title);
    // rest of interface
   }

   Also have
   public interface CommitmentSystemRequestFactory extends RequestFactory
   {
    CommitmentRequest commitmentRequest();
    ...
   }

   And...
   @Service (Commitment.class)
   public interface CommitmentRequest extends RequestContext {
          RequestLong countCommitments();
          // Other methods, implemented in Commitment.java above)
   }

   Finally, in my Commit2Binder.java, I have code that works to create a
   commitment when a button is clicked (this is just a test app)
          CommitmentRequest request = requestFactory.commitmentRequest();
          CommitmentProxy newCommitment =
   request.create(CommitmentProxy.class);
          newCommitment.setTitle(Test Objectify title);
          newCommitment.setDescription(Test Objectify Description);
          RequestVoid createReq =
   request.persistCommitment().using(newCommitment);

          createReq.fire(new ReceiverVoid()     {
                 �...@override
                  public void onSuccess(Void response) {
                          Window.alert(Created Commitment!);

                  }
          });

   Surprisingly enough it all works fine.  Now, I want to model a new
   object, a user with two collections of the Commitment object above.
   These are unowned collections.  Following the objectify-appengine/
   wiki//IntroductionToObjectify#Relationships, I create CommitUser

   public class CommitUser implements Serializable {
          private static final long serialVersionUID = 1L;
         �...@id private Long id;
          private String googleEmail;
    ...
          private KeyCommitment[] dueByMeCommitments;
          private KeyCommitment[] dueToMeCommitments;
   }

   And the related CommitUserProxy
   @ProxyFor (CommitUser.class)
   public interface CommitUserProxy extends EntityProxy {
          public int getUserLevel();
          
   }

   And a new Request Interface
   @Service (CommitUser.class)
   public interface CommitUserRequest extends RequestContext {
          InstanceRequestCommitUserProxy, Void persistCommitUser();
   }

   And add a line to my CommitmentSystemRequestFactory.java for
   CommitUserRequest.

   Now, in my Commit2Binder, I want to create a new CommitUser - empty
   collections are fine to start with.  But the code I have, essentially
   the code that works for creating a Commitment, fails.  The code is:
          CommitUserRequest request = requestFactory.commitUserRequest();
          CommitUserProxy newCommitUser =
   request.create(CommitUserProxy.class);
          newCommitUser.setGoogleNickname(Richard);
          newCommitUser.setGoogleEmail(richardlan...@gmail.com);
          newCommitUser.setUserLevel(1);
          newCommitUser.setDueByMeCommitments(null);
          newCommitUser.setDueToMeCommitments(null);
          RequestVoid

RequestFactory, Objectify, saving a new object with collections

2010-11-23 Thread Richard Berger
Goal: Save an object an associated collection
How to do this with Request Factory and Objectify?

I have an object that looks like:
Commitment.java (in com.br.commit2.server.domain)
public class Commitment {
  @Id private Long id;
private String title;
  // other simple fields
  private Integer version;

  // Methods exposed through Request factory

  // Getters, setters
}

Since I am trying to use RequestFactory, I also have:
CommitmentProxy.java (in com.rb.commit2.shared)
@ProxyFor (Commitment.class)
public interface CommitmentProxy extends EntityProxy {
public String getTitle();
public void setTitle(String title);
  // rest of interface
}

Also have
public interface CommitmentSystemRequestFactory extends RequestFactory
{
  CommitmentRequest commitmentRequest();
  ...
}

And...
@Service (Commitment.class)
public interface CommitmentRequest extends RequestContext {
RequestLong countCommitments();
// Other methods, implemented in Commitment.java above)
}

Finally, in my Commit2Binder.java, I have code that works to create a
commitment when a button is clicked (this is just a test app)
CommitmentRequest request = requestFactory.commitmentRequest();
CommitmentProxy newCommitment =
request.create(CommitmentProxy.class);
newCommitment.setTitle(Test Objectify title);
newCommitment.setDescription(Test Objectify Description);
RequestVoid createReq =
request.persistCommitment().using(newCommitment);

createReq.fire(new ReceiverVoid() {
@Override
public void onSuccess(Void response) {
Window.alert(Created Commitment!);

}
});

Surprisingly enough it all works fine.  Now, I want to model a new
object, a user with two collections of the Commitment object above.
These are unowned collections.  Following the objectify-appengine/
wiki//IntroductionToObjectify#Relationships, I create CommitUser

public class CommitUser implements Serializable {
private static final long serialVersionUID = 1L;
@Id private Long id;
private String googleEmail;
  ...
private KeyCommitment[] dueByMeCommitments;
private KeyCommitment[] dueToMeCommitments;
}

And the related CommitUserProxy
@ProxyFor (CommitUser.class)
public interface CommitUserProxy extends EntityProxy {
public int getUserLevel();

}

And a new Request Interface
@Service (CommitUser.class)
public interface CommitUserRequest extends RequestContext {
InstanceRequestCommitUserProxy, Void persistCommitUser();
}

And add a line to my CommitmentSystemRequestFactory.java for
CommitUserRequest.

Now, in my Commit2Binder, I want to create a new CommitUser - empty
collections are fine to start with.  But the code I have, essentially
the code that works for creating a Commitment, fails.  The code is:
CommitUserRequest request = requestFactory.commitUserRequest();
CommitUserProxy newCommitUser =
request.create(CommitUserProxy.class);
newCommitUser.setGoogleNickname(Richard);
newCommitUser.setGoogleEmail(richardlan...@gmail.com);
newCommitUser.setUserLevel(1);
newCommitUser.setDueByMeCommitments(null);
newCommitUser.setDueToMeCommitments(null);
RequestVoid createReq =
request.persistCommitUser().using(newCommitUser);

createReq.fire(new ReceiverVoid() {
@Override
public void onSuccess(Void response) {
Window.alert(Created User!);

}
@Override
public void onFailure(ServerFailure error) {
Window.alert(error.getMessage());
}
});
;

The failure occurs when the rquest is fired and the error is:
Caused by: java.lang.ClassCastException:
sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl cannot be
cast to java.lang.Class
If I remove the calls to setDueByMeCommitments, setDueToMeCommitments
I get the same error.

I start to look at other ideas, but it starts to seem that I am going
down the wrong path, since this should be something relative.  Any
pointers and thoughts would be greatly appreciated.

Thanks!
RB

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory, Objectify, saving a new object with collections

2010-11-23 Thread Richard Berger
Thank you for the quick and clear reply which completely fixed my
problem.  On a higher level, when support for Keys is added, should I
use the Key or the Entity?  I can see that there may be some value in
just having the Key and getting the Entity when I need it - although
it seems like I will nearly always be needing the Entity.  But perhaps
I am missing some key distinction.

Thanks so much for taking the time to share your advice!
RB

On Nov 23, 12:26 pm, David Chandler drfibona...@google.com wrote:
 Hi Richard,

 RequestFactory doesn't yet support arrays. Use ListT instead. Also
 ensure that your Proxy doesn't expose the Objectify Key type, as only
 entity types and a few value types are supported until 2.1.1.

 /dmc









 On Tue, Nov 23, 2010 at 2:23 PM, Richard Berger richardlan...@gmail.com 
 wrote:
  Goal: Save an object an associated collection
  How to do this with Request Factory and Objectify?

  I have an object that looks like:
  Commitment.java (in com.br.commit2.server.domain)
  public class Commitment {
  �...@id private Long id;
         private String title;
   // other simple fields
   private Integer version;

   // Methods exposed through Request factory

   // Getters, setters
  }

  Since I am trying to use RequestFactory, I also have:
  CommitmentProxy.java (in com.rb.commit2.shared)
  @ProxyFor (Commitment.class)
  public interface CommitmentProxy extends EntityProxy {
         public String getTitle();
         public void setTitle(String title);
   // rest of interface
  }

  Also have
  public interface CommitmentSystemRequestFactory extends RequestFactory
  {
   CommitmentRequest commitmentRequest();
   ...
  }

  And...
  @Service (Commitment.class)
  public interface CommitmentRequest extends RequestContext {
         RequestLong countCommitments();
         // Other methods, implemented in Commitment.java above)
  }

  Finally, in my Commit2Binder.java, I have code that works to create a
  commitment when a button is clicked (this is just a test app)
         CommitmentRequest request = requestFactory.commitmentRequest();
         CommitmentProxy newCommitment =
  request.create(CommitmentProxy.class);
         newCommitment.setTitle(Test Objectify title);
         newCommitment.setDescription(Test Objectify Description);
         RequestVoid createReq =
  request.persistCommitment().using(newCommitment);

         createReq.fire(new ReceiverVoid()     {
                �...@override
                 public void onSuccess(Void response) {
                         Window.alert(Created Commitment!);

                 }
         });

  Surprisingly enough it all works fine.  Now, I want to model a new
  object, a user with two collections of the Commitment object above.
  These are unowned collections.  Following the objectify-appengine/
  wiki//IntroductionToObjectify#Relationships, I create CommitUser

  public class CommitUser implements Serializable {
         private static final long serialVersionUID = 1L;
        �...@id private Long id;
         private String googleEmail;
   ...
         private KeyCommitment[] dueByMeCommitments;
         private KeyCommitment[] dueToMeCommitments;
  }

  And the related CommitUserProxy
  @ProxyFor (CommitUser.class)
  public interface CommitUserProxy extends EntityProxy {
         public int getUserLevel();
         
  }

  And a new Request Interface
  @Service (CommitUser.class)
  public interface CommitUserRequest extends RequestContext {
         InstanceRequestCommitUserProxy, Void persistCommitUser();
  }

  And add a line to my CommitmentSystemRequestFactory.java for
  CommitUserRequest.

  Now, in my Commit2Binder, I want to create a new CommitUser - empty
  collections are fine to start with.  But the code I have, essentially
  the code that works for creating a Commitment, fails.  The code is:
         CommitUserRequest request = requestFactory.commitUserRequest();
         CommitUserProxy newCommitUser =
  request.create(CommitUserProxy.class);
         newCommitUser.setGoogleNickname(Richard);
         newCommitUser.setGoogleEmail(richardlan...@gmail.com);
         newCommitUser.setUserLevel(1);
         newCommitUser.setDueByMeCommitments(null);
         newCommitUser.setDueToMeCommitments(null);
         RequestVoid createReq =
  request.persistCommitUser().using(newCommitUser);

         createReq.fire(new ReceiverVoid()     {
                �...@override
                 public void onSuccess(Void response) {
                         Window.alert(Created User!);

                 }
                �...@override
                 public void onFailure(ServerFailure error) {
                         Window.alert(error.getMessage());
                 }
         });
  ;

  The failure occurs when the rquest is fired and the error is:
  Caused by: java.lang.ClassCastException:
  sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl cannot be
  cast to java.lang.Class
  If I remove the calls

Re: GWT MVP and RequestFactory

2010-11-18 Thread Richard Berger
I am having a very similar problem - NullPointerException when I call
fire() (the NPE is in AbstractRequestContext.doFire()).  So I am
wondering if you have found a solution to your problem.

The code with the fire() is:
CommitmentSystemRequestFactory requestFactory =
GWT.create(CommitmentSystemRequestFactory.class);
requestFactory.commitmentRequest().countCommitments().fire(
  new ReceiverLong() {
@Override
public void onSuccess(Long response) {
Window.alert(Done!);
}
  });

My CommitmentRequest class has:
@Service (Commitment.class)
public interface CommitmentRequest extends RequestContext {
  RequestLong countCommitments();

My Commitment.java class has:
  public static long countCommitments() {

  }

Some other notes...
* I have also been going through the Expenses sample app, both the
description at: 
http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html#proxies
and the sample code.
* I am NOT using JPA.  My first learning project for GWT/GAE was with
JPA, but now I wanted to try the RequestFactory and then add
Objectify.
* I am NOT using MVP.  I just don't yet have the critical mass of
brain cells necessary.

Thanks for any updates or advice...
RB

On Nov 18, 9:05 am, Nicholas nick.sm...@gmail.com wrote:
 Thanks, you got me on the right rack.  I didn't realize that more
 information on the exceptions was available in the dev mode console of
 eclipse.  My domain entity objects had some Boolean accessors which I
 had named isProperty() instead of getProperty().  I changed all of
 those, and also made the domain service methods 'static' like you
 suggested.

 Now the application is running, but when it fires a request for
 UserInformation, I get a null pointer exception.  After debugging, it
 gets into AbstractRequestContext.doFire(receiver) method, which
 attempts to call requestFactory.getRequestTransport().send(...).
 requestFactory.getRequestTransport() returns NULL so it throws a Null
 Pointer Exception.  Do I need to configure the transport somewhere?  I
 didn't see anything in the documentation or the Expenses sample app.

 The portion of my code that is initiating this is (~ line 60) 
 in:http://code.google.com/p/eatright/source/browse/trunk/EatRightApp/src...

 On Nov 17, 6:28 pm, Thomas Broyer t.bro...@gmail.com wrote:







  On 17 nov, 21:06, Nicholas nick.sm...@gmail.com wrote:

   I am working on a small GWT app (I have used GWT in the past but it
   was a while ago), trying to learn the new MVP and RequestFactory.  I
   am not sure if I am just approaching this wrong, or have some error I
   can't spot.  When I add a call to instantiate my app's RequestFactory,
   it no longer runs.  It gives me Deferred Binding Failed for my
   request factory.

   I went back and double-checked the domain / entity objects and I think
   I have the required pattern in place (implicit no-arg constructor,
   getId(), findEntity(id) and getVersion()).

   Some of the relevant code:

   Domain 
   objects:http://code.google.com/p/eatright/source/browse/#svn/trunk/EatRightAp...

   EntityRequest and Proxy 
   objects:http://code.google.com/p/eatright/source/browse/#svn/trunk/EatRightAp...

   This class instantiates the RequestFactory (line 35) and passes it to
   the Activity (line 
   41)http://code.google.com/p/eatright/source/browse/trunk/EatRightApp/src...

   This class is where I have a method utilizing the request factory. (~
   line 
   49)http://code.google.com/p/eatright/source/browse/trunk/EatRightApp/src...

  http://code.google.com/p/eatright/source/browse/trunk/EatRightApp/src...

   Any ideas?

  Your service methods in your domain objects aren't static, but
  aren't declared as InstanceRequest in your RequestContext.
  (don't you have more specific errors than deferred binding failed?)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT MVP and RequestFactory

2010-11-18 Thread Richard Berger
As is typical - after working on this for hours, I think I found my
problem 10 minutes after posting.  Since I am trying to avoid MVP (for
now, until the brain cell count improves), I had not initialized my
RequestFactory.  Adding:
  final EventBus eventBus = new SimpleEventBus();
  requestFactory.initialize(eventBus);
has moved me past my NPE.  Into other errors of course...

Thanks for listening

RB

On Nov 18, 11:50 am, Richard Berger richardlan...@gmail.com wrote:
 I am having a very similar problem - NullPointerException when I call
 fire() (the NPE is in AbstractRequestContext.doFire()).  So I am
 wondering if you have found a solution to your problem.

 The code with the fire() is:
 CommitmentSystemRequestFactory requestFactory =
         GWT.create(CommitmentSystemRequestFactory.class);
 requestFactory.commitmentRequest().countCommitments().fire(
   new ReceiverLong() {
                 @Override
                 public void onSuccess(Long response) {
                         Window.alert(Done!);
                 }
   });

 My CommitmentRequest class has:
 @Service (Commitment.class)
 public interface CommitmentRequest extends RequestContext {
   RequestLong countCommitments();

 My Commitment.java class has:
   public static long countCommitments() {
     
   }

 Some other notes...
 * I have also been going through the Expenses sample app, both the
 description 
 at:http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.h...
 and the sample code.
 * I am NOT using JPA.  My first learning project for GWT/GAE was with
 JPA, but now I wanted to try the RequestFactory and then add
 Objectify.
 * I am NOT using MVP.  I just don't yet have the critical mass of
 brain cells necessary.

 Thanks for any updates or advice...
 RB

 On Nov 18, 9:05 am, Nicholas nick.sm...@gmail.com wrote:







  Thanks, you got me on the right rack.  I didn't realize that more
  information on the exceptions was available in the dev mode console of
  eclipse.  My domain entity objects had some Boolean accessors which I
  had named isProperty() instead of getProperty().  I changed all of
  those, and also made the domain service methods 'static' like you
  suggested.

  Now the application is running, but when it fires a request for
  UserInformation, I get a null pointer exception.  After debugging, it
  gets into AbstractRequestContext.doFire(receiver) method, which
  attempts to call requestFactory.getRequestTransport().send(...).
  requestFactory.getRequestTransport() returns NULL so it throws a Null
  Pointer Exception.  Do I need to configure the transport somewhere?  I
  didn't see anything in the documentation or the Expenses sample app.

  The portion of my code that is initiating this is (~ line 60) 
  in:http://code.google.com/p/eatright/source/browse/trunk/EatRightApp/src...

  On Nov 17, 6:28 pm, Thomas Broyer t.bro...@gmail.com wrote:

   On 17 nov, 21:06, Nicholas nick.sm...@gmail.com wrote:

I am working on a small GWT app (I have used GWT in the past but it
was a while ago), trying to learn the new MVP and RequestFactory.  I
am not sure if I am just approaching this wrong, or have some error I
can't spot.  When I add a call to instantiate my app's RequestFactory,
it no longer runs.  It gives me Deferred Binding Failed for my
request factory.

I went back and double-checked the domain / entity objects and I think
I have the required pattern in place (implicit no-arg constructor,
getId(), findEntity(id) and getVersion()).

Some of the relevant code:

Domain 
objects:http://code.google.com/p/eatright/source/browse/#svn/trunk/EatRightAp...

EntityRequest and Proxy 
objects:http://code.google.com/p/eatright/source/browse/#svn/trunk/EatRightAp...

This class instantiates the RequestFactory (line 35) and passes it to
the Activity (line 
41)http://code.google.com/p/eatright/source/browse/trunk/EatRightApp/src...

This class is where I have a method utilizing the request factory. (~
line 
49)http://code.google.com/p/eatright/source/browse/trunk/EatRightApp/src...

   http://code.google.com/p/eatright/source/browse/trunk/EatRightApp/src...

Any ideas?

   Your service methods in your domain objects aren't static, but
   aren't declared as InstanceRequest in your RequestContext.
   (don't you have more specific errors than deferred binding failed?)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



How can I use applySortedColumnIndicator

2010-11-15 Thread Richard Berger
I have a ScrollTable that I sometimes need to sort programmatically
and would like to indicate to the user which column has been used to
sort.

In the javadocs at http://collectionofdemos.appspot.com, I find that
the AbstractScrollTable has the applySortedColumnIndicator method that
seems just what I need.

But when I try to use it:
// currentView is my ScrollTable
currentView.applySortedColumnIndicator(headerElem, isAscending);
or
((AbstractScrollTable)currentView).applySortedColumnIndicator(headerElem,
isAscending);

I get the error:
The method applySortedColumnIndicator(Element, boolean) from the type
AbstractScrollTable is not visible

Am I doing something very wrong?  Is there a workaround?
http://collectionofdemos.appspot.com/javadoc/com/google/gwt/widgetideas/table/client/ScrollTable.html#applySortedColumnIndicator(com.google.gwt.user.client.Element,
boolean) indicates this method is deprecated, but I don't see any
mention of a replacement.

Perhaps I am just running into bug 56, reported at:
http://code.google.com/p/google-web-toolkit-incubator/issues/detail?id=56
?

That last thought may be the correct conclusion, but it is late in my
timezone and I am not the sharpest knife in the drawer on my best
days :)

Thanks in advance for help/advice/etc
RB

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: UiBinder fails after upgrading to gwt 2.1.0

2010-11-03 Thread Richard Berger
OK, this won't help much, but... I was having the same problem just
going through some basic tutorial using UiBinder and GWT 2.1.  So, I
redid everything, writing down each step - and, of course, the problem
vanished.

So, there exists the possibility that 2.1 and UiBinder do actually
work together.

I can only offer the truly lame suggestion of restarting Eclipse to
clean up any old invocations of the dev server.

Good luck,
RB

On Nov 3, 8:34 am, pgraham philip.robert.gra...@gmail.com wrote:
 Update:

 I have commented out all code in the two files listed above so that
 they are as follows:

 MainMenu.ui.xml:

 ui:UiBinder xmlns:ui=urn:ui:com.google.gwt.uibinder
     xmlns:g=urn:import:com.google.gwt.user.client.ui

 /ui:UiBinder

 MainMenu.java:

 public class MainMenu extends Composite {

     interface Binder extends UiBinderWidget, MainMenu {}

     private static Binder uiBinder = GWT.create(Binder.class);

     public MainMenu() {
         initWidget(uiBinder.createAndBindUi(this));
     }

 }

 When I do this I get the same error so it is not related to the
 content.

 At this point I am thinking that there is a version conflict with
 xerces.  Does anyone know if Dev Mode relies on xerces to parse
 *.ui.xml files and if so which version?

 NOTE:  I am using the gwt-maven-plugin to compile the app and it works
 fine if I compile it and deploy it in Tomcat

 Thanks,
 Philip

 On Nov 2, 1:54 pm, pgraham philip.robert.gra...@gmail.com wrote:







  MainMenu.ui.xml:

  ui:UiBinder xmlns:ui=urn:ui:com.google.gwt.uibinder
      xmlns:g=urn:import:com.google.gwt.user.client.ui

      ui:with field=css
  type=org.sitebrand.ui.gwt.resources.UiResources.MainMenuCss /
      ui:with field=lbls
  type=org.sitebrand.ui.gwt.resources.MainMenuLbls /
      ui:with field=debugIds
  type=org.sitebrand.gwt.constants.DebugConstants /

      g:MenuBar stylePrimaryName={css.primary}
          g:MenuItem ui:field=campaigns
  debugId={debugIds.menuitem_campaigns} text={lbls.campaigns}
              g:MenuBar vertical=true
                  g:MenuItem ui:field=createCampaign
                      text={lbls.createCampaign} /
                  g:MenuItem ui:field=viewCampaigns
                      text={lbls.viewCampaigns} /
                  g:MenuItem ui:field=campaignPriority
                      text={lbls.campaignPriority} /
                  g:MenuItem ui:field=reports
                      text={lbls.reports} /
              /g:MenuBar
          /g:MenuItem

          g:MenuItem ui:field=content
  debugId={debugIds.menuitem_content} text={lbls.content}
              g:MenuBar vertical=true
                  g:MenuItem
                      ui:field=createContent
                      text={lbls.createContent} /
                  g:MenuItem
                      ui:field=viewContent
                      text={lbls.viewContent} /
                  g:MenuItem
                      ui:field=integrate
                      text={lbls.integrate} /
              /g:MenuBar
          /g:MenuItem

          g:MenuItem ui:field=segments
  debugId={debugIds.menuitem_segments} text={lbls.segments}
              g:MenuBar vertical=true
                  g:MenuItem
                      ui:field=createSegment
                      text={lbls.createSegment} /
                  g:MenuItem
                      ui:field=viewSegments
                      text={lbls.viewSegments} /
              /g:MenuBar
          /g:MenuItem

          g:MenuItem ui:field=layout
  debugId={debugIds.menuitem_layout} text={lbls.layout}
              g:MenuBar vertical=true
                  g:MenuItem
                      ui:field=addTemplate
                      text={lbls.addTemplate} /
                  g:MenuItem
                      ui:field=viewTemplates
                      text={lbls.viewTemplates} /
              /g:MenuBar
          /g:MenuItem

          g:MenuItem ui:field=account
  debugId={debugIds.menuitem_account_mgmt} text={lbls.account}
              g:MenuBar vertical=true
                  g:MenuItem
                      ui:field=myAccount
                      text={lbls.myAccount} /
                  g:MenuItem
                      ui:field=organizations
                      text={lbls.organizations} /
                  g:MenuItem
                      ui:field=sites
                      text={lbls.sites} /
                  g:MenuItem
                      ui:field=users
                      text={lbls.users} /
                  g:MenuItem
                      ui:field=globalSettings
                      text={lbls.globalSettings} /
              /g:MenuBar
          /g:MenuItem

          g:MenuItem ui:field=help debugId={debugIds.menuitem_help}
  text={lbls.help}
              g:MenuBar vertical=true
                  g:MenuItem
                      ui:field=manual
                      text={lbls.manual} /
                  g:MenuItem
                      ui:field=support
                      

Re: DockLayoutPanel layout problem with south and UiBinder

2010-01-21 Thread Richard Berger
I am using a DockLayoutPanel with UiBinder and it seems to work fine.
However, I can't see any real difference between your code and mine.
My ordering is different - I have north, center, west, then south.
Also, my center panel has a size.  Sorry to not have anything more
useful for you.
RB

On Jan 19, 12:38 am, Marcel Wagner marcel.wag...@gmx.de wrote:
 I have tried to use the DockLayoutPanel and the UiBinder with the
 following layout:

         g:DockLayoutPanel unit='EM'
                 g:north size='5'
                         lp:HeaderArea ui:field='headerArea' /
                 /g:north
                 g:west size='12'
                         lp:VerticalBar ui:field='verticalBar' /
                 /g:west
                 g:south size='2'
                         lp:StatusArea ui:field='statusArea' /
                 /g:south

                 g:center
                         lp:ContentArea ui:field='contentArea' /
                 /g:center
         /g:DockLayoutPanel

 This should generate a four area layout. All is fine beside of the
 layout the south panel. It not starts at the left window border, it
 starts at the same border as the center panel and the west panel is
 layouted completely to the bottom of the window.
 Is this a bug, or do I somthing wrong?

 Thanks, Marcel
-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




Re: Apply css to dockLayoutPanel

2010-01-19 Thread Richard Berger
It may not be possible.  At least the information at
http://java.ociweb.com/mark/programming/GWT.html#Formatting doesn't
show any CSS styles for DockPanel.  Hope the pointer is useful to you.

Enjoy,
RB

On Jan 15, 4:06 am, netxplorer loupasch...@gmail.com wrote:
 Hello,
 I'm actually trying to set a style to the dockLayoutPanel. When I set
 it, everything's ok (with firebug I can see the new style class
 added), but when I try to set some properties in thecssfile it won't
 work. I can usecsswith other elements, like my tabLayoutPanel (in
 this case I have to redefine existingcss) but not the
 dockLayoutPanel.

 I'm using CssRessource to injectcssin my application.

 Any idea on this ?

 Thanks !
-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




Re: TRying to upload a file

2010-01-18 Thread Richard Berger
Here's a link that I found pretty useful in using FileUpload with
GWT... http://www.jroller.com/hasant/entry/fileupload_with_gwt

Enjoy,
RB

On Jan 18, 12:30 am, Abdullah Shaikh abdullah.shaik...@gmail.com
wrote:
 Yes you are correct. GWT has not automated file upload, it just submits the
 data to the server, where you need to get this data and store the file
 somewhere, as in any non-GWT project.

 - Abdullah

 On Mon, Jan 18, 2010 at 1:16 PM, Ewald Pankratz 
 ewald.pankr...@gmail.comwrote: I am a newbie and I am never sure about 
 anything. But for me it looks
  the whole server part of the example is missing.

  On Jan 18, 2:33 am, tedpottel tedpot...@gmail.com wrote:
   Hi,
   I cannot figure out how to upload a file.  I copied the sample code at

  http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/g...

   The program seemed to run fine, I
   1.      Click the browse button to choose a file to upload.
   2.      clicked submit.

   Check the folder war folder of my GWT project for the uploaded file
   could not fine it.
   Did the file get uploaded? If so whare is it? Help
   Ted

  --
  You received this message because you are subscribed to the Google Groups
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs 
  cr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




Re: problemas con Hibernate y gilead no compatible con gwt 2.0

2010-01-01 Thread Richard Berger
Had the same problem - the following post was very helpful:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/ca5722230f14f54e/408301beba6a2bf4?lnk=raot

RB

On Dec 30 2009, 12:08 pm, marcelomos marcelo.mosc...@gmail.com
wrote:
 GRAVE: WebModule[/gwt20lab2hibernate]Exception while dispatching
 incoming RPC call
 java.lang.NoSuchMethodError:
 com.google.gwt.user.server.rpc.RPCRequest.init(Ljava/lang/reflect/
 Method;[Ljava/lang/Object;Lcom/google/gwt/user/server/rpc/
 SerializationPolicy;)V
         at com.google.gwt.user.server.rpc.RPCCopy_GWT15.decodeRequest
 (RPCCopy_GWT15.java:278)
         at com.google.gwt.user.server.rpc.RPCCopy.decodeRequest
 (RPCCopy.java:136)
         at net.sf.gilead.gwt.PersistentRemoteService.processCall
 (PersistentRemoteService.java:143)
         at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost
 (RemoteServiceServlet.java:224)
         at
 com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost
 (AbstractRemoteServiceServlet.java:62)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:
 754)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:
 847)
         at org.apache.catalina.core.StandardWrapper.service
 (StandardWrapper.java:1523)
         at org.apache.catalina.core.StandardWrapperValve.invoke
 (StandardWrapperValve.java:279)
         at org.apache.catalina.core.StandardContextValve.invoke
 (StandardContextValve.java:188)
         at org.apache.catalina.core.StandardPipeline.invoke
 (StandardPipeline.java:641)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:
 97)
         at
 com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke
 (PESessionLockingStandardPipeline.java:85)
         at org.apache.catalina.core.StandardHostValve.invoke
 (StandardHostValve.java:185)
         at org.apache.catalina.connector.CoyoteAdapter.doService
 (CoyoteAdapter.java:332)
         at org.apache.catalina.connector.CoyoteAdapter.service
 (CoyoteAdapter.java:233)
         at com.sun.enterprise.v3.services.impl.ContainerMapper.service
 (ContainerMapper.java:165)
         at com.sun.grizzly.http.ProcessorTask.invokeAdapter
 (ProcessorTask.java:791)
         at com.sun.grizzly.http.ProcessorTask.doProcess
 (ProcessorTask.java:693)
         at com.sun.grizzly.http.ProcessorTask.process
 (ProcessorTask.java:954)
         at com.sun.grizzly.http.DefaultProtocolFilter.execute
 (DefaultProtocolFilter.java:170)
         at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter
 (DefaultProtocolChain.java:135)
         at com.sun.grizzly.DefaultProtocolChain.execute
 (DefaultProtocolChain.java:102)
         at com.sun.grizzly.DefaultProtocolChain.execute
 (DefaultProtocolChain.java:88)
         at com.sun.grizzly.http.HttpProtocolChain.execute
 (HttpProtocolChain.java:76)
         at com.sun.grizzly.ProtocolChainContextTask.doCall
 (ProtocolChainContextTask.java:53)
         at com.sun.grizzly.SelectionKeyContextTask.call
 (SelectionKeyContextTask.java:57)
         at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork
 (AbstractThreadPool.java:330)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.run
 (AbstractThreadPool.java:309)
         at java.lang.Thread.run(Thread.java:619)

--

You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




Re: Using Gilead with GWT 2.0 ms1

2009-12-26 Thread Richard Berger
Trevor:

Thank you for the post - it was a life saver.  When I copied the java
files to my system, I had a compiler error at line 161 of
RPCCopy.java:
return RPCCopy_GWT16.invoke(target, serviceMethod, args,
serializationPolicy);
The error was:
The method invoke(Object, Method, Object[], SerializationPolicy) is
undefined for the type RPCCopy_GWT16.

Since I am on GWT2, I figured I could replace that line with
return null;

Seemed to work for me.

Thanks again for your work here!
RB


On Dec 23, 6:02 am, Trevor Skaife tska...@gmail.com wrote:
 I'm just glad to see people are able to use my fix for using gilead
 with GWT 2.0.0

 On Dec 22, 11:08 am, lucamen epped...@gmail.com wrote:



  Thanks Josh!! That really help me a lot and now everything is working
  properly!

  BTW Bruno (the Gilead main developer) wrote 
  herehttp://sourceforge.net/projects/gilead/forums/forum/868076/topic/3484314
  that a new release is coming very soon... so just wait and hope in a
  stable version that works with gwt2.0

  Thanks again and merry christmas! :-P

  On 18 Dic, 22:53, Josh Martin alodar...@gmail.com wrote:

   What worked for me was to add the files Trevor specified to 'my'
   project, and not into the original gilead source directories.  You
   just have to make sure to match the original package directory he
   specified of: src/com/google/gwt/user/server/rpc in your project
   directory.  Any project that you create now that uses the adapter4gwt
   library should include those two files as source files as well.  Your
   application should compile with those source files in it, as long as
   you have the adapter4gwt library files included (which you would have
   to have to use gilead anyway).

   I, too, thought he meant to put them in the original gilead
   directories and recreate the entire adapter4gwt library, but after re-
   reading what he suggested, I realized his real suggestion was far
   easier. (Thanks Trevor!)

   Hope this helps,
   Josh

   On Dec 18, 4:04 am, lucamen epped...@gmail.com wrote:

Hello, I'm working on a GWT 2.0 project with hibernate integration 
viaGilead. When I try to load data from database (on GWT 1.7 everything
was working properly) I get this error Parameter 0 of is of an
unknown type 'java.lang.String/2004016611' and googling I've found
this thread.
I downloaded these two files and put in src/com/google/gwt/user/server/
rpc under mygileadroot directory but nothing changes!

To be sure I've updated all my buildpath with the jars I need but the
error still remain.

Do I have to ant build the adapter4gwt with these two new files and
then add the new jars I get?

I've already tried but ant failed with this error:

build:
     [echo] adapter4gwt: 
/Users/lucame/Documents/workspace/Libs/gilead-1.2.3.823/adapter4gwt/build.x
 ml
    [javac] Compiling 6 source files to /Users/lucame/Documents/
workspace/Libs/gilead-1.2.3.823/adapter4gwt/classes
    [javac] /Users/lucame/Documents/workspace/Libs/gilead-1.2.3.823/
adapter4gwt/src/com/google/gwt/user/server/rpc/RPCCopy_GWT20.java:287:
cannot find symbol
    [javac] symbol  : constructor RPCRequest
(java.lang.reflect.Method,java.lang.Object
[],com.google.gwt.user.server.rpc.SerializationPolicy,int)
    [javac] location: class com.google.gwt.user.server.rpc.RPCRequest
    [javac] return new RPCRequest(method, parameterValues,
serializationPolicy, 0);
    [javac]        ^
    [javac] 1 error

What should I do to get GWT 2.0 work withGilead?

ANY help would be VERY appreciate!!

Thanks, Luca.

On 10 Dic, 16:35, Trevor Skaife tska...@gmail.com wrote:

 I definitely should have worded that better. You did exactly what I
 wanted you to do, if you would put them in any other package it
 wouldn't work.

 On Dec 9, 5:27 pm, graffle...@gmail.com graffle...@gmail.com
 wrote:

  Thanks!!  Great work...

  but what do you mean by Once you get these files in your project 
  just
  make sure to change the package accordingly.

  all I did was put these files in src/com/google/gwt/user/server/rpc

  should I do anything else?

    - Bob

  On Oct 18, 10:06 am, tskaife tska...@gmail.com wrote:

   Ok, well I found out that my changes to makegileadwork for GWT 2.0
   didn't quite work, but I've been able to fix that. I also notice 
   that
   I put the same two files up above, here are the 2 files to 
   download to
   getgileadworking with GWT 2.0.

   RPCCopy.javahttp://trg-commons.googlecode.com/files/RPCCopy.java

   RPCCopy_GWT20.javahttp://trg-commons.googlecode.com/files/RPCCopy_GWT20.java

   Once you get these files in your project just make sure to change 
   the
   package accordingly.

   On Oct 9, 1:35 pm, tskaife tska...@gmail.com wrote:

I just updated toGWT 2.0ms1 and noticed that I was getting an