Return-Path: Delivered-To: apmail-shindig-users-archive@minotaur.apache.org Received: (qmail 61179 invoked from network); 8 Nov 2010 17:45:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Nov 2010 17:45:41 -0000 Received: (qmail 84265 invoked by uid 500); 8 Nov 2010 17:46:12 -0000 Delivered-To: apmail-shindig-users-archive@shindig.apache.org Received: (qmail 84219 invoked by uid 500); 8 Nov 2010 17:46:12 -0000 Mailing-List: contact users-help@shindig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@shindig.apache.org Delivered-To: mailing list users@shindig.apache.org Received: (qmail 84211 invoked by uid 99); 8 Nov 2010 17:46:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Nov 2010 17:46:12 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of justinwyllie@hotmail.co.uk designates 65.55.34.220 as permitted sender) Received: from [65.55.34.220] (HELO col0-omc4-s18.col0.hotmail.com) (65.55.34.220) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Nov 2010 17:46:07 +0000 Received: from COL102-W29 ([65.55.34.199]) by col0-omc4-s18.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 8 Nov 2010 09:45:46 -0800 Message-ID: Content-Type: multipart/alternative; boundary="_260c822d-2bd1-4156-b981-cab2ac31d513_" X-Originating-IP: [137.108.145.10] From: Justin Wyllie To: Subject: RE: Persistence of userPrefs Date: Mon, 8 Nov 2010 17:45:46 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 08 Nov 2010 17:45:46.0122 (UTC) FILETIME=[C5C21EA0:01CB7F6C] --_260c822d-2bd1-4156-b981-cab2ac31d513_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Peter As a quick response.. As I understand you have shindig.DefaultUserPrefStore.prototype.savePrefs w= hich is called. Assuming you get the name/value pair out of some params in that function as= I understand you you now plan to use the appData service to save the prefs= . Therefore you would need to call this service from within savePrefs.=20 I guess you could do this either by the Rest api or the JSON-RPC one: The notes for the Rest one: At this url http://wiki.opensocial.org/index.ph= p?title=3DDeveloper's_Guide_REST there is a section 'Creating AppData items= '. I guess you can skip the bit about the discovery document since you alr= eady know the url.=20 Or by JSON-RPC. I think you can include the necessary libraries in your con= tainer page in the line that looks like this: http://justin.sociallearndevi= g.open.ac.uk/gadgets/js/core:rpc.js?c=3D0&debug=3D1&nocache=3D1 . I'm not s= ure but I think if you add gadgets (as in core:gadgets:rpc:) to this you c= ould then construct an appData request in the same way you would in a gadge= t. Which one are you using? As far as malformed tokens go - whichever way you are doing the request if = you have a flag 'allow_anonymous_token' =3D> false=2C set in the config the= n it needs to be authenticated. In our case we have not yet set up oAuth. If you stick a valid security tok= en on either the end of the JSON-RPC request or the Rest request that worke= d for us. You should be able to get the token in your shindig.DefaultUserPr= efStore.prototype.savePrefs as there seems to be. magically=2C an element f= which gives you a handle for the iframe of the gadget from which you can g= et a security token - or just borrow one for testing. I don't know if this adds anything to what you've done regards Justin=20 > Date: Mon=2C 8 Nov 2010 17:05:50 +0100 > From: rothenpieler@itm.uni-luebeck.de > To: users@shindig.apache.org > Subject: Persistence of userPrefs >=20 > Hi all=2C >=20 > After getting my UserPref-Dialog to work (see other thread)=2C I'm now > trying to get the Persistence of my UserPref=2C using the AppDataService > as proposed e.g. in [1]. I have successfully set up my AppDataService by > implementing the AppDataService interface and binding it to the > AppDataService.class in my AbstractModule. > My intention is to use the AppDataService to e.g. set the > UserPreferences upon clicking the "save" Button in the rendered > Gadget-Preference-Panel. I understand that I need to implement my own > UserPrefStore (in shindig-container.js) and the Function > "shindig.DefaultUserPrefStore.prototype.savePrefs" is indeed called. > However I'm currently missing the connection to my AppDataServce in the > backend. I tried using the "osapi.appdata.update()" function as proposed > in [1] but sadly my AppDataService isn't called. >=20 > I'm getting an error message related a "malformed security token" (is > this a good "sign"?): >=20 > > 08.11.2010 17:02:33 org.apache.shindig.auth.AuthenticationServletFilter= doFilter > > INFO: Malformed security token -1:-1:*::*:0:default > > org.apache.shindig.auth.SecurityTokenException: Malformed security toke= n > > at org.apache.shindig.auth.BasicSecurityTokenCodec.createToken(= BasicSecurityTokenCodec.java:82) > > at org.apache.shindig.auth.DefaultSecurityTokenCodec.createToke= n(DefaultSecurityTokenCodec.java:68) > > at org.apache.shindig.auth.UrlParameterAuthenticationHandler.ge= tSecurityTokenFromRequest(UrlParameterAuthen > > ticationHandler.java:56) > > at org.apache.shindig.auth.AuthenticationServletFilter.doFilter= (AuthenticationServletFilter.java:84) > > at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte= r(ServletHandler.java:1157) > > at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl= er.java:388) > > at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHa= ndler.java:216) > > at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl= er.java:182) > > at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl= er.java:765) > > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.= java:440) > > at org.mortbay.jetty.handler.ContextHandlerCollection.handle(Co= ntextHandlerCollection.java:230) > > at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCo= llection.java:114) > > at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapp= er.java:152) > > at org.mortbay.jetty.Server.handle(Server.java:326) > > at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnectio= n.java:542) > > at org.mortbay.jetty.HttpConnection$RequestHandler.content(Http= Connection.java:943) > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) > > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:= 218) > > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:= 404) > > at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEn= dPoint.java:410) > > at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThr= eadPool.java:582) >=20 > So does this mean I am on the right way and just need to correct > something regarding the security token or am I confusing some key > concept of shindig in this aspect? >=20 > -Peter >=20 > [1] http://www.mail-archive.com/dev@shindig.apache.org/msg01938.html = --_260c822d-2bd1-4156-b981-cab2ac31d513_--