Paging in java application
Greetings to All, I found this documentation http://code.google.com/appengine/articles/paging.html on paging in python. Can some one suggest the best way to implement pagin in a java application deployed in GAE and data store in GAE data store. I want to show say 10 images in every page out of around 1000 (available in DB). Also please let me know any widgets available to implement pagination. -Sanjith --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: how to use a server class in client code
@Dalla: Thanks again for those steps. As i am not familiar with those tools am finding a bit difficult to handle it. @Dominik: Thanks a lot for that information. It will save a lot of life for me. So is it enough to move my current class definitions from the server to the client/domain package and use them at both server and client code? -Sanjith On Tue, Nov 10, 2009 at 11:12 PM, Dominik Steiner < dominik.j.stei...@googlemail.com> wrote: > > Sanjith, > > I'm using GWT on GAE and I also have my data model classes with JDO > annotations. I have those classes reside under client/domain and GWT > 2.0 handles/ignores those JDO related annotations well and i don't > have to use Dozer or another framework in order to be able to use > those classes on the client. > > If you need more help, please let me know. > > HTH > > Dominik > > On Nov 9, 12:40 pm, Dalla wrote: > > I´m not sure you can solve this particular problem the way DaveS > > suggested, not without modifying the class anyway. > > Even if you created a separate .jar and referenced that from your > > client project, the GWT compiler wouldn´t understand the annotations. > > > > My problem was similar to yours, and would be solved by creating a new > > even simpler class like this: > > > > Public class PhotoSetStoreDTO { > > > > private String setid; > > private String title; > > private String description; > > > > private String primaryPhotoURL; > > public PhotoSetStore(String id, String title, String descString, > > String photoURL) { > > setSetID(id); > > setTitle(title); > > setDescrption(descString); > > setPrimaryPhotoURL(photoURL); > > > > } > > } > > > > Then use Dozer or a similar mapping framework to do the mapping > > between server side and client side objects. > > I haven´t been working with GAE at all to be honest, so there might be > > a better approach. > > > > On 9 Nov, 18:39, Sanjith Chungath wrote: > > > > > Thanks to all for your suggestions. > > > > > As my application needs to be deployed in google app engine, I doubt > whether > > > I can move those classes from server to client. I use JDO to persist > objects > > > to the GAE data store. The class is a simple class and I have mentioned > it > > > below, > > > > > @PersistenceCapable(identityType = IdentityType.DATASTORE) > > > public class PhotoSetStore { > > > @PrimaryKey > > > @Persistent > > > private String setid; > > > > > @Persistent > > > private String title; > > > > > @Persistent > > > private String description; > > > > > @Persistent > > > private String primaryPhotoURL; > > > > > public PhotoSetStore(String id, String title, String descString, > > > String photoURL) { > > > setSetID(id); > > > setTitle(title); > > > setDescrption(descString); > > > setPrimaryPhotoURL(photoURL); > > > > > } > > > } > > > > > Dave, it looks simple approach to have a (java) project to have common > > > classes defined. I need few clarifications, do you have seperate > projects > > > for GWT client code and server code? If not, how did you added the > common > > > .jar file to the client code? > > > > > Also, I didnt quiet get how the common .jar file is different from the > class > > > existing in a server package of same GWt project! > > > > > -Sanjith > > > > > On Mon, Nov 9, 2009 at 5:10 PM, sathya wrote: > > > > > > Hi, > > > >You can serialize classes only defined in client side(not server > > > > side).Class you defined on server side should be moved to client side > > > > to serialize. > > > > > > On Nov 9, 4:01 pm, DaveS wrote: > > > > > That's how we did it originally, but then we created a separate GWT > > > > > project (well, actually it's just a JAR project) that defines all > our > > > > > types that are common over the RPC interfaces. We reference that > > > > > project in both the server and client projects, and the JAR gets > > > > > pulled into the client side and GWT happily generates JS code from > it. > > > > > We now also use it for some 'shared' client-side classes as well so > > > > > it's effectively just a library project. > > > > > > > DaveS. > > > > > > > On Nov 9, 3:35 am, rjcarr
Re: how to use a server class in client code
Thanks to all for your suggestions. As my application needs to be deployed in google app engine, I doubt whether I can move those classes from server to client. I use JDO to persist objects to the GAE data store. The class is a simple class and I have mentioned it below, @PersistenceCapable(identityType = IdentityType.DATASTORE) public class PhotoSetStore { @PrimaryKey @Persistent private String setid; @Persistent private String title; @Persistent private String description; @Persistent private String primaryPhotoURL; public PhotoSetStore(String id, String title, String descString, String photoURL) { setSetID(id); setTitle(title); setDescrption(descString); setPrimaryPhotoURL(photoURL); } } Dave, it looks simple approach to have a (java) project to have common classes defined. I need few clarifications, do you have seperate projects for GWT client code and server code? If not, how did you added the common .jar file to the client code? Also, I didnt quiet get how the common .jar file is different from the class existing in a server package of same GWt project! -Sanjith On Mon, Nov 9, 2009 at 5:10 PM, sathya wrote: > > Hi, >You can serialize classes only defined in client side(not server > side).Class you defined on server side should be moved to client side > to serialize. > > > On Nov 9, 4:01 pm, DaveS wrote: > > That's how we did it originally, but then we created a separate GWT > > project (well, actually it's just a JAR project) that defines all our > > types that are common over the RPC interfaces. We reference that > > project in both the server and client projects, and the JAR gets > > pulled into the client side and GWT happily generates JS code from it. > > We now also use it for some 'shared' client-side classes as well so > > it's effectively just a library project. > > > > DaveS. > > > > On Nov 9, 3:35 am, rjcarr wrote: > > > > > > > > > Hi Sanjith- > > > > > I don't completely follow your question but any shared code between > > > the client and the server has to reside in the client package (by > > > default). This is because GWT can only see code in the modules you > > > have defined and the server package isn't a GWT module (again, by > > > default). > > > > > Hope this helps! > > > > > On Nov 8, 10:30 am, Sanjith Chungath wrote: > > > > > > Greetings to all, > > > >I have defined a class in the server and want to get a list of > > > > objects (of that class) as return parameter of an async call. But > while > > > > compile I got following error "No source code is available for type > > > > com.abc.pqr.data.XXX; did you forget to inherit a required module?". > I know > > > > that it is because GWT dont know the java script code for > coresponding > > > > class. What is the general practice to use a object of class in > server side > > > > at client code, serialize it? or any other better way. > > > > > > -Sanjith.- Hide quoted text - > > > > - Show quoted text - > > > --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
how to use a server class in client code
Greetings to all, I have defined a class in the server and want to get a list of objects (of that class) as return parameter of an async call. But while compile I got following error "No source code is available for type com.abc.pqr.data.XXX; did you forget to inherit a required module?". I know that it is because GWT dont know the java script code for coresponding class. What is the general practice to use a object of class in server side at client code, serialize it? or any other better way. -Sanjith. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: How can I set an alternative URL?
ah got it just now. it's very very easy in eclipse. As i added new entry point from eclipse project setting, it created a folder with the new entry point in the *war *folder. I just need to refer the .js file inside that folder in a new .html file. -Sanjith. On Sun, Nov 8, 2009 at 12:51 AM, Sanjith Chungath wrote: > Thanks a lot Bob for sharing the solution. I was trying to do exactly what > you referred below. For me the default entry point is for normal user and I > want a new one for admin user. > > I already did steps 1 and 2, also i think steps 4 and 5 will be > automatically taken care as I added new entry point in the eclipse project > setting dialog. > > I want to know what you wrote in "com.myApp.db_maint.nocache.js" that > you referred in step 3. > > Are there any documentation on how to define and use new entry points? > > -Sanjith. > > On Thu, Sep 24, 2009 at 8:40 PM, BobM wrote: > >> >> I have solved my problem. The solution may be helpful to others with >> similar requirements. >> >> my solution: >> >> 1. Create a new and additional module, db_maint.gwt.xml: >> >> >> >> >> >> >> >> >> 2. Create a new EntryPoint class, DB_MaintEntryPoint.java: >> /* DB_MaintEntryPoint.java >> * >> */ >> package com.myApp.client; >> import com.google.gwt.core.client.EntryPoint; >> import com.myApp.client.gui.MainFrame; >> public class DB_MaintEntryPoint implements EntryPoint { >>/** Creates a new instance of MainEntryPoint */ >>public DB_MaintEntryPoint() { >>} >>/** >>The entry point method, called automatically by loading a >> module >>that declares an implementing class as an entry-point >>*/ >>public void onModuleLoad() { >>new MainFrame(); >>} >> } // End of DB_MaintEntryPoint >> >> 3. Create a new html to load the new module, db_maint.html: >> > www.w3.org/TR/html40/Strict.dtd"> >> >> >>MyApp Database maintenance >> >> >>> src="com.myApp.db_maint.nocache.js"> >> >> >> >> 4. My development environment is driven by ant, so I had to modify my >> build.xml to include my new module in the compile process, both for >> that process which does the GWT compile for deployment and, >> separately, for the process that drives the hosted mode: >> >> In my build.xml, GWTcompile target: >> >>> fork="true" >> maxmemory="256m" > >> >> >> >> >> >> >> Then into the GWTshell target: >> >> >>> fork="true" >> spawn="true" >> maxmemory="256m" > >> >> >> >> >> >> >> The GWT shell is starting database maintenance. >> >> >> >> Having accomplished these steps and then compiled and deploy to tomcat >> I can run my main application by >> http://localhost:8080/myApp >> and my subApp by >> http://localhost:8080/db_maint.html >> >> Works for me! I hope this may to useful to others. Enjoy! >> >> >> > --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: How can I set an alternative URL?
Thanks a lot Bob for sharing the solution. I was trying to do exactly what you referred below. For me the default entry point is for normal user and I want a new one for admin user. I already did steps 1 and 2, also i think steps 4 and 5 will be automatically taken care as I added new entry point in the eclipse project setting dialog. I want to know what you wrote in "com.myApp.db_maint.nocache.js" that you referred in step 3. Are there any documentation on how to define and use new entry points? -Sanjith. On Thu, Sep 24, 2009 at 8:40 PM, BobM wrote: > > I have solved my problem. The solution may be helpful to others with > similar requirements. > > my solution: > > 1. Create a new and additional module, db_maint.gwt.xml: > > > > > > > > > 2. Create a new EntryPoint class, DB_MaintEntryPoint.java: > /* DB_MaintEntryPoint.java > * > */ > package com.myApp.client; > import com.google.gwt.core.client.EntryPoint; > import com.myApp.client.gui.MainFrame; > public class DB_MaintEntryPoint implements EntryPoint { >/** Creates a new instance of MainEntryPoint */ >public DB_MaintEntryPoint() { >} >/** >The entry point method, called automatically by loading a > module >that declares an implementing class as an entry-point >*/ >public void onModuleLoad() { >new MainFrame(); >} > } // End of DB_MaintEntryPoint > > 3. Create a new html to load the new module, db_maint.html: > www.w3.org/TR/html40/Strict.dtd"> > > >MyApp Database maintenance > > > src="com.myApp.db_maint.nocache.js"> > > > > 4. My development environment is driven by ant, so I had to modify my > build.xml to include my new module in the compile process, both for > that process which does the GWT compile for deployment and, > separately, for the process that drives the hosted mode: > > In my build.xml, GWTcompile target: > > fork="true" > maxmemory="256m" > > > > > > > > Then into the GWTshell target: > > > fork="true" > spawn="true" > maxmemory="256m" > > > > > > > > The GWT shell is starting database maintenance. > > > > Having accomplished these steps and then compiled and deploy to tomcat > I can run my main application by > http://localhost:8080/myApp > and my subApp by > http://localhost:8080/db_maint.html > > Works for me! I hope this may to useful to others. Enjoy! > > > --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: how can we append Text to a TextArea widget
Adam,Ah thats too simple. i will try that. Lothar, tnx for all hints. I will chk for log-monitor also. one more query, how can i find the number of lines of available text in a TextArea? -Sanjith. On Thu, Jan 8, 2009 at 1:15 PM, Lothar Kimmeringer wrote: > > Sanjith Chungath schrieb: > > > I want to write an async method to retrieve some String from the > > server. onSuccess I want to append the reruned string to a TextArea. is > > it possible. i can see only setText() method for this class.basically I > > want to monitor the stdout/stderr of a server process and update it on > > the client using async method (with a timer). My use will be in intranet > > not in internet. > > Adam was answering that already but one more point. I was having the > same necessity and was ending with a VerticalPanel (inside a Scrollpanel) > where I added HTML-instances for every new entry being added. That gave > me the ability to e.g. deactivate scrolling allowing the reading of the > content (if you do a setText, the browser will jump to the beginning > of the text again) and you can delete old entries from the beginning > of the list to avoid that the browser will run out of memory if the > (let's call it) logmonitor is running for a longer period of time. > > If you look for log-monitor there even might be a ready to use widget > somewhere waiting to be downloaded. > > > Regards, Lothar > > > > --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
how can we append Text to a TextArea widget
Hi, I want to write an async method to retrieve some String from the server. onSuccess I want to append the reruned string to a TextArea. is it possible. i can see only setText() method for this class.basically I want to monitor the stdout/stderr of a server process and update it on the client using async method (with a timer). My use will be in intranet not in internet. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---