Retrieving entities with Request Factory.

2013-05-01 Thread Aman Sharma
I have following method which should return a list of PollProxy.

public ListPollProxy getPollList(){
ListPollProxy polls;
requestFactory.userRequest().findUser(Cookies.getCookie(user)).with(polls).fire(
new ReceiverUserProxy(){
@Override
public void onSuccess(UserProxy user){
polls=user.getPolls();
}
});
return polls;
}

but I can't figure out how to  use the list returned by user.getPolls() 
outside the onSuccess() . As polls field can't be accessed inside an inner 
class. Please fix this method for me?

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




Re: Entity not persisted, using JDO,RequestFactory.

2013-04-25 Thread Aman Sharma
I am able to persist this entity in a servlet with following code:

PersistenceManager pm = PMF.getInstance().getPersistenceManager();
 User abcd = new User();
abcd.setEmail(em...@email.com);
abcd.setName(name); 
 VerificationToken token1 = new 
VerificationToken(abcd,VerificationToken.VerificationTokenType.emailVerification,60);
 
 if(abcd!=nulltoken1!=null)
abcd.addVerificationToken(token1);
else
System.err.println(Why me!);
 Poll poll = new Poll();
poll.setQuestion(Hello Good Morning);
ListString options = new ArrayListString();
options.add(option 1);
options.add(option 2);
poll.setOptions(options);
poll.setUser(abcd);
poll.setCloseTime(new Date());
pm.makePersistent(abcd);
pm.makePersistent(poll);
 pm.close();

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




Re: Entity not persisted, using JDO,RequestFactory.

2013-04-25 Thread Aman Sharma
I am still not able to persist poll entity using Requestfactory in GWT. 
Please point out if there's anything wrong with following code.

view.setMsg(preparing);
 PollRequest pr = requestFactory.pollRequest();
UserRequest ur = requestFactory.userRequest();
 final UserProxy[] oldUser=new UserProxy[1];
 ur.findUser(Cookies.getCookie(user)).fire(new ReceiverUserProxy(){
@Override
public void onSuccess(UserProxy user){
oldUser[0]=user;
}
});

UserProxy editUser=ur.edit(oldUser[0]);
 PollProxy createdPoll = ur.create(PollProxy.class);
 createdPoll.setQuestion(view.getQuestion());
createdPoll.setOptions(view.asEditor().getList());
createdPoll.setCloseTime(closeTime);
createdPoll.setUser(oldUser[0]);
editUser.setPolls(createdPoll);
 ur.persist().using(editUser).fire(new ReceiverVoid(){
@Override
public void onSuccess(Void arg0){
view.setMsg(POll Created);
}
});

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




Entity not persisted, using JDO,RequestFactory.

2013-04-24 Thread Aman Sharma
I am trying to persist this http://pastebin.com/7KtXaBGe entity using 
following piece of code: 

PollRequest pr = requestFactory.pollRequest();
PollProxy createdPoll = pr.create(PollProxy.class);
createdPoll.setQuestion(view.getQuestion());
createdPoll.setOptions(view.asEditor().getList());
createdPoll.setCloseTime(closeTime);
createdPoll.setUser(Cookies.getCookie(user));
RequestVoid createReq = pr.persist().using(createdPoll);


   createReq.fire(new ReceiverVoid(){
@Override
public void onSuccess(Void arg0){
 view.setMsg(PollCreated);
}
@Override
public void onFailure(ServerFailure error){
Logger logger = Logger.getLogger(PollPersistError);
logger.log(Level.SEVERE,error.getMessage());
}
});


But it doesn't get persisted.There are no exceptions. What could be wrong? 

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




Re: Entity not persisted, using JDO,RequestFactory.

2013-04-24 Thread Aman Sharma
No,there's no error or exception. And the control never reaches onSuccess 
block. 

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




Re: Entity not persisted, using JDO,RequestFactory.

2013-04-24 Thread Aman Sharma
I have checked localhost:/_ah/admin there's no Poll entity created in 
datastore.

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




Re: Entity not persisted, using JDO,RequestFactory.

2013-04-24 Thread Aman Sharma
I'm only having problem persisting this entity.

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




Re: Conceptual Doubt

2013-04-15 Thread Aman Sharma
Hi Robson,

Have you done any Swing programming before?

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




Exception while persisting an entity.

2013-04-09 Thread Aman Sharma
While persisting following entity I am getting a server error : null in GWT 
development console. But on removing the call to pm.persist() everything 
goes right. I have doubts that I have not defined this entity properly. 
Maybe I am using types not supported by Datastore.Or is there anything else 
I am doing wrong? Please please help it's been a week I am following this 
long chain of exceptions with this GWT project.


package com.torrid.gwt.pollingApp.server;


import com.google.appengine.api.datastore.Key;

import javax.jdo.annotations.EmbeddedOnly;
import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.Version;
import javax.jdo.annotations.Extension;
import javax.jdo.annotations.VersionStrategy;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.PersistenceManager;
import javax.jdo.JDOHelper;
import javax.jdo.Query;
import com.torrid.gwt.pollingApp.server.PMF;

import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;

@PersistenceCapable
@Version(strategy=VersionStrategy.VERSION_NUMBER, column=VERSION,
 extensions={@Extension(vendorName=datanucleus, key=field-name, 
value=myVersion)})
public class User{
 @PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;

protected Long version;
@Persistent
private String name;
 @Persistent
@Embedded
private Password kunji;
public void setName(String name){
this.name=name;
}
public void setPassword(String pass){
byte[] bSalt;
String salt = null;
String hash = null;
try{
bSalt = PassEncryptionService.generateSalt();
salt = new String(bSalt);
hash = new String(PassEncryptionService.getEncryptedPassword(pass,bSalt));
}
catch(NoSuchAlgorithmException e){
//no idea about what to do yet.
}
catch(InvalidKeySpecException e){
//no idea about what to do yet.
}
kunji=new Password(hash,salt);
}
public String getPassword(){
return abc;
}
public String getName(){
return this.name;
}
public Long getId(){
return this.id;
}
 @PersistenceCapable
@EmbeddedOnly
public static class Password{
@Persistent
private String hash;
 @Persistent
private String salt;
 public Password(String hash,String salt){
this.hash=hash; this.salt=salt;
}
 }
public static User findUser(Long id){
if(id==null)
return null;
PersistenceManager pm = PMF.getInstance().getPersistenceManager();
return pm.getObjectById(User.class,id);
}
 public Long getVersion(){
return this.version;
}
 public void persist(){
PersistenceManager pm  = PMF.getInstance().getPersistenceManager();
try{
pm.makePersistent(this);
}
finally{
pm.close();
}
}
 }


package com.torrid.gwt.pollingApp.server;
import javax.jdo.JDOHelper;import javax.jdo.PersistenceManagerFactory;
public final class PMF {
  private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory(transactions-optional);

 private PMF() {}

 public static PersistenceManagerFactory getInstance() {
return pmfInstance;
 }}


public void persist(){
PersistenceManager pm  = PMF.getInstance().getPersistenceManager();
try{
pm.makePersistent(this);
}
finally{
pm.close();
}}

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




Re: Uncaught umbrella exception.

2013-04-07 Thread Aman Sharma
Thanks Thomas.

Your solution is right.

Now I have to do this 
http://vivagwt.blogspot.in/2011/09/requestfactory-en-gwt-24.html but how do 
I add requestfactory-apt.jar annotation processor to my project manually. 
Instructions on this link is for only Eclipse.


 And also do I have to define a getter method even I am not using it just 
to prevent those Umbrella Exceptions?

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




Re: The RequestFactory ValidationTool must be run for the RequestFactory type

2013-04-07 Thread Aman Sharma
How to do the all of these steps if no IDE's including Eclipse.

On Saturday, September 24, 2011 2:33:49 AM UTC+5:30, Jonas wrote:

 Hi, 

 this Wiki entry helped me to solve the problem: 
 http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation
 Do exactly what is shown in the printscreens and it should work.

 If it's not working tell exactly what you did. I almost got crazy and did 
 see that they added verbose=false to Annotation Processing. I thought 
 this isn't necessary as they didn't mention it in the text. I was wrong.

 Jonas


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




Implementing a service using request factory : static method in a type vs instance methods in a service class

2013-04-06 Thread Aman Sharma
I'm using JDO with RequestFactory and MVP pattern. Example to  implement 
service in firty way is very clear to me from 
https://developers.google.com/web-toolkit/doc/latest/DevGuideRequestFactory#entity_service

But how do you implement a service as instance methods in a service class? 
I am not very clear with the definition and use of ServiceLocator , 
Locator. When do you use them?

Is a service class different from persistence capable entity?

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




Uncaught umbrella exception.

2013-04-06 Thread Aman Sharma


Please help me resolve this Umbrella exception http://pastebin.com/DACPRhbP

NewUserPresenter file : http://pastebin.com/FZyAffu8

NewUserViewImpl file: http://pastebin.com/i6fYwnLH

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




Unable to load module error while running an appengine and gwt project in development mode

2012-10-07 Thread Aman Sharma
https://lh4.googleusercontent.com/-VtD39Kcacd0/UHE7H2KPDyI/AAY/Ot2Z9umtUvk/s1600/gwtDevMode.png









Please help me rectify this problem. I am not able to run my project in 
development mode locally, every time I have to upload the project to 
app-engine to run it.
Terminal output is attached.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/1GvPlTPH3yAJ.
To post to this group, send email to google-web-toolkit@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.

aman@aman-N150P:~/workspace/FriendList$ ant devmode
Buildfile: /home/aman/workspace/FriendList/build.xml

libs:

javac:
[javac] /home/aman/workspace/FriendList/build.xml:42: warning: 
'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to 
false for repeatable builds
[datanucleusenhancer] Oct 7, 2012 1:42:22 PM 
org.datanucleus.enhancer.DataNucleusEnhancer init
[datanucleusenhancer] INFO: DataNucleus Enhancer : Using ClassEnhancer ASM 
for API JDO
[datanucleusenhancer] Oct 7, 2012 1:42:22 PM 
org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
[datanucleusenhancer] INFO: Bundle org.datanucleus has an optional dependency 
to org.eclipse.equinox.registry but it cannot be resolved
[datanucleusenhancer] Oct 7, 2012 1:42:22 PM 
org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
[datanucleusenhancer] INFO: Bundle org.datanucleus has an optional dependency 
to org.eclipse.core.runtime but it cannot be resolved
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.PersistenceConfiguration setProperty
[datanucleusenhancer] INFO: Property 
datanucleus.rdbms.sql.allowAllSQLStatements unknown - will be ignored
[datanucleusenhancer] DataNucleus Enhancer (version 1.1.4) : Enhancement of 
classes
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.PersistenceConfiguration setProperty
[datanucleusenhancer] INFO: Property datanucleus.rdbms.stringDefaultLength 
unknown - will be ignored
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.enhancer.DataNucleusEnhancer main
[datanucleusenhancer] INFO: DataNucleus Enhancer (version 1.1.4) : Enhancement 
of classes
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class com.aman.gwt.friendList.client.FriendList 
has no MetaData or annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class com.aman.gwt.friendlist.client.FriendList$1 
has no MetaData or annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class 
com.aman.gwt.friendlist.client.FriendList$1MyHandler$1 has no MetaData or 
annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class 
com.aman.gwt.friendlist.client.FriendList$1MyHandler has no MetaData or 
annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class 
com.aman.gwt.friendlist.client.FriendList$FriendsGetCallback has no MetaData 
or annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class 
com.aman.gwt.friendlist.client.FriendList$LoginClickHandler$1 has no MetaData 
or annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class 
com.aman.gwt.friendlist.client.FriendList$LoginClickHandler has no MetaData 
or annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class 
com.aman.gwt.friendlist.client.FriendList$LogoutClickHandler has no MetaData 
or annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class 
com.aman.gwt.friendlist.client.FriendList$ThenRenderRestOfApp has no MetaData 
or annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class com.aman.gwt.friendlist.client.FriendList 
has no MetaData or annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: Class 
com.aman.gwt.friendlist.client.FriendListService has no MetaData or 
annotations.
[datanucleusenhancer] Oct 7, 2012 1:42:23 PM 
org.datanucleus.metadata.MetaDataManager loadClasses
[datanucleusenhancer] INFO: 

Unable to open GWT designer?

2012-09-17 Thread Aman Sharma
I have Eclipse 4.2 installed with google plugin,GWT designer,app engine and 
GWT sdks. I don't have windows builder installed. Whenever I am trying to 
open entrypoint class of the Google Web Application project with GWT 
designer it fails to open the file  reporting an error that it could not 
parse web.xml file.

Should I install windows builder or is it some other problem with GWT 
designer?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/R6MPaBvc71wJ.
To post to this group, send email to google-web-toolkit@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.



Unable to open GWT designer.

2012-09-17 Thread Aman Sharma
I have Eclipse Juno with Google Plugin,GWT designer,Windows builder,google 
app engine sdk,GWT sdk installed. My problem is that  I am not able to use 
GWT designer. Whenever I try to open entrypoint class with GWT designer in 
design view it reports an error that   not able to parse web.xml. So what 
should I do to make it work?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/6Y964Ipf2I4J.
To post to this group, send email to google-web-toolkit@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: Unable to open GWT designer.

2012-09-17 Thread Aman Sharma
Also there is no option to create a windows builder project in new project 
dialog box.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/xae9NTXJZREJ.
To post to this group, send email to google-web-toolkit@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.