[appengine-java] Implementing custom login

2010-09-25 Thread Stakka
Anyone have tips on how to best implement custom login. Not forcing
users to have an Google account.

I've thought of two possible solutions:

* Implement custom login in a Servlet Filter, thus replacing the
standard servlet security model.

* Implement an OpenID provider, then use Federated Login with only
that provider. This will let me use the standard servlet security
model and GAE build-in UserServices.

Discuss...

-- 
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: SimpleDS: an alternative for Datastore persistence

2009-11-02 Thread Stakka

One feature I see useful for a layer atop the Low-Level API is
asynchronization. Since you'll never know how much time a Low-Level
API call will take it should automatically create Tasks for them,
writes atleast.


On Oct 22, 10:37 am, Nacho Coloma  wrote:
> Hi all,
>
> We have been developing a persistence framework for the AppEngine
> Datastore based on the raw DatastoreService API. For our (simple)
> persistence case, both JDO and JPA were a bit overkill as we were
> spending a significant amount of time jumping through hoops to make
> our application roll, but at the same time the Datastore API was a too
> low-level solution to be usable.
>
> So we reinvented our wheel. In two days.
>
> SimpleDS is a light wrapper around the DatastoreService APIs that
> provide a simple interface for java persistent classes. It does not
> include fancy stuff or any super features, it's just the
> DatastoreService ported to a world where Java entities can be
> persisted directly (using a subset of JPA annotations).  This is _not_
> a JPA/JDO replacement, and will never be. But we have been using it
> for some weeks and are quite happy with it.
>
> Any kind of feedback from the AppEngine  community would be welcome.
> Before calling the typical "but we already have JPA/JDO!" argument,
> please notice the following:
>
> * There are lots of considerations in a relational database that do
> not apply to AppEngine. This allows a specific solution to be
> simplified big time. Just see the depth of your typical stack trace to
> understand what I am talking about.
> * Solutions can be designed for specific cases that are common
> practice in AppEngine but do not apply to a relational database. See,
> for example, saving entities with a parent instance.
> * Transactions also behave a bit differently, where a "one size fits
> all" approach would probably not be the best solution.
>
> To better ilustrate with an example, these are some typical tasks
> performed with SimpleDS:
>
> Retrieve instance:
> FooBar bar = entityManager.get(key);
>
> Transform from Google Datastore Entity to java and viceversa:
> Entity entity = entityManager.datastoreToJava(bar);
>
> Save generating a  primary key, with a parent instance:
> FooBar bar = new FooBar();
> entityManager.put(parentKey, bar);
>
> More can be seen here:http://code.google.com/p/simpleds/wiki/SimpleTasks
>
> Any discussion about the current API state is welcome. This entire
> thing was rolled in two days and tested in a couple of weeks so there
> should be some bugs in between.
>
> It is important to keep in mind the current list of limitations:
>
> * Only the Key class is a supported primary key.
> * IN and != are not supported (yet). I have big concerns about
> supporting this, performance-wise.
> * Relationships are not supported. You can use Keys and collections of
> Keys for that purpose.
> * Transactions are not yet included. We are not yet sure about how to
> proceed here.
>
> As I said, this is not conceived to become a feature-complete JPA
> replacement, so please don't treat it like that.
>
> Best regards,
>
> Nacho.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: FOP support / workaround

2009-10-19 Thread Stakka

I've tried to get Apache FOP working on GAE, using java.awt.* classes
from Harmony.
I came to the conclusion it's just to much work.

Problems:
* Implement the required java.awt.* and javax.imageio.* classes.
* Implement a complete Graphics2D in java. JVMs use the OS native
drawing APIs.
* Implement font management, atleast TrueType. Same problem here, JVMs
use native.

If there was a FOP engine using iText instead, it would be easier.
iText uses alot less awt classes and got its own font manager.

Good luck - please post if you get FOP working.

On Oct 19, 10:21 am, "nicanor.babula" 
wrote:
> Got that solved by ignoring "external-graphics" tags. Now I am stuck
> with another restricted class:
> Error for /TestFOP
> java.lang.NoClassDefFoundError: java.awt.geom.AffineTransform is a
> restricted class. Please see the Google App Engine developer's guide
> for more details.
>         at
> com.google.apphosting.runtime.security.shared.stub.java.awt.geom.AffineTransform.
> (AffineTransform.java)
>         at org.apache.xmlgraphics.java2d.GraphicContext.
> (GraphicContext.java:59)
>         at org.apache.fop.render.intermediate.IFGraphicContext.
> (IFGraphicContext.java:42)
>         at org.apache.fop.render.intermediate.IFRenderer.
> (IFRenderer.java:127)
>         at
> org.apache.fop.render.RendererFactory.createRendererForDocumentHandler
> (RendererFactory.java:313)
>         at org.apache.fop.render.RendererFactory.tryIFDocumentHandlerMaker
> (RendererFactory.java:290)
>         at org.apache.fop.render.RendererFactory.createRenderer
> (RendererFactory.java:270)
>         at org.apache.fop.area.RenderPagesModel.(RenderPagesModel.java:
> 69)
>         at org.apache.fop.area.AreaTreeHandler.setupModel
> (AreaTreeHandler.java:130)
>         at org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:
> 102)
>         at org.apache.fop.render.RendererFactory.createFOEventHandler
> (RendererFactory.java:359)
>         at org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:105)
>         at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:100)
>         at org.apache.fop.apps.Fop.(Fop.java:78)
>         at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:255)
>         at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:232)
>         at cri.almaitalia.AlmaOffice.server.Servlets.TestFOP.genPDF
> (TestFOP.java:90)
>         at cri.almaitalia.AlmaOffice.server.Servlets.TestFOP.doPost
> (TestFOP.java:56)
>         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:
> 487)
>         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> (ServletHandler.java:1093)
>         at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter
> (SaveSessionFilter.java:35)
>         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> (ServletHandler.java:1084)
>         at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
> (TransactionCleanupFilter.java:43)
>         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
> (ServletHandler.java:1084)
>         at org.mortbay.jetty.servlet.ServletHandler.handle
> (ServletHandler.java:360)
>         at org.mortbay.jetty.security.SecurityHandler.handle
> (SecurityHandler.java:216)
>         at org.mortbay.jetty.servlet.SessionHandler.handle
> (SessionHandler.java:181)
>         at org.mortbay.jetty.handler.ContextHandler.handle
> (ContextHandler.java:712)
>         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> 405)
>         at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
> (AppVersionHandlerMap.java:238)
>         at org.mortbay.jetty.handler.HandlerWrapper.handle
> (HandlerWrapper.java:139)
>         at org.mortbay.jetty.Server.handle(Server.java:313)
>         at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> 506)
>         at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
> (HttpConnection.java:830)
>         at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable
> (RpcRequestParser.java:76)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>         at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest
> (JettyServletEngineAdapter.java:139)
>         at com.google.apphosting.runtime.JavaRuntime.handleRequest
> (JavaRuntime.java:239)
>         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $6.handleBlockingRequest(RuntimePb.java:5135)
>         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $6.handleBlockingRequest(RuntimePb.java:5133)
>         at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
> (BlockingApplicationHandler.java:24)
>         at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> 363)
>         at com.google

[appengine-java] Re: Low-Level Datastore API Library that abstracts large Entity (greater than 1MB) concerns.

2009-08-26 Thread Stakka

How do you get past the datastore's 1 MB entity size limit, ~20MB
transaction write limit and the 30 sec request time limit of writing
this amount of data?

On Aug 26, 9:41 am, Tristan  wrote:
> Ok, it is far from complete, but I have implemented the put(Entity)
> and the get(Key) methods around which the whole library will be based.
> The source of those two methods shows how it is possible to store
> large entities without having to worry about their sizes. If you can
> upload it, you should be able to do something like:
>
> Entity e = new Entity("myEntity", "myKey");
> e.setProperty("myProperty", <200MB Blob>);
> mindashDatastore.put(e);
>
> Design considerations:
> 1. exact implementation of the DatastoreService Interface so that
> coding practices can remain the same. (only added
> EntityCorruptException)
> 2. Text type is not supported due to predictability issues (use Blob
> instead)
>
> I acknowledge that some of my sizing assumptions may be inappropriate,
> those were my best guesses at the time.
>
> The project can be found at:http://code.google.com/p/mindash-datastore/
>
> I look forward to your feedback as the library becomes functional.
>
> -Tristan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: How to query multivalued properties in low-level Datastore API?

2009-08-25 Thread Stakka

Just and a FilterPredicate that EQUAL "hamburger" to your Query:

Quenry query = new Query("recipe");
query.addFilter("ingredients", Query.FilterOperator.EQUAL,
"hamburger");
for (Entity receipt : service.prepare(query).asIterable()) {
 // do stuff
}


On Aug 25, 2:53 pm, ted stockwell  wrote:
> Hi All,
>
> I am using the low-level Datastore API in my application.
> Suppose I store a bunch of 'Recipe' entities, where each entity has a
> multivalued property named 'ingredients", and the ingredients property
> is a set of Strings.
> For instance:
>     Entity recipe= new Entity("recipe", "tater tot casserole");
>     recipe.setProperty("ingredients", new HashSet() {{
>          add("Tater Tots");
>          add("peas");
>          add("Cream of Celery Soup");
>          add("hamburger");
>     }});
>
> Can I create a Query in the low-level API that will select all recipes
> that include 'hamburger" in the ingredients???
>
> I'm thinking that it's possible since it's supported in the JDO API,
> but I cannot see how it should be done.
>
> Thanks in advance,
> -ted stockwell
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---