You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Chris Chabot <ch...@xs4all.nl> on 2008/04/15 17:47:50 UTC

Writing to sample container xml statefile

Hey Guys,

Finishing the last bits for the socialdata work on the PHP side, and  
only a tiny bit away from a fully functioning implementation.

However part of the test i'm using (http://opensocial-resources.googlecode.com/svn/tests/trunk/compliancetests.xml 
) requires data to be written as well to get a green across the board  
compliance status.

Now on the java side this has been done by keeping the person app data  
in memory, which of course means when jetty is restarted its lost,  
which is probably what you want in a sample container kind of  
situation. However in PHP land i'm stuck in a multi process model with  
no persistent shared memory (unless i would want to add arbitrary  
extra layers to the whole thing, which i don't).

So instead i opted for actually writing the new data (or replacing if  
it existed) to the state file (state-basicfriendlist.xml), this way  
any consequent reads of the data can actually succeed, and i get green  
fields across the board in the compliance test :)

It could well be possible that some people might be playing with both  
the PHP and Java versions and examples / samplecontainer etc, and i'm  
lacking the insight to know if this could somehow affect the Java side  
of things. Presumably not, especially because at some point of the  
future this code will be scrapped and replaced with the REST interface  
but it felt better to double check :)

	-- Chris

Re: Writing to sample container xml statefile

Posted by David Primmer <da...@gmail.com>.
The path you provided is the source. This file is copied to the
deployment dir which is the one that the webserver references as
/gadgets/files. So the java server has its own copy.

davep

On Tue, Apr 15, 2008 at 9:47 AM, Chris Chabot <ch...@xs4all.nl> wrote:
> shindig/javascript/samplecontainer/state-basicfriendlist.xml
>
>  The java code in social/samplecontainer uses it, albeit through in it's
> case thru http:
>
>  public class XmlStateFileFetcher {
>   private static final String DEFAULT_STATE_URL
>       = "http://localhost:8080/gadgets/files/samplecontainer/"
>       + "state-basicfriendlist.xml";
>
>
>
>
>  On Apr 15, 2008, at 6:42 PM, David Primmer wrote:
>
>
> > Hi Chris
> >
> > I'm not sure where the state-basicfriendlist.xml  file is that you're
> > editing but it's probably not the same one that the java server uses.
> > The java build deploys the file to the /target/gadgets folder next to
> > the web-inf folder and the running server looks there for the file.
> > I'd assume there won't be any conflict.
> >
> > davep
> >
>
>

Re: Writing to sample container xml statefile

Posted by Chris Chabot <ch...@xs4all.nl>.
shindig/javascript/samplecontainer/state-basicfriendlist.xml

The java code in social/samplecontainer uses it, albeit through in  
it's case thru http:

public class XmlStateFileFetcher {
   private static final String DEFAULT_STATE_URL
       = "http://localhost:8080/gadgets/files/samplecontainer/"
       + "state-basicfriendlist.xml";


On Apr 15, 2008, at 6:42 PM, David Primmer wrote:

> Hi Chris
>
> I'm not sure where the state-basicfriendlist.xml  file is that you're
> editing but it's probably not the same one that the java server uses.
> The java build deploys the file to the /target/gadgets folder next to
> the web-inf folder and the running server looks there for the file.
> I'd assume there won't be any conflict.
>
> davep


Re: Writing to sample container xml statefile

Posted by David Primmer <da...@gmail.com>.
Hi Chris

I'm not sure where the state-basicfriendlist.xml  file is that you're
editing but it's probably not the same one that the java server uses.
The java build deploys the file to the /target/gadgets folder next to
the web-inf folder and the running server looks there for the file.
I'd assume there won't be any conflict.

davep

On Tue, Apr 15, 2008 at 8:47 AM, Chris Chabot <ch...@xs4all.nl> wrote:
> Hey Guys,
>
>  Finishing the last bits for the socialdata work on the PHP side, and only a
> tiny bit away from a fully functioning implementation.
>
>  However part of the test i'm using
> (http://opensocial-resources.googlecode.com/svn/tests/trunk/compliancetests.xml)
> requires data to be written as well to get a green across the board
> compliance status.
>
>  Now on the java side this has been done by keeping the person app data in
> memory, which of course means when jetty is restarted its lost, which is
> probably what you want in a sample container kind of situation. However in
> PHP land i'm stuck in a multi process model with no persistent shared memory
> (unless i would want to add arbitrary extra layers to the whole thing, which
> i don't).
>
>  So instead i opted for actually writing the new data (or replacing if it
> existed) to the state file (state-basicfriendlist.xml), this way any
> consequent reads of the data can actually succeed, and i get green fields
> across the board in the compliance test :)
>
>  It could well be possible that some people might be playing with both the
> PHP and Java versions and examples / samplecontainer etc, and i'm lacking
> the insight to know if this could somehow affect the Java side of things.
> Presumably not, especially because at some point of the future this code
> will be scrapped and replaced with the REST interface but it felt better to
> double check :)
>
>         -- Chris
>