[appengine-java] Re: JDO Collection of Serializables

2010-07-07 Thread l.denardo
If you are using a serialized field you must add the serialized="true"
clause to your annotation

@Persistent(serialized="true")
MySerializableObject serializable;

Also notice that JDO does not automatically detect if you update only
the inner fields of the object you save, so you must substitute it
with a copy to have it persisted.
See this post for a very good overview and an explanation of the fact
above:

http://groups.google.com/group/google-appengine-java/browse_thread/thread/747ceed8396c0ed8/b311227fbe4d9304?lnk=gst&q=serialized+fields+snippets+work#b311227fbe4d9304

Regards
Lorenzo

On Jul 7, 1:33 am, laserjim  wrote:
> Hello,
>
> I'm still trying to persist a list of serializable objects. I would
> expect this to be a standard collection as described 
> here:http://code.google.com/appengine/docs/java/datastore/dataclasses.html...
>
> FooObject is serializable, but my attempt gave me an exception:
> FooObject is not a supported property type.
>
> Everything works as expected if I replace my serializable class
> (FooObject) with String.
>
> How can I persist my list of FooObjects using 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.



[appengine-java] How to get the BlobKey from a file which was uploaded

2010-07-07 Thread Alexander Orlov
I want to get the BlobKey from a file a user has uploaded to link the
BlobKey to other information.

First I retrieve a post URL to upload the blob:

val blobstoreService = BlobstoreServiceFactory.getBlobstoreService
return blobstoreService.createUploadUrl("/")

Than I do a simple doPost() to post the file to the retrieved post
URL. But doPost is a void method and don't provide any return value.

Is there a method which provides a return value (the BlobKey) for the
file that was uploaded?

-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: JDO Collection of Serializables

2010-07-07 Thread laserjim
Hello Lorenzo,

Thanks, but perhaps my question wasn't clear.  I'm trying to make a
list of serialized objects, NOT a serialized list of objects.

For instance, assuming FooObject implements Serializable...

@Element(serialized="true)
List foos = new ArrayList();

Unfortunately, the list is always empty.  Not quite sure why.

Thanks!


On Jul 7, 2:59 am, "l.denardo"  wrote:
> If you are using a serialized field you must add the serialized="true"
> clause to your annotation
>
> @Persistent(serialized="true")
> MySerializableObject serializable;
>
> Also notice that JDO does not automatically detect if you update only
> the inner fields of the object you save, so you must substitute it
> with a copy to have it persisted.
> See this post for a very good overview and an explanation of the fact
> above:
>
> http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> Regards
> Lorenzo
>
> On Jul 7, 1:33 am, laserjim  wrote:
>
>
>
> > Hello,
>
> > I'm still trying to persist a list of serializable objects. I would
> > expect this to be a standard collection as described 
> > here:http://code.google.com/appengine/docs/java/datastore/dataclasses.html...
>
> > FooObject is serializable, but my attempt gave me an exception:
> > FooObject is not a supported property type.
>
> > Everything works as expected if I replace my serializable class
> > (FooObject) with String.
>
> > How can I persist my list of FooObjects using 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.



[appengine-java] Re: JDO Collection of Serializables

2010-07-07 Thread l.denardo
Hello,
I guess your problem is the behavior of serialized fields (including
collections of them, as far as I know), which is explained in Max
Ross's post.
Or something related to that.

Anyway, some property fields are marked as "updated" and hence saved
in the datastore only if you update the reference to the field, and
they're not updated if you just use modifiers to operate on them.
In practice, something like

 ArrayList list = "retrieve from datastore"
list.add(Foo foo)
close persistence manager

Does not modify the list in the datastore, so if it's saved as an
empty list at creation it remains empty.
Doing

 ArrayList list = "retrieve from datastore"
 ArrayList copy = new ArrayList(list);
 copy.add(Foo foo)
 list = copy;
close PM

Usually makes everything work, since the original list field is marked
as "updated" and persisted.
As far as I know this is true both for serialized fields and for many
collections.

Regards
Lorenzo

On Jul 7, 1:28 pm, laserjim  wrote:
> Hello Lorenzo,
>
> Thanks, but perhaps my question wasn't clear.  I'm trying to make a
> list of serialized objects, NOT a serialized list of objects.
>
> For instance, assuming FooObject implements Serializable...
>
> @Element(serialized="true)
> List foos = new ArrayList();
>
> Unfortunately, the list is always empty.  Not quite sure why.
>
> Thanks!
>
> On Jul 7, 2:59 am, "l.denardo"  wrote:
>
> > If you are using a serialized field you must add the serialized="true"
> > clause to your annotation
>
> > @Persistent(serialized="true")
> > MySerializableObject serializable;
>
> > Also notice that JDO does not automatically detect if you update only
> > the inner fields of the object you save, so you must substitute it
> > with a copy to have it persisted.
> > See this post for a very good overview and an explanation of the fact
> > above:
>
> >http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> > Regards
> > Lorenzo
>
> > On Jul 7, 1:33 am, laserjim  wrote:
>
> > > Hello,
>
> > > I'm still trying to persist a list of serializable objects. I would
> > > expect this to be a standard collection as described 
> > > here:http://code.google.com/appengine/docs/java/datastore/dataclasses.html...
>
> > > FooObject is serializable, but my attempt gave me an exception:
> > > FooObject is not a supported property type.
>
> > > Everything works as expected if I replace my serializable class
> > > (FooObject) with String.
>
> > > How can I persist my list of FooObjects using 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.



Re: [appengine-java] Facing errors when installing the google plugin for eclipse.

2010-07-07 Thread Jason Parekh
This might be happening because of a flaky internet connection.  You can try
again (it's been 2 days since you originally posted) or download the
standalone zip file of the plugin which you unzip into your eclipse/dropins
directory.  See http://code.google.com/eclipse/docs/install-from-zip.html for
GPE 1.3.

jason

On Mon, Jul 5, 2010 at 12:34 PM, Siddharth Naik wrote:

> Hi,
>
> I face an error regarding 'String index out of range 0'. I am using
> Eclipse Galileo and jdk 1.6.0_03 32 bit.
>
> Thanks.
>
> Below is the complete error log.
>
> --
>
> !SESSION 2010-07-04 19:47:36.550
> ---
> eclipse.buildId=M20100211-1343
> java.version=1.6.0_03
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Framework arguments:  XX:MaxPermSize=256M
> Command-line arguments:  -os win32 -ws win32 -arch x86
> XX:MaxPermSize=256M
>
> !ENTRY org.eclipse.ecf.provider.filetransfer 4 1001 2010-07-04
> 19:58:46.294
> !MESSAGE Transfer Exception
> !STACK 0
> java.net.SocketTimeoutException: Read timed out
>at java.net.SocketInputStream.socketRead0(Native Method)
>at java.net.SocketInputStream.read(SocketInputStream.java:129)
>at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
>at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
>at
>
> org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:
> 170)
>at java.io.FilterInputStream.read(FilterInputStream.java:116)
>at
>
> org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:
> 108)
>at java.io.FilterInputStream.read(FilterInputStream.java:90)
>at
>
> org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:
> 127)
>at
> org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer
> $1.performFileTransfer(AbstractRetrieveFileTransfer.java:140)
>at
> org.eclipse.ecf.filetransfer.FileTransferJob.run(FileTransferJob.java:
> 73)
>at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
> !ENTRY org.eclipse.equinox.p2.engine 4 4 2010-07-04 20:04:00.360
> !MESSAGE An error occurred while installing the items
> !SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2010-07-04 20:04:00.360
> !MESSAGE session context was:(profile=SDKProfile,
> phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Install,
> operand=null --> [R]com.google.appengine.eclipse.core
> 1.3.3.v201006111302,
>
> action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).
> !SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2010-07-04 20:04:00.360
> !MESSAGE String index out of range: 0
> !STACK 0
> java.lang.StringIndexOutOfBoundsException: String index out of range:
> 0
>at java.lang.String.charAt(String.java:687)
>at
>
> org.eclipse.equinox.internal.frameworkadmin.equinox.ParserUtils.getValueForArgument(ParserUtils.java:
> 124)
>at
>
> org.eclipse.equinox.internal.frameworkadmin.equinox.EclipseLauncherParser.getStartup(EclipseLauncherParser.java:
> 224)
>at
>
> org.eclipse.equinox.internal.frameworkadmin.equinox.EclipseLauncherParser.read(EclipseLauncherParser.java:
> 59)
>at
>
> org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImpl.loadWithoutFwPersistentData(EquinoxManipulatorImpl.java:
> 358)
>at
>
> org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImpl.load(EquinoxManipulatorImpl.java:
> 331)
>at
>
> org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.loadDelegate(LazyManipulator.java:
> 50)
>at
>
> org.eclipse.equinox.internal.p2.touchpoint.eclipse.LazyManipulator.getConfigData(LazyManipulator.java:
> 108)
>at
>
> org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.installBundle(InstallBundleAction.java:
> 76)
>at
>
> org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction.execute(InstallBundleAction.java:
> 29)
>at
>
> org.eclipse.equinox.internal.p2.engine.ParameterizedProvisioningAction.execute(ParameterizedProvisioningAction.java:
> 35)
>at
>
> org.eclipse.equinox.internal.provisional.p2.engine.Phase.mainPerform(Phase.java:
> 129)
>at
>
> org.eclipse.equinox.internal.provisional.p2.engine.Phase.perform(Phase.java:
> 72)
>at
>
> org.eclipse.equinox.internal.provisional.p2.engine.PhaseSet.perform(PhaseSet.java:
> 44)
>at
>
> org.eclipse.equinox.internal.provisional.p2.engine.Engine.perform(Engine.java:
> 54)
>at
>
> org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil.performProvisioningPlan(ProvisioningUtil.java:
> 389)
>at
>
> org.eclipse.equinox.internal.provisional.p2.ui.operations.Pr

Re: [appengine-java] DataNucleus Enhancer failed to run

2010-07-07 Thread Jason Parekh
Hi Ravi,

You might try moving your workspace closer to the root directory, for
example from C:\Some\Long\Path\To\Your\Workspace to C:\Workspace.  We're
tracking this issue in
http://code.google.com/p/google-web-toolkit/issues/detail?id=4395 .

jason

On Sun, Jul 4, 2010 at 1:53 PM, Ravi  wrote:

> Hi,
> I was working happily, changed few lines of java code(didnt touch any
> eclipse setting or installed any thing new or added extar jar in
> classpth) and then started getting follwoing error. Please help spent
> half a day and not able to understand how this error emerged. Googled
> this error an dpeople are saying that if classpth goes long then this
> error comes but i have not changed classpth since few days, just
> writing new java files.
>
> DataNucleus Enhancer has encountered a problem
>
> Error
> Sun Jul 04 18:45:14 BST 2010
> Cannot run program "C:\Program Files (x86)\Java\jdk1.6.0_17\bin
> \javaw.exe" (in directory "Y:\projects\New-Eclipse-Workspace
> \TestGwt"): CreateProcess error=87, The parameter is incorrect
>
>
> eclipse.buildId=
> java.version=1.6.0_20
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
> Framework arguments:  -product org.eclipse.epp.package.jee.product
> Command-line arguments:  -os win32 -ws win32 -arch x86 -product
> org.eclipse.epp.package.jee.product -clean
>
>
>
> java.io.IOException: Cannot run program "C:\Program Files (x86)\Java
> \jdk1.6.0_17\bin\javaw.exe" (in directory "Y:\projects\New-Eclipse-
> Workspace\TestGwt"): CreateProcess error=87, The parameter is
> incorrect
> at java.lang.ProcessBuilder.start(Unknown Source)
> at
>
> com.google.gdt.eclipse.core.ProcessUtilities.launchProcessAndActivateOnError(ProcessUtilities.java:
> 195)
> at
>
> com.google.appengine.eclipse.core.orm.enhancement.EnhancerJob.runInWorkspace(EnhancerJob.java:
> 78)
> at
>
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:
> 38)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> Caused by: java.io.IOException: CreateProcess error=87, The parameter
> is incorrect
> at java.lang.ProcessImpl.create(Native Method)
> at java.lang.ProcessImpl.(Unknown Source)
> at java.lang.ProcessImpl.start(Unknown Source)
> ... 5 more
>
> --
> 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] Desarrollo de Aplicaciones con Eclipse

2010-07-07 Thread Guillermo Schwarz
Edixon,


¿Lo quieres hacer en Google Application Engine?

Saludos,
Guillermo.

2010/7/6 Edixon Polanco 

> Buenas Tardes.
>
> Como puedo empezar a desarrollar una aplicación que funcione como una
> biblioteca en la cual pueda subir mis archivos o libros y poder buscar
> dentro de ellos
>
> Nota: Espero me puedan dar alguna idea
>
> Gracias.
>
> --
> 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.
>
>


-- 
Saludos cordiales,

Guillermo Schwarz
Sun Certified Enterprise Architect

-- 
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: Confused by jdo relationships

2010-07-07 Thread poe
I've got a question regarding this.

Isn't it kind of "nicer" regarding the design to not store relational
Attributes in a core table/class. In the given example I would
implement this like this:


@PersistenceCapable
public class Categories
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long Id;

No owned or unowner object here
...
}

@PersistenceCapable
public class CategoryGroups
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long Id;
...
}

@PersistenceCapable
public class CategoryGroupRelation {


   @PrimaryKey
   @Persistent(mappedBy="category")
   private Long categoryId;

   @Persistent(mappedBy="categorygroups"
   private Long categoryGroupId;

}

Isn't it better to design the tables this way? I don't like relational
attributes in a core database class. What do you think?

Greets
Poe


On 7 Jul., 01:25, AC  wrote:
> Thanks.  That answers my question.
>
> On Jul 6, 3:18 pm, Ravi Sharma  wrote:
>
>
>
> > You need to understand the concept of Entity group here, and need to
> > understand the owned relation and unowned relation.
> > Think of owned and unowned relation like this
> > You(your house) and your TV has owned relationship, your house has TV, no ne
> > can see it from outside, and if your friend want the same tv he need to buy
> > the same TV and own it. And at one point if you ask who all watching my TV
> > then it will be just you not your friend as he has his own TV(although same
> > kind of TV).
>
> > But You and your favourite movie theatre has unowned relationship, you dont
> > own it, anyone who knows the address of theatre can go and watch movie. and
> > at one moment 1000s of people might be watching the same movie/theatre
>
> > Back to your question.
>
> > Categories(3)/CategoryGroups(4)     is an example for owned relation.
> > CategoryGroup(4) will be available to Category(3) only and if you create
> > another category Cateory(10) with same category group it will just create
> > another version of categoryGroup CategoryGroup(11) in that category. But you
> > may see that CategoryGroup 11 and CategoryGroup 4 both are Entertainment.
>
> > In your case many categories can have same categoryGroup.So instead of using
> > owned relationship, you should use unowned relationship.
>
> > Instead of this
> > @Persistent
> >    private CategoryGroups Group;
>
> > define this
> > @Persistent
> >    private Key categoryGroupId;
>
> > and save key of CategoryGroup rather then full object. (Dont buy a TV for
> > every other rmovie you want to watch, just buy a movie theatre ticket go
> > there and use that :) )
>
> > I hope u get the idea,  you can learn more from here
>
> >http://code.google.com/appengine/docs/java/datastore/relationships.html
>
> > spare me if you dont like my example... :)
>
> > Ravi.
>
> > On Tue, Jul 6, 2010 at 5:47 PM, AC  wrote:
> > > I just started fooling around w/ GAE this weekend.
>
> > > I have a Categories class and a CategoryGroup class.  The idea is that
> > > every category must be grouped.  For example the CategoryGroup
> > > "Entertainment" can be assigned to many Categories, such as "movies",
> > > "music" and "television".
>
> > > Here are my classes.
>
> > > @PersistenceCapable
> > > public class Categories
> > > {
> > >   �...@primarykey
> > >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > >        private Key Id;
>
> > >   �...@persistent
> > >    private CategoryGroups Group;
>
> > >       �...@persistent
> > >        private boolean IsDeleted;
>
> > >       �...@persistent
> > >        private String Name;
>
> > >       �...@persistent
> > >        private Date CreateDate;
>
> > >       �...@persistent
> > >       �...@column(allowsNull="true")
> > >    private Date ModifiedDate;
> > > }
>
> > > @PersistenceCapable
> > > public class CategoryGroups
> > > {
> > >       �...@primarykey
> > >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > >        private Key Id;
>
> > >       �...@persistent
> > >    boolean IsDeleted;
>
> > >       �...@persistent
> > >    String Name;
>
> > >       �...@persistent
> > >    Date CreateDate;
>
> > >       �...@persistent
> > >       �...@column(allowsNull="true")
> > >    Date ModifiedDate;
> > > }
>
> > > First I add a record to CategoryGroups.  When I query all, the reult
> > > is :
>
> > > CategoryGroups(2)
>
> > > Next, I add a record to Categories.  When I query all CategoryGroups,
> > > the result is :
>
> > > Categories(3)/CategoryGroups(4)
> > > CategoryGroups(2)
>
> > > I do not doubt that this works as it was designed to, however, coming
> > > from a RDBMS background, this is very confusing to me.  The screen I
> > > created to manage Categories now has "Entertainment" listed twice in
> > > the CategoryGroups select box.  Is there a better approach to achieve
> > > my goal?
>
> > > Any advice is much appreciated.
>
> > > --
> > > You received this mess

[appengine-java] How to write to log file

2010-07-07 Thread MANISH DHIMAN
Hi All
I want to write to a log file , please give me some details about it.

-- 
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] How to write to log file

2010-07-07 Thread Pieter Coucke
You can not log to a file, but App Engine has a log console.

See
http://code.google.com/intl/nl-BE/appengine/docs/java/runtime.html#Logging


On Wed, Jul 7, 2010 at 4:37 PM, MANISH DHIMAN  wrote:

> Hi All
> I want to write to a log file , please give me some details about it.
>
> --
> 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.
>
>


-- 
Pieter Coucke
Onthoo BVBA
http://www.onthoo.com
http://www.koopjeszoeker.be

-- 
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: Confused by jdo relationships

2010-07-07 Thread Ravi Sharma
Hi Poe,
You have just implemented relational many to many relation. 

But this design is perfectly fine but just think if you need one to many 
relation only then in your case you will be writing 2 entities while u could 
just write one by saving catehoryGroup id in category it self.
And when u want to read category and catehorygroup, u need to read three 
entities while u could read just two.

So for one to many relations I will use unowned relation and save some write 
and read :).

GAE doesn't say u can't think relational :).

Thanks
Ravi

Sent from my iPhone

On 7 Jul 2010, at 15:18, poe  wrote:

> I've got a question regarding this.
> 
> Isn't it kind of "nicer" regarding the design to not store relational
> Attributes in a core table/class. In the given example I would
> implement this like this:
> 
> 
> @PersistenceCapable
> public class Categories
> {
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Long Id;
> 
>No owned or unowner object here
>...
> }
> 
> @PersistenceCapable
> public class CategoryGroups
> {
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Long Id;
>...
> }
> 
> @PersistenceCapable
> public class CategoryGroupRelation {
> 
> 
>   @PrimaryKey
>   @Persistent(mappedBy="category")
>   private Long categoryId;
> 
>   @Persistent(mappedBy="categorygroups"
>   private Long categoryGroupId;
> 
> }
> 
> Isn't it better to design the tables this way? I don't like relational
> attributes in a core database class. What do you think?
> 
> Greets
> Poe
> 
> 
> On 7 Jul., 01:25, AC  wrote:
>> Thanks.  That answers my question.
>> 
>> On Jul 6, 3:18 pm, Ravi Sharma  wrote:
>> 
>> 
>> 
>>> You need to understand the concept of Entity group here, and need to
>>> understand the owned relation and unowned relation.
>>> Think of owned and unowned relation like this
>>> You(your house) and your TV has owned relationship, your house has TV, no ne
>>> can see it from outside, and if your friend want the same tv he need to buy
>>> the same TV and own it. And at one point if you ask who all watching my TV
>>> then it will be just you not your friend as he has his own TV(although same
>>> kind of TV).
>> 
>>> But You and your favourite movie theatre has unowned relationship, you dont
>>> own it, anyone who knows the address of theatre can go and watch movie. and
>>> at one moment 1000s of people might be watching the same movie/theatre
>> 
>>> Back to your question.
>> 
>>> Categories(3)/CategoryGroups(4) is an example for owned relation.
>>> CategoryGroup(4) will be available to Category(3) only and if you create
>>> another category Cateory(10) with same category group it will just create
>>> another version of categoryGroup CategoryGroup(11) in that category. But you
>>> may see that CategoryGroup 11 and CategoryGroup 4 both are Entertainment.
>> 
>>> In your case many categories can have same categoryGroup.So instead of using
>>> owned relationship, you should use unowned relationship.
>> 
>>> Instead of this
>>> @Persistent
>>>private CategoryGroups Group;
>> 
>>> define this
>>> @Persistent
>>>private Key categoryGroupId;
>> 
>>> and save key of CategoryGroup rather then full object. (Dont buy a TV for
>>> every other rmovie you want to watch, just buy a movie theatre ticket go
>>> there and use that :) )
>> 
>>> I hope u get the idea,  you can learn more from here
>> 
>>> http://code.google.com/appengine/docs/java/datastore/relationships.html
>> 
>>> spare me if you dont like my example... :)
>> 
>>> Ravi.
>> 
>>> On Tue, Jul 6, 2010 at 5:47 PM, AC  wrote:
 I just started fooling around w/ GAE this weekend.
>> 
 I have a Categories class and a CategoryGroup class.  The idea is that
 every category must be grouped.  For example the CategoryGroup
 "Entertainment" can be assigned to many Categories, such as "movies",
 "music" and "television".
>> 
 Here are my classes.
>> 
 @PersistenceCapable
 public class Categories
 {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key Id;
>> 
@Persistent
private CategoryGroups Group;
>> 
@Persistent
private boolean IsDeleted;
>> 
@Persistent
private String Name;
>> 
@Persistent
private Date CreateDate;
>> 
@Persistent
@Column(allowsNull="true")
private Date ModifiedDate;
 }
>> 
 @PersistenceCapable
 public class CategoryGroups
 {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key Id;
>> 
@Persistent
boolean IsDeleted;
>> 
@Persistent
String Name;
>> 
@Persistent
Date CreateDate;
>> 
@Persistent
@Column(allowsNull="true")
Date ModifiedDate;
 }
>> 
 F

[appengine-java] Re: Confused by jdo relationships

2010-07-07 Thread poe
Hi Ravi,

the relation is still a one to one relation because the
categoryGroupRelation holds a categoryId as a primary Key, so the
relation only holds one or zero categoryId for ever Category and
thereby every Category has only one CategoryGroup.

But my question is more about design principles. Isn't it better to
separate the data from relations? Lets say you create a User class on
the first Version of you App. You store thinks like eMail, names,
birthdays and so on in this class. In a second version of you App you
want to extend the database schema with user groups. By then you only
need to add two new classes Groups and UserGroupsRelations to
accomplish this and don't need to extends or alter the original User
class (Think about altering all the old User objects that are still in
the datastore, what are the inital values for this new attribute?).

There is another advantage: If you implement the userGroups relation
in the UserClass you only get all Users from one Group by making a
query over all Users insted of just checking the relations. You could
simply get allUsersFromAGroup and allGroupsFromAUser over this class.

Tell me how you would implement this and what are your experiences?

Thanks and greetings
Poe

On 7 Jul., 16:46, Ravi Sharma  wrote:
> Hi Poe,
> You have just implemented relational many to many relation.
>
> But this design is perfectly fine but just think if you need one to many 
> relation only then in your case you will be writing 2 entities while u could 
> just write one by saving catehoryGroup id in category it self.
> And when u want to read category and catehorygroup, u need to read three 
> entities while u could read just two.
>
> So for one to many relations I will use unowned relation and save some write 
> and read :).
>
> GAE doesn't say u can't think relational :).
>
> Thanks
> Ravi
>
> Sent from my iPhone
>
> On 7 Jul 2010, at 15:18, poe  wrote:
>
>
>
> > I've got a question regarding this.
>
> > Isn't it kind of "nicer" regarding the design to not store relational
> > Attributes in a core table/class. In the given example I would
> > implement this like this:
>
> > @PersistenceCapable
> > public class Categories
> > {
> >   �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >        private Long Id;
>
> >    No owned or unowner object here
> >    ...
> > }
>
> > @PersistenceCapable
> > public class CategoryGroups
> > {
> >       �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >        private Long Id;
> >    ...
> > }
>
> > @PersistenceCapable
> > public class CategoryGroupRelation {
>
> >   @PrimaryKey
> >   @Persistent(mappedBy="category")
> >   private Long categoryId;
>
> >   @Persistent(mappedBy="categorygroups"
> >   private Long categoryGroupId;
>
> > }
>
> > Isn't it better to design the tables this way? I don't like relational
> > attributes in a core database class. What do you think?
>
> > Greets
> > Poe
>
> > On 7 Jul., 01:25, AC  wrote:
> >> Thanks.  That answers my question.
>
> >> On Jul 6, 3:18 pm, Ravi Sharma  wrote:
>
> >>> You need to understand the concept of Entity group here, and need to
> >>> understand the owned relation and unowned relation.
> >>> Think of owned and unowned relation like this
> >>> You(your house) and your TV has owned relationship, your house has TV, no 
> >>> ne
> >>> can see it from outside, and if your friend want the same tv he need to 
> >>> buy
> >>> the same TV and own it. And at one point if you ask who all watching my TV
> >>> then it will be just you not your friend as he has his own TV(although 
> >>> same
> >>> kind of TV).
>
> >>> But You and your favourite movie theatre has unowned relationship, you 
> >>> dont
> >>> own it, anyone who knows the address of theatre can go and watch movie. 
> >>> and
> >>> at one moment 1000s of people might be watching the same movie/theatre
>
> >>> Back to your question.
>
> >>> Categories(3)/CategoryGroups(4)     is an example for owned relation.
> >>> CategoryGroup(4) will be available to Category(3) only and if you create
> >>> another category Cateory(10) with same category group it will just create
> >>> another version of categoryGroup CategoryGroup(11) in that category. But 
> >>> you
> >>> may see that CategoryGroup 11 and CategoryGroup 4 both are Entertainment.
>
> >>> In your case many categories can have same categoryGroup.So instead of 
> >>> using
> >>> owned relationship, you should use unowned relationship.
>
> >>> Instead of this
> >>> @Persistent
> >>>    private CategoryGroups Group;
>
> >>> define this
> >>> @Persistent
> >>>    private Key categoryGroupId;
>
> >>> and save key of CategoryGroup rather then full object. (Dont buy a TV for
> >>> every other rmovie you want to watch, just buy a movie theatre ticket go
> >>> there and use that :) )
>
> >>> I hope u get the idea,  you can learn more from here
>
> >>>http://code.google.com/appengine/docs/java/datastore/relationships.html

[appengine-java] Frustrations with Performance

2010-07-07 Thread praseed
Folks,

I hope I have the right audience.

I am an Independent Software Vendor (read: small software business)
and I have developed a GWT/GAE product.

Things were good during development (plugin et al). I was able to get
features developed quickly.

However, the application performance these days has been dicey to say
the least.

A simple click of a button tends to get 5 to 6 seconds to respond at
times. Dont have any concurrent users right now. The Appspot dashboard
does not show any issues and I am well below the quota.

I have upgraded to the latest GAE engine.

The App is absolutely horrendous to use due to this. As an ISV, I
cannot demo this to my prospective customers and I cant "market" the
cloud availability, Google performance etc.., -- coz that seems to be
the downfall of my app.

The App performs way better on my laptop. The moment it is deployed,
it is bloody slow.

I am aware of the current datastore issues at Google. Is that the sole
reason for this , almost pervasive issue?

Google AppEngine for Business has been announced. Any time tables?
Will it address these issues?

Can someone address this? How about other developers? Can anyone chime
in here...

Cheers
Strawman

-- 
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 Collection of Serializables

2010-07-07 Thread laserjim
Hey,

I agree that your comments above are true for serialized fields, but I
can't find any documentation indicating such a behavior for
collections (I assume "supported collections" here, as described in
dataclasses#Collections).  My understanding is that a collection
should behave correctly (inserts, deletes, etc) unless the list its
self is serialized.  Can you provide a counter-example?

With regards to the article Max Ross wrote (very good article by the
way), the trick he used (where he made a copy in order to change the
reference) was intended to "dirty" the state when a member is
modified.  My FooObjects are immutable, so I don't think this applies
to me.  Max Ross' article is completely consistent with my
understanding of the documentation, but it's entirely possible I
missed something, so let me know if this doesn't sound right to you.

I BELIEVE the issue I'm running into is rooted in the exception I get
when trying to persist a populated instance of the list: "FooObject is
not a supported property type."  I'm just not understanding why it
isn't supported.  I would have expected that any serializable object
would be permitted, especially if the @Element(serialized="true")
annotation is specified.

Basically, I'm looking for a code fragment that demonstrates the
persistence of a collection of (more than one) non-standard
serializable objects.

Any ideas?

Thanks!


On Jul 7, 5:05 am, "l.denardo"  wrote:
> Hello,
> I guess your problem is the behavior of serialized fields (including
> collections of them, as far as I know), which is explained in Max
> Ross's post.
> Or something related to that.
>
> Anyway, some property fields are marked as "updated" and hence saved
> in the datastore only if you update the reference to the field, and
> they're not updated if you just use modifiers to operate on them.
> In practice, something like
>
>  ArrayList list = "retrieve from datastore"
> list.add(Foo foo)
> close persistence manager
>
> Does not modify the list in the datastore, so if it's saved as an
> empty list at creation it remains empty.
> Doing
>
>  ArrayList list = "retrieve from datastore"
>  ArrayList copy = new ArrayList(list);
>  copy.add(Foo foo)
>  list = copy;
> close PM
>
> Usually makes everything work, since the original list field is marked
> as "updated" and persisted.
> As far as I know this is true both for serialized fields and for many
> collections.
>
> Regards
> Lorenzo
>
> On Jul 7, 1:28 pm, laserjim  wrote:
>
>
>
> > Hello Lorenzo,
>
> > Thanks, but perhaps my question wasn't clear.  I'm trying to make a
> > list of serialized objects, NOT a serialized list of objects.
>
> > For instance, assuming FooObject implements Serializable...
>
> > @Element(serialized="true)
> > List foos = new ArrayList();
>
> > Unfortunately, the list is always empty.  Not quite sure why.
>
> > Thanks!
>
> > On Jul 7, 2:59 am, "l.denardo"  wrote:
>
> > > If you are using a serialized field you must add the serialized="true"
> > > clause to your annotation
>
> > > @Persistent(serialized="true")
> > > MySerializableObject serializable;
>
> > > Also notice that JDO does not automatically detect if you update only
> > > the inner fields of the object you save, so you must substitute it
> > > with a copy to have it persisted.
> > > See this post for a very good overview and an explanation of the fact
> > > above:
>
> > >http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> > > Regards
> > > Lorenzo
>
> > > On Jul 7, 1:33 am, laserjim  wrote:
>
> > > > Hello,
>
> > > > I'm still trying to persist a list of serializable objects. I would
> > > > expect this to be a standard collection as described 
> > > > here:http://code.google.com/appengine/docs/java/datastore/dataclasses.html...
>
> > > > FooObject is serializable, but my attempt gave me an exception:
> > > > FooObject is not a supported property type.
>
> > > > Everything works as expected if I replace my serializable class
> > > > (FooObject) with String.
>
> > > > How can I persist my list of FooObjects using 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.



[appengine-java] Turning on GWT in the project causes class not found excepction in my appengine code.

2010-07-07 Thread emurmur
I have an Java App Engine project using SDK 1.3.5 and the latest
Restlet GAE 2.0rc4 to implement some restful services.  Everything
worked well (this has been in product for 6 months) until I added GWT
to the project.  As soon as I check GWT on in the control panel
(without even adding a module) my services start to fail in the
development server with the following class not found exception:

Couldn't write the XML representation: Provider
org.apache.xalan.processor.TransformerFactoryImpl not found

Any clues why simply turning GWT on would cause this?  Any solutions
that you know of?  Thanks much.

-- 
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 use the data in local datastore uploaded by bulk loader?

2010-07-07 Thread Fox W
Hi,every one!
I uploaded some data into local datastore, but I found Python and Java
are using different files to store data.
I want to debug my program in local, is there any solution?
Thanks in advance!

-- 
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: Spring Security + GAE

2010-07-07 Thread oserra
And could you please provide us an example of your dispacher-
servlet.xml (or whatever spring file you use to configure spring-
security)?
I don't use GWT.

Thank you very much.


On 12 jun, 15:26, Sudhir Ramanandi  wrote:
> I have Spring security running properly on GAE...  But I don't use GWT..
> What help are you looking for...
>
> On Fri, Jun 11, 2010 at 11:39 PM, Cleber Dantas Silva 
> wrote:
>
>
>
>
>
> > Hi!
>
> > I need help to integrate Spring Security 3.0.2 with GWT RPC Methods.
>
> > Do you have any sample project or configuration to help me?
>
> > Thanks!
> > Cleber
>
> > --
> > 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.
>
> --
> Sudhir Ramanandihttp://www.ramanandi.org

-- 
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 Collection of Serializables

2010-07-07 Thread Jim
Hello Lorenzo,

Thanks, but perhaps my question wasn't completely clear.  Direct
serialization using the @Persistent annotation works fine for me.  I'm
trying to create a list of serialized objects, NOT a serialized list
of objects.

I run into the issue when trying to create a list of serializable
objects.  For instance, if we assume FooObject implements
Serializable, and try the following:

@Element(serialized="true")
List foos = new ArrayList();

The list will always be empty, contrary to my expectations.

Thanks!


On Jul 7, 2:59 am, "l.denardo"  wrote:
> If you are using a serialized field you must add the serialized="true"
> clause to your annotation
>
> @Persistent(serialized="true")
> MySerializableObject serializable;
>
> Also notice that JDO does not automatically detect if you update only
> the inner fields of the object you save, so you must substitute it
> with a copy to have it persisted.
> See this post for a very good overview and an explanation of the fact
> above:
>
> http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> Regards
> Lorenzo
>
> On Jul 7, 1:33 am, laserjim  wrote:
>
>
>
> > Hello,
>
> > I'm still trying to persist a list of serializable objects. I would
> > expect this to be a standard collection as described 
> > here:http://code.google.com/appengine/docs/java/datastore/dataclasses.html...
>
> > FooObject is serializable, but my attempt gave me an exception:
> > FooObject is not a supported property type.
>
> > Everything works as expected if I replace my serializable class
> > (FooObject) with String.
>
> > How can I persist my list of FooObjects using 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.



[appengine-java] Error: The API package 'urlfetch' or call 'Fetch()' was not found.

2010-07-07 Thread [jake]
I'm using jetty outside of the dev_appserver.sh environment.

When I try to use com.google.appengine.api.urlfetch package, I get the
following error:

The API package 'urlfetch' or call 'Fetch()' was not found.
  [Thrown class com.google.apphosting.api.ApiProxy
$CallNotFoundException]

I don't get any errors trying to import
com.google.appengine.api.urlfetch so I think the problem lies in how I
set up an ApiProxy Environment.  I'm probably missing the relevant
entries to enable urlfetch.

Any tips on how to make this service available outside of the
dev_appserver.sh environment?

[jake]

-- 
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] Cannot see 'New Web Application' in New menu

2010-07-07 Thread John
I've installed the google plugin into a clean install of Eclipse 3.6
on ubuntu. The install finished without reporting any errors, and
eclipse restarted successfully, but the File -> New option doesn't
have the Web Application Project choice in it.

Can someone tell me what I've done wrong?

John

-- 
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] Context Denpency Injection

2010-07-07 Thread [Sh4d]
Will CDI (J2EE 6) play in App Engine?

-- 
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: SQL Like operator with %

2010-07-07 Thread Julian!
Hi There

searchWords is a List of User entity that contains All tokens?

the filter in de JDOQL  WHERE searchWords == \""+tag.toUpperCase()+.
find some token in all elements on the List property ???


Thanks !!


On 2 jul, 06:49, RAVINDER MAAN  wrote:
> we can set it in following way
>
>   public class User {
>
> @Persistent(defaultFetchGroup="true")
> private Set searchWords;
>
> public static void getCombination(String word,Set searchWords){
> word = word.trim().toUpperCase();
> if(word == null || "".equals(word))
> return ;
> int wordLength = word.length();
> while(true){
> for(int i=0;i searchWords.add(word.substring(i, wordLength));}
>
> for(int i=wordLength-1;i > 1;i--){
> searchWords.add(word.substring(0, i));}
>
> word = word.substring(1,wordLength-1);
> wordLength = word.length();
> if(wordLength <= 2)
> break;
> else
> searchWords.add(word);}
> return ;
> }
>
> public List search(String tag){
> PersistenceManager pm = PMF.getPM();
> Transaction tx=pm.currentTransaction();
> try
> {
>  tx.begin();
>
>     Query q = pm.newQuery("javax.jdo.query.JDOQL","SELECT FROM
> "+User.class.getName()+" WHERE searchWords == \""+tag.toUpperCase()+"\"");
>     q.setRange(0,10);
>     List c = (List)q.execute();
>     tx.commit();
>     return c;}
>
> finally
> {
>     if (tx.isActive())
>     {
>         tx.rollback();
>     }
>
>     pm.close();}
>
>  }
>
> }
>
> You can modify getCombination the way you want.
>
> --
>
> Regards,
> Ravinder Singh Maan

-- 
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] Deployment failed (Client Error 400)

2010-07-07 Thread myownwaste...@googlemail.com
I constantly get these errors when deploying to appengine. Although
the development mode works:


java.io.IOException: Error posting to URL:
https://appengine.google.com/api/appversion/deploy?app_id=errai-demo&version=1&;
400 Bad Request

Client Error (400)
The request is invalid for an unspecified reason.

-- 
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: SQL Like operator with %

2010-07-07 Thread RAVINDER MAAN
searchWords is list of strings.

On Wed, Jul 7, 2010 at 4:38 AM, Julian!  wrote:

> Hi There
>
> searchWords is a List of User entity that contains All tokens?
>
> the filter in de JDOQL  WHERE searchWords == \""+tag.toUpperCase()+.
> find some token in all elements on the List property ???
>
>
> Thanks !!
>
>
> On 2 jul, 06:49, RAVINDER MAAN  wrote:
> > we can set it in following way
> >
> >   public class User {
> >
> > @Persistent(defaultFetchGroup="true")
> > private Set searchWords;
> >
> > public static void getCombination(String word,Set searchWords){
> > word = word.trim().toUpperCase();
> > if(word == null || "".equals(word))
> > return ;
> > int wordLength = word.length();
> > while(true){
> > for(int i=0;i > searchWords.add(word.substring(i, wordLength));}
> >
> > for(int i=wordLength-1;i > 1;i--){
> > searchWords.add(word.substring(0, i));}
> >
> > word = word.substring(1,wordLength-1);
> > wordLength = word.length();
> > if(wordLength <= 2)
> > break;
> > else
> > searchWords.add(word);}
> > return ;
> > }
> >
> > public List search(String tag){
> > PersistenceManager pm = PMF.getPM();
> > Transaction tx=pm.currentTransaction();
> > try
> > {
> >  tx.begin();
> >
> > Query q = pm.newQuery("javax.jdo.query.JDOQL","SELECT FROM
> > "+User.class.getName()+" WHERE searchWords ==
> \""+tag.toUpperCase()+"\"");
> > q.setRange(0,10);
> > List c = (List)q.execute();
> > tx.commit();
> > return c;}
> >
> > finally
> > {
> > if (tx.isActive())
> > {
> > tx.rollback();
> > }
> >
> > pm.close();}
> >
> >  }
> >
> > }
> >
> > You can modify getCombination the way you want.
> >
> > --
> >
> > Regards,
> > Ravinder Singh Maan
>
> --
> 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.
>
>


-- 
Regards,
Ravinder Singh Maan

-- 
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 Collection of Serializables

2010-07-07 Thread laserjim
Hey,

I've attached some example code for reference:

public class FooObject implements Serializable
{
private final String name;
public FooObject(String name)
{
this.name = name;
}
public String toString()
{
return name;
}
}


@PersistenceCapable
public class Entity
{
@Element(serialized="true")
List foos = new ArrayList();

public void addFoo(FooObject foo)
{
foos.add(foo);
}
public List getFoos()
{
return foos;
}
}


Please let me know if you see the problem.

Thanks!


On Jul 7, 10:30 am, laserjim  wrote:
> Hey,
>
> I agree that your comments above are true for serialized fields, but I
> can't find any documentation indicating such a behavior for
> collections (I assume "supported collections" here, as described in
> dataclasses#Collections).  My understanding is that a collection
> should behave correctly (inserts, deletes, etc) unless the list its
> self is serialized.  Can you provide a counter-example?
>
> With regards to the article Max Ross wrote (very good article by the
> way), the trick he used (where he made a copy in order to change the
> reference) was intended to "dirty" the state when a member is
> modified.  My FooObjects are immutable, so I don't think this applies
> to me.  Max Ross' article is completely consistent with my
> understanding of the documentation, but it's entirely possible I
> missed something, so let me know if this doesn't sound right to you.
>
> I BELIEVE the issue I'm running into is rooted in the exception I get
> when trying to persist a populated instance of the list: "FooObject is
> not a supported property type."  I'm just not understanding why it
> isn't supported.  I would have expected that any serializable object
> would be permitted, especially if the @Element(serialized="true")
> annotation is specified.
>
> Basically, I'm looking for a code fragment that demonstrates the
> persistence of a collection of (more than one) non-standard
> serializable objects.
>
> Any ideas?
>
> Thanks!
>
> On Jul 7, 5:05 am, "l.denardo"  wrote:
>
>
>
> > Hello,
> > I guess your problem is the behavior of serialized fields (including
> > collections of them, as far as I know), which is explained in Max
> > Ross's post.
> > Or something related to that.
>
> > Anyway, some property fields are marked as "updated" and hence saved
> > in the datastore only if you update the reference to the field, and
> > they're not updated if you just use modifiers to operate on them.
> > In practice, something like
>
> >  ArrayList list = "retrieve from datastore"
> > list.add(Foo foo)
> > close persistence manager
>
> > Does not modify the list in the datastore, so if it's saved as an
> > empty list at creation it remains empty.
> > Doing
>
> >  ArrayList list = "retrieve from datastore"
> >  ArrayList copy = new ArrayList(list);
> >  copy.add(Foo foo)
> >  list = copy;
> > close PM
>
> > Usually makes everything work, since the original list field is marked
> > as "updated" and persisted.
> > As far as I know this is true both for serialized fields and for many
> > collections.
>
> > Regards
> > Lorenzo
>
> > On Jul 7, 1:28 pm, laserjim  wrote:
>
> > > Hello Lorenzo,
>
> > > Thanks, but perhaps my question wasn't clear.  I'm trying to make a
> > > list of serialized objects, NOT a serialized list of objects.
>
> > > For instance, assuming FooObject implements Serializable...
>
> > > @Element(serialized="true)
> > > List foos = new ArrayList();
>
> > > Unfortunately, the list is always empty.  Not quite sure why.
>
> > > Thanks!
>
> > > On Jul 7, 2:59 am, "l.denardo"  wrote:
>
> > > > If you are using a serialized field you must add the serialized="true"
> > > > clause to your annotation
>
> > > > @Persistent(serialized="true")
> > > > MySerializableObject serializable;
>
> > > > Also notice that JDO does not automatically detect if you update only
> > > > the inner fields of the object you save, so you must substitute it
> > > > with a copy to have it persisted.
> > > > See this post for a very good overview and an explanation of the fact
> > > > above:
>
> > > >http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> > > > Regards
> > > > Lorenzo
>
> > > > On Jul 7, 1:33 am, laserjim  wrote:
>
> > > > > Hello,
>
> > > > > I'm still trying to persist a list of serializable objects. I would
> > > > > expect this to be a standard collection as described 
> > > > > here:http://code.google.com/appengine/docs/java/datastore/dataclasses.html...
>
> > > > > FooObject is serializable, but my attempt gave me an exception:
> > > > > FooObject is not a supported property type.
>
> > > > > Everything works as expected if I replace my serializable class
> > > > > (FooObject) with String.
>
> > > > > How can I persist my list of FooObjects using JDO?
>
> > > > > Thanks!

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

Re: [appengine-java] can't figure out how to use JSTL to escape xml (guestbook tutorial)

2010-07-07 Thread Ikai L (Google)
If you already have EL enabled with this tag at the top of your page:

<%@ page isELIgnored="false" %>

Can't you just use this?

${g.content}

On Mon, Jul 5, 2010 at 9:44 PM, decitrig  wrote:

> In the tutorial, I've added the following to the guestbook.jsp file:
>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
>
> and made changed this:
>
> <%= g.getAuthor().getNickname() %> wrote:
> <%
>}
> %>
> 
> <%
>}
>}
>pm.close();
> %>
>
> I get no output from the c:out tag. I've tried a bunch of different
> variations and nothing seems to work: I can get a medley of my
> favorite exceptions, or no output, or the the literal text of the
> expression I was hoping to evaluate. I have searched around, and I can
> confirm the following:
>
> I have isELIgnored="false", I do not have any JSLT jar in my WEB-INF/
> lib directory. I also tried a  class="guestbook.Greeting" /> tag, but I got an error about the value
> for the "class" attribute being invalid. Please help? I'm happy to
> provide additional code or debugging output, if someone can point me
> in the right direction.
>
> PS. Might I respectfully submit that this would be a good thing to
> include in the tutorial?
>
> --
> 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.



Re: [appengine-java] Turning on GWT in the project causes class not found excepction in my appengine code.

2010-07-07 Thread Ronmell Fuentes
Hi emurmur

Try to copy all .jar files used by your application to the following
directory.

//war/WEB-INF/lib

then, just restart your IDE, refresh the project and run it.

It should work.

Rgds.

Ronmell

2010/7/6 emurmur 

> I have an Java App Engine project using SDK 1.3.5 and the latest
> Restlet GAE 2.0rc4 to implement some restful services.  Everything
> worked well (this has been in product for 6 months) until I added GWT
> to the project.  As soon as I check GWT on in the control panel
> (without even adding a module) my services start to fail in the
> development server with the following class not found exception:
>
> Couldn't write the XML representation: Provider
> org.apache.xalan.processor.TransformerFactoryImpl not found
>
> Any clues why simply turning GWT on would cause this?  Any solutions
> that you know of?  Thanks much.
>
> --
> 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: Frustrations with Performance

2010-07-07 Thread Jake
Hey,

Are you getting frequent instance restarts?  Check the log for loading
requests.  This has been known to happen on sites with little-to-no
traffic.

Solution?  None, but if this issue is affecting you, star this:
http://code.google.com/p/googleappengine/issues/detail?id=2931

Jake

On Jul 7, 11:54 am, praseed  wrote:
> Folks,
>
> I hope I have the right audience.
>
> I am an Independent Software Vendor (read: small software business)
> and I have developed a GWT/GAE product.
>
> Things were good during development (plugin et al). I was able to get
> features developed quickly.
>
> However, the application performance these days has been dicey to say
> the least.
>
> A simple click of a button tends to get 5 to 6 seconds to respond at
> times. Dont have any concurrent users right now. The Appspot dashboard
> does not show any issues and I am well below the quota.
>
> I have upgraded to the latest GAE engine.
>
> The App is absolutely horrendous to use due to this. As an ISV, I
> cannot demo this to my prospective customers and I cant "market" the
> cloud availability, Google performance etc.., -- coz that seems to be
> the downfall of my app.
>
> The App performs way better on my laptop. The moment it is deployed,
> it is bloody slow.
>
> I am aware of the current datastore issues at Google. Is that the sole
> reason for this , almost pervasive issue?
>
> Google AppEngine for Business has been announced. Any time tables?
> Will it address these issues?
>
> Can someone address this? How about other developers? Can anyone chime
> in here...
>
> Cheers
> Strawman

-- 
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] Getting java.lang.ClassNotFoundException on class (the package seems to be wrong) after deploy onto google (works localy)

2010-07-07 Thread Daniel
Hi i tried to deploy my application onto google after testing it
localy

and got java.lang.ClassNotFoundException :

javax.servlet.ServletException: java.lang.RuntimeException:
java.lang.ClassNotFoundException: dr.todo.ToBuyBean

the thing is that the class "ToBuyBean" isnt located in package
dr.todo (this is how it was long time ago, now the class "ToBuyBean"
located in dr.todo.beans.. that why it weird to get this error
pointing on package that is not populated by any classes.. i searched
the workspace and i have no references at all to "dr.todo.ToBuyBean"

is there any cache i can clean in google app engine?

the previous app that was deplyed to google app engine had the
ToBuyBean class in the  dr.todo package but in the current application
its not...

again, i did check over all the application.. but no references at all
to  dr.todo.ToBuyBean

i'm posting the entire trace

Thanks ahead for the help


#

84.109.9.2 - vedmack [07/Jul/2010:11:44:25 -0700] "GET / HTTP/1.1" 500
0 - "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.6) Gecko/
20100625 Firefox/3.6.6,gzip(gfe)" "vedmack.appspot.com" ms=4669
cpu_ms=6319 api_cpu_ms=0 cpm_usd=0.175611 loading_request=1

#
W 07-07 11:44AM 24.467

[vedmack/1.343201784113727737].: SystemId Unknown; Line #57;
Column #31; Failed calling setMethod method


#
W 07-07 11:44AM 25.137

http://vedmack.appspot.com/
javax.servlet.ServletException: java.lang.RuntimeException:
java.lang.ClassNotFoundException: dr.todo.ToBuyBean
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
240)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:923)
at
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
135)
at
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
250)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:7115)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:7113)
at
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:
24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
398)
at com.google.net.rpc.impl.Server$2.run(Server.java:852)
at
com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:
56)
at
com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:
576)
at com.google.net.rpc.impl.Server.startRpc(Server.java:807)
at com.google.net.rpc.impl.Server.processRequest(Server.java:369)
at
com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:
442)
at
com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:
319)
at
com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:
290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:
474)
at
com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:
831)
at
com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:
207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
103)
at
com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:
251)
at com.google.apphosting.runtime.JavaRuntime
$RpcRunnable.run(JavaRuntime.java:417)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException:
java.lang.ClassNotFoundException: dr.todo.ToBuyBean
at
com.google.apphosting.runtime.jetty.SessionManager.deserialize(SessionManager.java:
389)
at
com.google.apphosting.runtime.jetty.SessionManager.loadSession(SessionManager.java:
307)
at
com.google.apphosting.runtime.jetty.SessionManager.getSession(SessionManager.java:
282)
at
org.mortbay.jetty.servlet.AbstractSessionManager.getHttpSession(AbstractSessionManager.java:
237)
at
org.mortbay.jetty.servlet.SessionHandler.setRequestedId(SessionHandler.java:
246)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
136)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
418)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
238)
... 27 more
Caused by: java.lang.ClassNotFoundException

[appengine-java] Re: Data handling in GAE: BigTable vs. OO Data models

2010-07-07 Thread MArtin Schumacher
Hi John,

sorry for the delay.

> You might want to check out Twig which allows direct references for
> both owned and unowned relationships.  No Keys required.
>
> http://code.google.com/p/twig-persist/

Great. It seams like Twig is exactly what I looked for.  Just I cannot
see how I can do joins.

i.e. in my model mentioned above, I want to select a Person with some
specific ContactData.

Or I want to find all Attendances for a User logged in with a specific
Twittername.

Do you have any further hints for me?

Martin

-- 
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] Cannot see 'New Web Application' in New menu

2010-07-07 Thread Jason Parekh
Hi John,

Do you see any of the other Google Plugin for Eclipse features, like a few
toolbar buttons?

Did you happen to install Eclipse 3.6 as root and the plugin as your user?
 There's a known Eclipse issue where in some cases, that situation can lead
installed plugins not appearing, similar to your symptoms.  If this is the
case, try installing Eclipse as your user and also run it with the same
user.

jason

On Wed, Jul 7, 2010 at 11:19 AM, John  wrote:

> I've installed the google plugin into a clean install of Eclipse 3.6
> on ubuntu. The install finished without reporting any errors, and
> eclipse restarted successfully, but the File -> New option doesn't
> have the Web Application Project choice in it.
>
> Can someone tell me what I've done wrong?
>
> John
>
> --
> 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: Frustrations with Performance

2010-07-07 Thread Baz
For a work-around you can cron a hit to your site every minute to keep it
live.

On Wed, Jul 7, 2010 at 11:01 AM, Jake  wrote:

> Hey,
>
> Are you getting frequent instance restarts?  Check the log for loading
> requests.  This has been known to happen on sites with little-to-no
> traffic.
>
> Solution?  None, but if this issue is affecting you, star this:
> http://code.google.com/p/googleappengine/issues/detail?id=2931
>
> Jake
>
> On Jul 7, 11:54 am, praseed  wrote:
> > Folks,
> >
> > I hope I have the right audience.
> >
> > I am an Independent Software Vendor (read: small software business)
> > and I have developed a GWT/GAE product.
> >
> > Things were good during development (plugin et al). I was able to get
> > features developed quickly.
> >
> > However, the application performance these days has been dicey to say
> > the least.
> >
> > A simple click of a button tends to get 5 to 6 seconds to respond at
> > times. Dont have any concurrent users right now. The Appspot dashboard
> > does not show any issues and I am well below the quota.
> >
> > I have upgraded to the latest GAE engine.
> >
> > The App is absolutely horrendous to use due to this. As an ISV, I
> > cannot demo this to my prospective customers and I cant "market" the
> > cloud availability, Google performance etc.., -- coz that seems to be
> > the downfall of my app.
> >
> > The App performs way better on my laptop. The moment it is deployed,
> > it is bloody slow.
> >
> > I am aware of the current datastore issues at Google. Is that the sole
> > reason for this , almost pervasive issue?
> >
> > Google AppEngine for Business has been announced. Any time tables?
> > Will it address these issues?
> >
> > Can someone address this? How about other developers? Can anyone chime
> > in here...
> >
> > Cheers
> > Strawman
>
> --
> 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: Data handling in GAE: BigTable vs. OO Data models

2010-07-07 Thread Jeff Schnitzer
It's not that GAE doesn't do joins - it's that GAE doesn't do joins
for you.  You are the query planner.

Your examples seem straightforward:  Use two steps.  Look up the User
by twittername, then get all Attendances associated with the User.
You may want to memcache the mapping of twittername to User.

This is pretty much exactly what a SQL engine would do if you typed
"SELECT a.* FROM Attendance a, User u WHERE u.twittername = ? and u.id
= a.userId"

The hard problems come when you want to do the kinds of joins that
require in-memory hashing or sorting.  These are also the kinds of
problems that destroy RDBMS scalability, so they're hard no matter
what tools you use.

Jeff

On Wed, Jul 7, 2010 at 11:46 AM, MArtin Schumacher
 wrote:
> Hi John,
>
> sorry for the delay.
>
>> You might want to check out Twig which allows direct references for
>> both owned and unowned relationships.  No Keys required.
>>
>> http://code.google.com/p/twig-persist/
>
> Great. It seams like Twig is exactly what I looked for.  Just I cannot
> see how I can do joins.
>
> i.e. in my model mentioned above, I want to select a Person with some
> specific ContactData.
>
> Or I want to find all Attendances for a User logged in with a specific
> Twittername.
>
> Do you have any further hints for me?
>
> Martin
>
> --
> 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] Error: The API package 'urlfetch' or call 'Fetch()' was not found.

2010-07-07 Thread John Patterson
This RemoteDatastore  code does what you are after to allow you to  
upload and download data from the datastore from a normal JAva  
application.  You can copy the Environment stuff from there:


http://code.google.com/p/remote-datastore/source/browse/src/main/java/com/vercer/engine/proxy/RemoteDatastore.java#29

Line 29 sets the dummy environment

On 7 Jul 2010, at 20:33, [jake] wrote:


I'm using jetty outside of the dev_appserver.sh environment.

When I try to use com.google.appengine.api.urlfetch package, I get the
following error:

The API package 'urlfetch' or call 'Fetch()' was not found.
 [Thrown class com.google.apphosting.api.ApiProxy
$CallNotFoundException]

I don't get any errors trying to import
com.google.appengine.api.urlfetch so I think the problem lies in how I
set up an ApiProxy Environment.  I'm probably missing the relevant
entries to enable urlfetch.

Any tips on how to make this service available outside of the
dev_appserver.sh environment?

[jake]

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



Re: [appengine-java] Re: Data handling in GAE: BigTable vs. OO Data models

2010-07-07 Thread John Patterson
Hi Martin, Both Twig and Objectify support embedded collections which  
often let you get away with no joins.  For example you can query for  
Person with contact.phone == '828282828'.  ContactDetails seem an  
ideal candidate to be embedded.


For your second example, you could denormalize your model to include  
the twittername in the Attendance record - unless the name might  
change.  Otherwise it would be a simple case of doing a query for the  
twittername first and then the Attendances for the User Key.


Only if embedded collections is not flexible enough for you, and you  
need an AND query now, use the "zig-zag" method to join results in a  
stream - a Google search will turn up Google I/O videos that describe  
this.  Avoid loading into memory if you can at all help it.  To use  
the zig-zag join all queries must have the same sort order.


Right now Twig supports only OR joins that are streamed - not loaded  
into memory.  The unreleased version 2.0 adds AND by zig-zag but there  
is no ETA on that yet.




On 8 Jul 2010, at 01:46, MArtin Schumacher wrote:


Hi John,

sorry for the delay.


You might want to check out Twig which allows direct references for
both owned and unowned relationships.  No Keys required.

http://code.google.com/p/twig-persist/


Great. It seams like Twig is exactly what I looked for.  Just I cannot
see how I can do joins.

i.e. in my model mentioned above, I want to select a Person with some
specific ContactData.

Or I want to find all Attendances for a User logged in with a specific
Twittername.

Do you have any further hints for me?

Martin

--
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] achieving URL redirection (.htaccess) functionality with app engine?

2010-07-07 Thread John V Denley
I have an application where I want to simplify the URL for the end
users

so for example www.appname.appspot.com/demo would be redirected to
www.appname.appspot.com/?id=demo

currently Im doing this by using a .htaccess file on my hosting
company website so that www.appname.com/demo is then redirected to
user.appname.com/?id=demo and I have the CNAME for the user subdomain
pointing to ghs.google.com which is managed within my googleapp to
point back at www.appname.appspot.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] How to use the data in local datastore uploaded by bulk loader?

2010-07-07 Thread John Patterson
You can use the RemoteDatastore class to upload or download from a  
normal Java application to your local or a remote datastore.  It takes  
care of setting up a dummy Environment and ApiProxy.Delegate for you.   
You can then use then read local files unrestricted and use the low- 
level api to insert your data.


http://code.google.com/p/remote-datastore/

You just need to call RemoteDatastore.install() and ignore the other  
steps about connecting to a remote datastore.


John

On 7 Jul 2010, at 05:14, Fox W wrote:


Hi,every one!
I uploaded some data into local datastore, but I found Python and Java
are using different files to store data.
I want to debug my program in local, is there any solution?
Thanks in advance!

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