Re: [appengine-java] Re: Length of member variable names contributes to storage space used?

2010-07-19 Thread John Patterson
Also the class name is used in the Key as the kind.  To get the  
shortest keys you would need to use short class names and numeric long  
ids (rather than Strings).  Having small keys is important because  
they are stored many times per entity in indexes and more than once  
for the entity itself.


I know that both Twig and Objectify have support for defining your own  
kind names without needing to actually rename your class to something  
incomprehensible.


On 20 Jul 2010, at 11:11, Didier Durand wrote:


Hi Mark,

I would say yes: the datastore viewer shows the data with couples
(name,value), name being the origianal attribute name in the java
class.

Moreover the doc says "Each persistent field of the class represents a
property of the entity, with the name of the property equal to the
name of the field (with case preserved)." at
http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Class_and_Field_Annotations

regards
didier

On Jul 19, 3:32 pm, Mark  wrote:

Hi,

I read in a post that the length of member variable names contributes
to the amount of storage space your app uses, example:

class Farm {
private String mFarmersFavoriteCropToPlant;
}

would take more space to store than:

class Farm {
private String m;
}

might not matter for a handful of instances, but if I have thousands
of records... is this true?

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




--
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: dynamically resizing a textarea

2010-07-19 Thread Brandon A
This is on the client side of the application. However I've finally
found a solution to the problem... It's pretty simple and most
experienced developers would probably know about it... But yeah, even
though not all HTML attributes are accessible directly from the GWT
TextArea class, I'm pretty sure every attribute is accessible from the
element returned by textarea.getElement(), including scrollHeight.

On Jul 12, 11:41 am, "Ikai L (Google)"  wrote:
> You'll need to do this in the client using Javascript. You can't do client
> side UI on the server.
>
> If you're using Google Web Toolkit, you may have better luck finding an
> answer here:https://groups.google.com/group/Google-Web-Toolkit?pli=1
>
>
>
> On Sun, Jul 11, 2010 at 11:24 PM, Brandon A  wrote:
> > I'm creating textareas in the main java file of my app, and I want to
> > make them resize themselves as users enter and delete text in them. I
> > can't figure out how to do this, though. There are solutions online
> > where you can use javascript in the html file to compare the
> > offsetHeight and scrollHeight of the textarea and then make the two
> > heights match each other. However, since my textareas are not static
> > elements of the page and because I'm doing this with java, I don't
> > have access to the scrollHeight of the textarea (well, at least I
> > think I don't), so I can't use that solution. I'm very new to all of
> > this so there might be something that I'm completely missing. Any
> > advice would be greatly appreciated...
>
> > 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.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blog:http://googleappengine.blogspot.com
> Twitter:http://twitter.com/app_engine
> Reddit:http://www.reddit.com/r/appengine

-- 
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] Geomodel Java: Proximity Search

2010-07-19 Thread Mahsa
I am trying to use the proximity search of Geomodel. However, I
am facing a problem, which I am not sure what it is, but I think it is
related to either my PersistentManager or baseQuery. I ran the query,
however, while my database is not empty, I got null results.


Here are my codes:

public class HowToUseGeocell extends TestCase {
...

public int ProximitySearch(double lat, double lon, double distance) {

Point center = new Point(lat, lon);
List objects = null;
PersistenceManager pm = PMF.get().getPersistenceManager();

   try{
List params = new ArrayList();
params.add("Mahsa");
GeocellQuery baseQuery = new GeocellQuery("Owner ==
OwnerParam", "String OwnerParam", params);

try {
objects = GeocellManager.proximityFetch(center, 40,
distance, ObjectToSave.class, baseQuery, pm);
Assert.assertTrue(objects.size() > 0);
} catch (Exception e) {
// We catch excption here because we have not
configured the PersistentManager (and so the queries won't work)
}

} finally {
pm.close();
}

if (objects == null)
return -3;

else
return objects.size();

}
}

Here is my ObjectToSave class:

@PersistenceCapable(detachable="true")
public class ObjectToSave implements LocationCapable {

@PrimaryKey
@Persistent
private long id;

@Persistent
private double latitude;

@Persistent
private double longitude;

@Persistent
private double altitude;

@Persistent
private List geocells;

@Persistent
private String owner;

public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public double getLatitude() {
return latitude;
}

public void setLatitude(double latitude) {
this.latitude = latitude;
}

public double getLongitude() {
return longitude;
}

public void setLongitude(double longitude) {
this.longitude = longitude;
}

public double getAltitude() {
return altitude;
}

public void setAltitude(double alt) {
this.altitude = alt;
}

public List getGeocells() {
return geocells;
}

public void setGeocells(List geocells) {
this.geocells = geocells;
}

public String getKeyString() {
return Long.valueOf(id).toString();
}

public Point getLocation() {
return new Point(latitude, longitude);
}

public String getOwner() {
return owner;
}

public void setOwner(String o) {
this.owner = o;
}

}

My PMF class:

public final class PMF {
private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-
optional");

private PMF() {}

public static PersistenceManagerFactory get() {
return pmfInstance;
}

}

My Servlet:

@SuppressWarnings("serial")
public class Test8_Geomodel_GAEServlet extends HttpServlet {

//  public static UseGeocell GC = new UseGeocell();
//public final static PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-optional");

public void doGet(HttpServletRequest req, HttpServletResponse
resp)
throws IOException {

doPost(req, resp);

//  resp.setContentType("text/plain");
//  resp.getWriter().println("Hello, world");
}

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

HowToUseGeocell gc = new HowToUseGeocell();
List obj = new
ArrayList();

//Read Excel "source file" (which is defined in
web.xml file) &
store it in datastore
ServletContext context = getServletContext();

String file_path = context.getRealPath("LiDAR.xls");
File Myfile = new File(file_path);

Workbook workBook;
int PointNo;
double latitude = 0.0, longitude = 0.0, altitude =
0.0;
String owner = "";

try {

workBook = Workbook.getWorkbook(Myfile);
Sheet sheet = workBook.getSheet(0);

int NumOfColumns = sheet.getColumns();
int NumOfRows = sheet.getRows();

String data;
for(int row = 1; row < NumOfRows; row++) {
for(int col = 0; col < NumOfColumns; col++) {
data = sheet.getCell(col,
row).getContents();

data = sheet.getCell(0,
row).getContents();
PointNo =
Integer.parseInt(data.toString());

data = sheet.getCell(1

[appengine-java] Tag clouds on GAE for Java - how to store and how to aggregate

2010-07-19 Thread planetjones
Hi,
I'm looking to store entities using GAE Java which have 1-many tags.
I
would like to display a tag cloud, so will need to know how many
times
each tag occurs (can't use aggregate functions and group by on GAE to
do this like I would in SQL). And when I click a tag I would like to
retrieve all entities with the selected tag.
Does anyone have any examples of what my Classes should look like to
do this optimally and efficiently? Sample JPA code would be great
too.
Cheers - Jonathan

-- 
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: Length of member variable names contributes to storage space used?

2010-07-19 Thread Didier Durand
Hi Mark,

I would say yes: the datastore viewer shows the data with couples
(name,value), name being the origianal attribute name in the java
class.

Moreover the doc says "Each persistent field of the class represents a
property of the entity, with the name of the property equal to the
name of the field (with case preserved)." at
http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Class_and_Field_Annotations

regards
didier

On Jul 19, 3:32 pm, Mark  wrote:
> Hi,
>
> I read in a post that the length of member variable names contributes
> to the amount of storage space your app uses, example:
>
>     class Farm {
>         private String mFarmersFavoriteCropToPlant;
>     }
>
> would take more space to store than:
>
>     class Farm {
>         private String m;
>     }
>
> might not matter for a handful of instances, but if I have thousands
> of records... is this true?
>
> Thanks

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



[appengine-java] Re: JDO - How to Model a Transferable Relationship?

2010-07-19 Thread Didier Durand
Hi,

I think that you have to go for an unowned 1-to-many relationship to
achieve what you want else your child is stuck with its 1st parent.

See for samples:http://code.google.com/appengine/docs/java/datastore/
relationships.html#Unowned_Relationships

didier

On Jul 17, 10:44 pm, max <6738...@gmail.com> wrote:
> Hi,
>
> I'm having trouble getting JDO work in a situation of wanting to
> transfer child objects from one parent to another.  Let's say that I
> would like to model an object called "Team" and an object called
> "Player".  A Player can be on only one team at a time, and a Team can
> have many Players.  I can get the basics working, however I run into
> problems when I want to transfer ("trade") an existing Player instance
> to an existing Team instance.  Outside of that relationship, the
> objects are completely different.
>
> I have the problem that a child cannot be moved because apparently it
> isn't in the same entity group.  I have tried to model it as Set
> in each class like the Favorite Foods example in the documentation,
> but that doesn't work.  I don't get errors, but nothing is saved.  The
> Sets saved are always empty.  I have tried the same thing with
> ArrayList, where Long is the Key.getId() of the related
> object.
>
> I think I am missing something rather simple, but I can't get it
> working.  Do I need other annotations?  Can someone post a simple
> example?
>
> thanks!
> Max

-- 
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: strange datastore status

2010-07-19 Thread cse.zh...@gmail.com
Dear all,
I've already found the reason. It is related to my careless. There is
a tiny difference between the two apps which caused the problem. And I
didn't notice it.

Sorry for the inconvenience.

On 7月20日, 上午11时24分, "cse.zh...@gmail.com"  wrote:
> Dear all,
> Today I encountered a strange situation. I have used app engine SDK
> 1.3.5. And I have two applications onhttps://appengine.google.com/
> assume they are *myapp* and *myapp-sandbox*.
>
> *myapp* and *myapp-sandbox* have the same code. I tried to execute a
> same section of code towards these 2 apps. Both returned successfully.
> But the datastore response are diffrent. *myapp-sandbox* created a
> record in datastore, but *myapp* didn't.
>
> I tried to write SEVERE log in *myapp*, but none of them was
> successfully recorded. I can't see any logs in Admin Console, which
> prevent me from investigating the problem.
>
> I viewed the status report from url:http://code.google.com/status/appengine/,
> and everything seems OK.
>
> Can someone help me find it out?
>
> 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] strange datastore status

2010-07-19 Thread cse.zh...@gmail.com
Dear all,
Today I encountered a strange situation. I have used app engine SDK
1.3.5. And I have two applications on https://appengine.google.com/
assume they are *myapp* and *myapp-sandbox*.

*myapp* and *myapp-sandbox* have the same code. I tried to execute a
same section of code towards these 2 apps. Both returned successfully.
But the datastore response are diffrent. *myapp-sandbox* created a
record in datastore, but *myapp* didn't.

I tried to write SEVERE log in *myapp*, but none of them was
successfully recorded. I can't see any logs in Admin Console, which
prevent me from investigating the problem.

I viewed the status report from url: http://code.google.com/status/appengine/,
and everything seems OK.

Can someone help me find it out?

Thanks

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



[appengine-java] Re: Dance Dance Robot error / Channel API

2010-07-19 Thread GoSharp Lite
I have the same error using dev server.

If you deploy your app to production server, below error log shows
channel service is not enable.

exception: com.google.apphosting.api.ApiProxy
$FeatureNotEnabledException: The channel service is not enabled.

It seems we have to patiently wait:)

On Jul 20, 10:36 am, Daniel Guermeur  wrote:
> Thanks for the tip about channel.js. This is what I needed.
>
> Now I get an error when pushing a message to a client. I get this:
>
> com.google.appengine.api.channel.ChannelFailureException: An
> unexpected error occurred.
> Caused by: com.google.apphosting.api.ApiProxy$ApplicationException:
> ApplicationError: 2:
>
> Here is the stack trace. Let me know of any ideas you might have.
>
> Thanks!
> Daniel
>
> SEVERE: Failed to push the message
> com.metadot.book.stalkrapp.shared.mess...@1010a3b to client channel-
> a4kt0t-stalkrappt...@example.com-1
> com.google.appengine.api.channel.ChannelFailureException: An
> unexpected error occurred.
>         at
> com.google.appengine.api.channel.ChannelServiceImpl.sendMessage(ChannelServiceImpl.java:
> 59)
>         at
> com.metadot.book.stalkrapp.server.PushServer.sendMessageToOneUser(PushServer.java:
> 82)
>         at
> com.metadot.book.stalkrapp.server.FriendsServiceImpl.getFriend(FriendsServiceImpl.java:
> 283)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:
> 100)
>         at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
> 562)
>         at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
> 188)
>         at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
> 224)
>         at
> com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
> 62)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>         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.metadot.book.stalkrapp.server.servlets.LoginFilter.doFilter(LoginFilter.java:
> 31)
>         at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1157)
>         at
> com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
> 51)
>         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.HandlerWrapper.handle(HandlerWrapper.java:
> 152)
>         at com.google.appengine.tools.development.JettyContainerService
> $ApiProxyHandler.handle(JettyContainerService.java:349)
>         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.content(HttpConnection.java:938)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
>         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>         at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
> 409)
>         at org.mortbay.thread.QueuedThreadPool
> $PoolThread.run(QueuedThreadPool.java:582)
> Caused by: com.google.apphosting.api.ApiProxy$ApplicationExc

[appengine-java] Re: Dance Dance Robot error / Channel API

2010-07-19 Thread Daniel Guermeur
Thanks for the tip about channel.js. This is what I needed.

Now I get an error when pushing a message to a client. I get this:

com.google.appengine.api.channel.ChannelFailureException: An
unexpected error occurred.
Caused by: com.google.apphosting.api.ApiProxy$ApplicationException:
ApplicationError: 2:

Here is the stack trace. Let me know of any ideas you might have.

Thanks!
Daniel


SEVERE: Failed to push the message
com.metadot.book.stalkrapp.shared.mess...@1010a3b to client channel-
a4kt0t-stalkrappt...@example.com-1
com.google.appengine.api.channel.ChannelFailureException: An
unexpected error occurred.
at
com.google.appengine.api.channel.ChannelServiceImpl.sendMessage(ChannelServiceImpl.java:
59)
at
com.metadot.book.stalkrapp.server.PushServer.sendMessageToOneUser(PushServer.java:
82)
at
com.metadot.book.stalkrapp.server.FriendsServiceImpl.getFriend(FriendsServiceImpl.java:
283)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:
100)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
562)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
188)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
224)
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
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.metadot.book.stalkrapp.server.servlets.LoginFilter.doFilter(LoginFilter.java:
31)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)
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.HandlerWrapper.handle(HandlerWrapper.java:
152)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:349)
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.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
409)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
Caused by: com.google.apphosting.api.ApiProxy$ApplicationException:
ApplicationError: 2:
at
com.google.appengine.api.channel.dev.LocalChannelService.sendChannelMessage(LocalChannelService.java:
91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.development.ApiProxyLocalImpl
$AsyncApiCall.call(ApiProxyL

Re: [appengine-java] Updated Eclipse Plugin ?

2010-07-19 Thread Hariharan Anantharaman
>From your eclipse itself(having an older version of gae), you can update to
latest version by using software updates option in elclipse.

Thanks
Hari

On Jul 19, 2010 9:39 PM, "Navaneeth Krishnan" 
wrote:

I tried out the latest version of the eclipse plugin for GAE

http://code.google.com/appengine/docs/java/gettingstarted/installing.html

to realize that the bundled app engine version is 1.3.3. If there any
plan to upgrade it to the latest SDK (1.3.5) ?

When can we expect a new release ?

Also, is there a way to manually upgrade the eclipse plugin ?


--
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] PMF.get().getPersistenceManager() freezes after restart

2010-07-19 Thread bradr
We are seeing some strange behavior... after we stop/restart the dev
server it freezes when trying to get an instance of the
PersistenceManager.

Steps to repeat:
1) We execute a query similar to the AppEngine example:
http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Introducing_Queries
2) It returns about 480 entities
3) We stop the server using the Eclipse console
4) We restart the server and attempt to run the same Query
5) It hangs at PMF.get().getPersistenceManager();

We put in output statements to verify, and it doesn't output the
second string and in firebug we just see the RPC request hang...
 System.out.println("getting PMF");
 PMF.get().getPersistenceManager();
 System.out.println("got PMF");

Has anyone experienced similar issues? We are running Eclipse Helios
with AppEngine 1.3.5, GWT 2.0.4, JDK 1.6_20 and the newest Google
Eclipse Plugin. We tested on Ubuntu and Windows 7 and got the same
results.

-- 
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] Persistence manager for all system

2010-07-19 Thread lisandrodc
Hi! I have a  doubt of since administering a Persistence manager for
an application(for example web). When close the persistence manager?
When commit the transaction? The pattern singleton the example?
Because if I continue the help of google, the pattern, close a
persitence manager, for example:

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

Employee e = new Employee("Alfred", "Smith", new Date());

try {
pm.makePersistent(e);
} finally {
pm.close(); //I accede again for the system, it is going
to give mistake because it is closed
}

The standard errors that happen to me are:

1- "Object whit id "model.fe...@cf17c3" is handled for other
ObjectManager".
2-"The persistent manager is closed".
3- "The transaction is active still. You must close the transactions
using the methods
 commit() o rollback()."

Regards

-- 
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 Engine Java servlet clearing my Content-type Header for form POST from python

2010-07-19 Thread Jean Hsu
Hi,

I'm running a servlet on Google App Engine.  When I try to post multi-
part form data to the url from a python script, locally it works, but
when I deploy to app engine, it complains that the content-type header
is null.

When I print out the content type header to my logs, it is indeed
correct when run locally ("multipart/form-data; boundary.") but
null when run on app engine.

Is App Engine clearing certain headers?

Here's the stack trace when deployed to appengine:

org.apache.commons.fileupload.FileUploadBase
$InvalidContentTypeException: the request doesn't contain a multipart/
form-data or multipart/mixed stream, content type header is null at
org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.
(FileUploadBase.java:885) at
org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:
331) at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:
349) at
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:
126)


Thanks!
Jean

-- 
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] next gen queries

2010-07-19 Thread pac
In Alfred Fuller's presentation (http://www.youtube.com/watch?
v=ofhEyDBpngM&feature=channel), he mentioned that limit of 5000 list
items and need for number of composite indexes for list (i.e. 2 value
search from list, 3 value search from list etc) will be removed. As
per video, I think he mentioned that functionality is nearly in place.

At this stage, is it possible to give an approx idea when can we
expect this one out?

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



[appengine-java] Re: is there any solution/idea how blacklist IP in "realtime" ?

2010-07-19 Thread Marcus Brody
Yes, I already have such solution, but It still
does eat some resources (minimal if written correctly)

But thank for answer John,
only think I am afraid I wake up and my dayly budged will be eaten
by some kind of dos attack done while I was sleeping, I still think
since you can upload dos.xml very quickly there has to be some
mechanism how to automate it.

Anyone has some pros/cons of my ideas ?

On Jul 19, 3:56 pm, John Patterson  wrote:
> I believe some people maintain their own request count by ip address  
> using memcache and restrict access using a filter.
>
> On 19 Jul 2010, at 20:09, Marcus Brody wrote:
>
>
>
> > I am missing something ? So you guys are sitting in web console and
> > watch
> > how many requests came from given IP address ? This has to be done
> > automatically ... somehow.
>
> > --
> > 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 
> > 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.



Re: [appengine-java] local_db does not exist; cannot store persistent data

2010-07-19 Thread Ronmell Fuentes
Hello Erencie.

have you tried to save persistence objects in data store? and have you tried
to retrieve all data saved in your data store?
does it show any error?

are you using something like JUnit or something besides the code shown in
google tutorials?

Rgds.

R

2010/7/19 Erencie 

> I use Google app Engine plugin for Eclipse and managed to make the
> "guestbook" demo run successfuly. When I create my own app by
> following the code pattern of "guestbook", sth weird happens:
>
> Jul 19, 2010 6:08:46 AM
> com.google.appengine.api.datastore.dev.LocalDatastoreService load
> INFO: The backing store, D:\Eclipse workspace\TeammateV0.0\war\WEB-INF
> \appengine-generated\local_db.bin, does not exist. It will be created.
>
>
> I noticed that in /war/WEB-INF/appengine-generated folder, there is
> only "datastore-indexes-auto.xml", but no "local_db.bin" file exists,
> unlike the case in the demo guestbook project.
>
> And I find that I cannot store anything persistent objects, even
> though I follow the correct codes in tutorials. However, the whole
> thing runs without any errors.
>
>
> I tried diff configurations in the few xml files, and tried using
> transactions as well. I did also closed the persistentFactory. But
> nothing changes.
>
> Can anyone help me?Thanks a lot.
>
> --
> 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.
>
>


-- 
ausencia de evidencia  ≠  evidencia de ausencia
http://culturainteractiva.blogspot.com/

-- 
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: Geomodel in Java

2010-07-19 Thread Mahsa
Now, I am trying to use the proximity search in Geomodel. However, I
am facing a problem, which I am not sure what it is, but I think it is
related to either my PersistentManager or baseQuery. I ran the query,
however, while my database is not empty, I got null results.

public class HowToUseGeocell extends TestCase {
...

public int ProximitySearch(double lat, double lon, double distance) {

Point center = new Point(lat, lon);
List objects = null;
PersistenceManager pm = PMF.get().getPersistenceManager();

   try{
List params = new ArrayList();
params.add("Mahsa");
GeocellQuery baseQuery = new GeocellQuery("Owner ==
OwnerParam", "String OwnerParam", params);


try {
objects = GeocellManager.proximityFetch(center, 40,
distance, ObjectToSave.class, baseQuery, pm);
Assert.assertTrue(objects.size() > 0);
} catch (Exception e) {
// We catch excption here because we have not
configured the PersistentManager (and so the queries won't work)
}


} finally {
pm.close();
}


if (objects == null)
return -3;

else
return objects.size();


}

}


Here is my ObjectToSave class:


@PersistenceCapable(detachable="true")
public class ObjectToSave implements LocationCapable {

@PrimaryKey
@Persistent
private long id;

@Persistent
private double latitude;

@Persistent
private double longitude;

@Persistent
private double altitude;

@Persistent
private List geocells;

@Persistent
private String owner;

public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public double getLatitude() {
return latitude;
}

public void setLatitude(double latitude) {
this.latitude = latitude;
}

public double getLongitude() {
return longitude;
}

public void setLongitude(double longitude) {
this.longitude = longitude;
}

public double getAltitude() {
return altitude;
}

public void setAltitude(double alt) {
this.altitude = alt;
}

public List getGeocells() {
return geocells;
}

public void setGeocells(List geocells) {
this.geocells = geocells;
}

public String getKeyString() {
return Long.valueOf(id).toString();
}

public Point getLocation() {
return new Point(latitude, longitude);
}

public String getOwner() {
return owner;
}

public void setOwner(String o) {
this.owner = o;
}


}


My PMF class:

public final class PMF {
private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-
optional");

private PMF() {}

public static PersistenceManagerFactory get() {
return pmfInstance;
}
}


My Servlet:

@SuppressWarnings("serial")
public class Test8_Geomodel_GAEServlet extends HttpServlet {

//  public static UseGeocell GC = new UseGeocell();
//public final static PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-optional");

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {


doPost(req, resp);

//  resp.setContentType("text/plain");
//  resp.getWriter().println("Hello, world");
}



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

HowToUseGeocell gc = new HowToUseGeocell();
List obj = new ArrayList();


//Read Excel "source file" (which is defined in web.xml file) &
store it in datastore
ServletContext context = getServletContext();

String file_path = context.getRealPath("LiDAR.xls");
File Myfile = new File(file_path);


Workbook workBook;
int PointNo;
double latitude = 0.0, longitude = 0.0, altitude = 0.0;
String owner = "";

try {

workBook = Workbook.getWorkbook(Myfile);
Sheet sheet = workBook.getSheet(0);

int NumOfColumns = sheet.getColumns();
int NumOfRows = sheet.getRows();

String data;
for(int row = 1; row < NumOfRows; row++) {
for(int col = 0; col < NumOfColumns; col++) {
data = sheet.getCell(col, row).getContents();

data = sheet.getCell(0, 
row).getContents();
PointNo = 
Integer.parseInt(data.toString());

data = sheet.getCell(1

[appengine-java] Updated Eclipse Plugin ?

2010-07-19 Thread Navaneeth Krishnan
I tried out the latest version of the eclipse plugin for GAE

http://code.google.com/appengine/docs/java/gettingstarted/installing.html

to realize that the bundled app engine version is 1.3.3. If there any
plan to upgrade it to the latest SDK (1.3.5) ?

When can we expect a new release ?

Also, is there a way to manually upgrade the eclipse plugin ?


-- 
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: Roo + GWT + Security on AppEngine

2010-07-19 Thread ondrej
> 2) i had some issues with static files, spring security doesnt protect
> static html files.

I do have similar problem. Spring security works pretty fine for me,
but I cannot understand why I can't limit access to HTML host page.
The current situation is that my application starts and I have to
handle login problem in gwt code by myself.

I'd prefer Spring security to handle this, so when user is not logged,
and try to load my /Application.html, he/she is automatically
redirected to login page, and no gwt entry-point code is launched
until user is logged in.

This behavior is working very fine for dynamically (by servlet)
generated content (such as JSP pages), but the filter chain seems not
to be applied to to static (e.g. HTML) resources.

For example:

When this is set in config file:



and I try to access /secured/administration.jsp Spring security
rejects access correctly. But when I try to access /secured/index.html
and the file exists, seems that no Spring filter chain is applied and
the file is displayed.

Is there a way how to configure Spring security to deny access to
static files when user is not logged in?

-- 
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] local_db does not exist; cannot store persistent data

2010-07-19 Thread Erencie
I use Google app Engine plugin for Eclipse and managed to make the
"guestbook" demo run successfuly. When I create my own app by
following the code pattern of "guestbook", sth weird happens:

Jul 19, 2010 6:08:46 AM
com.google.appengine.api.datastore.dev.LocalDatastoreService load
INFO: The backing store, D:\Eclipse workspace\TeammateV0.0\war\WEB-INF
\appengine-generated\local_db.bin, does not exist. It will be created.


I noticed that in /war/WEB-INF/appengine-generated folder, there is
only "datastore-indexes-auto.xml", but no "local_db.bin" file exists,
unlike the case in the demo guestbook project.

And I find that I cannot store anything persistent objects, even
though I follow the correct codes in tutorials. However, the whole
thing runs without any errors.


I tried diff configurations in the few xml files, and tried using
transactions as well. I did also closed the persistentFactory. But
nothing changes.

Can anyone help me?Thanks a lot.

-- 
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: java.net.InetAddress and logback 0.9.21

2010-07-19 Thread Juan Hernandez
I'm running into the same issue (I'm using logback 0.9.21).

I tried to configure Logback manually using the JoranConfigurator.

Well, I started extending the JoranConfigurator trying to avoid the
call to the method ContextUtil.addHostNameAsProperty() in the
ConfigurationAction class that is the one causing the issue but it
looked I needed to extend a few classes and started to look messy.

At the end I took a different approach. Just created the ContextUtil
class in my webapp project in the same package as the original one so
mine would be picked instead of the other.

This is the code I put for that class ... (basically removing the use
of java.net.InetAddress class)

package ch.qos.logback.core.util;

import ch.qos.logback.core.Context;
import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.spi.ContextAwareBase;

public class ContextUtil extends ContextAwareBase {

public ContextUtil(Context context) {
setContext(context);
}

/**
 * Add the local host's name as a property
 */
public void addHostNameAsProperty() {
context.putProperty(CoreConstants.HOSTNAME_KEY, "yourhostname");
}
}

Hope it helps.


On May 21, 3:28 am, Sean  wrote:
> I've posted the same question over on the logback forum but I wanted
> to check here to see who is using SLF4J/logback with GAE:
>
> http://old.nabble.com/Google-App-Engine-and-java.net.InetAddress-ts28...
>
> Question is posted here again:
>
> I'm trying to hook up slf4j/logback into a Google App Engine project
> but it looks like I'm running into a problem with a class that GAE
> blocks, namely java.net.InetAddress.  I'm using the latest: slf4j
> 1.6.0 and logback 0.9.21, tied into v1.3.3.1 of the AppEngine SDK and
> here is my java version:
>
> * java version "1.6.0_18"
> * OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
> * OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
>
> If I don't include a logback.xml, my gae dev server starts up properly
> and I see my log messages printed to the console.
>
> The place in *my* code where the failure happens is in the very first
> call to grab the logger, in
> com.cosanta.eventflow.control.EventServletContextListener:43, which is
> just:
>
>         private org.slf4j.Logger logger =
> org.slf4j.LoggerFactory.getLogger(this.getClass().getName());
>
> I took the logback.xml right out of the examples: logback-examples/src/
> main/java/chapters/configuration/sample0.xml:
>
> 
> 
>
>        class="ch.qos.logback.core.ConsoleAppender">
>     
>     
>       %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg
> %n
>     
>   
>
>   
>     
>   
> 
>
> When I try to start the GAE dev server from my eclipse workspace, I
> get the following printed to the console:
>
> May 21, 2010 1:25:05 AM
> com.google.apphosting.utils.config.AbstractConfigXmlReader
> readConfigXml
> INFO: Successfully processed /home/sean/Dropbox/dev/workspace/
> EventFlow/war/WEB-INF/web.xml
> Failed to instantiate [ch.qos.logback.classic.LoggerContext]
> Reported exception:
> java.lang.NoClassDefFoundError: java.net.InetAddress is a restricted
> class. Please see the Google  App Engine developer's guide for more
> details.
>         at
> com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime 
> .java:
> 51)
>         at
> ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java :
> 34)
>         at
> ch.qos.logback.classic.joran.action.ConfigurationAction.begin(Configuration 
> Action.java:
> 47)
>         at
> ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:
> 273)
>         at
> ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:
> 145)
>         at
> ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:
> 127)
>         at
> ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:40)
>         at
> ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:332)
>         at
> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurat 
> or.java:
> 126)
>         at
> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurat 
> or.java:
> 93)
>         at
> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurat 
> or.java:
> 52)
>         at
> ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextI 
> nitializer.java:
> 60)
>         at
> ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitialize 
> r.java:
> 121)
>         at
> org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
>         at
> org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:
> 55)
>         at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
>         at
> org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
>         at
> org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
>         at org.slf4j.LoggerFacto

[appengine-java] local_db does not exist; cannot store persistent data

2010-07-19 Thread Erencie
I use Google app Engine plugin for Eclipse and managed to make the
"guestbook" demo run successfuly. When I create my own app by
following the code pattern of "guestbook", sth weird happens:

Jul 19, 2010 6:08:46 AM
com.google.appengine.api.datastore.dev.LocalDatastoreService load
INFO: The backing store, D:\Eclipse workspace\TeammateV0.0\war\WEB-INF
\appengine-generated\local_db.bin, does not exist. It will be created.


I noticed that in /war/WEB-INF/appengine-generated folder, there is
only "datastore-indexes-auto.xml", but no "local_db.bin" file exists,
unlike the case in the demo guestbook project.

And I find that I cannot store anything persistent objects, even
though I follow the correct codes in tutorials. However, the whole
thing runs without any errors.


I tried diff configurations in the few xml files, and tried using
transactions as well. I did also closed the persistentFactory. But
nothing changes.

Can anyone help me?Thanks a lot.

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

2010-07-19 Thread Nacho Coloma
My 2 cents: if all your users are of type Person and it's a root
entity, you can also save some space by storing Key ids instead of Key
instances (you save the redundant type name etc).

On Jul 19, 5:53 am, "Ikai L (Google)"  wrote:
> The best practice is probably to create list properties with Keys
> representing friend IDs. This is a good video to watch:
>
> http://www.youtube.com/watch?v=AgaL6NGpkB8
>
>
>
>
>
> On Fri, Jul 16, 2010 at 8:03 AM, dmetri333  wrote:
> > Im relatively new too GAE and the Datastore, and i had a question on
> > the best way to setup some entities.
>
> > I have created a entity called 'Person' and this person has a list of
> > friends in the system that are also of type 'Person'.  In SQL i would
> > have created a simple linker/relationship table with 2 fields
> > (person_id, friend_id), both referring to the same id from the
> > 'Person' table.
>
> > I was wondering what the best practice for doing this with GAE and
> > bigtable.
>
> > demetri
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com > unsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blog:http://googleappengine.blogspot.com
> Twitter:http://twitter.com/app_engine
> Reddit:http://www.reddit.com/r/appengine

-- 
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: App Engine integration with Google Apps Marketplace

2010-07-19 Thread l.denardo
I don't know if there are any differences, since I never tried the
other way.

I'll try to investigate in the next days, but I think this could be
helpful for things such as https redirect and similar issues.
Maybe a word from GAE team will help (anyway, some blog posts about
OpenID have been announced, so I think we'll be informed soon about
everything).

regards
Lorenzo

On Jul 19, 3:52 pm, Daniel Pascariu  wrote:
> Hi Lorenzo,
>
> Thanks for taking the time to help !
>
> I tried to call userService.createLoginURL with federatedIdentity =
> "https://www.google.com/accounts/o8/site-xrds?hd=domain1.com"; as you
> suggested and it seems to work :)
>
> But it also works with federatedIdentity = 'domain1.com" !
>
> The produced URLs are slightly different, but the outcome seems the
> same - I can login to domain1.com using user1 (on google apps).
> I'm wondering if there's any subtle difference between the OpenId
> authentification in the two cases - do you know ?
>
> Thanks,
> Daniel
>
> On Jul 19, 9:43 am, "l.denardo"  wrote:
>
> > The link to generate login URL is different for apps accounts
>
> > String appsLoginUrl = userService.getOpenIdLoginUrl(redirectTo,
> > loginDomain,
> >                                                 
> > "https://www.google.com/accounts/o8/site-xrds?hd="; +
> > loginDomain, attributesRequest);
>
> > loginDomain is obviously your domain, in your case the URL is
> > "https://www.google.com/accounts/o8/site-xrds?hd=domain1.com";
>
> > Regards
> > Lorenzo
>
> > On Jul 15, 11:29 pm, Daniel Pascariu 
> > wrote:
>
> > > Hi,
>
> > > I'm trying to enable SSO for my App Engine app in order to put it on
> > > the Google Marketplace.
> > > Let's say that I have my GAE app running atwww.example.com. When I
> > > publish it to the Google Marketplace, a Google Apps user (say
> > > us...@domain1.com) will be able to click on a link in the Google menu
> > > pointing to my site - something like 
> > > this:http://www.example.com/home?from=google&domain=domain1.com
>
> > > Now, acording to this docu (http://code.google.com/appengine/docs/java/
> > > users/overview.html) I should use the Users API to authenticate the
> > > user.
> > > I assume I have to use  userService.createLoginURL method somehow and
> > > use the domain "domain1.com" (which is passed as a parameter to my /
> > > home servlet).
>
> > > I have tried something like this:
>
> > > Set attributesRequest = new HashSet();
> > > attributesRequest.add("openid.mode=checkid_immediate");
> > > attributesRequest.add("openid.ns=http://specs.openid.net/auth/2.0";);
> > > attributesRequest.add("openid.return_to=" + thisUrl);
> > > userService.createLoginURL(thisUrl, "domain1.com", 
> > > "https://www.google.com/accounts/o8/id";, attributesRequest);
>
> > > The probem is that the login URL which I get works for google accounts
> > > only (like gmail accounts) - I do not get any Google Apps page where a
> > > user like us...@domain1.com could login :(
>
> > > Does anybody know how I can get this working ? Or am I on the wrong
> > > track ?
>
> > > Many thanks for the help !!
> > > Daniel

-- 
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] C++ in GAE

2010-07-19 Thread Toby Reyelts
There is software  that can
translate some subset of C++ to Java. Another option is to create a
webservice interface over your C++ libraries and host them outside of App
Engine.

On Mon, Jul 19, 2010 at 8:21 AM, Gal Dolber  wrote:

> No...
>
> 2010/7/18 otuyama 
>
> Hello,
>> Is it possible to compile C++ code in JVM bytecode? I would like to
>> run
>> legacy code in Google App Engine for Java. Of course, C++ and Java
>> libs will
>> be incompatible, but it could be fixed with wrapper libs.
>> Thanks.
>> Julio
>>
>> --
>> 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.
>>
>>
>
>
> --
> http://ajax-development.blogspot.com/
>
>  --
> 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: PDF Files

2010-07-19 Thread chrischelmi
You are right conor, i set the content to application/pdf and i cand
display it. but my problem is that in some browsers and OS(Mac) ,the
pdf is not displyed, the download starts automatically with a default
name, i want to have control on the name given to the file before it
is downloaded





On Jul 18, 6:44 pm, Conor Power  wrote:
> it doesn't sound like you need to generate the PDF using a library if it's
> stored as a blob ... can't you just set the content type to be
> application/pdf and stream the blog contents?
>
> your servlet just needs the key or some mapping to look up the blob.
>
> otherwise, i wrote a summary of my experiences with PDF generation a while
> ago:
>
> http://conorjpower.com/2010/01/11/pdf-generation-in-java/
>
> C
>
> On Sun, Jul 18, 2010 at 5:12 AM, Khor Yong Hao  wrote:
>
> > Your Problem is not using iText to generate PDF content and download it,
> > but is able to allow user upload their own PDF and providing download,
> > right?
>
> > On Thu, Jul 15, 2010 at 3:25 PM, dovm  wrote:
>
> >> Hi,
>
> >> Check this one
> >>http://www.pdfjet.com/java/index.html
>
> >> They claim to support Google App Engine
>
> >> =Dov
>
> >> On Jul 15, 7:57 am, Daniel  wrote:
> >> > But it says that on" Will it play in App Engine"
>
> >> > That its incompatible:
>
> >> > iText
> >> > Version(s): ?
> >> > Status: INCOMPATIBLE
>
> >> >     * iText relies on several classes not in the JRE class whitelist
> >> > including java.awt.Color and java.nio.MappedByteBuffer. A bug has been
> >> > filed athttp://
> >> sourceforge.net/tracker/?func=detail&atid=365255&aid=2810312&g
>
> >> > On Jul 15, 7:51 am, Shyam Visamsetty  wrote:
>
> >> > > Chris,
>
> >> > > Did you want to generate a PDF File on the GAE?
> >> > > If yes, you can use the iText library for generating the pdfs on the
> >> > > app engine. You can have a servlet to download the PDF file you
> >> > > generated.
>
> >> > > Thanks,
> >> > > Shyam Visamsetty
>
> >> > > On Jul 14, 1:36 pm, chrischelmi  wrote:
>
> >> > > > Helle every body,
> >> > > > I am working on a Google App Engine Project that consists of
> >> uploading
> >> > > > PDF files and displaying it after.
> >> > > > I use a Blob to store the PDF file
> >> > > > i want to do a process to download this PDF file by giving the a
> >> > > > specifics name.
> >> > > > Is there a way to generaye PDF files with GAE?
> >> > > > i have a process to display the PDF but i want to download it
> >> direcly
> >> > > > from an URL.
>
> >> --
> >> 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: PDF Files

2010-07-19 Thread chrischelmi
yes exatky

On Jul 18, 1:12 pm, Khor Yong Hao  wrote:
> Your Problem is not using iText to generate PDF content and download it, but
> is able to allow user upload their own PDF and providing download, right?
>
> On Thu, Jul 15, 2010 at 3:25 PM, dovm  wrote:
> > Hi,
>
> > Check this one
> >http://www.pdfjet.com/java/index.html
>
> > They claim to support Google App Engine
>
> > =Dov
>
> > On Jul 15, 7:57 am, Daniel  wrote:
> > > But it says that on" Will it play in App Engine"
>
> > > That its incompatible:
>
> > > iText
> > > Version(s): ?
> > > Status: INCOMPATIBLE
>
> > >     * iText relies on several classes not in the JRE class whitelist
> > > including java.awt.Color and java.nio.MappedByteBuffer. A bug has been
> > > filed athttp://
> > sourceforge.net/tracker/?func=detail&atid=365255&aid=2810312&g
>
> > > On Jul 15, 7:51 am, Shyam Visamsetty  wrote:
>
> > > > Chris,
>
> > > > Did you want to generate a PDF File on the GAE?
> > > > If yes, you can use the iText library for generating the pdfs on the
> > > > app engine. You can have a servlet to download the PDF file you
> > > > generated.
>
> > > > Thanks,
> > > > Shyam Visamsetty
>
> > > > On Jul 14, 1:36 pm, chrischelmi  wrote:
>
> > > > > Helle every body,
> > > > > I am working on a Google App Engine Project that consists of
> > uploading
> > > > > PDF files and displaying it after.
> > > > > I use a Blob to store the PDF file
> > > > > i want to do a process to download this PDF file by giving the a
> > > > > specifics name.
> > > > > Is there a way to generaye PDF files with GAE?
> > > > > i have a process to display the PDF but i want to download it direcly
> > > > > from an URL.
>
> > --
> > 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: is there any solution/idea how blacklist IP in "realtime" ?

2010-07-19 Thread John Patterson
I believe some people maintain their own request count by ip address  
using memcache and restrict access using a filter.


On 19 Jul 2010, at 20:09, Marcus Brody wrote:



I am missing something ? So you guys are sitting in web console and
watch
how many requests came from given IP address ? This has to be done
automatically ... somehow.

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




--
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: App Engine integration with Google Apps Marketplace

2010-07-19 Thread Daniel Pascariu
Hi Lorenzo,

Thanks for taking the time to help !

I tried to call userService.createLoginURL with federatedIdentity =
"https://www.google.com/accounts/o8/site-xrds?hd=domain1.com"; as you
suggested and it seems to work :)

But it also works with federatedIdentity = 'domain1.com" !

The produced URLs are slightly different, but the outcome seems the
same - I can login to domain1.com using user1 (on google apps).
I'm wondering if there's any subtle difference between the OpenId
authentification in the two cases - do you know ?

Thanks,
Daniel


On Jul 19, 9:43 am, "l.denardo"  wrote:
> The link to generate login URL is different for apps accounts
>
> String appsLoginUrl = userService.getOpenIdLoginUrl(redirectTo,
> loginDomain,
>                                                 
> "https://www.google.com/accounts/o8/site-xrds?hd="; +
> loginDomain, attributesRequest);
>
> loginDomain is obviously your domain, in your case the URL is
> "https://www.google.com/accounts/o8/site-xrds?hd=domain1.com";
>
> Regards
> Lorenzo
>
> On Jul 15, 11:29 pm, Daniel Pascariu 
> wrote:
>
> > Hi,
>
> > I'm trying to enable SSO for my App Engine app in order to put it on
> > the Google Marketplace.
> > Let's say that I have my GAE app running atwww.example.com. When I
> > publish it to the Google Marketplace, a Google Apps user (say
> > us...@domain1.com) will be able to click on a link in the Google menu
> > pointing to my site - something like 
> > this:http://www.example.com/home?from=google&domain=domain1.com
>
> > Now, acording to this docu (http://code.google.com/appengine/docs/java/
> > users/overview.html) I should use the Users API to authenticate the
> > user.
> > I assume I have to use  userService.createLoginURL method somehow and
> > use the domain "domain1.com" (which is passed as a parameter to my /
> > home servlet).
>
> > I have tried something like this:
>
> > Set attributesRequest = new HashSet();
> > attributesRequest.add("openid.mode=checkid_immediate");
> > attributesRequest.add("openid.ns=http://specs.openid.net/auth/2.0";);
> > attributesRequest.add("openid.return_to=" + thisUrl);
> > userService.createLoginURL(thisUrl, "domain1.com", 
> > "https://www.google.com/accounts/o8/id";, attributesRequest);
>
> > The probem is that the login URL which I get works for google accounts
> > only (like gmail accounts) - I do not get any Google Apps page where a
> > user like us...@domain1.com could login :(
>
> > Does anybody know how I can get this working ? Or am I on the wrong
> > track ?
>
> > Many thanks for the help !!
> > Daniel

-- 
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] Length of member variable names contributes to storage space used?

2010-07-19 Thread Mark
Hi,

I read in a post that the length of member variable names contributes
to the amount of storage space your app uses, example:

class Farm {
private String mFarmersFavoriteCropToPlant;
}

would take more space to store than:

class Farm {
private String m;
}

might not matter for a handful of instances, but if I have thousands
of records... is this true?

Thanks

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



[appengine-java] Re: is there any solution/idea how blacklist IP in "realtime" ?

2010-07-19 Thread Marcus Brody

I am missing something ? So you guys are sitting in web console and
watch
how many requests came from given IP address ? This has to be done
automatically ... somehow.

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



[appengine-java] How to "close" an object before second transaction?

2010-07-19 Thread coltsith
Here's the psudo-code for one of my methods:


1. Get PersistenceManager (pm)

2. pm.fetchObject1

3. pm.beginTransaction

4. pm.modifyObject1

5. pm.commit

6. pm.fetchObject2

7. pm.beginTransaction

8. pm.modifyObject2

9. pm.commit

however I get this error "can't operate on multiple entity groups in a
single transaction..."

Do I have to put another line in between step 5 and 7 saying that I'm
'done' with object1, like to close it?

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] C++ in GAE

2010-07-19 Thread Gal Dolber
No...

2010/7/18 otuyama 

> Hello,
> Is it possible to compile C++ code in JVM bytecode? I would like to
> run
> legacy code in Google App Engine for Java. Of course, C++ and Java
> libs will
> be incompatible, but it could be fixed with wrapper libs.
> Thanks.
> Julio
>
> --
> 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.
>
>


-- 
http://ajax-development.blogspot.com/

-- 
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 queues and retries

2010-07-19 Thread Fabrizio Accatino
AFAIK if you don't catch exceptions, you'll get HTTP 500 error.
Can you post your code?
Are you sure that you do not try/catch the exception?

fabrizio


On Mon, Jul 19, 2010 at 12:38 AM, Philip Tucker  wrote:

> One of my tasks encountered a failure and wasn't retried. I think it's
> because the servlet returned a 200 response, but I don't know why it
> did since the exception bubbled all the way up to the base servlet. Do
> we need to explicitly return a 5xx error code in exception cases for
> retries to work?
>
> 07-18 02:46PM 06.907 /cleanerq 200 29515ms 9156cpu_ms 5404api_cpu_ms
> 0kb AppEngine-Google; (+http://code.google.com/appengine)
> 0.1.0.2 - - [18/Jul/2010:14:46:36 -0700] "POST /cleanerq HTTP/1.1" 200
> 0 "http://11.latest.wordwisegame.appspot.com/starttasks"; "AppEngine-
> Google; (+http://code.google.com/appengine)"
> "11.latest.wordwisegame.appspot.com" ms=29516 cpu_ms=9157
> api_cpu_ms=5404 cpm_usd=0.254392 queue_name=cleaner-queue
> task_name=5681724147391472665 exit_code=104
>
> ...

-- 
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] Must only return a redirect from a Blobstore upload callback??? What does it mean?

2010-07-19 Thread salvatore
Hi all!

I have two jsp,
-one whith a form for upload a file
-one for managing upload

But, stil the upload goes fine , I recive this warning


19-lug-2010 12.11.15
com.google.appengine.api.blobstore.dev.UploadBlobServlet$3$2 write
GRAVE: Must only return a redirect from a Blobstore upload callback.
19-lug-2010 12.11.15 com.google.apphosting.utils.jetty.JettyLogger
warn
AVVERTENZA: Committed before 500 Expected a redirect, tried to write
content instead.
19-lug-2010 12.11.15 com.google.apphosting.utils.jetty.JettyLogger
warn

what does it mean?

-- 
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] Share session between 3rd party domain (google apps) and appspot.com?

2010-07-19 Thread Just
Hi,

is it possible to share the session between a google apps domain and
appspot.com?
I wanted to use the ssl of appspot.com for secure login and the
redirect back to regular domain.

Regards

-- 
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: How to get the BlobKey from a file which was uploaded

2010-07-19 Thread Alexander Orlov
On Jul 16, 7:02 pm, Jairo Luna  wrote:
> Do you speak spanish? I have an idea but I don't know english very

Sorry, I don't. However your answer was pretty understandable :)

> I don't know if it's the best way but when I upload an image, I save
> the blobKey.getKeyString() into the User's model. Then I create a new
> BlobKey by the keyString that I was saved and I show it...

That's basically the only way to assign blobs to users as you can't(?)
store user's meta-data within BlobInfo. BUT! How do you get the
blobKey of the the image a user has uploaded? Where/how do you get
your return value? Maybe a short code snippet that explains the trick?

-Alex

-- 
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: JCache

2010-07-19 Thread pdias
Yes it needs to be “serializable”.
Thanks for your answer.
pdias

On 19 Jul, 09:30, Hariharan Anantharaman
 wrote:
> As long as the objects are serializable, I believe we can store them in
> jcache.
>
> ~hari
>
> On Jul 19, 2010 9:15 AM, "pdias"  wrote:
>
> Is possible to save object instances using JCache?
>
> I have tried and received the following message:
> javax.servlet.ServletException: java.lang.IllegalArgumentException:
> can't accept class CLASSNAME as a memcache entity
>
> 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 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: Unable to execute query for a large number of entities

2010-07-19 Thread Simon
I believe (and this may be wrong) that the index data is only created
when the object is inserted/updated.  Therefore, any existing data
will be not covered by the new index and won't be retrieved with any
queries which are based upon the index.

Updating them or reuploading them should solve the issue.

On Jul 16, 9:18 am, Ice13ill  wrote:
> I created and uploaded an index for those 2 params:
>
>      source="auto">
>         
>         
>     
>
> After building it i can now execute the query i needed, but i have
> another problem: the retrieved data is incomplete :(
> I run an GQL query in Datastore viewer and the data is there, it seems
> that the app engine sdk does not serve it even with the composite
> indexes.
> Could it help if I reupload the data ? Or if i use low level api to
> get the entities ? (theoretically, it should work right? because it
> seams that the information is not indexed as it should)
>
> On Jul 15, 6:28 pm, Ice13ill  wrote:
>
>
>
> > I uploaded about 100.000 entities into datastore and I need to execute
> > a type of query that shouldn't require composite indexes.
> > But i get this:
>
> > The built-in indices are not efficient enough for this query and your
> > data. Please add a composite index for this query..  An index is
> > missing but we are unable to tell you which one due to a bug in the
> > App Engine SDK
>
> > My entity has three fields (String): type, value, parent so i created
> > an index like this:
>
> > 
> >     > source="auto">
> >         
> >         
> >         
> >     
> > 
>
> > The query uses only equality filters but sometimes only 2 params are
> > used (type and value, let's say)
>
> > Does that meen that i have to create another index ?
> > Or can something else help ?- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
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: About Google App Engine & Google API

2010-07-19 Thread Tan Duy
Hi there,
Now, I think that I should create an application on GAE.
It will list some libraries on Google Map. We can search, look for
books and make friends with book-lovers at somewhere near you.
I'll try to use Google Web Toolkit in my project and some another
Google APIs.
This project will serve all people.
I need some helps.

On Jul 19, 11:51 am, Khor Yong Hao  wrote:
> Is you meant that you want to create another SNS that consisted of all
> members of google appengine java group?

-- 
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 creates entities when I don't ask it to

2010-07-19 Thread Hariharan Anantharaman
Where do u commit the transaction? I hope it is not after saving of A. Could
you confirm if B and A are persisted and committed seperately and
independent of each other.

Thanks
Hari

On Jul 19, 2010 9:15 AM, "pbadn"  wrote:

I am having a problem that is confusing me.

I have two entities, A and B.  Both have user-assigned numeric ids and
A refers to an instance of B.  So I have a process like this:

B b = new B();
b.setId(1);

// save b

A a = new A();
a.setId(1);

B b2 = DAL.getBById(1);
a.setB(b2);

// save a

DAL.getBById is a method that returns an instance of B by the id given
to it.  However, when I do this, a second instance of B is created.
So I should have an instance of A and an instance of B that is
referred to by A.  But what I have is an instance of A and two
instances of B.
Is this a common mistake?  I am new to GAE/J and JDO.

Thanks!

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

-- 
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] error when persist more than 1 object

2010-07-19 Thread senderj
I am trying to learn GAE by writing simple java programs. This is the
coding I use to try JPA:

EntityManager em = null;
try {
em = EMF.get().createEntityManager();
int i = 6;
Trade5min t5 = new Trade5min();
t5.setStkCode(i);
t5.settDate("2010-07-15");
t5.setTradeRec("this is trec of "+i);
em.persist(t5);
} finally {
   em.close();
   resp.getWriter().println("TestWrite done");
}

It works. I can see the persisted records in datastore, and showed
"TestWrite done" on the browser.

However, if I add a second persist:
EntityManager em = null;
try {
em = EMF.get().createEntityManager();
int i = 6;
Trade5min t5 = new Trade5min();
t5.setStkCode(i);
t5.settDate("2010-07-15");
t5.setTradeRec("this is trec of "+i);
em.persist(t5);
i++;
t5 = new Trade5min();
t5.setStkCode(i);
t5.settDate("2010-07-15");
t5.setTradeRec("this is trec of "+i);
em.persist(t5);
} finally {
   em.close();
   resp.getWriter().println("TestWrite done");
}

It gives out warning:
handleAbandonedTxns: Request completed without committing or rolling
back
and then PersistenceException: Illegal argument at "em.close()".
Anybody know what's wrong with my coding?

-- 
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] JCache

2010-07-19 Thread Hariharan Anantharaman
As long as the objects are serializable, I believe we can store them in
jcache.

~hari

On Jul 19, 2010 9:15 AM, "pdias"  wrote:

Is possible to save object instances using JCache?

I have tried and received the following message:
javax.servlet.ServletException: java.lang.IllegalArgumentException:
can't accept class CLASSNAME as a memcache entity

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.



[appengine-java] Re: rename a app-id

2010-07-19 Thread Marcus Brody
create new app with your desired ID and forward all request :P

On Jul 18, 3:34 pm, aswath satrasala 
wrote:
> I do not want to delete the app.  I have user data.
>
> -Aswath
>
> On Sun, Jul 18, 2010 at 6:57 PM, jacek.ambroziak
> wrote:
>
> > Not really, but you can delete the app
> > and after it is gone
> > create a new one with the (available) name you want
>
> > On Jul 18, 12:02 am, aswath satrasala 
> > wrote:
> > > Hello,
> > > Is there any way I can rename my app-id.
>
> > > -Aswath
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



[appengine-java] Re: Active transactions

2010-07-19 Thread Marcus Brody
try follow this pattern for transactions

public void doSomthingWithEntity(T entity) {

PersistenceManager pm = getPersistenceManager();
Transaction transaction = pm.currentTransaction();

try {
transaction.begin();
//  do something with entity, get, persist, delete
//  pm.makePersistent(entity);

transaction.commit();
}
finally {
if (transaction != null && transaction.isActive())
transaction.rollback();
pm.close();
}
}

On Jul 18, 11:01 pm, lisandrodc  wrote:
> Hi! I have a problem with active transaction.When I try to guard in
> the datastore, says:
>
>  "La transaccion esta activo todavia. Debe cerrar las transacciones
> usando los metodos commit() o rollback()."
>
> As closure all the transactions?
> The method is:
>
> PersistenceManager pm2 = JDOHelper.getPersistenceManager(fechaAgreg);
>
>                 Transaction tx = pm2.currentTransaction();
>
>                 try {
>                         tx.begin();
>                         Partido par1 = null;
>                         ControladorTorneo cT= new ControladorTorneo();
>                         par1 = new Partido(null, new Resultado(),
> cT.devolverEquipo( idTorneo,idEqLocal),
> cT.devolverEquipo(idTorneo,idEqVisitante), fecha, hora);
>
>                         fechaAgreg.agregarPartido(par1);
>                         pm2.makePersistent(fechaAgreg);
>                         tx.commit();
>
>                 } finally {
>                         pm2.close();
>
>                         if (tx.isActive()) {
>                                 tx.rollback();
>                         }
>                 }
>
>         }
>
> Regards

-- 
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: Active transactions

2010-07-19 Thread Marcus Brody
Hi lisandrodc,

please carefully read all documents

http://code.google.com/appengine/docs/java/datastore/
and
http://www.datanucleus.org/products/accessplatform_1_1/guides/jdo/daolayer_design.html

Also many people cannot read spanish, if you would write in english
you may get more
answers.

I think you problem is that you datastore operation failed in catch
block
and since you are closing persistence manager first and then
rollbacking it
fails.

Solution:
1) read everything as carefully as possible, look at example and try
experiment.
2) in finally block rollback first and then close persistence manager

On Jul 18, 11:01 pm, lisandrodc  wrote:
> Hi! I have a problem with active transaction.When I try to guard in
> the datastore, says:
>
>  "La transaccion esta activo todavia. Debe cerrar las transacciones
> usando los metodos commit() o rollback()."
>
> As closure all the transactions?
> The method is:
>
> PersistenceManager pm2 = JDOHelper.getPersistenceManager(fechaAgreg);
>
>                 Transaction tx = pm2.currentTransaction();
>
>                 try {
>                         tx.begin();
>                         Partido par1 = null;
>                         ControladorTorneo cT= new ControladorTorneo();
>                         par1 = new Partido(null, new Resultado(),
> cT.devolverEquipo( idTorneo,idEqLocal),
> cT.devolverEquipo(idTorneo,idEqVisitante), fecha, hora);
>
>                         fechaAgreg.agregarPartido(par1);
>                         pm2.makePersistent(fechaAgreg);
>                         tx.commit();
>
>                 } finally {
>                         pm2.close();
>
>                         if (tx.isActive()) {
>                                 tx.rollback();
>                         }
>                 }
>
>         }
>
> Regards

-- 
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: App Engine integration with Google Apps Marketplace

2010-07-19 Thread l.denardo
The link to generate login URL is different for apps accounts

String appsLoginUrl = userService.getOpenIdLoginUrl(redirectTo,
loginDomain,

"https://www.google.com/accounts/o8/site-xrds?hd="; +
loginDomain, attributesRequest);

loginDomain is obviously your domain, in your case the URL is
"https://www.google.com/accounts/o8/site-xrds?hd=domain1.com";

Regards
Lorenzo

On Jul 15, 11:29 pm, Daniel Pascariu 
wrote:
> Hi,
>
> I'm trying to enable SSO for my App Engine app in order to put it on
> the Google Marketplace.
> Let's say that I have my GAE app running atwww.example.com. When I
> publish it to the Google Marketplace, a Google Apps user (say
> us...@domain1.com) will be able to click on a link in the Google menu
> pointing to my site - something like 
> this:http://www.example.com/home?from=google&domain=domain1.com
>
> Now, acording to this docu (http://code.google.com/appengine/docs/java/
> users/overview.html) I should use the Users API to authenticate the
> user.
> I assume I have to use  userService.createLoginURL method somehow and
> use the domain "domain1.com" (which is passed as a parameter to my /
> home servlet).
>
> I have tried something like this:
>
> Set attributesRequest = new HashSet();
> attributesRequest.add("openid.mode=checkid_immediate");
> attributesRequest.add("openid.ns=http://specs.openid.net/auth/2.0";);
> attributesRequest.add("openid.return_to=" + thisUrl);
> userService.createLoginURL(thisUrl, "domain1.com", 
> "https://www.google.com/accounts/o8/id";, attributesRequest);
>
> The probem is that the login URL which I get works for google accounts
> only (like gmail accounts) - I do not get any Google Apps page where a
> user like us...@domain1.com could login :(
>
> Does anybody know how I can get this working ? Or am I on the wrong
> track ?
>
> Many thanks for the help !!
> Daniel

-- 
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 any solution/idea how blacklist IP in "realtime" ?

2010-07-19 Thread Marcus Brody
Hello,

I was looking for some solution which would allow me "realtime"
blacklist IPs. I didnt find any.
"Realtime" I mean without manually getting IP and change dos.xml and
upload it.

A man can upload dos.xml to bann certain IPs. Can this be done somehow
(anyhow) programmatically, even using home computer ?

I image it would be possible to let my computer run request every 5
mins to get webapplication "abusive IPs" and then upload new dos.xml ?
Is this only possible solution or I am heavily missing something ? :)

Other way I came with is to update dos.xml on gae webapp and somehow
trigger it has changed so gae will notice, problem is I dont know how
or if its even possible :)

Thank you for you time,

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