[appengine-java] Re: Best Practice for Java Datastore API

2011-04-23 Thread Andy
Well after studying the source, I guess I will just use 3rd party lib like 
Objectify because creating one takes too much time and effort to cover all 
GAE datastore API's ground.

Thanks all for the advice!

-- 
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-java@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: Best Practice for Java Datastore API

2011-04-23 Thread Andy
Thanks Didier!  Totally forgot that I could read the source from Objectify!!

-- 
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-java@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: Best Practice for Java Datastore API

2011-04-21 Thread Andy
Thanks both of you.  I would like to know the best practice of system design 
when using low level api.  Like where should I store the property type 
information?  I could simply use a Map to store the schema for each entity 
but then a property sometimes has more than just the type but also 
formatting, default and all other attributes.  So wondering if anyone has 
successful example of using low level API?

thanks again.

-- 
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-java@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] Best Practice for Java Datastore API

2011-04-21 Thread Andy
Hi,

I am trying to get away from JDO and now into Low Level API.  I find that 
the Low Level API is much more flexible except one thing.  I have a 
challenge on enforcing or checking data type for each entity property.  So 
if I don't want to hard code the data type or using reflection, how do I do 
that?  e.g. creationDate is a Date type when saving it as a property of an 
entity but where should I define it as a Date type so I don't have to cast 
every single type?

Thanks,

Andy

-- 
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-java@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: Getting error when passing the object to client side please help me..

2011-03-05 Thread andy
hey, thanks.
 i did that with DTO class. means every time if i want send the result i 
should have to use DTO class objects??

-- 
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-java@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: Getting error when passing the object to client side please help me..

2011-03-05 Thread andy
thanks , i will try it now... one more thing i wants to ask that how get the 
child record(only child properties or including some parent properties) 
based on the parent properties? because i have used the one to many relation 
and there is on parent property in child. 
One way to do this- using the parent object but unnecessarily i am 
retrieving the all parent records.So what can do?

-- 
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-java@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] Getting Error while sending the parent object to client side please help me...

2011-03-05 Thread andy
here is my code;
Employee:(Parent)
@PersistenceCapable(identityType = 
IdentityType.APPLICATION,detachable="true")
public class Employee implements Serializable {
private static final long serialVersionUID = 1L;

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


@Persistent
private String ename;

@Persistent
private String designation;
*@Persistent(mappedBy="parentEmployee",defaultFetchGroup="true")
private List leaves;
*
*@Persistent
@Embedded
private EmployeeManager employeeManager;
*
}


Leaves:(Child)\
@PersistenceCapable(identityType = 
IdentityType.APPLICATION,detachable="true")
public class Leave implements Serializable{

private static final long serialVersionUID = 1L;

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

@Persistent
private String reason;

@Persistent
private String status;

*//@OneToMany(fetch=FetchType.EAGER)
public Employee parentEmployee;
*


}

when i store the data it works fine even when i can retrieve the data at 
server side and sending through the string it works fine but when i m trying 
to send the object of Employee it gives the error like *"Type 
'org.datanucleus.sco.backed.List'"*


[WARN] Meta-data warning for parentemp.client.Employee.leaves: The datastore 
does not support joins and therefore cannot honor requests to place related 
objects in the default fetch group.  The field will be fetched lazily on 
first access.  You can modify this warning by setting the 
datanucleus.appengine.ignorableMetaDataBehavior property in your config.  A 
value of NONE will silence the warning.  A value of ERROR will turn the 
warning into an exception.
[ERROR] javax.servlet.ServletContext log: Exception while dispatching 
incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: 
java.lang.reflect.InvocationTargetException
at 
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer(ServerSerializationStreamWriter.java:764)
at 
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:727)
at 
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:616)
at 
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
at 
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
at 
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:534)
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:609)
at 
com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:467)
at 
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:564)
at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207)
at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
at 
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at 
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at 
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at 
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at 
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at 
org.mortbay.jetty.handler.Handl

[appengine-java] Getting Error "org.datanucleus.sco.backed.List" while paasing the parent object form server to chile side

2011-03-05 Thread andy


-- 
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-java@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] Getting error when passing the object to client side please help me..

2011-03-03 Thread andy
My code here:
Employee Class:
@PersistenceCapable(identityType = 
IdentityType.APPLICATION,detachable="true")
public class Employee implements Serializable {
private static final long serialVersionUID = 1L;

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

@Persistent
private String designation;
@Persistent(mappedBy="parentEmployee",defaultFetchGroup="true")
private List leaves;

@Persistent
@Embedded
private EmployeeManager employeeManager;
}

Leave Class:
@PersistenceCapable(identityType = 
IdentityType.APPLICATION,detachable="true")
public class Leave implements Serializable{

private static final long serialVersionUID = 1L;

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

@Persistent
private String reason;

@Persistent
private String status;

//@OneToMany(fetch=FetchType.EAGER)
public Employee parentEmployee;
}

EmployeeManager:

@PersistenceCapable
@EmbeddedOnly
public class EmployeeManager implements Serializable {
private static final long serialVersionUID = 1L;

@Persistent
public String managerId;
}

when i covert the result into String and then send to client then it is 
accepting but when i am sending object it giving me error like:
 Type 'org.datanucleus.store.appengine.query.StreamingQueryResult' was not 
included in the set of types which can be serialized by this 
SerializationPolicy or its Class object could not be loaded. For security 
purposes, this type will not be serialized.: instance = 
[parentemp.client.Employee@1988799, parentemp.client.Employee@ee738e, 
parentemp.client.Employee@e48ee2]

What should i do...???

-- 
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-java@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: What Is "It's possible for two entities to have values of different types for the same property"

2011-01-05 Thread Andy
Thanks for your quick reply.

I actually thought about it again and read it again, it's not just about 
updating schema, but the GAE documentation is all about the low level API, 
not JDO nor JPA.  I am using JDO now so I thought that it is talking about 
JDO but it's not.

So here's what I found in case someone wants to know too.  You create class 
and pre-define all properties and their types.  Therefore, you will only 
store different types of values for the same property when you update the 
schema if you are using JDO or JPA.

However, if you are using low level API, you create entity with following 
line:

Entity entity = new Entity("Employee");
entity.setProperty("age", 5);
datatstore.put(entity);

...

and then you store the same type of entity but with a String age:

Entity entity = new Entity("Employee");
entity.setProperty("age", "10");
datatstore.put(entity);
..

So though they have the same kind (which is the same as having one Employee 
Class in JDO/JPA), you can store age as integer and String or any other GAE 
type.

I hope I understood correctly and helpful to others.

-- 
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: Datastore Backup and Restore (for Java)

2011-01-05 Thread Andy
It is possible.  Use KeyFactory's static method "keytostring()" to convert 
all your keys to string value.  Since String values are portable on any 
platform, you can do that easily.  Hope this help.

-- 
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] What Is "It's possible for two entities to have values of different types for the same property"

2011-01-05 Thread Andy
I found the sentence in subject line in the following page:

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

It doesn't elaborate more how to achieve that in Java at all, no sample 
code, no explanation, no nothing.

We learned the way of creating entity schema for all same kind of entities, 
so if age is integer for entity "Person", how do you have the same property 
storing age as "String"

Please enlighten me!!!

-- 
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] Basic Text Search Not Working

2011-01-03 Thread Andy Haaf
I followed the instructions at:

http://googlecode.blogspot.com/2010/05/google-app-engine-basic-text-search.html

but search is only working for exact matches in the column, not partial 
strings. Here is my code:

   String querystring = request.getParameter("querystring");

querystring = ( querystring != null ? querystring.toLowerCase() : ""
).trim();

PersistenceManager pm = PMF.get().getPersistenceManager();

Query q = pm.newQuery(Item.class);

q.setFilter("shortDesc >= :1 && shortDesc < :2");

List items = (List) q.execute(querystring, (querystring + 
"\ufffd"));


What am I missing?

-- 
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] App calling another secured App

2011-01-01 Thread Andy
Hi,

I think I will leverage XMPP as system exchange channel, I will try some 
experiments and hopefully that's working.

Thanks,

Andy

-- 
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] App calling another secured App

2011-01-01 Thread Andy
Thanks for your reply.

I am not very familiar with shared keyed encryption method, do you have a 
link to the resource you can share?

Besides, I think it is beyond encryption, it requires some kind of 
authentication also right?

-- 
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] App calling another secured App

2010-12-31 Thread Andy
Hi,

I am trying to build 2 apps.  App 1 is calling App 2 through URL Fetch but 
App 2's URL is secured so when APP 1 is fetching something from APP 2, it 
requires authentication, both apps belong to the same gmail account though. 
 How do I do that?  Do I use URL Fetch with GET and submit login to APP 2? 
 Any idea?

Thanks,

Andy

-- 
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: Entity relationship designing - best practice

2010-12-31 Thread Andy
I have the same question but this is leading to much bigger
relationship model.

As students, they may not have many exams, but I am working on an app
for financial institute so a banking client has more than 100,000,000
transactions for different account.  Therefore, should I group all
transactions into the same entity group of one account or should I
still leave it separate and let an account object contain 100,000,000
keys?

Thanks in advance

WillSpecht wrote:
> http://www.google.com/events/io/2009/sessions/BuildingScalableComplexApps.html
>
> this is a pretty good discussion on building apps that have lots of
> child objects.  I also think you are prematurely optimizing.  How many
> exams is a user going to have? 100, 200? This is still a tiny number
> and if you went with RB's method or the one in the link I posted, you
> have to run a separate query each time, which has its own costs.  I
> think either way is fine until you start having users that have
> thousands of exams.
>
> On Dec 21, 3:05 am, Richard Berger  wrote:
> > Har_Shan:
> >
> > I have been thinking about this topic also (but sadly, am not much of
> > an expert).  I am using Objectify as a layer on top of the Datastore.
> > Their website has a lot of good information on structuring data in the
> > Datastore - 
> > seehttp://code.google.com/p/objectify-appengine/wiki/Concepts?tm=6
> > ).
> >
> > There is also a good post on the various ways of handling 1 to many
> > relationships using Objectify.  What appeared to be something that
> > would work in your situation (which is like my situation) is what I
> > think of as the "database approach".  What I mean by that is, if you
> > had a 1 to many relationship, how would you model that in a database?
> > Specifically if 1 User can have Many Exams, you would have...
> >
> > User table
> > * userId
> > * Other user fields
> >
> > Exam table
> > * examId
> > * userId
> > * Other exam fields
> >
> > So, turning this into GWT/Objectify, it would be
> >
> > public class User  {
> >   @Id private Long id;
> >   // Other user fields
> >
> > }
> >
> > public class Exam{
> >   @Id private Long id;
> >   private Key userKey;
> >   // Other exam fields
> >
> > }
> >
> > The way to find all the exams for a particular user (represented by
> > "this") is:
> >   Objectify ofy = ObjectifyService.begin();
> >   Key userKey = new Key(User.class, this.id);
> >   List result = ofy.query(Exam.class).filter("userKey",
> > userKey).list();
> >
> > This is explained (much better than I could do) 
> > at:http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjec...
> >
> > This may not solve all (or any) of your use cases, but it has worked
> > for me in my admittedly very limited usage.
> > Also check 
> > out:http://groups.google.com/group/objectify-appengine/browse_frm/thread/...
> >
> > Enjoy,
> > RB
> >
> > On Dec 19, 12:17 am, Matej  wrote:
> >
> > > I am not expert in dataStore this is just what I would do:
> > > Add new entity with fields:
> > > ID OrderID UserID ExamID PageID QuestionID AnswerID
> >
> > > Yes it is a lot of redundant data, but simple.
> > > When user starts new Exam, all data are created with AnswerID set to
> > > general answer unAnswer. After that you just update AnswerID.
> >
> > > What are obstacle in design like this?
> >
> > > Best, M

-- 
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] Blobstore Code Works On Dev Server, Not Production

2010-12-07 Thread Andy Haaf
So, I did that, but now I am receiving the following error:


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 19.0px; font:
13.0px Courier New}
java.lang.IllegalStateException: Must be called from a blob upload
callback request




Plus, I needed to change my .jsp form code to a "get" versus a post
which is not what the sample recommended. And once again, this was
working fine on the dev server. Why is production different?

-- 
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 Code Works On Dev Server, Not Production

2010-12-07 Thread Andy Haaf
My blobstore code works just great in the dev server (running on Mac)
but I receive an error when uploading to production. I receive an
Error: HTTP method GET is not supported by this URLeven though the
sample refers to post. As I said, works fine in Dev. Please help!

-- 
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] Where Do I Store Memcache "Cache" Reference?

2010-12-03 Thread Andy
According to the docs, creating memcache for an app is easy but where
do I store the "Cache" reference returned by the CacheFactory? Do I
store it in ServletContext as an attribute? or any other technique?


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] Compare Unowned Key

2010-11-02 Thread Andy
Got it!!!


http://gae-java-persistence.blogspot.com/2010/01/querying-with-key-parameters.html



Thanks Max Ross, the blogger.


Basically I have to use the following syntax instead of regular String
builder:

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height:
15.0px} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco;
color: #492df6} span.s1 {color: #971365} span.s2 {color: #00}
span.Apple-tab-span {white-space:pre}



Query query = pm.newQuery(PField.class,

"pobject == :p");

List results = (List)query.execute(object);

-- 
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] Compare Unowned Key

2010-11-02 Thread Andy
Hello,


I store a KEY in a child object as foreign key kind of thing, then when
I query the child, I use query with following:

Query query = pm.newQuery(PField.class, "pobject
== "+KeyFactory.keyToString(object));


Where PField is the child class, pobject is the KEY foreign key, but
when I execute this, it always returns all PField instances, did I do
anything wrong?


Thanks,


Andy 

-- 
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] Compare Unowned Key

2010-11-01 Thread Andy Leung
Because the key is an unowned foreign key.

Sent from my iPhone

On 2010-11-01, at 6:22 PM, "Ikai Lan (Google)" 
wrote:

If you're searching by key, why not use KeyFactory and get the object
director by key instead? It'll run faster.

--
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 Sun, Oct 31, 2010 at 8:38 PM, Andy  wrote:

> I created unowned key in child objects for query.  When I try to query by
> the key, I tried the following because I read the GQL statement:
>
> "where product = KEY('"+KeyFactory.keyToString(product)+"')");
>
>
> But it complains:
>
>
> SEVERE: Portion of expression could not be parsed: product =
> KEY('aghiYXRoY2FydHINCxIHUHJvZHVjdBgMDA')
>
>
> Please anybody?
>
>
> 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.
>

 --
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] Compare Unowned Key

2010-10-31 Thread Andy
I created unowned key in child objects for query. When I try to query
by the key, I tried the following because I read the GQL statement:


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} span.s1
{color: #492df6}
"where product = KEY('"+KeyFactory.keyToString(product)+"')");




But it complains:




p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco;
color: #ff1b19}

SEVERE: Portion of expression could not be parsed: product =
KEY('aghiYXRoY2FydHINCxIHUHJvZHVjdBgMDA')




Please anybody?




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] Is there a way to turn off Task Queue timeouts?

2010-10-12 Thread andy stevko
I really want to be able to debug step through a Task Queue initiated task
and have it not time out.

 http method POST against URL http://0.0.0.0:8080/task/simple timed out.

Also - have you noticed that the dev server does retry tasks that throw
errors?
This is contrary to the docs - "the development server does not retry tasks.
"

-- 
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] OneToOne relationship with java.lang.Long ids

2010-10-11 Thread andy stevko
The ID for the owned child User instances has to be a Key or String type
because the it contains both the reference to the parent(s) and the unique
id of the object.  A Long alone will not contain enough information to
navigate the object model to it. I usually stick with String ids for all my
types.

You can create/encode/decode Keys easily using the KeyFactory.



On Mon, Oct 11, 2010 at 8:03 PM, Rick Curtis  wrote:

> Hello all! I am new to GAE and have a pretty simple domain model that I'm
> trying to persist. I am creating an Event(with a generated ID) and a
> User(with a pre-defined ID) which is hosting the event. This is a one to one
> relationship owned by the Event(@See below for code snippets).
>
> Upon commiting the transaction, I'm getting an exception which states
> "Error in meta-data for User._id: Cannot have a java.lang.Long primary key
> and be a child object (owning field is Event._host)." I did some searching
> and came across this[1] post which suggested that I need to change my key
> from a java.lang.Long to a com.google.appengine.api.datastore.Key.
>
> Since "The App Engine Java SDK includes an implementation of JPA 1.0 for
> the App Engine datastore"[2]... I don't really need to use these internal
> GAE classes to describe this mapping do I? Maybe I'm being a bit naive here,
> but I have a hard time believing that this requirement/limitation is due to
> the underlying database not being a relational database.
>
> Hopefully someone can shed some light on my findings.
>
> Thanks,
> Rick
>
> @Entity
> public class Event {
> @Id
> @GeneratedValue(strategy=GenerationType.IDENTITY)
> Long _id;
>
> @OneToOne
> User _host;
> ...
> }
>
>
> @Entity
> public class User {
> @Id
> Long _id;
> ...
> }
>
> [1] http://code.google.com/p/datanucleus-appengine/issues/detail?id=26
> [2]http://code.google.com/appengine/docs/java/datastore/usingjpa.html
>
> --
> 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] what is sharding?

2010-10-11 Thread andy stevko
This is a bit of a stretch for this forum.

Perhaps this explanation will help you understand the database design term.
http://stackoverflow.com/questions/992988/what-is-sharding-and-why-is-it-important



On Mon, Oct 11, 2010 at 4:30 AM, sagar misal wrote:

> can  anyone please make me understand what is this sharding and how to
> implement it in java?
>
> --
> 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] Task queue with HTTP POST not working.

2010-10-10 Thread andy stevko
Does your servlet respond to POST requests?
On Oct 10, 2010 10:28 AM, "apple"  wrote:
> I followed the codes in GAE document to make a simple task queue:
>
> Queue queue = QueueFactory.getDefaultQueue();
> queue.add(TaskOptions.Builder.method(TaskOptions.Method.GET).url("/
> security"));
>
> This works perfectly.
>
> However, if I changed method to HTTP POST:
>
> Queue queue = QueueFactory.getDefaultQueue();
>
> queue.add(TaskOptions.Builder.method(TaskOptions.Method.POST).url("/
> security"));
>
> The task is not executed.
>
> What's wrong in my code?
>
> --
> 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] Re: Web Hook - Asynchronous - Where is my response?

2010-10-07 Thread Andy Leung
gotcha, thank you.

On Thu, Oct 7, 2010 at 10:37 AM, John Patterson wrote:

> There is no public API for checking the status of tasks.  A task is really
> nothing more than a normal http request which is monitored by GAE to retry
> it if it fails.  The real brains is in the task queue which is simply a
> queue of URL's that app engine will fire off at a given rate and retry
> failed requests.
>
> The only public method to check tasks (http requests) in this queue is the
> console webpage.  Its up to you to monitor your tasks yourself by storing
> some kind of status data in memcache or the datastore.
>
>
> On 7 Oct 2010, at 20:13, Andy wrote:
>
>  Sorry I don't quite understand your answer, what do you mean by "DataStore
>> Operation"?
>>
>> --
>> 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.
>
>

-- 
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: Many to many relation ship

2010-10-07 Thread Andy
Hi Hadf,


This is how I did it. Basically in RDBMS, it has a running thread that
does the cascaded update/delete and so there is an option for you to
tell the RDBMS to do that automatically for you or not.


In GDataStore, it doesn't have such automation. Instead, you have to
retrieve the associated Key, and delete the associated object. You may
think this is manual process by yourself but it is considerably very
quick since Key is all cached in Google, and if you try to find the Key
(even at root Entity Group), it will return you the associated Object
in lightning short period of time, and then you can perform Update or
Delete yourself.


Having such cascade update/delete automation is good except that you
don't have much control where manual gives you full power to control
the flow such as retrieving external information from web services just
right before you do the cascade update.


Syntax wise, you can use the following if you are using Java:

Employee e = pm.getObjectById(Employee.class, k);

k is the Key object. Assuming you put this key onto web, make sure you
use keyToString and stringToKey methods to encode/decode the key before
you store/retrieve the Key.


hope this helps,


Andy

-- 
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 Hook - Asynchronous - Where is my response?

2010-10-07 Thread Andy
Sorry I don't quite understand your answer, what do you mean
by "DataStore Operation"?

-- 
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] Datastore, Java, JSP, JSON, AJAX, Web Page. Is it going to work?

2010-10-06 Thread andy stevko
Hi  x_maras,

re: using email as a primary key
http://code.google.com/appengine/docs/java/users/overview.html
The User object exposes a unique user ID that is guaranteed to be stable for
the lifetime of the user's account, even if the email address is changed.
You can use this value in a datastore entity key or property value.

re: Datastore, Java, JSP, JSON, AJAX, Web Page
Writing a RESTful service that can respond to AJAX requests with JSON
payloads is very much a mainstream way to do things on app-engine.
Be careful to keep the processing response times really short. The max
response time is 30 seconds, the sweet spot is to average about 1 second
response time.

Happy Coding,
--Stevko


On Wed, Oct 6, 2010 at 4:34 PM, x_maras  wrote:

> Hi,
>
> I am new to GAE and I want to make a web application page on it.
> I was used to work with PHP for web applications but lately I am
> struggling to get in the thinking of a GAE web application.
>
> After reading tutorials and trying to do different things I came up
> with a thinking how I want my project to be and how to make the
> communication through the different layers. I will explain you my
> thinking and I would like to tell me if am I in the right way and if I
> am not I would like someone to put back into it.
>
> e.g.
>
> I thought to have a user @persistent class for storing the information
> of a user, such as name, email(as a primary key), registration date
> etc... (I will use the User class for logging in, but I want to keep
> some data also for every user)
>
> Then I need to create a java (dao) class that reads and inserts data
> to the datastore "tables-objects". I thought to create a different one
> for each @persistent class
>
> Then Java files that execute the  functions from the DAO classes and
> give information to the jsp files which through JSON give information
> to the Ajax functions in the HTML page (which I was thinking also to
> be the welcome-file in my web.xml)
>
> So here comes the questions. Is something like this right? Is it going
> to work? And if not what do you propose me to do.
>
> Any links or examples are very very welcome.
>
> --
> 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: Web Hook - Asynchronous - Where is my response?

2010-10-06 Thread Andy
Thanks for your quick reply Robert.


So is there a way to check the task status by task ID or some sort?

-- 
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] Web Hook - Asynchronous - Where is my response?

2010-10-06 Thread Andy
Hi,


I have read the Task API for many times and am still confused about the
web hook. If web hook is asynchronous, where do I get the signal (like
Future) that my task is completed and where do I get the response of
the web hook request?


Thanks,


Andy

-- 
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] Many to many relation ship

2010-10-06 Thread andy stevko
Not sure why the datastore needs to know that a Car is associated with a
particular User.
There is no easy way for the datastore to handle cascading deletes in a
M-to-M relationship w/o reference counting.
Also setting the Fetch policy to load children with the parent load is not
an option due to them being in separate entity groups.

Regardless, you can use
 
*getObjectById
*(java.lang.Class cls, java.lang.Object key)

to verify the Key is referencing a particular class and an object exists.


On Wed, Oct 6, 2010 at 2:15 PM, hadf  wrote:

> Hello,
>
> I read that many to many relation ship must resolved by using sets of
> Key.
> But what I don't understand is how do I specify the type the Key is
> referencing.
> I mean that if I have a many to many relation ship between Car and
> User, how jpa or jdo knows that Car is associated to User ?
>
> public class Car {
>@OneToMany
>private Set users; //this relation ship is untyped
> }
>
> --
> 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] is there any proper way to create shortcut(s) for the current window object in gwt

2010-10-03 Thread andy stevko
 google-appengine-java  is probably
the wrong group to ask this question.
http://groups.google.com/group/google-web-toolkit is a better community for
GWT questions.

Also - did your Widget has focus when you used the keyboard?

On Sun, Oct 3, 2010 at 2:30 AM, wingdings  wrote:

> just for like CTRL+1 or CTRL+2 .. how do i assigns shortcuts ?
>
> something like this i did but it aint executing , also am i doing it
> right ?
> mayday mayday !
>
> public class quotation implements KeyboardListener
> {
>
> public static Widget getSomeWidget()
> {
>
> return new Widget;
> }
> @Override
>public void onKeyDown(Widget sender, char keyCode, int modifiers) {
>// TODO Auto-generated method stub
>
>}
>
>@Override
>public void onKeyPress(Widget sender, char keyCode, int modifiers) {
>if(KeyboardListener.KEY_CTRL == keyCode)
>{
>
>}
>
>}
>
>@Override
>public void onKeyUp(Widget sender, char keyCode, int modifiers) {
>// TODO Auto-generated method stub
>
>}
> }
>
> --
> 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] Simplest key query

2010-10-02 Thread andy stevko
Hi Paul,

FWIW, Here is a slightly edited version of my JDO query by id.
Perhaps it can help you get over this bump.

@SuppressWarnings("unchecked")
public Account lookupAccountById( PersistenceManager pm, Long accountId) {
logger.fine("looking up account id=" + accountId );
// look up
Query q1 = pm.newQuery(Account.class, "id == accountId");
q1.declareParameters("Long accountId");
List accounts = (List) q1.execute(accountId);
if (accounts == null || accounts.isEmpty()) {
logger.warning("Account Id = " + accountId + " not found.");
return null;
}
return (accounts.get(0));
}





On Fri, Oct 1, 2010 at 4:13 PM, Paul  wrote:

> Hi,
>
> I must admit that my db knowledge is very lacking, thus I need some
> help with making a simple query. I know I am just missing smth obvious
> and easy.
>
> Anyway, what I need is just a boolean method to check if enity
> exists.
>
> I am using Guice too, for binding all stuff.
>
> I know that the query syntax is SELECT * FROM entity WHERE __key__ =
> KEY('entity', 'key name')
>
> My class for DB queries looks like that [yeah, from gae-wicket
> template]:
>
> public abstract class JdoQueries
> {
>private final Class clazz;
>private final Provider pmProvider;
>
>protected JdoQueries(Class clazz, Provider
> pmProvider)
>{
>this.clazz = clazz;
>this.pmProvider = pmProvider;
>}
>
>protected Query newQuery()
>{
>return pmProvider.get().newQuery(clazz);
>}
>
>@SuppressWarnings("unchecked")
>protected Collection toCollection(Object queryResult)
>{
>return (Collection) queryResult;
>}
>
>protected List toList(Object queryResult)
>{
>return new ArrayList(toCollection(queryResult));
>}
> }
>
>
> I know I should create public interface for query I need, then create
> a class extending JdoQueries and implementing my interface, but it's
> just theory and I cannot write that final part :)
>
> --
> 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] Re: Creating Folder/Directory at Runtime

2010-10-01 Thread andy stevko
I don't see how this could work without updating the deployed image.

What I mean is that if one deployed instance was able to create the
directory or alter any of the files in the deployed image, none of these
changes are replicated to other deployed instances.

Perhaps you can script the file system changes you desire and have them
pushed out as a deployed new version? You may be able to do that using an
automated change/build/test/deploy tool like Cruise.


On Fri, Oct 1, 2010 at 3:53 AM, jr  wrote:

> Thank you for the quick response. However it is said that files in WAR
> are accessible to the application via the filesystem. Does that mean
> that I can create a directory at runtime in the /war directory? Or the
> statement means another thing? I wish to create a directory at runtime
> so I can create a "domain". For example, if I have www.webpage.com, I
> will create a domain new_domain. I will then have
> www.webpage.com/new_domain/
> if I can create this directory at runtime. Thanks again!
>
> On Oct 1, 11:00 am, andy stevko  wrote:
> > No - all local disk write access is not permitted.
> >
> > http://code.google.com/appengine/docs/java/runtime.html
> > The Filesystem
> >
> > A Java application cannot use any classes used to write to the
> filesystem,
> > such as java.io.FileWriter. An application can read its own files from
> the
> > filesystem using classes such as java.io.FileReader. An application can
> also
> > access its own files as "resources", such as with Class.getResource() or
> > ServletContext.getResource().
> >
> > Only files that are considered "resource files" are accessible to the
> > application via the filesystem. By default, all files in the WAR are
> > "resource files." You can exclude files from this set using the
> > appengine-web.xml<
> http://code.google.com/appengine/docs/java/config/appconfig.html>
> >  file.
> >
> > On Thu, Sep 30, 2010 at 6:52 PM, Norberto Ramirez II <
> ramirez.j...@gmail.com
> >
> >
> >
> >
> >
> >
> >
> > > wrote:
> > > Hi!
> >
> > > Is creating a folder at runtime allowed? I was trying to create a
> folder
> > > but I'm getting the following error.
> > > *java.security.AccessControlException: access denied
> > > (java.io.FilePermission \testfolder write)*
> >
> > > Thank you!
> >
> > > --
> > > 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.
>
>

-- 
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] JDO unique Long ID keys across entity groups

2010-09-30 Thread andy stevko
Perhaps you can weaken the P-C relationship by making C separate entities
and, instead of P storing a list of C objects, P stores a list of C ids.


On Thu, Sep 30, 2010 at 3:28 AM, Fred  wrote:

> Hi Group,
>
> I know key ids are only unique across entity groups so what GAE + JDO
> gives me is:
> /Parent[1]/Child[1]
> /Parent[1]/Child[2]
> /Parent[1]/Child[3]
>
> /Parent[2]/Child[1]
> /Parent[2]/Child[2]
>
> /Parent[3]/Child[1]
>
> etc.
>
> What I need to achieve (aka implement) is a way to assign keys in the
> following fashion:
> /Parent[1]/Child[1]
> /Parent[1]/Child[2]
> /Parent[1]/Child[3]
>
> /Parent[2]/Child[4]
> /Parent[2]/Child[5]
>
> /Parent[3]/Child[6]
>
> etc... so child ids are in sequence across entity groups (or at least
> unique). Does anyone have experience with this or any thoughts on how
> to go about it in a secure fashion?
> I can't seem to come up with a secure way of doing this, but don't
> want to give up on it because it would give my use case a lot of
> querying power.
>
> Hope someone can help.
> Thanks in advance,
> Fred
>
>
> --
> 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] Creating Folder/Directory at Runtime

2010-09-30 Thread andy stevko
No - all local disk write access is not permitted.

http://code.google.com/appengine/docs/java/runtime.html
The Filesystem

A Java application cannot use any classes used to write to the filesystem,
such as java.io.FileWriter. An application can read its own files from the
filesystem using classes such as java.io.FileReader. An application can also
access its own files as "resources", such as with Class.getResource() or
ServletContext.getResource().

Only files that are considered "resource files" are accessible to the
application via the filesystem. By default, all files in the WAR are
"resource files." You can exclude files from this set using the
appengine-web.xml
 file.


On Thu, Sep 30, 2010 at 6:52 PM, Norberto Ramirez II  wrote:

> Hi!
>
> Is creating a folder at runtime allowed? I was trying to create a folder
> but I'm getting the following error.
> *java.security.AccessControlException: access denied
> (java.io.FilePermission \testfolder write)*
>
> Thank you!
>
> --
> 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] Problem with persist a child class

2010-09-30 Thread andy stevko
My only thought is that you should clean your project and have datanucleus
rebuild the persistent classes entirely.


On Wed, Sep 29, 2010 at 2:34 PM, lisandrodc  wrote:

> Hi andy! I have tried delete my local_db and the problem persist.
> The exception is in the next code, in the call of the build method
> "RegFechaUsuario":
>
> ControladorFecha cF = new ControladorFecha();
>System.out.println("nombre " +
> nuevaFecha.getNombre());
>System.out.println("fecha ini " +
> fechaOriginal.getFechaIni());
>System.out.println("fecha fin " +
> fechaOriginal.getFechaFin());
>System.out.println("idUsuario " + idUsuario);
>System.out.println("idFecha " +
> fechaOriginal.getId().getId());
>System.out.println("partidos " +
> nuevaFecha.getPartidos());
> /*Here print in console:
> na fecha 4
> us id 7
> nombre f1
> fecha ini Fri Jan 01 00:00:00 UTC 2010
> fecha fin Fri Jan 01 00:00:00 UTC 2010
> idUsuario 7
> idFecha 4
> partidos [model.part...@973678]*/
>RegFechaUsuario regFechaUsuario = new
>
> RegFechaUsuario(nuevaFecha.getNombre(),fechaOriginal.getFechaIni(),fechaOriginal.getFechaFin(),idUsuario,fechaOriginal.getId().getId(),nuevaFecha.getPartidos());
>cF.crearRegFechaUsuario(regFechaUsuario);
>
> .
>
> The code of method:
>
> public void crearRegFechaUsuario(RegFechaUsuario regFechaUsuario) {
>
>Transaction tx = pm.currentTransaction();
>try {
>tx.begin();
>//here is exception
>pm.makePersistentAll(regFechaUsuario);
>tx.commit();
>} finally {
>// pm.close();
>if (tx.isActive()) {
>tx.rollback();
>}
>}
>
>}
>
> --
> 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] Re: Not Able To Move To The Cloud

2010-09-29 Thread andy stevko
Yes, it is simple - You are missing the leading slash in your .

Perhaps you can learn how to configure tomcat web.xml files with this very
nice blog post.
http://tomcat-configure.blogspot.com/2009/01/tomcat-web-xml.html

You can also learn how what matches the regular expression by using this
tester tool:
http://www.regular-expressions.info/javascriptexample.html


On Wed, Sep 29, 2010 at 8:36 AM, turncom wrote:

> Yo! Google folkshelp us out here!
>
> As I understand it, appengine-web.xml has the application id, which in
> my case is jwigapp. That is how it knows which application of yours to
> apply the upload to. (I think we can have 9 or 10 apps). And that is
> the name of the application to the world.
>
> So, I changed my web.xml back to Guestbook, as it has always been
> until this morning's experiment, and tried to upload it, and here are
> the messages I got:
>
>
> **
> Creating staging directory
> Scanning for jsp files.
> Compiling jsp files.
> Scanning files on local disk.
> Initiating update.
> java.io.IOException: Error posting to URL:
>
> https://appengine.google.com/api/appversion/create?app_id=jwigapp&version=2&;
> 400 Bad Request
> Error when loading application configuration:
> Unable to assign value 'Guestbook' to attribute 'url':
> Value 'Guestbook' for key url does not match expression '^(?!\^)/|\.|(\
> (.).*(?!\$).$'
>
> ***
>
> Again, I wonder what that regular expression means, and why I am told
> it violates it, and how to fix it.
>
> This has GOT to be really simple.
>
>
>
> On Sep 29, 10:15 am, "David C. Hicks"  wrote:
> >   Someone hopefully will correct me if I'm wrong about these...
> >
> > I believe that the  name in appengine.xml must match the
> > name of the application as it is defined on Google.  So, if you're
> > trying to upload to an application named "guestbook", then you need to
> > change it to be "guestbook" in appengine.xml.
> >
> > Also, make sure that you have defined it correctly in the Project setup
> > in Eclipse.  Right-click on the Project, select "Properties", then look
> > for the "Google" section.  There is a place to define the application
> > name in there, as well.
> >
> > Dave
> >
> > On 09/29/2010 10:56 AM, turncom wrote:
> >
> >
> >
> > > My application id is jwigapp.  The application is the example,
> > > Guestbook, from the AppEngine website, for Java. No state secrets
> > > there.
> >
> > > So, here is my appengine-web.xml
> >
> > > http://appengine.google.com/ns/1.0";>
> > >jwigapp
> > >2
> >
> > >
> > >
> > > value="WEB-INF/
> > > logging.properties"/>
> > >
> >
> > > 
> >
> > > Now, this morning I got an idea. Maybe I should change my web.xml to
> > > reflect my jwigapp name. So here is what it looks like now (in part):
> >
> > >
> > >guestbook
> > >guestbook.GuestbookServlet
> > >
> > >
> > >guestbook
> > >jwigapp
> > >
> >
> > > I did this thinking perhaps that would help. It works on my computer.
> > > But here is the error message I get when I try to upload it using the
> > > Google Plugin:
> >
> > > Creating staging directory
> > > Scanning for jsp files.
> > > Compiling jsp files.
> > > Scanning files on local disk.
> > > Initiating update.
> > > java.io.IOException: Error posting to URL:
> > >https://appengine.google.com/api/appversion/create?app_id=jwigapp&ver.
> ..
> > > 400 Bad Request
> > > Error when loading application configuration:
> > > Unable to assign value 'jwigapp' to attribute 'url':
> > > Value 'jwigapp' for key url does not match expression '^(?!\^)/|\.|(\
> > > (.).*(?!\$).$'
> >
> > > I am guessing that expression is a regular expression, which I don't
> > > know how to understand.
> >
> > > I have a feeling the answer is very simple, and that I am looking
> > > right at it, and just miss it.
> >
> > > I have a presentation tomorrow and I would like to show it off.
> >
> > > Gr.
> >
> > > On Sep 28, 7:28 pm, "David C. Hicks"  wrote:
> > >>It sounds like the application id you've given to your local
> > >> application isn't the same as the application you created on
> AppEngine.
> > >> You might want to verify that you're uploading to an application that
> is
> > >> valid.
> >
> > >> Dave
> >
> > >> On 09/28/2010 07:35 PM, turncom wrote:
> >
> > >>>  I am using Eclipse (I'm a newbie with Eclipse) and Java
> (which
> > >>>  I know).
> > >>> The app I created (the standard Guestbook) works on my laptop. When I
> > >>> attempt to upload it using the Google Plugin (and on the command
> line,
> > >>> too, for that matter) I get this message:
> > >>> Unable to update app: Error posting to URL:
> > >>>
> https://appengine.google.com/api/appversion/create?app_id=jwigapp&ver...
> > >>> <
> https://appengine.google.com/api/appversio

Re: [appengine-java] Re: Not Able To Move To The Cloud

2010-09-29 Thread andy stevko
Dave is correct the  tag must match the app id.
The  is best incremented from deployment to deployment as well.
This is easily maintained using the eclipse project properties google
appengine tab.

Your web xml url pattern is the problem.
Try using a absolute uri rather than a relative uri as the regular
expression decodes to.
/jwigapp


On Wed, Sep 29, 2010 at 8:15 AM, David C. Hicks  wrote:

>  Someone hopefully will correct me if I'm wrong about these...
>
> I believe that the  name in appengine.xml must match the name
> of the application as it is defined on Google.  So, if you're trying to
> upload to an application named "guestbook", then you need to change it to be
> "guestbook" in appengine.xml.
>
> Also, make sure that you have defined it correctly in the Project setup in
> Eclipse.  Right-click on the Project, select "Properties", then look for the
> "Google" section.  There is a place to define the application name in there,
> as well.
>
> Dave
>
>
> On 09/29/2010 10:56 AM, turncom wrote:
>
>> My application id is jwigapp.  The application is the example,
>> Guestbook, from the AppEngine website, for Java. No state secrets
>> there.
>>
>> So, here is my appengine-web.xml
>>
>> http://appengine.google.com/ns/1.0";>
>>jwigapp
>>2
>>
>>
>>
>>> value="WEB-INF/
>> logging.properties"/>
>>
>>
>> 
>>
>>
>> Now, this morning I got an idea. Maybe I should change my web.xml to
>> reflect my jwigapp name. So here is what it looks like now (in part):
>>
>>
>>guestbook
>>guestbook.GuestbookServlet
>>
>>
>>guestbook
>>jwigapp
>>
>>
>> I did this thinking perhaps that would help. It works on my computer.
>> But here is the error message I get when I try to upload it using the
>> Google Plugin:
>>
>> Creating staging directory
>> Scanning for jsp files.
>> Compiling jsp files.
>> Scanning files on local disk.
>> Initiating update.
>> java.io.IOException: Error posting to URL:
>>
>> https://appengine.google.com/api/appversion/create?app_id=jwigapp&version=2&;
>> 400 Bad Request
>> Error when loading application configuration:
>> Unable to assign value 'jwigapp' to attribute 'url':
>> Value 'jwigapp' for key url does not match expression '^(?!\^)/|\.|(\
>> (.).*(?!\$).$'
>>
>>
>> I am guessing that expression is a regular expression, which I don't
>> know how to understand.
>>
>> I have a feeling the answer is very simple, and that I am looking
>> right at it, and just miss it.
>>
>> I have a presentation tomorrow and I would like to show it off.
>>
>> Gr.
>>
>>
>>
>> On Sep 28, 7:28 pm, "David C. Hicks"  wrote:
>>
>>>   It sounds like the application id you've given to your local
>>> application isn't the same as the application you created on AppEngine.
>>>  You might want to verify that you're uploading to an application that is
>>> valid.
>>>
>>> Dave
>>>
>>> On 09/28/2010 07:35 PM, turncom wrote:
>>>
>>>
>>>
>>>
>>>
>>>  I am using Eclipse (I'm a newbie with Eclipse) and Java (which
 I know).
 The app I created (the standard Guestbook) works on my laptop. When I
 attempt to upload it using the Google Plugin (and on the command line,
 too, for that matter) I get this message:
 Unable to update app: Error posting to URL:
 https://appengine.google.com/api/appversion/create?app_id=jwigapp&ver.
 ..
 <
 https://appengine.google.com/api/appversion/create?app_id=jwigapp&ver..
 .>
 400 Bad Request
 Error when loading application configuration:
 Unable to assign value 'guestbook' to attribute 'url':
 Value 'guestbook' for key url does not match expression
 '^(?!\^)/|\.|(\(.).*(?!\$).$'
 So..what am I doing wrong? Is there something I am missing in
 configuring Eclipse? I've been banging my head on this for two days. I
 will do a presentation on Thursday, and I would love to show this off.
 --
 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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send emai

Re: [appengine-java] Re: Urgent: Getting only Server Error (500) since ~12:30 am (September 28th)

2010-09-28 Thread andy stevko
Ditto on the high error rate on my app too.

app_id=ninuku-archivist

Whats going on here??

On Tue, Sep 28, 2010 at 8:08 AM, mscwd01  wrote:

> I've been getting the second issue you mentioned for the last few
> days. Sometimes the error rate is above 50%. Don't expect to get any
> help from Google employees though, I've tried and got nowhere. It
> makes you wonder if they care any more.
>
> On Sep 28, 10:37 am, Lior Harsat  wrote:
> > Hi ,
> >
> > Our production server (application id = farmigo-csa) is experiencing
> > an alarming error rate (close to 100%) for any request processed by
> > App Engine.
> > The log shows a couple of repeating messages:
> > 1. "A serious problem was encountered with the process that handled
> > this request, causing it to exit. This is likely to cause a new
> > process to be used for the next request to your application. If you
> > see this message frequently, you should contact the App Engine team."
> > 2. "Request was aborted after waiting too long to attempt to service
> > your request. This may happen sporadically when the App Engine serving
> > cluster is under unexpectedly high or uneven load. If you see this
> > message frequently, please contact the App Engine team."
> >
> > Our server is not under high load.
> > Our customers are already reporting this issue.
> > Please help as soon as possible.
>
> --
> 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] Re: Problem with persist a child class

2010-09-25 Thread andy stevko
Hi Lisandro,
Perhaps you didn't understand my last line of reasoning re: is your
datastore empty...
I suspect that the schema for your classes has migrated - i.e. a member that
was Long and is now String or vice-versa

A close read of the datastore docs says:
http://code.google.com/appengine/docs/java/datastore/dataclasses.html

If an entity has a property whose value is of a different type than the
corresponding field in the object, JDO attempts to cast the value to the
field type. If the value cannot be cast to the field type, JDO throws a
ClassCastException. In the case of numbers (long integers and double-width
floats), the value is converted, not cast. If the numeric property value is
larger than the field type, the conversion overflows without throwing an
exception.

--Andy

On Sat, Sep 25, 2010 at 1:40 PM, lisandrodc  wrote:

> Hi! Andy I can't change the type of a member from String to Long
> becasue
> it is an internal error of datanucleus in google apps, I I do not find
> way of solving it.
> All the exception is:
>
> Problem accessing /Prode/JugarFecha.action. Reason:
>
>java.lang.Long cannot be cast to java.lang.String
>
> Caused by:
>
> java.lang.ClassCastException: java.lang.Long cannot be cast to
> java.lang.String
>at
>
> org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch(DatastoreRelationFieldManager.java:
> 202)
>

-- 
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] Problem with persist a child class

2010-09-24 Thread andy stevko
I've managed to make class inheritance work for me using JDO.
The only difference I see between my annotations and yours is I'm using
@Inheritance(customStrategy = "complete-table")

InheritanceStrategy
*COMPLETE_TABLE
*
Another idea is to trim your class members down to see exactly which one(s)
is producing the type conflict.

Lastly, I'm not sure that class inheritance is the problem at all...
Are you working with a totally empty datastore?
Did you change the type of a member from String to Long?


On Sun, Sep 19, 2010 at 7:22 AM, lisandrodc  wrote:

> Hi! I have a problem with persist a child class.
> The classes are:
>
> The parent class:
>
>
> @PersistenceCapable
>
> @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> public  abstract class Fecha   {
>
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Key id;
>@Persistent
>private String nombre;
>@Persistent
>private Date fechaIni;
>@Persistent
>private Date fechaFin;
>
>@Persistent(defaultFetchGroup = "true")
>List partidos;
>
> The child class:
>
> @PersistenceCapable
>
> public class RegFechaUsuario extends Fecha  {
>
>@Persistent
>private int puntos;
>@Persistent
>private Long idUsuarioFecha;
>@Persistent
>private Long idFechaOriginal;
>
>
> And the code of run the exception is:
> Transaction tx = pm.currentTransaction();
>try {
>tx.begin();
>
>pm.makePersistentAll(regFechaUsuario);
>  //here is the exception
>tx.commit();
>
> And the regFechaUsuario is created with the build:
>
> public RegFechaUsuario(String nombre, Date fechaIni, Date fechaFin,
> Long idUsuarioFecha, Long idFechaOriginal,
> Listpartidos)
> {
>//super(nombre,fechaIni,fechaFin,partidos);
>this.puntos = 0;
>this.idUsuarioFecha = idUsuarioFecha;
>this.idFechaOriginal = idFechaOriginal;
>this.partidos=partidos;
>}
>
> The exception is:
> Problem accessing /Prode/JugarFecha.action. Reason:
>
>java.lang.Long cannot be cast to java.lang.String
>
> Caused by:
>
> java.lang.ClassCastException: java.lang.Long cannot be cast to
> java.lang.String
>at
>
> org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch(DatastoreRelationFieldManager.java:
> 202)
>at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> $1.setObjectViaMapping(DatastoreRelationFieldManager.java:133)
>at org.datanucleus.store.appengine.DatastoreRelationFieldManager
> $1.apply(DatastoreRelationFieldManager.java:112)
>at
>
> org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations(DatastoreRelationFieldManager.java:
> 81)
>at
>
> org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations(DatastoreFieldManager.java:
> 955)
>at
>
> org.datanucleus.store.appengine.DatastorePersistenceHandler.storeRelations(DatastorePersistenceHandler.java:
> 546)
>at org.datanucleus.store.appengine.DatastorePersistenceHandler.
>
> Regards
> Lisandro
>
> --
> 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] Re: problem, please help me

2010-09-18 Thread andy stevko
Managing datastore indexes are an unexpected bump in the road to using a
production GAE but the documentation is very concise and fairly complete.

Did the deployment console report "Uploading index definitions." and
complete successfully?
Did the dashboard "Datastore Indexes"  page report the index is defined?
being built?

You should set autoGenerate="false"  if you want to manually define the
indexes.



On Fri, Sep 17, 2010 at 5:24 PM, Ahmed Shoeib  wrote:

> but i wanna to tell you another query for this Table
> done successfully
>
> i don't know why this problem done ??
>
> On Sep 18, 3:20 am, Ahmed Shoeib 
> wrote:
> > i removed the datastore-indexes-auto.xml
> >
> > and replaced it by datastore-indexes.xml
> > and make these indexes
> >
> > 
> >
> > 
> >
> > 
> > 
> >     
> > 
> > 
> >
> > 
> >
> > and nothing done ?
> >
> > what can i do else ???
> >
> > On Sep 18, 1:43 am, andy stevko  wrote:
> >
> > > Perhaps you can figure this out by understanding way in which these
> files
> > > are used as described athttp://
> code.google.com/appengine/docs/java/config/indexconfig.html#Us...
> >
> > > On Fri, Sep 17, 2010 at 3:36 PM, Ahmed Shoeib <
> ahmedelsayed.sho...@gmail.com
> >
> > > > wrote:
> > > > i found these indexes for quote
> >
> > > > 
> > > > 
> > > >
> > > >
> >
> > > > what is the problem in it ??
> >
> > > > On Sep 18, 12:51 am, andy stevko  wrote:
> > > > > Seems pretty straight forward You need to define an index for
> 'Quote'
> > > > > I suggest looking at
> > > > > .../war/WEB-INF/appengine-generated/datastore-indexes.xml and
> > > > > datastore-indexes-auto.xml
> > > > > and correct the settings.
> > > >
> http://code.google.com/appengine/docs/java/datastore/queriesandindexe...
> >
> > > > > There could also be a chance that the Quote index is still being
> built.
> > > >https://appengine.google.com/datastore/indexes
> >
> > > > > On Fri, Sep 17, 2010 at 2:05 PM, Ahmed Shoeib <
> > > > ahmedelsayed.sho...@gmail.com
> >
> > > > > > wrote:
> > > > > > my code work very well in my localhost
> > > > > > after a time from uploading the code on appspot
> > > > > > i face this problem
> >
> > > > > > what is this problem 
> > > > > > how i can solve it ?
> >
> > > > > > 
> > > > > > 1 - First This is Warning###
> > > > > > 
> >
> > > > > > W 09-17 01:38PM 17.629
> >
> > > > > > /api/quote
> > > > > > com.google.appengine.api.datastore.DatastoreNeedIndexException:
> no
> > > > > > matching index found..   > > > > > ancestor="false" source="manual">
> > > > > >
> > > > > >
> > > > > >
> >
> > > > > >at
> >
> > > >
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
> > > > > > 40)
> > > > > >at
> >
> > > >
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
> > > > > > 67)
> > > > > >at
> >
> > > >
> com.google.appengine.api.datastore.PreparedQueryImpl.runQuery(PreparedQueryImpl.java:
> > > > > > 127)
> > > > > >at
> >
> > > >
> com.google.appengine.api.datastore.PreparedQueryImpl.asIterator(PreparedQueryImpl.java:
> > > > > > 87)
> > > > > >at com.google.appengine.api.datastore.PreparedMultiQuery
> > > > > >
> $DedupingMultiQueryIterator.getNextIterator(PreparedMultiQuery.java:
> > > > > > 154)
> > > > > >at com.google.appengine.api.datastore.PreparedMultiQuery
> > > > > >
> $DedupingMultiQueryIterator.computeNext(PreparedMultiQuery.java:173)
> > > > > >at com.google.appengine.api.datastore.PreparedMultiQuery
> > > > > >
> $DedupingMul

Re: [appengine-java] Re: problem, please help me

2010-09-17 Thread andy stevko
Perhaps you can figure this out by understanding way in which these files
are used as described at
http://code.google.com/appengine/docs/java/config/indexconfig.html#Using_Automatic_Index_Configuration




On Fri, Sep 17, 2010 at 3:36 PM, Ahmed Shoeib  wrote:

> i found these indexes for quote
>
> 
> 
>
>
>
> what is the problem in it ??
>
> On Sep 18, 12:51 am, andy stevko  wrote:
> > Seems pretty straight forward You need to define an index for 'Quote'
> > I suggest looking at
> > .../war/WEB-INF/appengine-generated/datastore-indexes.xml and
> > datastore-indexes-auto.xml
> > and correct the settings.
> http://code.google.com/appengine/docs/java/datastore/queriesandindexe...
> >
> > There could also be a chance that the Quote index is still being built.
> https://appengine.google.com/datastore/indexes
> >
> > On Fri, Sep 17, 2010 at 2:05 PM, Ahmed Shoeib <
> ahmedelsayed.sho...@gmail.com
> >
> > > wrote:
> > > my code work very well in my localhost
> > > after a time from uploading the code on appspot
> > > i face this problem
> >
> > > what is this problem 
> > > how i can solve it ?
> >
> > > 
> > > 1 - First This is Warning###
> > > 
> >
> > > W 09-17 01:38PM 17.629
> >
> > > /api/quote
> > > com.google.appengine.api.datastore.DatastoreNeedIndexException: no
> > > matching index found..   > > ancestor="false" source="manual">
> > >
> > >
> > >
> >
> > >at
> >
> > >
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
> > > 40)
> > >at
> >
> > >
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
> > > 67)
> > >at
> >
> > >
> com.google.appengine.api.datastore.PreparedQueryImpl.runQuery(PreparedQueryImpl.java:
> > > 127)
> > >at
> >
> > >
> com.google.appengine.api.datastore.PreparedQueryImpl.asIterator(PreparedQueryImpl.java:
> > > 87)
> > >at com.google.appengine.api.datastore.PreparedMultiQuery
> > > $DedupingMultiQueryIterator.getNextIterator(PreparedMultiQuery.java:
> > > 154)
> > >at com.google.appengine.api.datastore.PreparedMultiQuery
> > > $DedupingMultiQueryIterator.computeNext(PreparedMultiQuery.java:173)
> > >at com.google.appengine.api.datastore.PreparedMultiQuery
> > > $DedupingMultiQueryIterator.computeNext(PreparedMultiQuery.java:98)
> > >at
> >
> > >
> com.google.appengine.api.datastore.AbstractIterator.tryToComputeNext(AbstractIterator.java:
> > > 52)
> > >at
> >
> > >
> com.google.appengine.api.datastore.AbstractIterator.hasNext(AbstractIterator.java:
> > > 47)
> > >at com.google.appengine.api.datastore.BasePreparedQuery
> > > $UncompilablePreparedQuery$1.hasNext(BasePreparedQuery.java:78)
> > >at
> >
> > >
> org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterator.hasNext(RuntimeExceptionWrappingIterator.java:
> > > 44)
> > >at
> >
> > >
> org.datanucleus.store.appengine.query.LazyResult.resolveAll(LazyResult.java:
> > > 115)
> > >at
> > > org.datanucleus.store.appengine.query.LazyResult.size(LazyResult.java:
> > > 110)
> > >at
> >
> > >
> org.datanucleus.store.appengine.query.StreamingQueryResult.size(StreamingQueryResult.java:
> > > 124)
> > >at
> > >
> com.fuoeg.dailyquote.api.DailyQuoteService.doGet(DailyQuoteService.java:
> > > 39)
> > >at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
> > >at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> > >at
> > > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> > > 511)
> > >at org.mortbay.jetty.servlet.ServletHandler
> > > $CachedChain.doFilter(ServletHandler.java:1166)
> > >at
> >
> > >
> com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:
> > > 97)
> > >at org.mortbay.jetty.servlet.ServletHandler
> > > $CachedChain.doFilter(ServletHandler.java:1157)
&

Re: [appengine-java] problem, please help me

2010-09-17 Thread andy stevko
Seems pretty straight forward You need to define an index for 'Quote'
I suggest looking at
.../war/WEB-INF/appengine-generated/datastore-indexes.xml and
datastore-indexes-auto.xml
and correct the settings.
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Defining_Indexes_With_Configuration

There could also be a chance that the Quote index is still being built.
https://appengine.google.com/datastore/indexes


On Fri, Sep 17, 2010 at 2:05 PM, Ahmed Shoeib  wrote:

> my code work very well in my localhost
> after a time from uploading the code on appspot
> i face this problem
>
> what is this problem 
> how i can solve it ?
>
>
> 
> 1 - First This is Warning###
> 
>
> W 09-17 01:38PM 17.629
>
> /api/quote
> com.google.appengine.api.datastore.DatastoreNeedIndexException: no
> matching index found..   ancestor="false" source="manual">
>
>
>
>
>
>at
>
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
> 40)
>at
>
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
> 67)
>at
>
> com.google.appengine.api.datastore.PreparedQueryImpl.runQuery(PreparedQueryImpl.java:
> 127)
>at
>
> com.google.appengine.api.datastore.PreparedQueryImpl.asIterator(PreparedQueryImpl.java:
> 87)
>at com.google.appengine.api.datastore.PreparedMultiQuery
> $DedupingMultiQueryIterator.getNextIterator(PreparedMultiQuery.java:
> 154)
>at com.google.appengine.api.datastore.PreparedMultiQuery
> $DedupingMultiQueryIterator.computeNext(PreparedMultiQuery.java:173)
>at com.google.appengine.api.datastore.PreparedMultiQuery
> $DedupingMultiQueryIterator.computeNext(PreparedMultiQuery.java:98)
>at
>
> com.google.appengine.api.datastore.AbstractIterator.tryToComputeNext(AbstractIterator.java:
> 52)
>at
>
> com.google.appengine.api.datastore.AbstractIterator.hasNext(AbstractIterator.java:
> 47)
>at com.google.appengine.api.datastore.BasePreparedQuery
> $UncompilablePreparedQuery$1.hasNext(BasePreparedQuery.java:78)
>at
>
> org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterator.hasNext(RuntimeExceptionWrappingIterator.java:
> 44)
>at
>
> org.datanucleus.store.appengine.query.LazyResult.resolveAll(LazyResult.java:
> 115)
>at
> org.datanucleus.store.appengine.query.LazyResult.size(LazyResult.java:
> 110)
>at
>
> org.datanucleus.store.appengine.query.StreamingQueryResult.size(StreamingQueryResult.java:
> 124)
>at
> com.fuoeg.dailyquote.api.DailyQuoteService.doGet(DailyQuoteService.java:
> 39)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> 511)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1166)
>at
>
> com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:
> 97)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>at
>
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
> 35)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>at
>
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
> 43)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> 388)
>at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> 216)
>at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> 182)
>at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> 765)
>at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> 418)
>at
>
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
> 238)
>at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> 152)
>at org.mortbay.jetty.Server.handle(Server.java:326)
>at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> 542)
>at org.mortbay.jetty.HttpConnection
> $RequestHandler.headerComplete(HttpConnection.java:923)
>at
>
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
> 76)
>at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>at
>
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
> 135)
>at
> com.

Re: [appengine-java] [IDEA] Circumventing app engine cold start with a warm up

2010-09-16 Thread andy stevko
I was just thinking about this issue during an interview this morning.

I like your initServlet idea and think that it could also be used during
takedown to cleanup any external resources (like batched sequence counters).

An alternative for the scaling from 1 server to many startup problem is to
not route the triggering request to the newly started service but rather
keep the startup event trigger and route that request to an already warm
service. Extra points for not routing any requests until the new instance is
stabilized.




On Thu, Sep 16, 2010 at 10:42 AM, Maxim Veksler  wrote:

> Hey Guys,
>
> Just a quick 2.5cent idea.
>
> The current situation for applications running on the app engine is that a
> request that causes instance spin up (be it first request, or the unlucky
> one in high load) is usually cancelled because of timeout (30s). I'm
> observing this situation even for "virgin" applications that do nothing more
> then return "Hello World".
>
> Now, what if application developers could define a special API call (much
> like mail delivery to the application is handled by GAE) that will be called
> when GAE decides to spin yet another instance. This could solve the problem
> of requests being "canceled" in high load while the new JVM instance is
> loading. The GAE could allocate a "finite" amount of time from the "warm up"
> call to the "start of request delivery" to the new jvm (something like 60
> seconds?). The application developers could take advantage of this call
> (that will go to the "InitServlet") to do start up logic (population of
> MemCache, loading static maps from DataStore and co..)
>
> This could be poor's men solution for applications that *should* not lose
> requests, even if it's 1/10.
>
> I know about the planned "reserved instances" feature, don't really see the
> logic in this though as this approach doesn't seem to scale well: Say I'm
> holding 5 reserved instances. What happens if my requests get a peak... a
> truly massive slashdot peak which in theory should require yet another (well
> just for ex.) 100 instances? If GAE launches them and instantly starts
> forwarding requests to them then, assuming each instance takes 15sec to load
> - ~(15sec*95instances*)*0.40 requests are
> timed out. That's bad.
>
>
> Comments?
>
> Maxim.
>
> --
> 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] Delete indexes for application

2010-09-15 Thread andy stevko
run appcfg.py vacuum_indexes

as described in
http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Big_Entities_and_Exploding_Indexes


On Tue, Sep 14, 2010 at 11:43 AM, Barada Sahu  wrote:

> Hi,
> I need to delete the indexes for my java app as the column name has
> changed. I am now unable to perform any entity deletions because of
> the existing entries in the index table. Would it be possible to
> somehow delete all the indexes for my app?
>
> Regards
> Barada Sahu
>
> --
> 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: Security problem with App Engine application

2010-09-06 Thread Andy Faulkner
Thanks for your contributions guys. Had got myself a confused with the
need to use AppEngine which, as John points out, I don't need to in
this context.

Andy

On Sep 3, 9:23 am, John Patterson  wrote:
> You can write a local Java application that reads data using the JDBC  
> driver and inserts it into your datastore using the RemoteDatastore  
> library:
>
> http://code.google.com/p/remote-datastore/
>
> I use this code to read local data from a CSV file and "push" it to  
> either my local App Engine environment for development or the  
> production environment.
>
> On 2 Sep 2010, at 22:28, Andy Faulkner wrote:
>
>
>
> > Hi,
>
> > I'm trying to develop an AppEngine application in Java, that will read
> > some values from a local MSSQL database on our internal network using
> > Microsoft's JDBC driver, and then insert those values into a reference
> > spreadsheet in our Google Docs domain.
>
> > I'm falling at the first hurdle!
>
> > I have Eclipse Helios, with Version 1.3.7 of the App Engine SDK Plugin
> > installed.
>
> > So, I create a new App Engine project (HelloWorld) and when I run
> > this, it works just fine.
>
> > And then, just to get things going, I have modified the doGet method
> > so that it looks like this (I'm expecting that this will extract some
> > records from my database, and then print them to the HTML page) - just
> > want to get things going before I really get to work.
>
> > @SuppressWarnings("serial")
> > public class VisionConnectorServlet extends HttpServlet {
> >    public void doGet(HttpServletRequest req, HttpServletResponse resp)
> >                    throws IOException {
>
> >            resp.setContentType("text/plain");
>
> >            // Declare the JDBC objects.
> >          Connection con = null;
> >          Statement stmt = null;
> >          ResultSet rs = null;
>
> >          try {
> >             // Establish the connection.
> >             Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
>
> >             SQLServerDataSource ds = new SQLServerDataSource();
> >             ds.setUser("DeltekVision");
> >             ds.setPassword("Password1");
> >             ds.setServerName("server02");
> >             ds.setPortNumber(1433);
> >             ds.setDatabaseName("vision2");
> >             con = ds.getConnection();
>
> >             String SQL = "SELECT * FROM CL where status='A'";
> >             stmt = con.createStatement();
> >             rs = stmt.executeQuery(SQL);
>
> >             // Iterate through the data in the result set and display
> > it.
> >             while (rs.next()) {
> >                    resp.getWriter().println("Client: " + 
> > rs.getString("Name"));
> >                    resp.getWriter().println("");
> >             }
> >          }
>
> >          // Handle any errors that may have occurred.
> >          catch (Exception e) {
> >             e.printStackTrace();
> >          }
> >          finally {
> >             if (rs != null) try { rs.close(); } catch(Exception e) {}
> >             if (stmt != null) try { stmt.close(); } catch(Exception e)
> > {}
> >             if (con != null) try { con.close(); } catch(Exception e) {}
> >             System.exit(1);
> >          }
>
> >    }
>
> > When I run the application the Jetty server fires up as expected (so
> > everything builds OK) but when I access the web page, kaboom:
>
> > java.security.AccessControlException: access denied
> > (java.net.SocketPermission cc:1433 connect,resolve)
> >    at
> > java
> > .security
> > .AccessControlContext.checkPermission(AccessControlContext.java:
> > 323)
> >    at
> > java.security.AccessController.checkPermission(AccessController.java:
> > 546)
> >    at java.lang.SecurityManager.checkPermission(SecurityManager.java:
> > 532)
> >    at com.google.appengine.tools.development.DevAppServerFactory
> > $CustomSecurityManager.checkPermission(DevAppServerFactory.java:166)
> >    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
> >    at
> > com
> > .microsoft
> > .sqlserver
> > .jdbc
> > .SQLServerConnectionSecurityManager
> > .checkConnect(SQLServerConnection.java:
> > 3229)
> >    at
> > com
> > .microsoft
> > .sqlserver
> > .jdbc.ServerPortP

[appengine-java] Security problem with App Engine application

2010-09-02 Thread Andy Faulkner
rg.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)

I'd really appreciate if someone can help me to resolve these errors.
Do I need a policy file? And if so, where should it reside and how do
I link it to my application?

Many thanks,

Andy

-- 
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: Calendar API

2010-05-07 Thread Andy Glover
Assuming you've got a service initialized and a URL, etc -- here is
some code that grabs all events between now and May 10th.

CalendarQuery query = new CalendarQuery();
myQuery.setMinimumStartTime(DateTime.now());
myQuery.setMaximumStartTime(DateTime.parseDateTime("2010-05-10T23:59:59"));

CalendarEventFeed resultFeed = myService.query(query,
CalendarEventFeed.class);

List entries = resultFeed.getEntries();
 for (int i = 0; i < entries.size(); i++) {
  CalendarEventEntry entry = entries.get(i);


 }
}

CalendarEventEntry has a getId, etc. Does that help?

-Andy

On May 5, 5:41 pm, "Ian R."  wrote:
> Can someone help me get started on pulling the event data from the NFL
> team calendars that Google provides. I cant seem to find the call to
> give me a listing of the eventIds. Am I just blind?
>
> --
> 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: help! output Image to a webpage

2009-12-16 Thread andy
You need to do this differently. Serve one HTML page that includes
 tags for your X pictures. The src url for
the pictures then points to a servlet that take the URL parameter of
the picture ID, load the data and write it to the stream.

Servlet code also needs to set the content type to "image/jpg" or
whatever your binary format is:

response.setContentType(pic.getMimeType());
response.getOutputStream().write(pic.getImage().getBytes());




On Dec 16, 12:18 pm, Yiming Li  wrote:
> Hi all,
>         I am testing the Image Api, what I am trying to do is to
> display the following on the page:
>         picture name1
>         picture1
>         picture name2
>         picture2
>         ...
>
>         the code is:
>         public void doGet(HttpServletRequest req, HttpServletResponse resp)
>                         throws IOException {
>               try {
>                         resp.getOutputStream().print("picture name12");
>                         resp.getOutputStream().write(picture1.getImageData());
>                         resp.getOutputStream().flush();
>
>                         resp.getOutputStream().print("picture name2");
>                         resp.getOutputStream().write(picture2.getImageData());
>                         resp.getOutputStream().flush();
>
>                         ...
>                 } catch (IOException e) {
>                         e.printStackTrace();
>                 }
>         }
>
>          I know there is something wrong in this code, because when I
> execute it, the web browser download a page which contains the string
> "picture1" and the raw data of picture1...
>          Any help is greatly appreciated!
>
> Yiming

--

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, No image data is available.

2009-12-16 Thread andy
The resize without accessing the dimensions works.

  Image oldImage = ImagesServiceFactory.makeImageFromBlob(bi.getBlobKey
());
  ImagesService imagesService = ImagesServiceFactory.getImagesService
();
  Transform resize = ImagesServiceFactory.makeResize(128, 128);
  Image newImage = imagesService.applyTransform(resize, oldImage);

Interesting that it's not a full fledged image when created from a
blob key. It would be nice if you could transform from one blob object
to a new one. In other words upload an image and save different
resolutions in the blob store and maybe even delete the original. With
the current service you have to transform and store in a different
table and adhere to the 1MB limit. Is this correct? Is there any plan
for storing custom data in the blob (transformed or created in the
app)?

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] BlobstoreService, No image data is available.

2009-12-15 Thread andy
I'm trying to scale an image after upload (in the doPost method). The
blob key seems to be ok and the image is served after the upload.

Image oldImage = ImagesServiceFactory.makeImageFromBlob(bk);
double aspectRatio = (double) oldImage.getWidth()  / (double)
oldImage.getHeight();


->

java.lang.UnsupportedOperationException: No image data is available.

--

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: Collections usge in Appengine Java

2009-12-09 Thread andy stevko
Sorry for not seeing this earlier - I missed your reply post in the mail
stream.

FetchGroups are documented at
http://www.datanucleus.org/products/accessplatform_1_1/jdo/fetchgroup.html#dfg

The xml metadata they show is generated by the @FetchGroup annotation which
is documented at
http://www.datanucleus.org/products/accessplatform_1_1/jdo/annotations.html#FetchGroup

Strings and other basic java.lang types are in the default fetch group.
User defined types need to be added to a user named fetch group (or may be
added to the default group).

HTH,
--Andy

On Thu, Dec 3, 2009 at 11:10 PM, Avis developer
wrote:

> Sir thanks for the reply , but pl help me sir, am jus a beginner, can
> u pls be elaborate, thanks for spending ur time and effort
>
> --
>
> 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] Collections usge in Appengine Java

2009-12-02 Thread andy stevko
This is a common issue. You need to define a @FetchGroup( )  for your class
that names that member then add the FetchGroup to your persistence manager.

@FetchGroup(  name="children", members={
@Persistent(name="childcollection")
})
public class 

//---
PersistenceManager pm;
FetchPlan fp = pm.getFetchPlan();
fp.addGroup("children");


On Wed, Dec 2, 2009 at 9:50 AM, Avis developer wrote:

> I tried using ArrayList in a persistent way, but its not getting
> persistent.. It adds the value when i call the add method, but for
> retriving it still says null..
> Is this a bug or my programming fault ? Pls help
>
> --
>
> 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: JSP errors in hosted mode

2009-09-16 Thread andy


  Thanks Keith.   I somewhat understand your point.  Since you say the
JSP compiler would give the desired information is there a way to
configure the hosted mode to use the JSP compiler instead of javac?

  From the IRC chat today it was suggested that I add an issue.  The
issue I added was 
http://code.google.com/p/googleappengine/issues/detail?id=2132.

   If anyone else feels this is an issue please feel free to star the
issue.

   Thanks again.

On Sep 16, 11:49 am, Keith Platfoot  wrote:
> Hi Andy,
> At this point, no.  For JSP errors generated by javac, the error will refer
> to locations inside the generated servlet class, instead of inside the JSP
> file it came from.  Errors from the JSP compiler, on the other hand,
> *will*generally refer to the actual JSP file/line that caused the
> error.
>
> I see that you've already created an issue in the public tracker, which is
> exactly the right approach.  Incidentally, you created an issue *just
> minutes* before I created essentially the same issue (issue
> 2131<http://code.google.com/p/googleappengine/issues/detail?id=2131>)
> on your behalf!  That's ok, though; I'll go ahead and mark mine as a
> duplicate.
>
> Thanks for reporting this,
>
> Keith
>
> On Wed, Sep 16, 2009 at 11:23 AM, andy  wrote:
>
> >   I have been trying out Google App Engine for Java in Hosted mode
> > and ran into something I hope someone can shed some light on.  I'm
> > using JSP pages and when a JSP page generates an error ( either
> > compilation or runtime ) the error message displayed contains
> > reference to the line number in the compiled servlet not the jsp
> > source.  For example, the following error is displayed for a simple
> > invalid tag <% abc %>:
>
> > Unable to compile class for JSP
>
> > Generated servlet error:
> >    [javac] C:\DOCUME~1\username\LOCALS~1\Temp
> > \Jetty_0_0_0_0_8080_warut4fm1\jsp\org\apache\jsp\index_jsp.java:
> > 53: ';' expected
>
> >  Is there a way to get the GAE hosted mode server to display JSP
> > source line level error messages?
>
> >  Any help would be much appreciated.
>
> >  Andy
--~--~-~--~~~---~--~~
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-java@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] JSP errors in hosted mode

2009-09-16 Thread andy


   I have been trying out Google App Engine for Java in Hosted mode
and ran into something I hope someone can shed some light on.  I'm
using JSP pages and when a JSP page generates an error ( either
compilation or runtime ) the error message displayed contains
reference to the line number in the compiled servlet not the jsp
source.  For example, the following error is displayed for a simple
invalid tag <% abc %>:

Unable to compile class for JSP

Generated servlet error:
[javac] C:\DOCUME~1\username\LOCALS~1\Temp
\Jetty_0_0_0_0_8080_warut4fm1\jsp\org\apache\jsp\index_jsp.java:
53: ';' expected


  Is there a way to get the GAE hosted mode server to display JSP
source line level error messages?

  Any help would be much appreciated.

  Andy
--~--~-~--~~~---~--~~
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-java@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
-~--~~~~--~~--~--~---