[appengine-java] two entities into the same entity group - unowned relationship

2009-12-18 Thread aswath satrasala
I have two classes with unowned relationship.  I am making tenant key as a
key field in the MasterUserLogin.  How can I make them belong to the same
entity group

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Tenant {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName = datanucleus, key=gae.encoded-pk,
value=true)
private String id;

@Persistent
@Extension(vendorName = datanucleus, key=gae.pk-name, value=true)
private String name;
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class MasterUserLogin {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private String id;

@Persistent
private Key currentTenantKey;

}

Regards
-Aswath

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: JDO Query limit? 1000?

2009-12-18 Thread Fabrizio
Stephen, you're right. I tested setRange(1200, 1500) and I get an
exception.

I'd like to understand more about that. Why datastore limits the first
parameter (skip) and not also the second?
I was thinking that the limit of a query was 1000 items. I was wrong.
So, I can get 5000 items with problem, but I cannot skip the first
1000.  Quite strange... IMHO

   fabrizio

On Dec 17, 10:39 pm, stephenp slpe...@gmail.com wrote:
 He meant setRange(1001, 2000) will fail. Datastore will only let you
 skip the first 1000. If you try to skip past more than 1000 you'll get
 an error. In your code, you're only skipping the first 10 setRange
 (10,1500).

 Stephen

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Meassuring Loading Request

2009-12-18 Thread Marcel Overdijk
On http://code.google.com/intl/nl/appengine/kb/java.html#performance
there is info how to write a listener to log loading requests.
Would it also be possible to log how much time a loading request
caused?

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] BlobStore not just jclouds anymore

2009-12-18 Thread Adrian Cole
Glad to see google appengine has a blob store.  Mildly annoying that it uses
the same name as the jclouds blobstore api, as it will make code confusing.
At least you lowercased the 's' in store :p

If you'd like to see the first blobstore in google appengine, have a look
here:

http://anyweight.blogspot.com/2009/10/save-your-tweets-forever-with-jclouds.html

I suppose we'll look into adding google Blobstore to our BlobStore soon ;)

Cheers,
Adrian
jclouds: open source cloud integration framework
http://code.google.com/p/jclouds/

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Is it possible to store ContactEntrys in the appengine datastore?

2009-12-18 Thread andy.booth
http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Serializable_Objects

Serializable objects can be stored as a field of an entity using
@Persistent(serialized=true). However, the GData ContactEntry object
does not appear to be marked as serializable, so you will probably
have to create your own custom contact information class and convert
between the two classes.

Andy


On Dec 17, 7:19 pm, Tb tho...@bertranfamily.com wrote:
 Any update on this? I'm getting the same error while trying to store a
 ContactEntry object per record...
 However, I don't mind storing an ArrayList if we can solve your
 problem! ;)

 On Dec 9, 9:38 am, Josh joshua.t.gr...@gmail.com wrote:



  One other thing I should add.  The ContactEntrys are currently stored
  in an ArrayList.  I'm trying to persist the whole list.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Web API Development Hosting

2009-12-18 Thread andy.booth
http://wikis.sun.com/display/Jersey/Overview+of+JAX-RS+1.0+Features

I'm using JAX-RS (Jersey 1.1.5 version) to provide clients with a
GData/AtomPub style REST api to their data stored in the App Engine
datastore, allowing both XML and JSON CRUD requests to GET, POST, PUT,
DELETE data.

(Though you may find Restlet a bit easier to use out of the box with
Google App Engine at http://www.restlet.org/downloads/testing as you
certainly need to use the latest versions of Jersey for it to work.)

So, yes, you can produce a web api, and it should be an appropriate
platform using Google App Engine. It's really deciding which Java REST
or web service framework you like best. Then it's just the same
process as building a public facing web application.

If your API is allowing bulk updates, then there are existing posts to
this group discussing using the Task Queue to keep operation times
down.

Andy


On Dec 17, 5:39 pm, Prashant Gupta nextprash...@gmail.com wrote:
 Hi,

 I was thinking of developing a web api which will allow web apps to read or
 put some data from/to my app. I am not sure what I exactly want to do
 because I am not sure how a web API is developed  what are the limitations,
 is it same as we write an app? ok, that was a stupid question. I tried to
 search some text which could help me get some tips or ideas on web api
 development but I couldn't find any :( . I would be thankful if you guys
 help me find out some text which could help me with this. Secondly, I was
 wondering if App Engine is the right place to host a web api? Experts please
 comment on this.

 Thanks.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: select count(*) ?

2009-12-18 Thread Jorge
I second this question.

Jorge Gonzalez

On Dec 2, 1:19 pm, king kingalpha...@gmail.com wrote:
 Jason, do you have a timeline for when:
 1. the cursor feature will be available?
 2. the data download feature be available for JAVA (not Python).

 On Oct 21, 10:54 am, Jason (Google) apija...@google.com wrote:

  The query restrictions are an artifact of the way App Engine's datastore is
  constructed, which makes certain operations (e.g. queries and reads) very
  fast and scalable but does limit the types of queries you can make, though
  you can typically get around these restrictions by re-thinking your model a
  bit.

  We are working on adding built-in cursor support for easier paging through
  entities and have just added a datastore statistics API for, among other
  things, getting the total entity count, even if it exceeds 1,000. More
  details here:

 http://code.google.com/appengine/docs/java/datastore/stats.html

  And we also have a data export utility included with the SDK to make it
  easier for you to back up or even move off of App Engine should you choose
  to, and we're continuing to look at ways of making App Engine, particularly
  the datastore component, easier to use.

 http://code.google.com/appengine/docs/python/tools/uploadingdata.html...

  - Jason

  On Mon, Oct 19, 2009 at 1:53 PM, vetch oldpete...@gmail.com wrote:

   On 6 Paź, 10:03, Jason (Google) apija...@google.com wrote:
* Because App Engine queries can only return up to 1,000 results,
count(this) will never return above 1,000, even if you have more than
   1,000
entities, so bear this in mind.

   I'm deeply shocked. This works like some black hole.

   You put your data there simply, but can't get them back that simply.

   In connection with restricions (inequality property filter), it is
   even harder to get anything more complex.

   BiGAppEngine disappointment.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Retrieving an entity using a different key type than the key field in the class

2009-12-18 Thread a.maza


On 17 Dez., 23:11, Ikai L (Google) ika...@google.com wrote:
 When you say it doesn't work, do you mean that it does not retrieve the
 entity?

right, no entity was found.

Can you try creating a Key with the id instead of passing the ID
 directly?

 http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...

 That is, try KeyFactory.createKey(myEntity.class.getName(), keyId);


I tried that out and received a

javax.jdo.JDOFatalUserException: Exception converting com.myclass
(agh0ZXN0NDcxM3IWCxIGV2luZXJ5GAEMCxIEV2luZRgCDA) to an internal key.
at
org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager.getObjectById
(DatastoreJDOPersistenceManager.java:66)
at org.datanucleus.jdo.JDOPersistenceManagerProxy.getObjectById
(JDOPersistenceManagerProxy.java:373)


thanks for your support

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Unable to add another admin account

2009-12-18 Thread Lukasz
I tried the second link but instead of adding new developer to the
exising app there was only option for adding new app and I did it.
Is it possible to add new 'user/developer/email' to the existing
application if the email is in domain handled by Google Apps?

Cheers,
Lukasz

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Google Calendar log on GAE: Redirect requested but followRedirects is disabled

2009-12-18 Thread Pion
I have the following code snippets (remove exceptions code for
brevity) which is based on the example on
http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html#RetrievingAllCalendars

String appName = companyName-appName-1.0;
CalendarService myService = new CalendarService
(appName);

String id = myEmail;
String password = myPassword;
String host = http://www.google.com/calendar/feeds/;
+ id + @gmail.com/owncalendars/full;
myService.setUserCredentials(id, password);
URL feedUrl = new URL(host);
CalendarFeed resultFeed = myService.getFeed(feedUrl,
CalendarFeed.class);

for (int i = 0; i  resultFeed.getEntries().size(); i++) {
entry = resultFeed.getEntries().get(i);
logger.info(entry.getTitle().getPlainText())
}

I receive the following log info:

Dec 18, 2009 3:25:34 PM
org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled

Dec 18, 2009 3:25:35 PM org.apache.commons.httpclient.HttpMethodBase
getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using
getResponseBodyAsStream instead is recommended.

Dec 18, 2009 3:25:35 PM com.galensystems.pchr.server.DoServer
doCalendar
INFO: myem...@gmail.com

I am wondering if I am doign something wrong and have to worry the
above INFO and WARNING.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] BlobstoreService limited by serve() / Feature request for get()

2009-12-18 Thread Stuart Moffatt
App Engine team:

Thanks for introducing BlobstoreService. It looked like it was going
to solve a major impediment in an application I am prototyping, but I
hit the wall (again) with only being able to regurgitate blobs during
an http response, and not do anything useful with them in the cloud.

I am using BlobstoreService to upload and store serialized spatial
indexes. I want to be able to query them with point geometry, but once
they are in the store there is no way for me to fetch them again
within the context of my application. I can delete(key) in an
application context, and serve(key) them directly back to the browser,
but I cannot fetch them from the blobstore and operate on them, which
is exactly what I need to do in my app.

For a minute I was tricked into thinking that I could use the URL
Fetch API from within my app, since serve(key) pumps out the data in
response to a get call. But an internal URL Fetch is also limited to
1MB, and I receive the dreaded: The response from url
http://localhost:/serve/blob?blob-key=2rdXcmNBIZz3_mDE8msbXg was
too large. (Of course, if I just hit that same URL in my browser, I
download the data just fine -- its just within a programmatic App
Engine context that I cannot fetch that URL.)

All I want for Christmas is my two front teeth. In this case, the
teeth are either or both of the following hooks:

1) New URL Fetch API feature realizes that it is calling the
BlobstoreService, and lets data  1MB pass through. Since
BlobstoreService is handling the response internally, add an extra
header that URL Fetch understands to lift the size limit restriction.
You could even restrict this to only allow URL Fetch of blobs in the
same App Engine application.

2) Expose a BlobstoreService.get(BlobKey key) method so applications
can fetch blobs after they are stored and do something useful with
them -- like geospatial operations on spatial index blobs, or opening
stored zip archives and processing contents with task queues. No
worries if people go blob crazy -- billing is turned on, and real
fancy querying needs to be done with basic datastore entities anyways.

Please consider one or both of these options. Option #2 sounds like a
no-brainer to me, because somewhere under the serve() hood you must be
fetching the blob by key already.

Stuart

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] maven-gae-plugin 0.4.2

2009-12-18 Thread drone
maven-gae-plugin 0.4.2 has just been released (http://code.google.com/
p/maven-gae-plugin)

The main features are upgraded/cleaned dependencies, also there are
couple of small bug fixes.
You can check the GWT example project (uses GAE 1.3.0 and GWT 1.7.1).

Running hosted mode from maven should be possible after gwt-maven-
plugin's 1.2 version is released (http://jira.codehaus.org/browse/
MGWT-112) (or you can try building it's 1.2-SNAPSHOT yourself).

Combining maven-gae-plugin with Google Eclipse plug-in might be
possible, if you put war directory in your project root, but I haven't
tested this yet. (See following thread:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/ebfd891f84591432)

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: BlobstoreService limited by serve() / Feature request for get()

2009-12-18 Thread Stuart Moffatt
Added as feature request:

http://code.google.com/p/googleappengine/issues/detail?id=2536

http://code.google.com/p/googleappengine/issues/detail?id=2536Stuart

On Fri, Dec 18, 2009 at 11:16 AM, Stuart Moffatt stuartmoff...@gmail.comwrote:

 App Engine team:

 Thanks for introducing BlobstoreService. It looked like it was going
 to solve a major impediment in an application I am prototyping, but I
 hit the wall (again) with only being able to regurgitate blobs during
 an http response, and not do anything useful with them in the cloud.

 I am using BlobstoreService to upload and store serialized spatial
 indexes. I want to be able to query them with point geometry, but once
 they are in the store there is no way for me to fetch them again
 within the context of my application. I can delete(key) in an
 application context, and serve(key) them directly back to the browser,
 but I cannot fetch them from the blobstore and operate on them, which
 is exactly what I need to do in my app.

 For a minute I was tricked into thinking that I could use the URL
 Fetch API from within my app, since serve(key) pumps out the data in
 response to a get call. But an internal URL Fetch is also limited to
 1MB, and I receive the dreaded: The response from url
 http://localhost:/serve/blob?blob-key=2rdXcmNBIZz3_mDE8msbXg was
 too large. (Of course, if I just hit that same URL in my browser, I
 download the data just fine -- its just within a programmatic App
 Engine context that I cannot fetch that URL.)

 All I want for Christmas is my two front teeth. In this case, the
 teeth are either or both of the following hooks:

 1) New URL Fetch API feature realizes that it is calling the
 BlobstoreService, and lets data  1MB pass through. Since
 BlobstoreService is handling the response internally, add an extra
 header that URL Fetch understands to lift the size limit restriction.
 You could even restrict this to only allow URL Fetch of blobs in the
 same App Engine application.

 2) Expose a BlobstoreService.get(BlobKey key) method so applications
 can fetch blobs after they are stored and do something useful with
 them -- like geospatial operations on spatial index blobs, or opening
 stored zip archives and processing contents with task queues. No
 worries if people go blob crazy -- billing is turned on, and real
 fancy querying needs to be done with basic datastore entities anyways.

 Please consider one or both of these options. Option #2 sounds like a
 no-brainer to me, because somewhere under the serve() hood you must be
 fetching the blob by key already.

 Stuart

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: BlobstoreService limited by serve() / Feature request for get()

2009-12-18 Thread Stuart Moffatt
Users interested in better BlobstoreService, please star the issue so it
gets more attention:

http://code.google.com/p/googleappengine/issues/detail?id=2536

Stuart

On Fri, Dec 18, 2009 at 11:23 AM, Stuart Moffatt stuartmoff...@gmail.comwrote:

 Added as feature request:

 http://code.google.com/p/googleappengine/issues/detail?id=2536

  http://code.google.com/p/googleappengine/issues/detail?id=2536Stuart


 On Fri, Dec 18, 2009 at 11:16 AM, Stuart Moffatt 
 stuartmoff...@gmail.comwrote:

 App Engine team:

 Thanks for introducing BlobstoreService. It looked like it was going
 to solve a major impediment in an application I am prototyping, but I
 hit the wall (again) with only being able to regurgitate blobs during
 an http response, and not do anything useful with them in the cloud.

 I am using BlobstoreService to upload and store serialized spatial
 indexes. I want to be able to query them with point geometry, but once
 they are in the store there is no way for me to fetch them again
 within the context of my application. I can delete(key) in an
 application context, and serve(key) them directly back to the browser,
 but I cannot fetch them from the blobstore and operate on them, which
 is exactly what I need to do in my app.

 For a minute I was tricked into thinking that I could use the URL
 Fetch API from within my app, since serve(key) pumps out the data in
 response to a get call. But an internal URL Fetch is also limited to
 1MB, and I receive the dreaded: The response from url
 http://localhost:/serve/blob?blob-key=2rdXcmNBIZz3_mDE8msbXg was
 too large. (Of course, if I just hit that same URL in my browser, I
 download the data just fine -- its just within a programmatic App
 Engine context that I cannot fetch that URL.)

 All I want for Christmas is my two front teeth. In this case, the
 teeth are either or both of the following hooks:

 1) New URL Fetch API feature realizes that it is calling the
 BlobstoreService, and lets data  1MB pass through. Since
 BlobstoreService is handling the response internally, add an extra
 header that URL Fetch understands to lift the size limit restriction.
 You could even restrict this to only allow URL Fetch of blobs in the
 same App Engine application.

 2) Expose a BlobstoreService.get(BlobKey key) method so applications
 can fetch blobs after they are stored and do something useful with
 them -- like geospatial operations on spatial index blobs, or opening
 stored zip archives and processing contents with task queues. No
 worries if people go blob crazy -- billing is turned on, and real
 fancy querying needs to be done with basic datastore entities anyways.

 Please consider one or both of these options. Option #2 sounds like a
 no-brainer to me, because somewhere under the serve() hood you must be
 fetching the blob by key already.

 Stuart




--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: eclipse plugin and maven?

2009-12-18 Thread Miguel Méndez
Thanks for the response drone.  We are trying to determine what we can do to
make this smoother.  I think that a lot of people would like to see the
plugin relax the war folder constraint.  Specifically allowing a user to
specify an arbitrary path to their war folder.

On Fri, Dec 18, 2009 at 11:06 AM, drone andr...@gmail.com wrote:

 1. It appears, that it is possible to specify SDK location (at least
 in latest) Google Eclipse plugin. So you could make maven to download
 the whole SDK zip to it's repository and configure Eclipse plugin to
 use it from there.
 3. This might not be true - it seems that gwt has finally made it to
 the official repository:
 http://repo2.maven.org/maven2/com/google/gwt/

 the 2. point however is still true and this is the main problem with
 Google Eclipse plugin.
 however it should be possible to configure maven to work with war
 directory in root.. (which is awful, i know..)

 I haven't tried this configuration yet, but it seems to me, that this
 should work. I will try to come up with an example project, where this
 is done.


 On Dec 15, 8:16 pm, Miguel Méndez mmen...@google.com wrote:
  Here are somethings, that I'm aware of, that make it hard to use maven
 and
  the Google Plugin for Eclipse together:
 
1. Require users to use an SDK (classpath container in eclipse) instead
of regular jars
2. Force the war directory to be named war and appear at the project
root
3. No official GWT artifact maven repository
 
 
 
  On Mon, Dec 14, 2009 at 4:35 AM, drone andr...@gmail.com wrote:
   Regarding maven-gae-plugin - for now, the best way to adopt your
   application is to copy/paste pom parts from one of the example
   projects (plain jsp or gwt). It's not trivial, but not impossible.
   Also I tried to document every piece of pom.xml there.
 
   However it is true, that this plugin has become a bit stale.. on my
   part it's mostly because newer google appengine artifacts did not
   appear in
   google-maven-repository.
 
   I see now, that they can be found inhttp://www.mvnsearch.org/maven2/
   repository, so I will try updating maven-gae-plugin as soon as I have
   some free time.
   Also - gwt example is to be updated to use codehaus plugin
   (mojo.codehaus.org/gwt-maven-plugin) instead of gwt-maven
   (code.google.com/p/gwt-maven/).
 
   On Dec 13, 6:48 am, Yoichi takayama.yoi...@gmail.com wrote:
Google App Engine has a Maven Plugin project.
 
   http://code.google.com/p/maven-gae-plugin/
 
Unfortunately there is no manual and I can't figure out how to use
 it,
what else may be necessary, how to configure them, what's the
relationship with Apache Eclipse Maven plugins.
 
There are sample Project trees from the Web site. However, that is
 not
enough.
 
E.g. I can't see any new menu option to create and manage GAE Maven
project, etc. For example, the GAE Maven Plugin should add a new
Archtype in the Maven Plugin's Prlject creation menu. It seems this
 is
not the case.
 
Yoichi
 
   --
 
   You received this message because you are subscribed to the Google
 Groups
   Google App Engine for Java group.
   To post to this group, send email to
   google-appengine-j...@googlegroups.com.
   To unsubscribe from this group, send email to
   google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/google-appengine-java?hl=en.
 
  --
  Miguel

 --

 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.





-- 
Miguel

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Can I make GAE send an e-mail with Resent-To header ?

2009-12-18 Thread minor-undroid
I'd like to make an e-mail forward by GAE with Resent-To/Resent-From
header.

I tried the client Java program with JavaMail that I made,
and got the suitable result.
I applied ...
  mail.host:   smtp.gmail.com
  mail.smtp.auth:  true
  mail.smtp.socketFactory.port: 465
  mail.smtp.starttls.enable:true
  ...and more...

and Message Header is ...
  Resent-From ; xxxresentf...@aaa.com// my admin account
  Resent-To :   xxxresen...@bbb.com
  Resent-Date:  Mon, 30 Nov 2009 12:59:59 +  // Exactly now
  From: yyyf...@ccc,com
  To:   yy...@ddd.com
  Date: Sun, 01 Nov 2009 12:59:59 +  // Past date

so, the result was good (It was just what I had expected).
The response header is above.
  An e-mail looks like
-- comming from yyyf...@ccc,com.
-- comming at 01 Nov 2009.
-- going to yy...@ddd.com, but he(yy...@ddd.com) didn't get
   this e-mail, but another(xxxresen...@bbb.com) got this mail.


Then I tried that I implemented above code and a few fixed code,
and deployed on GAE, ran this application on GAE, but it left log
as warnings as follows.
  Failed: Send failure (javax.mail.MessagingException:
  Illegal Arguments (java.lang.IllegalArgumentException:
  Unauthorized Sender: Unauthorized sender))
or
  Failed: Unable to locate provider for protocol: smtp
or
  Failed: Illegal Arguments (java.lang.IllegalArgumentException:
  Bad Request: Missing recipients)


Does anyobody know a solution to this ?
What I want to do is to function Resent-To/Resent-From header
appropriately !


Thanks,

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Google Calendar log on GAE: Redirect requested but followRedirects is disabled

2009-12-18 Thread Pion
I have just compiled and executed the Google Calendar sample from
http://code.google.com/p/gdata-java-client/downloads/list (version
1.40.1) locally without using any GAE stuffs. EventFeedDemo.java

  private static void printUserCalendars(CalendarService service)
  throws IOException, ServiceException {
// Send the request and receive the response:
CalendarFeed resultFeed = service.getFeed(metafeedUrl,
CalendarFeed.class);

System.out.println(Your calendars:);
System.out.println();
for (int i = 0; i  resultFeed.getEntries().size(); i++) {
  CalendarEntry entry = resultFeed.getEntries().get(i);
  System.out.println(\t + entry.getTitle().getPlainText());
}
System.out.println();
  }

It prints 2 calendars. On the other hand, using similar code but
running on GAE, it returns only 1 calendar.

I am using GAE 1.3.

On Dec 18, 7:46 am, Pion onlee2...@gmail.com wrote:
 I have the following code snippets (remove exceptions code for
 brevity) which is based on the example 
 onhttp://code.google.com/apis/calendar/data/2.0/developers_guide_java.h...

                 String appName = companyName-appName-1.0;
                 CalendarService myService = new CalendarService
 (appName);

                 String id = myEmail;
                 String password = myPassword;
                 String host = http://www.google.com/calendar/feeds/;
 + id + @gmail.com/owncalendars/full;
                 myService.setUserCredentials(id, password);
                 URL feedUrl = new URL(host);
                 CalendarFeed resultFeed = myService.getFeed(feedUrl,
 CalendarFeed.class);

                 for (int i = 0; i  resultFeed.getEntries().size(); i++) {
                     entry = resultFeed.getEntries().get(i);
                     logger.info(entry.getTitle().getPlainText())
                 }

 I receive the following log info:

 Dec 18, 2009 3:25:34 PM
 org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
 INFO: Redirect requested but followRedirects is disabled

 Dec 18, 2009 3:25:35 PM org.apache.commons.httpclient.HttpMethodBase
 getResponseBody
 WARNING: Going to buffer response body of large or unknown size. Using
 getResponseBodyAsStream instead is recommended.

 Dec 18, 2009 3:25:35 PM com.galensystems.pchr.server.DoServer
 doCalendar
 INFO: myem...@gmail.com

 I am wondering if I am doign something wrong and have to worry the
 above INFO and WARNING.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] embedding parent object in parent-child relation with jdo

2009-12-18 Thread Eugene Kuleshov

  I am using the app engine SDK 1.3.0 with the latest Google Eclipse
plugin.

  Currently, in order to be able to run queries on attributes of the
parent object I have to embed parent object into a child. So, I have
created the following classes

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Parent {
  @PrimaryKey @Persistent String parentName;
  @Persistent(mappedBy = parent) ListChild children = new
ArrayListChild();

  public Parent(String parentName) { this.parentName = parentName; }
  public void setParentName(String parentName) { this.parentName =
parentName; }
  public String getParentName() { return parentName; }
  public ListChild getChildren() { return children; }
  public void addChild(Child child) {
child.setParent(this);
children.add(child);
  }
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Child {
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key
childKey;
  @Persistent String childName;

  @Embedded(
members = { @Persistent(name = parentName, column =
childParentName) },
ownerMember = children)
  @Persistent Parent parent;

  public Child(String childName) { this.childName = childName; }
  public void setChildName(String childName) { this.childName =
childName; }
  public String getChildName() { return childName; }
  public void setParent(Parent parent) { this.parent = parent; }
  public Parent getParent() { return parent; }
}
  and then I created a simple test to verify if I can persist and run
queries on those objects:

public class ParentTest {
  public static void main(String[] args) {
Parent parent1 = new Parent(parent1);
parent1.addChild(new Child(child1));
parent1.addChild(new Child(child2));

Parent parent2 = new Parent(parent2);
parent2.addChild(new Child(child3));

ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());
ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)) { });

ApiProxyLocalImpl proxy = (ApiProxyLocalImpl) ApiProxy.getDelegate
();
proxy.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY,
Boolean.TRUE.toString());

PersistenceManagerFactory pmf =
JDOHelper.getPersistenceManagerFactory(transactions-optional);
PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();
try {
  tx.begin();
  pm.makePersistent(parent1);
  tx.commit();

  tx.begin();
  pm.makePersistent(parent2);
  tx.commit();

  Query query2 = pm.newQuery(Child.class);
  query2.setFilter(parent.parentName==parentNameParam);
  query2.declareParameters(java.lang.String parentNameParam);
  ListChild results2 = (ListChild) query2.executeWithArray
(parent1);
  System.err.println(results2);
} finally {
  if (tx.isActive()) {
tx.rollback();
  }
  pm.close();
}
  }
}

  The DataNucleus Enhancer runs ok on the above code, but when I run
my test app, I am getting an IndexOutOfBoundException from somewhere
in the DataNucleus internals:

Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 0
at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK
(DatastoreTable.java:356)
at org.datanucleus.store.appengine.DatastoreTable.buildMapping
(DatastoreTable.java:285)
at org.datanucleus.store.appengine.DatastoreManager.buildStoreData
(DatastoreManager.java:405)
at org.datanucleus.store.appengine.DatastoreManager.newStoreData
(DatastoreManager.java:363)
at org.datanucleus.store.AbstractStoreManager.addClasses
(AbstractStoreManager.java:788)
at org.datanucleus.store.AbstractStoreManager.addClass
(AbstractStoreManager.java:759)
at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass
(MappedStoreManager.java:358)
at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass
(DatastoreManager.java:631)
at
org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer
(DatastoreFieldManager.java:1008)
at
org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer
(DatastoreFieldManager.java:998)
at org.datanucleus.store.appengine.DatastoreFieldManager.init
(DatastoreFieldManager.java:133)
at org.datanucleus.store.appengine.DatastoreFieldManager.init
(DatastoreFieldManager.java:167)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess
(DatastorePersistenceHandler.java:316)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
(DatastorePersistenceHandler.java:236)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
(DatastorePersistenceHandler.java:225)
at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent
(JDOStateManagerImpl.java:3185)
at org.datanucleus.state.JDOStateManagerImpl.makePersistent
(JDOStateManagerImpl.java:3161)
at 

Re: [appengine-java] Meassuring Loading Request

2009-12-18 Thread Toby Reyelts
All requests have their durations logged in the admin console. Was there
something more you wanted than that?

On Fri, Dec 18, 2009 at 3:42 AM, Marcel Overdijk
marceloverd...@gmail.comwrote:

 On http://code.google.com/intl/nl/appengine/kb/java.html#performance
 there is info how to write a listener to log loading requests.
 Would it also be possible to log how much time a loading request
 caused?

 --

 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: Meassuring Loading Request

2009-12-18 Thread Toby Reyelts
On Fri, Dec 18, 2009 at 3:50 AM, Marcel Overdijk
marceloverd...@gmail.comwrote:

 Now that I'm looking at the example code on
 http://code.google.com/intl/nl/appengine/kb/java.html#performance to
 distinguish normal request from loading request I'm wondering if the
 usage is correct...

 The example uses a HttpSessionListener but shouldn't this be a
 ServletContextListener?


Yes, thanks for pointing that out. We'll get it fixed.



 On 18 dec, 09:42, Marcel Overdijk marceloverd...@gmail.com wrote:
  Onhttp://code.google.com/intl/nl/appengine/kb/java.html#performance
  there is info how to write a listener to log loading requests.
  Would it also be possible to log how much time a loading request
  caused?

 --

 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Chat Time transcript for December 16, 2009

2009-12-18 Thread Jason (Google)
This past Wednesday, the App Engine team hosted the latest session of
its bimonthly IRC office hours. A transcript of the session and a
summary of the topics covered is provided below. The next session will
take place on Wednesday, January 6th from 7:00-8:00 p.m. PST in the
#appengine channel on irc.freenode.net.

- Jason


--SUMMARY---
- Q: What kind of data redundancy do uploaded files and stored data
have and is this redundancy counted towards the Stored Data quota? A:
We use GFS for data storage, which has its own redundancy, and we also
replicate to multiple datacenters and take backups. The cost of all of
this replication is included in the per-gigabyte cost, so you are only
charged for one copy of your data plus the indexes needed to query it.
[9:02-9:03]

- Discussion on feature request (http://code.google.com/p/
googleappengine/issues/detail?id=2377) to add more detail to the App
Engine status page and/or create a per-app status page to check
whether specific apps are being impacted by a particular issue since
not all apps are affected by all issues. Note: we do post planned and
unplanned downtime to the downtime-notify mailing list, so please
subscribe to http://groups.google.com/group/google-appengine-downtime-notify
to receive reminders about planned maintenance and status updates in
the event of system issues. [9:04-9:10, 9:16]

- Discussion on planned maintenances in general -- every 30-60 days,
App Engine enters read-only mode where apps continue serving but the
datastore can only be read, not written to. We're working on reducing
the occurrences of these planned maintenances as well as the time it
takes to complete each one, and will have a calendar set up soon so
developers can keep up to date with the maintenance schedule.
[9:34-9:39]

- Q: Can one achieve better peformance by writing entities in
different entity groups outside of a transaction over writing multiple
entitites in the same entity group inside of a transaction? A: Yes!
App Engine supports batch (parallel) writes for entities in distinct
entity groups. Updates to multiple entities in the same entity group,
regardless of whether you use transactions, forces the entities to be
written serially which takes more time. In order to achieve the best
performance, keep your entity groups as small as possible and only use
transactions if you absolutely need atomic writes to two or more
entities. [9:09-9:11, 9:13-9:15]

- Q: Can you map subdomains to versions? A: You can do this right now
-- when you deploy a new version, you can access it by hitting
version_string.latest.app_id.appspot.com, even if it's not the
default version. As of release 1.2.4, App Engine supports wildcard
subdomains, which work without any explicit configuration. To
determine which subdomain is being used, inspect the 'Host' request
header -- see 
http://googleappengine.blogspot.com/2009/08/new-features-in-124.html.
[9:11, 9:14, 9:16, 9:18]

- Discussion on feature request to allow app deployment to domains
other than appspot.com because of the crowded namespace. Note: App
Engine already allows you to deploy your application to any Google
Apps domain, so if you don't plan to host directly on appspot.com, a
recognizable app ID isn't as important. You can always prefix your own
username/alias to any app ID you choose to reduce the possibility that
the app ID is taken. [9:16-9:17, 9:21]

- Q: Is there any way to query for not null without using an
inequality? A: not equal to or != is implemented as two inequality
filters, so the answer is no. One workaround is using a calculated
property instead -- at write time, determine if a certain property
contains a value of interest. If so, store True in a boolean property,
False otherwise, then use an equality filter on this boolean property.
Or just filter the results in memory. Since empty property values
(displayed as missing in the datastore viewer) are not indexed, you
can just leave a particular property without a value so when you issue
a query that filters on that property, entities with missing values
don't get returned as results. You can't currently query on whether a
field is empty yet, although you can query on whether a certain
property value is null since null is an actual value. [9:19-9:26]

- Q: Are there any plans to increase the size of a result set from
1,000? A: No, but datastore cursors, which are on the public roadmap,
should make it easier to page through larger result sets. A cursor is
an object that points to a particular point in the result set of a
query which can be serialized and reconstituted so that you can pick
up from where you left off in a query -- essentially, it's an object
that helps you page through your result set, even if there are more
than 1,000 results. [9:26-9:29]

- Q: Are there any limits to the number of blobs you can store using
the new Blobstore service? A: No, but space needed for blobs are
counted against your storage 

[appengine-java] Re: Use Blobstore Java API with GWT

2009-12-18 Thread Henry
Yes, I did like this and works without problems...thank for the
response!

On 17 Dec, 09:42, Raphael André Bauer raphael.andre.ba...@gmail.com
wrote:
 hey henry,

 the gwt frontend code looks like java, but it is crosscompiled. that's
 the reason why the imports cannot be found - it's technically
 something completely different.

 so what you have to do is having an RPC call to your server, that
 returns a valid form url where you can upload your files.

 basically

     BlobstoreService blobstoreService =
  BlobstoreServiceFactory.getBlobstoreService();

 must be in the servlet of your RPC and the value returned by
 then you get this url back and add it to your client code

 in .setAction

 ..

 hope that helps,

 ra

 On Thu, Dec 17, 2009 at 12:08 AM, Henry enricrequ...@gmail.com wrote:
  Hi Guys,

  Im trying to upload images using the new Blobstore API to the app
  engine with GWT.

  Ive created a FormPanel() to upload the images to the app engine, but
  when im trying to set up the action in the form using
  BlobstoreService, i cant because the import com.google.appengine
  cannot be resolved.

  My question is: how can I set up the action on the form using the
  BlobstoreService?? I've this code in the client side:

     import com.google.appengine.api.blobstore.BlobstoreService;

     FormPanel form = new FormPanel();
     form.setEncoding(FormPanel.ENCODING_MULTIPART);
     form.setMethod(FormPanel.METHOD_POST);
     BlobstoreService blobstoreService =
  BlobstoreServiceFactory.getBlobstoreService();
     form.setAction(blobstoreService.createUploadUrl(handizo/
  upload));

  error: import com.google.appengine cannot be resolved.

  Ive also tried to setup the action without the BlobstoreService, but
  when the form is read in the server side using the BlobstoreService:

         private BlobstoreService blobstoreService =
  BlobstoreServiceFactory.getBlobstoreService();

         protected void doPost(HttpServletRequest req, HttpServletResponse
  resp)
                         throws ServletException, IOException {

                 MapString, BlobKey blobs = 
  blobstoreService.getUploadedBlobs(req);
                 BlobKey blobKey = blobs.get(myFile);

                 if (blobKey == null) {
                         resp.sendRedirect(/);
                 } else {
                         resp.sendRedirect(/serve?blob-key= + 
  blobKey.getKeyString());
                 }

  I've this other error saying me that I've to set up the action using
  the BlobstoreService.

  Error: Must be called from a blob upload callback request.
         at
  com.google.appengine.api.blobstore.BlobstoreServiceImpl.getUploadedBlobs
  (BlobstoreServiceImpl.java:97)
         at com.handizo.server.service.FileUploadAnnouncementServlet.doPost
  (FileUploadAnnouncementServlet.java:23)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

  So its possible to user the BlobstoreService with GWT by the moment??

  Thanks in advance :-)

  --

  You received this message because you are subscribed to the Google Groups 
  Google App Engine for Java group.
  To post to this group, send email to google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-appengine-java?hl=en.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Is it possible to store ContactEntrys in the appengine datastore?

2009-12-18 Thread Tb
Yep. Finally came to the same conclusion. Thanks for your reply Andy.


On Dec 18, 2:15 am, andy.booth andy.booth...@googlemail.com wrote:
 http://code.google.com/appengine/docs/java/datastore/dataclasses.html...

 Serializable objects can be stored as a field of an entity using
 @Persistent(serialized=true). However, the GData ContactEntry object
 does not appear to be marked as serializable, so you will probably
 have to create your own custom contact information class and convert
 between the two classes.

 Andy

 On Dec 17, 7:19 pm, Tb tho...@bertranfamily.com wrote:



  Any update on this? I'm getting the same error while trying to store a
  ContactEntry object per record...
  However, I don't mind storing an ArrayList if we can solve your
  problem! ;)

  On Dec 9, 9:38 am, Josh joshua.t.gr...@gmail.com wrote:

   One other thing I should add.  The ContactEntrys are currently stored
   in an ArrayList.  I'm trying to persist the whole list.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Google Calendar log on GAE: Redirect requested but followRedirects is disabled

2009-12-18 Thread Pion
By using the appropriate URLs as shown on the example,
// The base URL for a user's calendar metafeed (needs a username
appended).
private static final String METAFEED_URL_BASE = http://
www.google.com/calendar/feeds/;

// The string to add to the user's metafeedUrl to access the event
feed for their primary calendar.
private static final String EVENT_FEED_URL_SUFFIX = /private/full;

I could retrieve the calendars. But the log info messages below still
show:
Dec 18, 2009 3:25:34 PM
org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled

Dec 18, 2009 3:25:35 PM
org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size.
Using getResponseBodyAsStream instead is recommended.

On Dec 18, 9:44 am, Pion onlee2...@gmail.com wrote:
 I have just compiled and executed the Google Calendar sample 
 fromhttp://code.google.com/p/gdata-java-client/downloads/list(version
 1.40.1) locally without using any GAE stuffs. EventFeedDemo.java

   private static void printUserCalendars(CalendarService service)
       throws IOException, ServiceException {
     // Send the request and receive the response:
     CalendarFeed resultFeed = service.getFeed(metafeedUrl,
 CalendarFeed.class);

     System.out.println(Your calendars:);
     System.out.println();
     for (int i = 0; i  resultFeed.getEntries().size(); i++) {
       CalendarEntry entry = resultFeed.getEntries().get(i);
       System.out.println(\t + entry.getTitle().getPlainText());
     }
     System.out.println();
   }

 It prints 2 calendars. On the other hand, using similar code but
 running on GAE, it returns only 1 calendar.

 I am using GAE 1.3.

 On Dec 18, 7:46 am, Pion onlee2...@gmail.com wrote:

  I have the following code snippets (remove exceptions code for
  brevity) which is based on the example 
  onhttp://code.google.com/apis/calendar/data/2.0/developers_guide_java.h...

                  String appName = companyName-appName-1.0;
                  CalendarService myService = new CalendarService
  (appName);

                  String id = myEmail;
                  String password = myPassword;
                  String host = http://www.google.com/calendar/feeds/;
  + id + @gmail.com/owncalendars/full;
                  myService.setUserCredentials(id, password);
                  URL feedUrl = new URL(host);
                  CalendarFeed resultFeed = myService.getFeed(feedUrl,
  CalendarFeed.class);

                  for (int i = 0; i  resultFeed.getEntries().size(); i++) {
                      entry = resultFeed.getEntries().get(i);
                      logger.info(entry.getTitle().getPlainText())
                  }

  I receive the following log info:

  Dec 18, 2009 3:25:34 PM
  org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
  INFO: Redirect requested but followRedirects is disabled

  Dec 18, 2009 3:25:35 PM org.apache.commons.httpclient.HttpMethodBase
  getResponseBody
  WARNING: Going to buffer response body of large or unknown size. Using
  getResponseBodyAsStream instead is recommended.

  Dec 18, 2009 3:25:35 PM com.galensystems.pchr.server.DoServer
  doCalendar
  INFO: myem...@gmail.com

  I am wondering if I am doign something wrong and have to worry the
  above INFO and WARNING.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Re: Finding abandoned child entities

2009-12-18 Thread Rusty Wright
If you're using com.google.appengine.api.datastore.Key for your primary keys, 
it has a getParent() method which returns null when the object doesn't have a 
parent.  Also, your code is fetching a List of Entity, and Entity also has a 
getParent() which returns null if there is no parent.


m seleron wrote:
 Sorry, did not have enough explanation.
 
 I corrected it a little.
 
 I think that the method of confirming the parent existence is simple.
 It uses Entity#getParent()
 
 How about the following examples?
 
 String parentKindName = parentKind; //Parent Kindname
 String kindName = kindName; // Child Kindname
 
 DatastoreService service = DatastoreServiceFactory.getDatastoreService
 ();
 
 Query query = new Query(kindName);
 PreparedQuery pq = service.prepare(query);
 ListEntity list = pq.asList(FetchOptions.Builder.withOffset(0));
 
 for (Entity e : list) {
 e.getProperty(xx); //get childproperty
 
 
 
   //Parent check
   PreparedQuery parentPq = service.prepare(new Query
 (parentKindName,e.getParent()));
   int parentCount = parentPq.countEntities();
   if (parentCount == 0){
   //abandoned children
   }
 
 }
 
 Please try.
 Thanks,
 seleronm
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Google App Engine for Java group.
 To post to this group, send email to google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine-java?hl=en.
 
 

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] two entities into the same entity group - unowned relationship

2009-12-18 Thread Rusty Wright
My understanding is that the only way objects can be in the same entity group 
with GAE is they have a parent/child relationship (or grandparent/grandchild 
etc.).


aswath satrasala wrote:
 I have two classes with unowned relationship.  I am making tenant key as 
 a key field in the MasterUserLogin.  How can I make them belong to the 
 same entity group
 
 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class Tenant {

 @PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 @Extension(vendorName = datanucleus, key=gae.encoded-pk, 
 value=true)
 private String id;

 @Persistent
 @Extension(vendorName = datanucleus, key=gae.pk-name, value=true)
 private String name;
 }
 
 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class MasterUserLogin {
 @PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 private String id;
 
 @Persistent
 private Key currentTenantKey;
    
 }
 
 Regards
 -Aswath
 
 
 --
 
 You received this message because you are subscribed to the Google 
 Groups Google App Engine for Java group.
 To post to this group, send email to google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine-java?hl=en.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] embedding parent object in parent-child relation with jdo

2009-12-18 Thread Rusty Wright
Try making the parent's primary key be Key instead of String.


Eugene Kuleshov wrote:
   I am using the app engine SDK 1.3.0 with the latest Google Eclipse
 plugin.
 
   Currently, in order to be able to run queries on attributes of the
 parent object I have to embed parent object into a child. So, I have
 created the following classes
 
 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class Parent {
   @PrimaryKey @Persistent String parentName;
   @Persistent(mappedBy = parent) ListChild children = new
 ArrayListChild();
 
   public Parent(String parentName) { this.parentName = parentName; }
   public void setParentName(String parentName) { this.parentName =
 parentName; }
   public String getParentName() { return parentName; }
   public ListChild getChildren() { return children; }
   public void addChild(Child child) {
 child.setParent(this);
 children.add(child);
   }
 }
 
 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class Child {
   @PrimaryKey
   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key
 childKey;
   @Persistent String childName;
 
   @Embedded(
 members = { @Persistent(name = parentName, column =
 childParentName) },
 ownerMember = children)
   @Persistent Parent parent;
 
   public Child(String childName) { this.childName = childName; }
   public void setChildName(String childName) { this.childName =
 childName; }
   public String getChildName() { return childName; }
   public void setParent(Parent parent) { this.parent = parent; }
   public Parent getParent() { return parent; }
 }
   and then I created a simple test to verify if I can persist and run
 queries on those objects:
 
 public class ParentTest {
   public static void main(String[] args) {
 Parent parent1 = new Parent(parent1);
 parent1.addChild(new Child(child1));
 parent1.addChild(new Child(child2));
 
 Parent parent2 = new Parent(parent2);
 parent2.addChild(new Child(child3));
 
 ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());
 ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)) { });
 
 ApiProxyLocalImpl proxy = (ApiProxyLocalImpl) ApiProxy.getDelegate
 ();
 proxy.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY,
 Boolean.TRUE.toString());
 
 PersistenceManagerFactory pmf =
 JDOHelper.getPersistenceManagerFactory(transactions-optional);
 PersistenceManager pm = pmf.getPersistenceManager();
 Transaction tx = pm.currentTransaction();
 try {
   tx.begin();
   pm.makePersistent(parent1);
   tx.commit();
 
   tx.begin();
   pm.makePersistent(parent2);
   tx.commit();
 
   Query query2 = pm.newQuery(Child.class);
   query2.setFilter(parent.parentName==parentNameParam);
   query2.declareParameters(java.lang.String parentNameParam);
   ListChild results2 = (ListChild) query2.executeWithArray
 (parent1);
   System.err.println(results2);
 } finally {
   if (tx.isActive()) {
 tx.rollback();
   }
   pm.close();
 }
   }
 }
 
   The DataNucleus Enhancer runs ok on the above code, but when I run
 my test app, I am getting an IndexOutOfBoundException from somewhere
 in the DataNucleus internals:
 
 Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 0
   at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK
 (DatastoreTable.java:356)
   at org.datanucleus.store.appengine.DatastoreTable.buildMapping
 (DatastoreTable.java:285)
   at org.datanucleus.store.appengine.DatastoreManager.buildStoreData
 (DatastoreManager.java:405)
   at org.datanucleus.store.appengine.DatastoreManager.newStoreData
 (DatastoreManager.java:363)
   at org.datanucleus.store.AbstractStoreManager.addClasses
 (AbstractStoreManager.java:788)
   at org.datanucleus.store.AbstractStoreManager.addClass
 (AbstractStoreManager.java:759)
   at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass
 (MappedStoreManager.java:358)
   at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass
 (DatastoreManager.java:631)
   at
 org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer
 (DatastoreFieldManager.java:1008)
   at
 org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer
 (DatastoreFieldManager.java:998)
   at org.datanucleus.store.appengine.DatastoreFieldManager.init
 (DatastoreFieldManager.java:133)
   at org.datanucleus.store.appengine.DatastoreFieldManager.init
 (DatastoreFieldManager.java:167)
   at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess
 (DatastorePersistenceHandler.java:316)
   at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
 (DatastorePersistenceHandler.java:236)
   at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
 (DatastorePersistenceHandler.java:225)
   at 

Re: [appengine-java] com.google.appengine.api.datastore.DatastoreNeedIndexException

2009-12-18 Thread Jason (Google)
If you're deploying a new version that relies on indexes that haven't been
built yet, you should be able to deploy this to a non-default version. This
way, the indexes get built eventually but your application won't be serving
index errors in the meantime. Then, when the indexes are built, make this
new version the default to introduce your new functionality.

- Jason

On Wed, Dec 16, 2009 at 12:11 AM, Dmitry Anipko dmitry.ani...@gmail.comwrote:

 Jason,

 thanks for the info, this solved the problem.

 I've noticed however that the index building can take some time after
 the application has been deployed - is there any way to control that /
 prevent the new version of the application from being used if the
 indices are not ready yet? (Otherwise the app is guaranteed to produce
 errors if customers start using it when the indices are not yet fully
 ready)



 On Tue, Dec 15, 2009 at 4:16 PM, Jason (Google) apija...@google.com
 wrote:
  Hi Dmitry. What's your app ID?
  Indexes are auto-generated by the SDK when you run a query locally that
  requires a custom index. If you don't run a particular query locally and
 it
  uses multiple sort orders or otherwise requires a custom index, then the
  index won't be generated in datastore-indexes-auto.xml and you'll see an
  exception in production. You can see which indexes are created and
 serving
  for your app by clicking Datastore Indexes in your app's Admin Console.
  For now, I suggest adding the index definitions contained in your
 exception
  to your datastore-indexes.xml file, re-deploying your app, waiting for
 the
  indexes to build, and seeing if that fixes your problem.
  - Jason
 
  On Sun, Dec 13, 2009 at 10:00 PM, Dmitry Anipko dmitry.ani...@gmail.com
 
  wrote:
 
  Hello,
 
  our application recently started producing exceptions like:
 
  com.google.appengine.api.datastore.DatastoreNeedIndexException: no
  matching index found..  datastore-index kind=SketchCommandStore
  ancestor=false source=manual
property name=sketchId direction=asc/
property name=orderId direction=asc/
/datastore-index
 
  or
 
  Server error 1:
  com.google.appengine.api.datastore.DatastoreNeedIndexException: no
  matching index found..  datastore-index
  kind=SketchCommentThread ancestor=true source=manual
property name=lastUpdateTimestamp direction=desc/
/datastore-index
 
  for different tables in the data store. Our app doesn't use explicit
  index configuration / don't have datastore-indexes.xml .
 
  On the local development server the auto generated xml for these two
  tables looks like:
 
  !-- Indices written at Sun, 13 Dec 2009 23:01:11 UTC --
 
  datastore-indexes
 
!-- Used 1 time in query history --
datastore-index kind=SketchCommentThread ancestor=true
  source=auto
property name=lastUpdateTimestamp direction=desc/
/datastore-index
 
!-- Used 2 times in query history --
datastore-index kind=SketchCommandStore ancestor=false
  source=auto
property name=sketchId direction=asc/
property name=epochDate direction=desc/
/datastore-index
 
  /datastore-indexes
 
 
  I wonder if anybody faced similar issues / can shed some light on how
  to deal with that?
 
  Thank you,
  Dmitry
 
  --
 
  You received this message because you are subscribed to the Google
 Groups
  Google App Engine for Java group.
  To post to this group, send email to
  google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
  http://groups.google.com/group/google-appengine-java?hl=en.
 
 
 
  --
 
  You received this message because you are subscribed to the Google Groups
  Google App Engine for Java group.
  To post to this group, send email to
 google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
  http://groups.google.com/group/google-appengine-java?hl=en.
 

 --

 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 

Re: [appengine-java] Chat Time transcript for December 16, 2009

2009-12-18 Thread Rusty Wright
Regarding the question about better performance by writing entities in 
different entity groups; that's not an option if you're using JDO is it, 
doesn't JDO require a transaction around writes?


Jason (Google) wrote:
 This past Wednesday, the App Engine team hosted the latest session of
 its bimonthly IRC office hours. A transcript of the session and a
 summary of the topics covered is provided below. The next session will
 take place on Wednesday, January 6th from 7:00-8:00 p.m. PST in the
 #appengine channel on irc.freenode.net.
 
 - Jason
 
 
 --SUMMARY---
 - Q: Can one achieve better peformance by writing entities in
 different entity groups outside of a transaction over writing multiple
 entitites in the same entity group inside of a transaction? A: Yes!
 App Engine supports batch (parallel) writes for entities in distinct
 entity groups. Updates to multiple entities in the same entity group,
 regardless of whether you use transactions, forces the entities to be
 written serially which takes more time. In order to achieve the best
 performance, keep your entity groups as small as possible and only use
 transactions if you absolutely need atomic writes to two or more
 entities. [9:09-9:11, 9:13-9:15]

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: embedding parent object in parent-child relation with jdo

2009-12-18 Thread Eugene Kuleshov

  It shouldn't be needed, since according to the docs [1], the Key
type is only required to record parent relation in the child.
  But I tried it anyways and got pretty much the same exception:

Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 0
at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK
(DatastoreTable.java:356)
at org.datanucleus.store.appengine.DatastoreTable.buildMapping
(DatastoreTable.java:285)
at org.datanucleus.store.appengine.DatastoreManager.buildStoreData
(DatastoreManager.java:405)
...

  regards,
  Eugene

[1] 
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys


On Dec 18, 2:33 pm, Rusty Wright rwright.li...@gmail.com wrote:
 Try making the parent's primary key be Key instead of String.

 Eugene Kuleshov wrote:
    I am using the app engine SDK 1.3.0 with the latest Google Eclipse
  plugin.

    Currently, in order to be able to run queries on attributes of the
  parent object I have to embed parent object into a child. So, I have
  created the following classes

  @PersistenceCapable(identityType = IdentityType.APPLICATION)
  public class Parent {
    @PrimaryKey @Persistent String parentName;
    @Persistent(mappedBy = parent) ListChild children = new
  ArrayListChild();

    public Parent(String parentName) { this.parentName = parentName; }
    public void setParentName(String parentName) { this.parentName =
  parentName; }
    public String getParentName() { return parentName; }
    public ListChild getChildren() { return children; }
    public void addChild(Child child) {
      child.setParent(this);
      children.add(child);
    }
  }

  @PersistenceCapable(identityType = IdentityType.APPLICATION)
  public class Child {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key
  childKey;
    @Persistent String childName;

    @Embedded(
      members = { @Persistent(name = parentName, column =
  childParentName) },
      ownerMember = children)
    @Persistent Parent parent;

    public Child(String childName) { this.childName = childName; }
    public void setChildName(String childName) { this.childName =
  childName; }
    public String getChildName() { return childName; }
    public void setParent(Parent parent) { this.parent = parent; }
    public Parent getParent() { return parent; }
  }
    and then I created a simple test to verify if I can persist and run
  queries on those objects:

  public class ParentTest {
    public static void main(String[] args) {
      Parent parent1 = new Parent(parent1);
      parent1.addChild(new Child(child1));
      parent1.addChild(new Child(child2));

      Parent parent2 = new Parent(parent2);
      parent2.addChild(new Child(child3));

      ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());
      ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)) { });

      ApiProxyLocalImpl proxy = (ApiProxyLocalImpl) ApiProxy.getDelegate
  ();
      proxy.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY,
  Boolean.TRUE.toString());

      PersistenceManagerFactory pmf =
  JDOHelper.getPersistenceManagerFactory(transactions-optional);
      PersistenceManager pm = pmf.getPersistenceManager();
      Transaction tx = pm.currentTransaction();
      try {
        tx.begin();
        pm.makePersistent(parent1);
        tx.commit();

        tx.begin();
        pm.makePersistent(parent2);
        tx.commit();

        Query query2 = pm.newQuery(Child.class);
        query2.setFilter(parent.parentName==parentNameParam);
        query2.declareParameters(java.lang.String parentNameParam);
        ListChild results2 = (ListChild) query2.executeWithArray
  (parent1);
        System.err.println(results2);
      } finally {
        if (tx.isActive()) {
          tx.rollback();
        }
        pm.close();
      }
    }
  }

    The DataNucleus Enhancer runs ok on the above code, but when I run
  my test app, I am getting an IndexOutOfBoundException from somewhere
  in the DataNucleus internals:

  Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 0
     at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK
  (DatastoreTable.java:356)
     at org.datanucleus.store.appengine.DatastoreTable.buildMapping
  (DatastoreTable.java:285)
     at org.datanucleus.store.appengine.DatastoreManager.buildStoreData
  (DatastoreManager.java:405)
     at org.datanucleus.store.appengine.DatastoreManager.newStoreData
  (DatastoreManager.java:363)
     at org.datanucleus.store.AbstractStoreManager.addClasses
  (AbstractStoreManager.java:788)
     at org.datanucleus.store.AbstractStoreManager.addClass
  (AbstractStoreManager.java:759)
     at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass
  (MappedStoreManager.java:358)
     at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass
  (DatastoreManager.java:631)
     at
  

[appengine-java] Freemarker Templates in Dev Server

2009-12-18 Thread efleming969
I'm using freemarker as a template engine, but can't figure out how to
get the dev server to accept changes in my templates.  I have to
restart the dev server.

Research shows that the JRuby project has some success with this.
Does anyone have any advise?

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: bulk download error 403

2009-12-18 Thread Matthew Blain
A quick test is if you can visit yourapp/remote_api in the web
browser--it should work if you log in as an admin, well it should say
This request did not contain a necessary header but not any other
errors.

On Dec 16, 2:52 pm, lembas keremo...@gmail.com wrote:
 I get exactly the same error when I try to bulkupload with this
 command:
 appcfg.py upload_data --auth_domain=mydomain.com --db_filename=skip --
 url=http://remote.latest.myprogram.appspot.com/remote_api--no_cookies
 --has_header --config_file=loader.py --filename=kind.csv --kind=Kind
 myprogram

 On Dec 17, 12:37 am, lembas keremo...@gmail.com wrote:



  Hi,

  I have a java app on myprogram.appspot.com.
  I use google eclipse plugin to deploy it.(Eclipse 3.5, App Engine SDK
  1.3.0, GWT SDK 2.0.0)
  I set the version to bulkload and deployed it.
  Now I have bulkload.latest.myprogram.appspot.com as I can see 
  onhttps://appengine.google.com/deployment?app_id=myprogram

  I try to bulkdownload data to my app but cannot succeed.

  I use:
  bulkloader.py --dump --batch_size=5 --kind=Kind --
  auth_domain=mydomain.com --url=http://
  bulkload.latest.myprogram.appspot.com/remote_api --filename=dump.sql3
  myprogram

  when I execute this command it asks my an email and a password. I
  enter ad...@mydomain.com and its password but the result is:
  [ERROR   ] Exception during authentication
  Traceback (most recent call last):
    File C:\Program Files\Google\google_appengine\google\appengine\tools
  \bulkload
  er.py, line 2985, in Run
      request_manager.Authenticate()
    File C:\Program Files\Google\google_appengine\google\appengine\tools
  \bulkload
  er.py, line 1152, in Authenticate
      remote_api_stub.MaybeInvokeAuthentication()
    File C:\Program Files\Google\google_appengine\google\appengine\ext
  \remote_api
  \remote_api_stub.py, line 494, in MaybeInvokeAuthentication
      datastore_stub._server.Send(datastore_stub._path, payload=None)
    File C:\Program Files\Google\google_appengine\google\appengine\tools
  \appengin
  e_rpc.py, line 344, in Send
      f = self.opener.open(req)
    File C:\Python26\lib\urllib2.py, line 389, in open
      response = meth(req, response)
    File C:\Python26\lib\urllib2.py, line 502, in http_response
      'http', request, response, code, msg, hdrs)
    File C:\Python26\lib\urllib2.py, line 427, in error
      return self._call_chain(*args)
    File C:\Python26\lib\urllib2.py, line 361, in _call_chain
      result = func(*args)
    File C:\Python26\lib\urllib2.py, line 510, in http_error_default
      raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
  HTTPError: HTTP Error 403: Forbidden
  [INFO    ] Authentication Failed

  I got exactly the same error above when I tried downloading with this
  command:
  appcfg.py download_data --auth_domain=mydomain.com --url=http://
  bulkload.latest.myprogram.appspot.com/remote_api --
  config_file=exporter.py --filename=kind_data_archive.csv --kind=Kind
  myprogram

  If I enter my gmail.com account and password, which I use to deploy
  the app in google eclipse plugin, the error is:
  Invalid username or password.
  Please enter login credentials for
  bukload.latest.myprogram.appspot.com

  My app.yaml in myprogram folder is:
  application: myprogram
  version: bulkload
  runtime: python
  api_version: 1

  handlers:
  - url: /remote_api
    script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
    login: admin

  Any help? Or should I ask it on google-appengine-python group or
  google-appengine group?

  Thanks.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: Finding abandoned child entities

2009-12-18 Thread m seleron
Hi.

Thank you for following.

Movement might be different depending on the entry method in JDO.

thanks.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] Dynamically create classes using JPA/JDO and bytecode instrumentation

2009-12-18 Thread Bombay Goose
Thanks DataNucleus team and Toby.

Sorry, but I have some more questions

1. How do I delete a particular table dynamically? would just unloading the
class do it? Iin that case, what if there are changes to the dynamic table,
i.e. column addition/dropping, wouldnt that require unloading the class and
hence deletion of table?
2. I am going through the Queries and Indexes section in the documentation
at
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html
 This section says that inequality operators are allowed only one property.
Is anybody handling a situation where there are multiple properties with
inequality operators? If yes, how have you done it?
Thanks
On Wed, Dec 16, 2009 at 12:18 PM, Toby Reyelts to...@google.com wrote:

 One other thing you might consider is using the native App Engine
 datastore, since it's already schemaless. You can even mix and match using
 the native API and JDO/JPA.

   On Wed, Dec 16, 2009 at 1:30 AM, Bombay Goose bombaygo...@gmail.comwrote:

   Hello All,

 I am doing a feasibility study of whether we can develop our application
 on appengine or not.

 Our application has a requirement where we have to create tables
 dynamically, without restarting the application.

 Is that possible in Appengine?

 Datanucleus supports this through JDO, with some byte code
 instrumentation. More info -
 http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageId=6619188

 Is it possible through JPA? if yes, does appengine allow it?
  if not, does Appengine allow Bytecode instrumentation so that we can
 create classes dynamically according to the link above using JDO.

 Any help is greatly appreciated.

 Thanks,

 G

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: embedding parent object in parent-child relation with jdo

2009-12-18 Thread jd
Could you not split your query into two?  The first to find the parent
and the second to return all children with an ancestor query.
Alternatively, Twig makes embedding objects very simple.  If you use
the AnnotationTypesafeDatastore you can achieve the above with a
single annotation:

@Component
Parent parent;

However, currently Twig does not support the parent being _both_ an
embedded component and an entity.  It must be one of the other.
It will support this type of denormalisation in the next release which
I hope to get out a week or so after new year.

http://code.google.com/p/twig-persist/

John

On Dec 19, 3:58 am, Eugene Kuleshov ekules...@gmail.com wrote:
   It shouldn't be needed, since according to the docs [1], the Key
 type is only required to record parent relation in the child.
   But I tried it anyways and got pretty much the same exception:

 Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 0
         at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK
 (DatastoreTable.java:356)
         at org.datanucleus.store.appengine.DatastoreTable.buildMapping
 (DatastoreTable.java:285)
         at org.datanucleus.store.appengine.DatastoreManager.buildStoreData
 (DatastoreManager.java:405)
 ...

   regards,
   Eugene

 [1]http://code.google.com/appengine/docs/java/datastore/creatinggettinga...

 On Dec 18, 2:33 pm, Rusty Wright rwright.li...@gmail.com wrote:



  Try making the parent's primary key be Key instead of String.

  Eugene Kuleshov wrote:
     I am using the app engine SDK 1.3.0 with the latest Google Eclipse
   plugin.

     Currently, in order to be able to run queries on attributes of the
   parent object I have to embed parent object into a child. So, I have
   created the following classes

   @PersistenceCapable(identityType = IdentityType.APPLICATION)
   public class Parent {
     @PrimaryKey @Persistent String parentName;
     @Persistent(mappedBy = parent) ListChild children = new
   ArrayListChild();

     public Parent(String parentName) { this.parentName = parentName; }
     public void setParentName(String parentName) { this.parentName =
   parentName; }
     public String getParentName() { return parentName; }
     public ListChild getChildren() { return children; }
     public void addChild(Child child) {
       child.setParent(this);
       children.add(child);
     }
   }

   @PersistenceCapable(identityType = IdentityType.APPLICATION)
   public class Child {
     @PrimaryKey
     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key
   childKey;
     @Persistent String childName;

     @Embedded(
       members = { @Persistent(name = parentName, column =
   childParentName) },
       ownerMember = children)
     @Persistent Parent parent;

     public Child(String childName) { this.childName = childName; }
     public void setChildName(String childName) { this.childName =
   childName; }
     public String getChildName() { return childName; }
     public void setParent(Parent parent) { this.parent = parent; }
     public Parent getParent() { return parent; }
   }
     and then I created a simple test to verify if I can persist and run
   queries on those objects:

   public class ParentTest {
     public static void main(String[] args) {
       Parent parent1 = new Parent(parent1);
       parent1.addChild(new Child(child1));
       parent1.addChild(new Child(child2));

       Parent parent2 = new Parent(parent2);
       parent2.addChild(new Child(child3));

       ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());
       ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)) { });

       ApiProxyLocalImpl proxy = (ApiProxyLocalImpl) ApiProxy.getDelegate
   ();
       proxy.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY,
   Boolean.TRUE.toString());

       PersistenceManagerFactory pmf =
   JDOHelper.getPersistenceManagerFactory(transactions-optional);
       PersistenceManager pm = pmf.getPersistenceManager();
       Transaction tx = pm.currentTransaction();
       try {
         tx.begin();
         pm.makePersistent(parent1);
         tx.commit();

         tx.begin();
         pm.makePersistent(parent2);
         tx.commit();

         Query query2 = pm.newQuery(Child.class);
         query2.setFilter(parent.parentName==parentNameParam);
         query2.declareParameters(java.lang.String parentNameParam);
         ListChild results2 = (ListChild) query2.executeWithArray
   (parent1);
         System.err.println(results2);
       } finally {
         if (tx.isActive()) {
           tx.rollback();
         }
         pm.close();
       }
     }
   }

     The DataNucleus Enhancer runs ok on the above code, but when I run
   my test app, I am getting an IndexOutOfBoundException from somewhere
   in the DataNucleus internals:

   Exception in thread main java.lang.ArrayIndexOutOfBoundsException: 0
      at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK
   (DatastoreTable.java:356)
      at