Skip to main content

Home/ Google AppEngine/ Contents contributed and discussions participated by Esfand S

Contents contributed and discussions participated by Esfand S

Esfand S

How to upload primary key as an id instead of name - Google App Engine for Java | Googl... - 0 views

  • If you use the RemoteDatastore you have complete control in Java of   what you key is. http://code.google.com/p/remote-datastore/ e.g. this code puts an entity with the id set in your remote datastore   from your local machine:      RemoteDatastore.install();      RemoteDatastore.divert("http://myVersion.latest.myApp.appspot.com/remote-datastore ", "myApp", "myVersion");      DatastoreService service =   DatastoreServiceFactory.getDatastoreService();      Key key = KeyFactory.createKey("MyKindName, 35);      Entity entity1 = new Entity(key);      entity1.setProperty("property1", "hello");      datastore.put(Arrays.asList(entity1, entity2);
Esfand S

How to upload primary key as an id instead of name - Google App Engine for Java | Googl... - 0 views

  • If you use the RemoteDatastore you have complete control in Java of   what you key is. http://code.google.com/p/remote-datastore/ e.g. this code puts an entity with the id set in your remote datastore   from your local machine:      RemoteDatastore.install();      RemoteDatastore.divert("http://myVersion.latest.myApp.appspot.com/remote-datastore ", "myApp", "myVersion");      DatastoreService service =   DatastoreServiceFactory.getDatastoreService();      Key key = KeyFactory.createKey("MyKindName, 35);      Entity entity1 = new Entity(key);      entity1.setProperty("property1", "hello");      datastore.put(Arrays.asList(entity1, entity2);
  • You can do this now using the RemoteDatastore Java utility http://code.google.com/p/remote-datastore/ For example, this code runs on your desktop and creates a single   entity in your live datastore:     // divert datastore operations to live application     RemoteDatastore.install();     RemoteDatastore.divert("http://myVersion.latest.myApp.appspot.com/remote-datastore ", "myApp", "myVersion");     // create an entity with a numeric key     Key key = KeyFactory.createKey("MyKindName, 35);     Entity entity1 = new Entity(key);     entity1.setProperty("property1", "hello");     // put entity to the remote datastore     DatastoreService service =   DatastoreServiceFactory.getDatastoreService();     datastore.put(entity1); This also works for bulk puts
  • this won't be available until 1.3.6. You should be able to do something like this:  - property: __key__    external_name: CityId    export_transform: datastore.Key.id    import_transform: lambda value: datastore.Key.from_path('City', int(value))
Esfand S

How to upload primary key as an id instead of name - Google App Engine for Java | Googl... - 0 views

  • You can do this now using the RemoteDatastore Java utility http://code.google.com/p/remote-datastore/ For example, this code runs on your desktop and creates a single   entity in your live datastore:     // divert datastore operations to live application     RemoteDatastore.install();     RemoteDatastore.divert("http://myVersion.latest.myApp.appspot.com/remote-datastore ", "myApp", "myVersion");     // create an entity with a numeric key     Key key = KeyFactory.createKey("MyKindName, 35);     Entity entity1 = new Entity(key);     entity1.setProperty("property1", "hello");     // put entity to the remote datastore     DatastoreService service =   DatastoreServiceFactory.getDatastoreService();     datastore.put(entity1); This also works for bulk puts
Esfand S

How to query a __key__ in Datastore Viewer - Google App Engine for Java | Google Groups - 0 views

  • Try this: SELECT * FROM PreparedTransaction WHERE __key__=KEY('agdwYXllbGV4cjkLEhNQcmVwYXJlZFRyYW5zYWN0aW9uIiAwMDAwMGNjMjMwYzg2MTFjZTFhOWZjZDJkZDEzMWMyNww') This is documented here: http://code.google.com/appengine/docs/python/datastore/gqlreference.html
Esfand S

GAE JavaMail jumbles UTF-8 - Google App Engine for Java | Google Groups - 0 views

  • You should encode subject if using non-ASCII: msg.setSubject(MimeUtility.encodeText(_subject, "UTF-8", "Q"));
Esfand S

gaeoauthdemo - Project Hosting on Google Code - 0 views

  • This project has sample code for using OAuth support built in to AppEngine. Note that these features are only being made available at this time to get early feedback from the OAuth community.
Esfand S

HELP...OAUTH API - Google App Engine | Google Groups - 0 views

  • the oauth api google app engine provide is for OAUTH PROVIDER and not OAUTH CONSUMER.
Esfand S

Is _ah/openid_logout going to be a stable logout URL - Google App Engine | Google Groups - 0 views

  • It was one of the other ways to do it, I just wanted to avoid more code in my architecture just to do this (MVP has the disadvantage of added boilerplate for simple tasks like this one). Anyway I found a workaroud, passing the URL in an invisible div in my page and then reading and populating another field in my page using GWT RootPanel.get(id), using different ids for various parts of the page.
Esfand S

viewing the local data store - Google App Engine | Google Groups - 0 views

  • i had to do half an hour of googling to find the easiest solution; http://localhost:8080/_ah/admin/datastore imo it would be useful to have this information on http://code.google.com/appengine/docs/python/datastore/overview.html and related pages.
Esfand S

Storing hierarchical data in Google App Engine Datastore? - Stack Overflow - 0 views

  • The best option depends on your requirements. Here's a few solutions (I'm assuming you're using Python, since you didn't specify): If you need to do transactional updates on an entire tree, and you're not going to have more than about 1QPS of sustained updates to any one tree, you can use the built in support for heirarchial storage. When creating an entity, you can pass the "parent" attribute to specify a parent entity or key, and when querying, you can use the .ancestor() method (or 'ANCESTOR IS' in GQL to retrieve all descendants of a given entity. If you don't need transactional updates, you can replicate the functionality of entity groups without the contention issues (and transaction safety): Add a db.ListProperty(db.Key) to your model called 'ancestors', and populate it with the list of ancestors of the object you're inserting. Then you can easily retrieve everything that's descended from a given ancestor with MyModel.all().filter('ancestors =', parent_key). If you don't need transactions, and you only care about retrieving the direct children of an entity (not all descendants), use the approach outlined above, but instead of a ListProperty just use a ReferenceProperty to the parent entity. This is known as an Adjacency List. There are other approaches available, but those three should cover the most common cases.
Esfand S

Using the Java Mapper Framework for App Engine « Ikai Lan says - 0 views

  • to write large batch processing jobs without having to think about the plumbing details.
  • it is a very easy way to perform some operation on every single Entity of a given Kind in your datastore in parallel
  • What would you have to build for yourself if Mapper weren’t available? Begin querying over every Entity in chained Task Queues Store beginning and end cursors (introduced in 1.3.5) Create tasks to work with chunks of your datastore Write the code to manipulate your data Build an interface to control your batch jobs Build a callback system for your multitudes of parallelized workers to call when the entire task has completed It’s certainly not a trivial amount of work
  • ...1 more annotation...
  • Some things you can do very easily with the Mapper library include: Modify some property or set of properties for every Entity of a given Kind Delete all entities of a single Kind – the functional equivalent of a “DROP TABLE” if you were using a relational database Count the occurrences of some property across every single Entity of a given Kind in your datastore
Esfand S

How will http server handle html5 web sockets? - Stack Overflow - 0 views

  • App Engine apps create a channel on a remote server, and are returned a channel ID which they pass off to the web browser.
« First ‹ Previous 501 - 520 of 592 Next › Last »
Showing 20 items per page