[appengine-java] Re: Is GAEJ's admin console a Google Apps application ?

2010-12-01 Thread Guy Bobenrieth
Hello Ikai,

In fact I'm looking for a way to extend the admin console.

As I see the evolution in Google apps script ... I thought it would
have been a very efficient way to add some new features to the console
this way.

I see the console app like being a sort of dashboard for the
admin 

It's true that  
http://code.google.com/appengine/docs/java/config/appconfig.html#Admin
provides a way to add some functionalities to it. I try it but was
force to log in twice (one time inside the console, one time inside
the app protected this way).

What I try to achieve is to give the admin a way to exploit the data
produce by a web app deploy inside GAEJ.

Are their some links between GAEJ and the Google Apps (for example the
spreadsheet)  that could  be used to exchange data between the two ?
For example using the spreadsheet as a dashboard could be of some
interest !

Thanks for your answer.

Guy

On 1 déc, 01:04, "Ikai Lan (Google)"  wrote:
> Are you looking for something like this?
>
> http://code.google.com/appengine/docs/java/config/appconfig.html#Admi...
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blogger:http://googleappengine.blogspot.com
> Reddit:http://www.reddit.com/r/appengine
> Twitter:http://twitter.com/app_engine
>
> On Tue, Nov 30, 2010 at 5:02 AM, Guy Bobenrieth 
> wrote:
>
>
>
>
>
>
>
> > Dear reader,
>
> > In fact what I've in mind is if it could be possible to add some  new
> > functionnalities to the admin console like it is possible to other
> > Google Apps application ?
>
> > Thanks in advance for your help.
>
> > Guy
>
> > --
> > 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 > 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.



[appengine-java] Re: Is GAEJ's admin console a Google Apps application ?

2010-12-01 Thread Didier Durand
Hi Guy,

You can access Google Spreadsheets via its API from App Engine

Check out http://code.google.com/apis/spreadsheets/

regards
didier

On Dec 1, 9:58 am, Guy Bobenrieth  wrote:
> Hello Ikai,
>
> In fact I'm looking for a way to extend the admin console.
>
> As I see the evolution in Google apps script ... I thought it would
> have been a very efficient way to add some new features to the console
> this way.
>
> I see the console app like being a sort of dashboard for the
> admin 
>
> It's true that  
> http://code.google.com/appengine/docs/java/config/appconfig.html#Admin
> provides a way to add some functionalities to it. I try it but was
> force to log in twice (one time inside the console, one time inside
> the app protected this way).
>
> What I try to achieve is to give the admin a way to exploit the data
> produce by a web app deploy inside GAEJ.
>
> Are their some links between GAEJ and the Google Apps (for example the
> spreadsheet)  that could  be used to exchange data between the two ?
> For example using the spreadsheet as a dashboard could be of some
> interest !
>
> Thanks for your answer.
>
> Guy
>
> On 1 déc, 01:04, "Ikai Lan (Google)"  wrote:
>
> > Are you looking for something like this?
>
> >http://code.google.com/appengine/docs/java/config/appconfig.html#Admi...
>
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
> > Blogger:http://googleappengine.blogspot.com
> > Reddit:http://www.reddit.com/r/appengine
> > Twitter:http://twitter.com/app_engine
>
> > On Tue, Nov 30, 2010 at 5:02 AM, Guy Bobenrieth 
> > wrote:
>
> > > Dear reader,
>
> > > In fact what I've in mind is if it could be possible to add some  new
> > > functionnalities to the admin console like it is possible to other
> > > Google Apps application ?
>
> > > Thanks in advance for your help.
>
> > > Guy
>
> > > --
> > > 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 > >  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.



[appengine-java] Re: Is GAEJ's admin console a Google Apps application ?

2010-12-01 Thread Guy Bobenrieth

Hi Didier,

Do you know if the opposite is possible too ? That is to say access
the GAEJ data from inside Google Spreadsheets may be with Google Apps
Scripts or gadget ?

Thanks for help

Guy

On 1 déc, 10:06, Didier Durand  wrote:
> Hi Guy,
>
> You can access Google Spreadsheets via its API from App Engine
>
> Check outhttp://code.google.com/apis/spreadsheets/
>
> regards
> didier
>
> On Dec 1, 9:58 am, Guy Bobenrieth  wrote:
>
>
>
>
>
>
>
> > Hello Ikai,
>
> > In fact I'm looking for a way to extend the admin console.
>
> > As I see the evolution in Google apps script ... I thought it would
> > have been a very efficient way to add some new features to the console
> > this way.
>
> > I see the console app like being a sort of dashboard for the
> > admin 
>
> > It's true that  
> > http://code.google.com/appengine/docs/java/config/appconfig.html#Admin
> > provides a way to add some functionalities to it. I try it but was
> > force to log in twice (one time inside the console, one time inside
> > the app protected this way).
>
> > What I try to achieve is to give the admin a way to exploit the data
> > produce by a web app deploy inside GAEJ.
>
> > Are their some links between GAEJ and the Google Apps (for example the
> > spreadsheet)  that could  be used to exchange data between the two ?
> > For example using the spreadsheet as a dashboard could be of some
> > interest !
>
> > Thanks for your answer.
>
> > Guy
>
> > On 1 déc, 01:04, "Ikai Lan (Google)"  wrote:
>
> > > Are you looking for something like this?
>
> > >http://code.google.com/appengine/docs/java/config/appconfig.html#Admi...
>
> > > --
> > > Ikai Lan
> > > Developer Programs Engineer, Google App Engine
> > > Blogger:http://googleappengine.blogspot.com
> > > Reddit:http://www.reddit.com/r/appengine
> > > Twitter:http://twitter.com/app_engine
>
> > > On Tue, Nov 30, 2010 at 5:02 AM, Guy Bobenrieth 
> > > wrote:
>
> > > > Dear reader,
>
> > > > In fact what I've in mind is if it could be possible to add some  new
> > > > functionnalities to the admin console like it is possible to other
> > > > Google Apps application ?
>
> > > > Thanks in advance for your help.
>
> > > > Guy
>
> > > > --
> > > > 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 > > >  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.



[appengine-java] Re: Is GAEJ's admin console a Google Apps application ?

2010-12-01 Thread Didier Durand
Hi Guy,

Yes, it's possible: just use the write functions of the API to
populate the spreadsheet and then it's a regular Google spreadsheet
that you can use in any way you want.

regards
didier

On Dec 1, 11:01 am, Guy Bobenrieth  wrote:
> Hi Didier,
>
> Do you know if the opposite is possible too ? That is to say access
> the GAEJ data from inside Google Spreadsheets may be with Google Apps
> Scripts or gadget ?
>
> Thanks for help
>
> Guy
>
> On 1 déc, 10:06, Didier Durand  wrote:
>
> > Hi Guy,
>
> > You can access Google Spreadsheets via its API from App Engine
>
> > Check outhttp://code.google.com/apis/spreadsheets/
>
> > regards
> > didier
>
> > On Dec 1, 9:58 am, Guy Bobenrieth  wrote:
>
> > > Hello Ikai,
>
> > > In fact I'm looking for a way to extend the admin console.
>
> > > As I see the evolution in Google apps script ... I thought it would
> > > have been a very efficient way to add some new features to the console
> > > this way.
>
> > > I see the console app like being a sort of dashboard for the
> > > admin 
>
> > > It's true that  
> > > http://code.google.com/appengine/docs/java/config/appconfig.html#Admin
> > > provides a way to add some functionalities to it. I try it but was
> > > force to log in twice (one time inside the console, one time inside
> > > the app protected this way).
>
> > > What I try to achieve is to give the admin a way to exploit the data
> > > produce by a web app deploy inside GAEJ.
>
> > > Are their some links between GAEJ and the Google Apps (for example the
> > > spreadsheet)  that could  be used to exchange data between the two ?
> > > For example using the spreadsheet as a dashboard could be of some
> > > interest !
>
> > > Thanks for your answer.
>
> > > Guy
>
> > > On 1 déc, 01:04, "Ikai Lan (Google)"  wrote:
>
> > > > Are you looking for something like this?
>
> > > >http://code.google.com/appengine/docs/java/config/appconfig.html#Admi...
>
> > > > --
> > > > Ikai Lan
> > > > Developer Programs Engineer, Google App Engine
> > > > Blogger:http://googleappengine.blogspot.com
> > > > Reddit:http://www.reddit.com/r/appengine
> > > > Twitter:http://twitter.com/app_engine
>
> > > > On Tue, Nov 30, 2010 at 5:02 AM, Guy Bobenrieth 
> > > > wrote:
>
> > > > > Dear reader,
>
> > > > > In fact what I've in mind is if it could be possible to add some  new
> > > > > functionnalities to the admin console like it is possible to other
> > > > > Google Apps application ?
>
> > > > > Thanks in advance for your help.
>
> > > > > Guy
>
> > > > > --
> > > > > 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 > > > >  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.



[appengine-java] Re: updating object with owned one to one relationship.

2010-12-01 Thread clement boret
PLEASE HELP?§

On Nov 27, 2:28 pm, clement boret  wrote:
> hello.
> I have a problem when trying to update an object that has already been
> saved in the dataStore
> An Employee and Contactnfo.  One employee has a contactInfo...
>
> /// 
> ///
> /// 
> ///
> /// 
> ///
> @PersistenceCapable(detachable = "true")
> public class Employee implements Serializable {
>
>   @PrimaryKey
>   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>   private Key key;
>
>   @Persistent
>   private ContactInfo contactInfo = null;
>
>   public ContactInfo getContactInfo() {
>     return contactInfo;
>   }
>
>   public void setContactInfo(ContactInfo contactInfo) {
>     this.contactInfo = contactInfo;
>   }
>
>   public Key getKey() {
>     return key;
>   }}
>
> /// 
> ///
> /// 
> ///
> /// 
> ///
> @PersistenceCapable(detachable = "true")
> public class ContactInfo implements Serializable {
>
>   @PrimaryKey
>   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>   private Key key;
>
>   @Persistent
>   private String name;
>
>   public String getName() {
>     return name;
>   }
>
>   public void setName(String name) {
>     this.name = name;
>   }
>
>   public Key getKey() {
>     return key;
>   }
>
>   public void setKey(Key key) {
>     this.key = key;
>   }}
>
> /// 
> ///
> /// 
> ///
> /// 
> ///
> my servlet:
>
> public class GreetingServiceImpl extends RemoteServiceServlet
> implements GreetingService {
>
>   private static final PersistenceManagerFactory pmfInstance =
> JDOHelper.getPersistenceManagerFactory("transactions-optional");
>
>   public String greetServer(String input) {
>     String result = "";
>
>     //step1 create and save an employee in the datastore.
>     Key key = storeEmployeeInDatastore();
>
>     //step2 retrieve the employee from the datastore and detach it
>     Employee detachedEmployee = getDetachedEmployee(key);
>
>     //step3 modify the detached employee
>     ContactInfo contactInfo2 = new ContactInfo();
>     detachedEmployee.setContactInfo(contactInfo2);
>
>     //step4 save the modified employee...
>     updateEmployeeInDataStore(detachedEmployee);
>
>     return result;
>   }
>
>   /**
>    * @return the key of the employee that has been stored
>    */
>   private Key storeEmployeeInDatastore() {
>     Employee employee = new Employee();
>     ContactInfo contactInfo = new ContactInfo();
>     employee.setContactInfo(contactInfo);
>
>     //creates a new manager.
>     PersistenceManager manager1 = pmfInstance.getPersistenceManager();
>     Key key = null;
>
>     try {
>       manager1.makePersistent(employee);
>       key = employee.getKey();
>     }
>     catch ( Exception e ) {
>       e.printStackTrace();
>     }
>     finally {
>       //equivalent to manager1.close()
>       manager1.close();
>     }
>     return key;
>   }
>
>   private Employee getDetachedEmployee(Key key) {
>     PersistenceManager manager2 = pmfInstance.getPersistenceManager();
>     Employee attached = manager2.getObjectById(Employee.class, key);
>
>     Employee detachedEmployee = manager2.detachCopy(attached);
>     manager2.close();
>     return detachedEmployee;
>   }
>
>   private void updateEmployeeInDataStore(Employee detachedEmployee) {
>     PersistenceManager manager3 = pmfInstance.getPersistenceManager();
>     try {
>
>       Employee bidon = manager3.makePersistent(detachedEmployee);
>
>       System.out.println("");
>     }
>     catch ( Exception e ) {
>       e.printStackTrace();
>     }
>     finally {
>       manager3.close();
>     }
>   }
>
> }
>
> /// 
> 
> /// 
> 
> /// 
> 
> HERE IS THE ERROR I GET
> org.datanucleus.store.appengine.DatastoreRelationFieldManager
> $ChildWithoutParentException: Detected attempt to establish
> Employee(4) as the parent of ContactInfo(6) but the entity identified
> by ContactInfo(6) has already been persisted without a parent.  A
> parent cannot be established or changed once an object has been
> persisted.
>         at
> org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusExc

[appengine-java] Is it possible to use the bulk downloader to download nested entities in XML?

2010-12-01 Thread Riley
I'm trying to follow the hierarchical xml download instructions at
http://bulkloadersample.appspot.com/ using the java appengine. This is
my config file:

transformers:

- kind: ParentEntity
  connector: simplexml
  connector_options:
xpath_to_nodes: /Parents/Parent
style: element_centric
  property_map:
- property: __key__
  external_name: key
  export_transform: transform.key_id_or_name_as_string

- property: name
  external_name: name
  # Type: String Stats: 30 properties of this type in this kind.

- property: children
  external_name: Children
  import_transform:
transform.list_from_child_node('Children/Child')
  export_transform:
transform.child_node_from_list('Child')


And here is my ParentEntity definition:


package experiment.dataexport;

import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

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

@PersistenceCapable
public class ParentEntity
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
public Key key;

@Persistent
public String name;

@Persistent(defaultFetchGroup = "true")
public List children;
}


But when I run the downloader, I get:

google.appengine.ext.bulkload.bulkloader_errors.ErrorOnTransform:
Error on trans
form. Property: children External Name: Children. Code:
transform.child_node_fro
m_list('Child') Details: 'NoneType' object is not iterable



Individual XML downloads of ChildEntities and ParentEntities work
perfectly (without the children property, anyway), but I am
desperately looking for a way to include the children property as
nested XML inside of each ParentEntity.  Are there any working
examples of this anywhere, or does anyone have any suggestions for a
next step?

-- 
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] Executing Batch gets with Spring and JPA

2010-12-01 Thread michaelvb
I've been struggling to get batch gets working with Spring and JPA.  I
am basically trying to build a category tree for an e-commerce site.
The issues I am running in to seem to be related to transactions.  I
had set my DAO class for the Category entity to be @Transactional.
Everything seemed to be working, till I tried performing a batch get
query based on Max Ross' post (http://gae-java-
persistence.blogspot.com/2009/10/executing-batch-gets.html).  The
first error I got said that I was operating on multiple entity groups
in the same transaction.  I found this confusing because it listed two
Category entities and their id's.  So my first question is:
Can you only operate on one logical record at a time in a
transaction?  I figured since I was working on the same entity -
Category, I should be OK. If each instance of a Category is considered
a separate entity group, then I guess the behavior is correct.

My next approach was to remove the @Transactional annotation for the
batch get.  When I do this, I now get:
Object Manager has been closed
org.datanucleus.exceptions.NucleusUserException: Object Manager has
been closed
This occurs withing the DAO Method.  Here is the code:
@Override
//@Transactional
public List getCategoriesByIds(List ids) {
  final Query query = entityManager.createQuery(
  "SELECT FROM Category c WHERE id = :ids");
  query.setParameter("ids", ids);
  List results = query.getResultList();
  return results;
}
Note: the @Transactional is commented out
The error occurs right when "query.getResultList()" is called in the
method.  I don't understand how the object manager can already be
closed.

I have been calling the above method from a unit test.  Any help would
be appreciated.


The entities look like the following:

@Repository
@Entity
public class Category implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private Long memberId;

private String identifier;

private Boolean markForDelete;

private Date lastUpdate;

@OneToMany(mappedBy = "category", cascade = CascadeType.ALL)
private Set categoryDescriptions = new
HashSet();

 Getters and Setters
}

@SuppressWarnings("serial")
@Repository
@Entity
public class CategoryDescription implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key;

@ManyToOne(fetch = FetchType.LAZY)
private Category category;

private String language;

private String name;

private String shortDescription;

private Text longDescription;

private Text note;

private String keywords;
}

@SuppressWarnings("serial")
@Repository
@Entity
public class CategoryRelationship {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private Long parentCategoryId;

private Long childCategoryId;

private Long catalogId;

private Double sequence;

private Date lastUpdate;
}


Thanks,
Michael

-- 
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] How to deserialize a LIST using GSON ?

2010-12-01 Thread Valter Henrique
Hi everyone,
i can seralize a List in my servlet on GAE.

But i don't can deserialize it.

Can someone help me, please?

Best regards,
Valter Henrique.

-- 
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 use the bulk downloader to download nested entities in XML?

2010-12-01 Thread Riley
An important update:

By fiddling around with bulkloader_config.py, I have discovered a
problem: the value being passed to my the export transform is None.
When I swap a place-holding list in for the value, the transform works
perfectly, which leads me to believe that the transforms specified in
my download config file are correct.  The problem seems to be that the
downloader is not passing my list value (children) to my transformer
at all.

The children property of ParentEntity does not show up on any of the
built-in datastore viewers on appengine, either.  I can infer that the
property is there by accessing it in code - that works perfectly, and
the children are all in there as you'd expect.  But when I fetch it
with the bulkdownloader, the property is vanished!

When I download without any download config file, the children
property must be included, because I can re-upload the data and all of
the relationships are preserved.  I must not be specifying the model
correctly in the first place.


How can I cajole the bulk downloader into seeing my children property?


Thanks for any help - I've been working at this for hours and hours.

On Dec 1, 12:06 pm, Riley  wrote:
> I'm trying to follow the hierarchical xml download instructions 
> athttp://bulkloadersample.appspot.com/using the java appengine. This is
> my config file:
>
> transformers:
>
> - kind: ParentEntity
>   connector: simplexml
>   connector_options:
>     xpath_to_nodes: /Parents/Parent
>     style: element_centric
>   property_map:
>     - property: __key__
>       external_name: key
>       export_transform: transform.key_id_or_name_as_string
>
>     - property: name
>       external_name: name
>       # Type: String Stats: 30 properties of this type in this kind.
>
>     - property: children
>       external_name: Children
>       import_transform:
>         transform.list_from_child_node('Children/Child')
>       export_transform:
>         transform.child_node_from_list('Child')
>
> And here is my ParentEntity definition:
>
> package experiment.dataexport;
>
> import java.util.List;
>
> import javax.jdo.annotations.IdGeneratorStrategy;
> import javax.jdo.annotations.PersistenceCapable;
> import javax.jdo.annotations.Persistent;
> import javax.jdo.annotations.PrimaryKey;
>
> import com.google.appengine.api.datastore.Key;
>
> @PersistenceCapable
> public class ParentEntity
> {
>         @PrimaryKey
>         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         public Key key;
>
>         @Persistent
>         public String name;
>
>         @Persistent(defaultFetchGroup = "true")
>         public List children;
>
> }
>
> But when I run the downloader, I get:
>
> google.appengine.ext.bulkload.bulkloader_errors.ErrorOnTransform:
> Error on trans
> form. Property: children External Name: Children. Code:
> transform.child_node_fro
> m_list('Child') Details: 'NoneType' object is not iterable
>
> Individual XML downloads of ChildEntities and ParentEntities work
> perfectly (without the children property, anyway), but I am
> desperately looking for a way to include the children property as
> nested XML inside of each ParentEntity.  Are there any working
> examples of this anywhere, or does anyone have any suggestions for a
> next step?

-- 
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] Real-Time Log Delivery Via XMPP

2010-12-01 Thread Stephen Johnson
I'm not sure if anyone is interested in this type of capability but I had a
use for it for my own debugging and monitoring purposes so I thought I'd
share what I came up with especially since people seem to be losing their
logs or at least they aren't showing up for a while. You can read my post at
www.professionalintellectualdevelopment.com.
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.



Re: [appengine-java] Re: Is GAEJ's admin console a Google Apps application ?

2010-12-01 Thread Ikai Lan (Google)
While you won't be able to extend the admin console, the metadata queries
coming in version 1.4.0 will allow you to do things like query for Kind,
Property or Namespace information. You'll be able to build a toolkit for
building your own admin console.

--
Ikai Lan
Developer Programs Engineer, Google App Engine
Blogger: http://googleappengine.blogspot.com
Reddit: http://www.reddit.com/r/appengine
Twitter: http://twitter.com/app_engine



On Wed, Dec 1, 2010 at 3:04 AM, Didier Durand wrote:

> Hi Guy,
>
> Yes, it's possible: just use the write functions of the API to
> populate the spreadsheet and then it's a regular Google spreadsheet
> that you can use in any way you want.
>
> regards
> didier
>
> On Dec 1, 11:01 am, Guy Bobenrieth  wrote:
> > Hi Didier,
> >
> > Do you know if the opposite is possible too ? That is to say access
> > the GAEJ data from inside Google Spreadsheets may be with Google Apps
> > Scripts or gadget ?
> >
> > Thanks for help
> >
> > Guy
> >
> > On 1 déc, 10:06, Didier Durand  wrote:
> >
> > > Hi Guy,
> >
> > > You can access Google Spreadsheets via its API from App Engine
> >
> > > Check outhttp://code.google.com/apis/spreadsheets/
> >
> > > regards
> > > didier
> >
> > > On Dec 1, 9:58 am, Guy Bobenrieth  wrote:
> >
> > > > Hello Ikai,
> >
> > > > In fact I'm looking for a way to extend the admin console.
> >
> > > > As I see the evolution in Google apps script ... I thought it would
> > > > have been a very efficient way to add some new features to the
> console
> > > > this way.
> >
> > > > I see the console app like being a sort of dashboard for the
> > > > admin 
> >
> > > > It's true that
> http://code.google.com/appengine/docs/java/config/appconfig.html#Admin
> > > > provides a way to add some functionalities to it. I try it but was
> > > > force to log in twice (one time inside the console, one time inside
> > > > the app protected this way).
> >
> > > > What I try to achieve is to give the admin a way to exploit the data
> > > > produce by a web app deploy inside GAEJ.
> >
> > > > Are their some links between GAEJ and the Google Apps (for example
> the
> > > > spreadsheet)  that could  be used to exchange data between the two ?
> > > > For example using the spreadsheet as a dashboard could be of some
> > > > interest !
> >
> > > > Thanks for your answer.
> >
> > > > Guy
> >
> > > > On 1 déc, 01:04, "Ikai Lan (Google)" 
> > > > >
> wrote:
> >
> > > > > Are you looking for something like this?
> >
> > > > >
> http://code.google.com/appengine/docs/java/config/appconfig.html#Admi...
> >
> > > > > --
> > > > > Ikai Lan
> > > > > Developer Programs Engineer, Google App Engine
> > > > > Blogger:http://googleappengine.blogspot.com
> > > > > Reddit:http://www.reddit.com/r/appengine
> > > > > Twitter:http://twitter.com/app_engine
> >
> > > > > On Tue, Nov 30, 2010 at 5:02 AM, Guy Bobenrieth <
> guy.bobenri...@gmail.com>wrote:
> >
> > > > > > Dear reader,
> >
> > > > > > In fact what I've in mind is if it could be possible to add some
>  new
> > > > > > functionnalities to the admin console like it is possible to
> other
> > > > > > Google Apps application ?
> >
> > > > > > Thanks in advance for your help.
> >
> > > > > > Guy
> >
> > > > > > --
> > > > > > 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 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.
>
>

-- 
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: updating object with owned one to one relationship.

2010-12-01 Thread Didier Durand
Hi,

read the last entry by Ikai Lan in this thread
http://groups.google.com/group/google-appengine-java/browse_thread/thread/defc6d14445318b8/75a1e7b5bcbc1bb3#75a1e7b5bcbc1bb3

Maybe you should switch to a 3rd party package instead of JDO that
seems to have an uncertain future and represents anyway the majority
of the isssues in this group.

I personally switched (happily) to Objectify.

regards
didier

On Dec 1, 5:35 pm, clement boret  wrote:
> PLEASE HELP?§
>
> On Nov 27, 2:28 pm, clement boret  wrote:
>
> > hello.
> > I have a problem when trying to update an object that has already been
> > saved in the dataStore
> > An Employee and Contactnfo.  One employee has a contactInfo...
>
> > /// 
> > ///
> > /// 
> > ///
> > /// 
> > ///
> > @PersistenceCapable(detachable = "true")
> > public class Employee implements Serializable {
>
> >   @PrimaryKey
> >   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >   private Key key;
>
> >   @Persistent
> >   private ContactInfo contactInfo = null;
>
> >   public ContactInfo getContactInfo() {
> >     return contactInfo;
> >   }
>
> >   public void setContactInfo(ContactInfo contactInfo) {
> >     this.contactInfo = contactInfo;
> >   }
>
> >   public Key getKey() {
> >     return key;
> >   }}
>
> > /// 
> > ///
> > /// 
> > ///
> > /// 
> > ///
> > @PersistenceCapable(detachable = "true")
> > public class ContactInfo implements Serializable {
>
> >   @PrimaryKey
> >   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >   private Key key;
>
> >   @Persistent
> >   private String name;
>
> >   public String getName() {
> >     return name;
> >   }
>
> >   public void setName(String name) {
> >     this.name = name;
> >   }
>
> >   public Key getKey() {
> >     return key;
> >   }
>
> >   public void setKey(Key key) {
> >     this.key = key;
> >   }}
>
> > /// 
> > ///
> > /// 
> > ///
> > /// 
> > ///
> > my servlet:
>
> > public class GreetingServiceImpl extends RemoteServiceServlet
> > implements GreetingService {
>
> >   private static final PersistenceManagerFactory pmfInstance =
> > JDOHelper.getPersistenceManagerFactory("transactions-optional");
>
> >   public String greetServer(String input) {
> >     String result = "";
>
> >     //step1 create and save an employee in the datastore.
> >     Key key = storeEmployeeInDatastore();
>
> >     //step2 retrieve the employee from the datastore and detach it
> >     Employee detachedEmployee = getDetachedEmployee(key);
>
> >     //step3 modify the detached employee
> >     ContactInfo contactInfo2 = new ContactInfo();
> >     detachedEmployee.setContactInfo(contactInfo2);
>
> >     //step4 save the modified employee...
> >     updateEmployeeInDataStore(detachedEmployee);
>
> >     return result;
> >   }
>
> >   /**
> >    * @return the key of the employee that has been stored
> >    */
> >   private Key storeEmployeeInDatastore() {
> >     Employee employee = new Employee();
> >     ContactInfo contactInfo = new ContactInfo();
> >     employee.setContactInfo(contactInfo);
>
> >     //creates a new manager.
> >     PersistenceManager manager1 = pmfInstance.getPersistenceManager();
> >     Key key = null;
>
> >     try {
> >       manager1.makePersistent(employee);
> >       key = employee.getKey();
> >     }
> >     catch ( Exception e ) {
> >       e.printStackTrace();
> >     }
> >     finally {
> >       //equivalent to manager1.close()
> >       manager1.close();
> >     }
> >     return key;
> >   }
>
> >   private Employee getDetachedEmployee(Key key) {
> >     PersistenceManager manager2 = pmfInstance.getPersistenceManager();
> >     Employee attached = manager2.getObjectById(Employee.class, key);
>
> >     Employee detachedEmployee = manager2.detachCopy(attached);
> >     manager2.close();
> >     return detachedEmployee;
> >   }
>
> >   private void updateEmployeeInDataStore(Employee detachedEmployee) {
> >     PersistenceManager manager3 = pmfInstance.getPersistenceManager();
> >     try {
>
> >       Employee bidon = manager3.makePersistent(detachedEmployee);
>
> >       System.out.println("");
> >     }
> >     catch ( Exception e ) {
> >       e.printStackTrace();
> >     }
> >     finally {
> >       manager3.close();
> >     }
> >   }
>
> > }
>
> > ///

[appengine-java] Re: How to deserialize a LIST using GSON ?

2010-12-01 Thread Didier Durand
Hi,

Can you detail how you (de) serialize ? A code snippet would
definitely help.
Do you use an ObjectOutputStream or something else ? Let us know so
that we can provide good help.

I personally use ObjectOutputStream to serialize and then
ObjectInputStream to deseriliaze and didn't encounter any problem
until now.
(I use this technique for example to be able to POST objects that
represent the input args of a Task in GAE and then the deserialization
happens when the Task is effectively run)

regards
didier

On Nov 30, 9:41 pm, Valter Henrique  wrote:
> Hi everyone,
> i can seralize a List in my servlet on GAE.
>
> But i don't can deserialize it.
>
> Can someone help me, please?
>
> Best regards,
> Valter Henrique.

-- 
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] Latency on email service with yahoo emails?

2010-12-01 Thread Brother
I have created an application that makes use of the JavaMail API and
Mail service (for receiving mails). When I send an email to a Google
address, everything is getting processed instantly (sending and
receiving a mail). When I send an email to a yahoo account, it may
take 1-2 minutes before I get anything on my yahoo email. When
replying, the reply gets processed in 1-2 minutes.

Is that "normal"?

-- 
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: data in xml format from data store

2010-12-01 Thread pac
Hi Ikai,

If you could confirm this - from earlier Stephen's post:

"then I think you
will be safe even though it might take another minute or two for
Google's
infrastructure to stream it to the client. I have not tested this
though.
Can anyone confirm or deny this assumption on my part."

is download outside 30 sec limit i.e. after servlet finished in 30
seconds?

Thanks.

On Dec 1, 12:00 am, "Ikai Lan (Google)" 
wrote:
> The 30 second limit is imposed on the time it takes the servlet to finish.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blogger:http://googleappengine.blogspot.com
> Reddit:http://www.reddit.com/r/appengine
> Twitter:http://twitter.com/app_engine
>
> On Mon, Nov 29, 2010 at 10:13 AM, Stephen Johnson 
> wrote:
>
>
>
> > I believe the 30 second limit is imposed on the time it takes for your
> > servlet to finish. Thus, if your servlet finished generating and returning
> > the file to the AppEngine infrastructure in 29 seconds, then I think you
> > will be safe even though it might take another minute or two for Google's
> > infrastructure to stream it to the client. I have not tested this though.
> > Can anyone confirm or deny this assumption on my part.
>
> > On Mon, Nov 29, 2010 at 10:57 AM, pac  wrote:
>
> >> Sorry, did not see your post earlier Stephen.
>
> >> I was not aware of this 10 minute feature to create a file, I will
> >> look into.
>
> >> File size will be greater then 10MB, it is an existing website which I
> >> am thinking to port to gae, file size already gets around 12MB or so.
>
> >> So I guess more than 10MB download will be an issue and I guess
> >> download should also complete in 30 second, is that so?
>
> >> On Nov 29, 5:37 pm, pac  wrote:
> >> > A client will download a xml file instead of uploading.
> >> > Records will be created (or updated, deleted) in a table/kind over
> >> > time and all records from a kind need to be downloaded in form of a
> >> > xml file, I hope I am explaining the issue bit more clearly.
>
> >> > I am not sure if I could make use of blobstore in this case as it will
> >> > require update of blobstore object (in background may be using task)
> >> > every time a record gets added/updated/deleted i.e. if I create xml
> >> > file programmaticaly and store as blobstore object.
>
> >> > On Nov 29, 5:14 pm, Didier Durand  wrote:
>
> >> > > Hi,
>
> >> > > To emulate files, you have to use the Blob object in the datastore to
> >> > > store such xml content: see com.google.appengine.api.datastore.Blob
> >> inhttp://code.google.com/appengine/docs/java/datastore/dataclasses.html.
> >> ..
>
> >> > > Blob has a limited max size: 1 Mbyte. So, you can use a collection
> >> > > (Vector, List, etc..)  of Blobs if you need more than 1 Mbytes.
>
> >> > > If your files get uploaded by a client, you can use the Blobstore
> >> > > where the max size is much bigger(2 Gbytes): seehttp://
> >> code.google.com/appengine/docs/java/blobstore/overview.html
>
> >> > > You have to associate the blob with some other fields (name, size,
> >> > > last_updated) in you pojo to reproduce what you expect from a file.
>
> >> > > N.B. if you need to emulate a directory tree, you also have to write
> >> > > it by yourself.
>
> >> > > Finally, I would recommend alternative Objectify rather than standard
> >> > > JDO for such services.
>
> >> > > Hope this helps
>
> >> > > regards
> >> > > didier
>
> >> > > On Nov 29, 5:53 pm, pac  wrote:
>
> >> > > > In a website I need to provide a feature to get data in xml format
> >> > > > i.e. some url
>
> >> > > > e.g.http://www.mysite.com../data.xml
>
> >> > > > I think in gae I can not create a file. Any suggestions to create
> >> such
> >> > > > feature to get data from data store in this way?
>
> >> > > > Data store will have large number of records, so in general, a file
> >> > > > created from that could be of good few MBs.
>
> >> --
> >> 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.- Hide quoted 
> >text -
>
> - Show quoted text -

-- 
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.
T

Re: [appengine-java] Re: data in xml format from data store

2010-12-01 Thread Stephen Johnson
I believe Ikai's statement "The 30 second limit is imposed on the time it
takes the servlet to finish." is confirming what I said.

On Wed, Dec 1, 2010 at 5:52 PM, pac  wrote:

> Hi Ikai,
>
> If you could confirm this - from earlier Stephen's post:
>
> "then I think you
> will be safe even though it might take another minute or two for
> Google's
> infrastructure to stream it to the client. I have not tested this
> though.
> Can anyone confirm or deny this assumption on my part."
>
> is download outside 30 sec limit i.e. after servlet finished in 30
> seconds?
>
> Thanks.
>
> On Dec 1, 12:00 am, "Ikai Lan (Google)" 
> 
> >
> wrote:
> > The 30 second limit is imposed on the time it takes the servlet to
> finish.
> >
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
> > Blogger:http://googleappengine.blogspot.com
> > Reddit:http://www.reddit.com/r/appengine
> > Twitter:http://twitter.com/app_engine
> >
> > On Mon, Nov 29, 2010 at 10:13 AM, Stephen Johnson <
> onepagewo...@gmail.com>wrote:
> >
> >
> >
> > > I believe the 30 second limit is imposed on the time it takes for your
> > > servlet to finish. Thus, if your servlet finished generating and
> returning
> > > the file to the AppEngine infrastructure in 29 seconds, then I think
> you
> > > will be safe even though it might take another minute or two for
> Google's
> > > infrastructure to stream it to the client. I have not tested this
> though.
> > > Can anyone confirm or deny this assumption on my part.
> >
> > > On Mon, Nov 29, 2010 at 10:57 AM, pac 
> wrote:
> >
> > >> Sorry, did not see your post earlier Stephen.
> >
> > >> I was not aware of this 10 minute feature to create a file, I will
> > >> look into.
> >
> > >> File size will be greater then 10MB, it is an existing website which I
> > >> am thinking to port to gae, file size already gets around 12MB or so.
> >
> > >> So I guess more than 10MB download will be an issue and I guess
> > >> download should also complete in 30 second, is that so?
> >
> > >> On Nov 29, 5:37 pm, pac  wrote:
> > >> > A client will download a xml file instead of uploading.
> > >> > Records will be created (or updated, deleted) in a table/kind over
> > >> > time and all records from a kind need to be downloaded in form of a
> > >> > xml file, I hope I am explaining the issue bit more clearly.
> >
> > >> > I am not sure if I could make use of blobstore in this case as it
> will
> > >> > require update of blobstore object (in background may be using task)
> > >> > every time a record gets added/updated/deleted i.e. if I create xml
> > >> > file programmaticaly and store as blobstore object.
> >
> > >> > On Nov 29, 5:14 pm, Didier Durand  wrote:
> >
> > >> > > Hi,
> >
> > >> > > To emulate files, you have to use the Blob object in the datastore
> to
> > >> > > store such xml content: see
> com.google.appengine.api.datastore.Blob
> > >> inhttp://
> code.google.com/appengine/docs/java/datastore/dataclasses.html.
> > >> ..
> >
> > >> > > Blob has a limited max size: 1 Mbyte. So, you can use a collection
> > >> > > (Vector, List, etc..)  of Blobs if you need more than 1 Mbytes.
> >
> > >> > > If your files get uploaded by a client, you can use the Blobstore
> > >> > > where the max size is much bigger(2 Gbytes): seehttp://
> > >> code.google.com/appengine/docs/java/blobstore/overview.html
> >
> > >> > > You have to associate the blob with some other fields (name, size,
> > >> > > last_updated) in you pojo to reproduce what you expect from a
> file.
> >
> > >> > > N.B. if you need to emulate a directory tree, you also have to
> write
> > >> > > it by yourself.
> >
> > >> > > Finally, I would recommend alternative Objectify rather than
> standard
> > >> > > JDO for such services.
> >
> > >> > > Hope this helps
> >
> > >> > > regards
> > >> > > didier
> >
> > >> > > On Nov 29, 5:53 pm, pac  wrote:
> >
> > >> > > > In a website I need to provide a feature to get data in xml
> format
> > >> > > > i.e. some url
> >
> > >> > > > e.g.http://www.mysite.com../data.xml
> >
> > >> > > > I think in gae I can not create a file. Any suggestions to
> create
> > >> such
> > >> > > > feature to get data from data store in this way?
> >
> > >> > > > Data store will have large number of records, so in general, a
> file
> > >> > > > created from that could be of good few MBs.
> >
> > >> --
> > >> 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-appen

[appengine-java] Re: Sending an http request with ClientLogin Token

2010-12-01 Thread Stephen
Hmm still no luck. Instead of using Localhost, I followed your advice
and instead had it connect to the deployed version of my GAE app. I
also followed the pattern of your blog post in setting the request
properties. I think it must be a problem with the ClientLogin procedure
I'm using-- I'm not sure where I'm going wrong.


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco;
color: #4d9072} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px
Monaco; color: #3834ff} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font:
11.0px Monaco; color: #931a68} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px Monaco} p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font:
11.0px Monaco; min-height: 15.0px} span.s1 {color: #00} span.s2
{color: #931a68} span.s3 {color: #0027cc}
//AUTHENTICATE WITH GOOGLE

CalendarService client = new
CalendarService("https://www.google.com/accounts/ClientLogin";);

try {

client.setUserCredentials(userField.getText(), passField.getText());

} catch (AuthenticationException e1) {

e1.printStackTrace();

}







//STORE TOKEN LOCALLY

String token;

UserToken auth_token = (UserToken)
client.getAuthTokenFactory().getAuthToken();

token = auth_token.getValue();







p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco;
color: #3834ff} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px
Monaco} span.s1 {color: #00} span.s2 {color: #931a68} span.s3
{color: #3834ff}

URL url = new
URL("http://battleship-command.appspot.com/playerConnect/";);

HttpURLConnection conn = (HttpURLConnection)url.openConnection();

conn.setRequestMethod("POST");


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} span.s1
{color: #3834ff}

conn.setRequestProperty("Cookie", "auth=" + token);

conn.setRequestProperty("TokenAuth","auth="+token);

conn.setRequestProperty("Authorization", "auth=" + token);




I've been trying a bunch of different ways to set the request property.
It's unfortunate that auth_token doesn't have a getName() class like
the GoogleAuthentication thing in your example.

-- 
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: no async queries on AsyncDatastoreService for 1.4.0?

2010-12-01 Thread Luke
great, thanks for the insight max.

i have a client that will batch together multiple requests into one
RPC call to my app on GAE.  each of these individual requests may have
one or more datastore accesses.  this may include some prefetch
requests.

so i want to build a mechanism that will interleave these requests
taking advantage of the AsyncDatastoreService for minimum request
latency.

i've gone through my server-side stack and made it asynchronous by
wrapping RPC returns in Future objects.  then i've created a
FutureChain object that takes one or more Future objects as input, and
will return one Future object.  i then have some code that will poll
the ultimate Future objects until all of them have finished.

it ends up being a simple multi-threaded emulation where each
individual request in a batch gets a thread and each thread gives up
control when it makes an Async request.

now for the PreparedQuery, because my app knows how many items i want,
i should be able to wrap it in a special Future object that will try
to pull in that many items when it is polled...but the problem is, i
don't know when the batch has come back, so every time i call next(),
i risk blocking on I/O when i could be initiating another I/O
asynchronously or processing the results of an async I/O.

so until there is explicit knowledge of when the I/O for a batch has
finished, i may be able to get away with reducing the poll-rate of
queries

i suppose i could just query for the keys, then i could use an
explicit Async method to fetch the entities themselves.  if i query
for keys, will they be split up in batches?  any way to know how many
keys will be in one batch?


On Nov 29, 11:08 am, "Max Ross (Google)" 
wrote:
> Hi Luke,
>
> First the awesome news:
> As of 1.4.0, many queries are implicitly asynchronous.  When you call
> PreparedQuery.asIterable() or PreparedQuery.asIterator(), we initiate the
> query in the background and then immediately return.  This lets you do work
> while the first batch of results is being fetched.  And, when the first
> batch has been consumed we immediately request the next batch.  If you're
> performing a significant amount of work with each Entity as you iterate you
> will probably see a latency win as a result of this.
>
> Now the less awesome news:
> We didn't get around to making the List returned by PreparedQuery.asList()
> work this same magic, but you can expect this in a future release.
>
> Some deeper thoughts:
> The underlying RPCs between your app and the datastore fetch results in
> batches.  We fetch an initial batch of results, and once that batch has been
> consumed we fetch the next batch.  But, there's nothing in the API that maps
> to these batches - it's either a List containing the entire result set or an
> Iterable/Iterator that returns Entities one at a time.  An API that provides
> async access to the individual results returned by an Iterable/Iterator
> (Iterator>) doesn't really make sense since you don't know
> which call to hasNext() is going to require a new batch to be fetched, and
> without that knowledge, the knowledge of what is going to trigger something
> "expensive", you can't really make appropriate use of an asynchronous API.
>
> Going forward, we're definitely interested in exposing these batches
> directly, and an explicitly async API for these batches makes a lot of sense
> since fetching these batches would map directly to something "expensive" on
> the server side.
>
> Hope this helps,
> Max
>
> On Fri, Nov 26, 2010 at 4:41 PM, Luke  wrote:
> > i was taking a look at the 1.4.0 javadoc for AsyncDatastoreService.  i
> > see the get, put and delete operations return a Future, but the
> > prepare methods return a naked PreparedQuery object, and it doesn't
> > look like PreparedQuery has any async get methods.
>
> > does the AsyncDatastoreService not support asynchronous queries, or is
> > there something i'm missing?
>
> > glad to see at lets the get and put methods are async, hoping to get
> > async queries too (as well as async interfaces to more services).
>
> > --
> > 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.



[appengine-java] increase rate of 500 "resource constraint" on incoming xmpp messages

2010-12-01 Thread Jerome
Since we started using the xmpp GAE service late last year, we have
always seen on rare occasions the xmpp clients returning a 500 error.
It has been so unfrequent that it was not a real worry for us.

These past week, we have seen this error rate drastically increase.
This has been reported by our users on PidGin on Windows (XP, Vista,
7) sending messages to our app xmpp address. We experienced several
episodes of a few minutes where each message sent from PidGin was
causing a popup reporting a 500 with the description "resource
constraint". Looking in our app logs for 500s did not show anything.
We can not tell if this issue did not happen on other xmpp client, or
if it is just that they do not report them...

The last occurrence of this issue was late today morning, and lasted a
few minutes. During that time each message was causing this 500 xmpp
report. After these few minutes, everything went back to normal.

I do not think there is anything we can do from our app standpoint.
Let us know if there is additional information we could report to help
get this issue resolved.

Jerome

PS: I do not think this issue is related to the other sporadic problem
with the xmpp message receiver that has been always existing: /_ah/
xmpp/message/chat/
java.lang.IllegalArgumentException: Must set a body
at
com.google.appengine.api.xmpp.MessageBuilder.build(MessageBuilder.java:
54)

I have not been able to see a relation with the above 500 in the log
with the 500 "resource contraint" from the xmpp client side.

-- 
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.