Monday, December 31, 2012

Re: RequestFactory, ValueProxy support for Email, Link, User

For posterity:
After setting up the Annotation Processor, I realized there were many other issues. But User object isn't one of them. It works fine. Link, on the other hand, does not - the reason for this is that Link object doesn't have a default constructor. So we get errors if we try to make a LinkProxy for it. I decided to store my link just as a String, instead of Link.

Regards, 
Avanish

On Fri, Dec 21, 2012 at 11:12 PM, Avanish Raju <yaraju@gmail.com> wrote:
Hi GWT team, 

I've just started migrating from GWT-RPC to RequestFactory, and noticed that even when using ValueProxy to wrap the datastore objects, they aren't supported. For e.g, I created a UserProxy and a LinkProxy:

import com.google.appengine.api.users.User;
import com.google.web.bindery.requestfactory.shared.ProxyFor;
import com.google.web.bindery.requestfactory.shared.ValueProxy;

@ProxyFor(User.class)
public interface UserProxy extends ValueProxy {
String getUserId();
String getEmail();
String getNickName();
String getAuthDomain();
String getFederatedIdentity();
}

package com.kuryaat.lms.common.newdto;

import com.google.appengine.api.datastore.Link;
import com.google.web.bindery.requestfactory.shared.ProxyFor;
import com.google.web.bindery.requestfactory.shared.ValueProxy;

@ProxyFor(Link.class)
public interface LinkProxy extends ValueProxy {
String getValue();

}

And I'm using them like this:

import com.google.web.bindery.requestfactory.shared.EntityProxy;
import com.google.web.bindery.requestfactory.shared.ProxyFor;
import com.kuryaat.lms.common.dto.DocRefType;
import com.kuryaat.lms.server.jdo.DocRef;
import com.kuryaat.lms.server.rf.DocRefLocator;

@ProxyFor(value = DocRef.class, locator = DocRefLocator.class)
public interface DocRefProxy extends EntityProxy {

String getName();
LinkProxy getLink();
DocRefType getDocType();
int getStackIndex();
String getSourceService();
}


But I get the following error when I try to run the code:
[ERROR] [myapp] - Line 7: User cannot be resolved to a type

What is the right way to handle these?

Thanks, 
Avanish

--
"Life is what you make of it"
Y. Avanish Raju,

BTech, Computer Science and Engineering & Biotechnology,
ICFAI University, Dehradun

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/S/MU d- s:- a- C+++ UL+++ P+ L+++>++++ E-->--- W++>+++ N- o? K- w+>w++ !O !M !V
PS++@ PE++ Y+@ PGP- t 5? X+ R tv b+++ DI+@ D+ G e>++ h* r-- y
------END GEEK CODE BLOCK------



--
"Life is what you make of it"
Y. Avanish Raju,

BTech, Computer Science and Engineering & Biotechnology,
ICFAI University, Dehradun

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/S/MU d- s:- a- C+++ UL+++ P+ L+++>++++ E-->--- W++>+++ N- o? K- w+>w++ !O !M !V
PS++@ PE++ Y+@ PGP- t 5? X+ R tv b+++ DI+@ D+ G e>++ h* r-- y
------END GEEK CODE BLOCK------

--
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-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment