[OpenSocial] Re: Navigating between functional elements of a social app

2009-02-07 Thread Chris Chabot
Option number 2 is the correct one.

You don't want to lose the context of the gadget (security token, OpenSocial
API javascript, etc etc), so you want to stay inside of the same iframe
without navigating, the easiest way to do that is to simply have a main div,
which you assign the current 'view' too.

Also you could chose to use the canvas view for one or some of those
different view modes, in which case you can split up the layout between the
2 content blocks, ie:

Content type=html view=home,profile
div id=myMainContent
... initial content and hook up 'show details' click to onElementClick()
script
function onElementClick(elm) {
  var params = {};
  var surfaces = gadgets.views.getSupportedViews();
  var surfaceRef = surfaces['canvas'];
  params['selectedId'] = elm.id;
  gadgets.views.requestNavigateTo(surfaceRef, params);
}
/script
/div
/Content
Content type=html view=canvas
.. basic layout stuff
script
if (selectedId is some ID) {
  show the details for it;
} else {
  .. show generic overview
}
/script
/Content


On Sat, Feb 7, 2009 at 4:25 AM, markm208 markm...@gmail.com wrote:


 I've looked at the discussion board, and although there seems to be
 quite a few people who are asking similar questions, I have not found
 a very satisfying answer.

 I would like to build an application that has three main pieces of
 functionality, lets call them 'list all things', 'see a thing in
 detail' and 'see a thing in a slightly different way'. Each piece of
 functionality has a completely different look to it. 'list all things'
 should be a list of clickable 'thing' hyperlinks. When you click on a
 'thing' I would like the application to switch to show the details,
 that is, I don't want to see the list anymore I want to see the
 details of the 'thing'. Similarly, on the 'see a thing in detail'
 screen there is a hyperlink to 'see a thing in a slightly different
 way' which has its own look.

 My question is, is there a way to decompose the application so that I
 write three loosely coupled sections of code?

 Or, do I have to:
 1. use a single div and wipe out the div and start appending to it in
 response to clicking the link for all three sets of functionality
 2. write three separate opensocial apps (this is fine with me but how
 do I provide links for navigation)
 3. do something completely obvious that I have not listed above- if so
 my apologies

 Any help would be greatly appreciated.
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
OpenSocial Application Development group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~--~~~~--~~--~--~---



[OpenSocial] Re: How to call a function on remote server??

2009-02-07 Thread Tim Moore

We had some good luck modifying the client found here:
http://www.zentus.com/js/xmlrpc.js.html

Our modified version is at: 
http://labs.atlassian.com/svn/FEDEXX/trunk/atlassian.gadgets.xmlrpc.js
You'd probably want to take the alert statement out of the top :-) and
maybe change the namespace.

However I would *strongly* recommend that you change the back-end to
provide a RESTful API with OAuth authentication as it makes gadget
writing much more pleasant.

Cheers,
-- Tim

On Feb 6, 4:36 am, Chris Chabot chab...@google.com wrote:
 It doesn't, you would have to create a XML string your self, and then post
 it to the server using gadgets.io.makeRequest.

 All that makeRequest gives you is the ability to do a GET or a POST to a
 server, so just the basic IO. What you post, whether that is a string, json
 or xml, and what query params you use and how the server interprets them,
 that's completely up to you.

 If you look for 'xml-rpc javascript' in your favorite search engine, you'll
 find plenty of libraries that can help with this, the only thing you'll have
 to change in those libraries is that you have to use gadgets.io.makeRequest
 instead of a XMLHttpRequest (otherwise you run into cross-domain issues)

 On Fri, Feb 6, 2009 at 9:32 AM, rinku dongaria 
 rinku.donga...@gmail.comwrote:

  How do opensocial sends XML-RPC messages to the server to call a function
  ??

  On Thu, Feb 5, 2009 at 10:38 PM, Chris Chabot chab...@google.com wrote:

  that's really a question about the programming language on the server, and
  not about opensocial.

  Say that you were using PHP, then you could call different 'functions' in
  a page by:

  ?php
  $function = $_GET['action'];
  switch ($function) {
    case 'foo':
       include foo.php;
       break;
     case 'bar':
       include 'bar.php';
       break;
    case 'echo':
       echo $_GET['what'];
       break;
    case 'count':
      echo $_GET['a'] + $_GET['b'];
    default:
       echo Invalid function called!;
  }
  ?

  and you would call each 'function' by doing:

  gadgets.io.makeRequest('http://myserver.com/page.php?action=foo'http://myserver.com/page.php?action=foo%27);
  // for making 'foo.php' load on the server
  gadgets.io.makeRequest('http://myserver.com/page.php?action=bar'http://myserver.com/page.php?action=bar%27);
  // for making 'bar.php' load on the server
  gadgets.io.makeRequest('
 http://myserver.com/page.php?action=echowhat=Hello%20World'http://myserver.com/page.php?action=echowhat=Hello%20World%27);
  // Makes the server echo 'Hello world' back at us.
  gadgets.io.makeRequest('
 http://myserver.com/page.php?action=counta=1b=11'http://myserver.com/page.php?action=counta=1b=11%27);
  // this will return '12'

  Hope that's enough to get your inspiration going, your best bet is
  probably to chose a programming language you like (c#, asp, php, python are
  popular choices), and buy a beginners book to learn how to program with it.

  Good luck!

     -- Chris

  On Thu, Feb 5, 2009 at 6:13 AM, rinku dongaria 
  rinku.donga...@gmail.comwrote:

  Thanks Yoichiro...
  I have already used makeRequest call ... but this call will get a
  particular page on the server...what if we want to call a particular
  function on the server which is a subpart of the requested page??

  On Thu, Feb 5, 2009 at 5:37 AM, yoichiro yoich...@eisbahn.jp wrote:

  Hi rinku,

  You'll be able to access to remote server using gadgets.io.makeRequest
  ().

 http://code.google.com/intl/en/apis/opensocial/articles/makerequest-0...

  Thanks,
  Yoichiro

  On Feb 4, 8:34 pm, rinku dongaria rinku.donga...@gmail.com wrote:
   Hello friends,

   How to make call to a particular function located on remote server
  through
   your app ??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
OpenSocial Application Development group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~--~~~~--~~--~--~---



[OpenSocial] Re: Navigating between functional elements of a social app

2009-02-07 Thread markm208

I really appreciate your help... however, I'm still a little confused.
I think you are saying there are two ways of doing this
1. assign a view to a div
2. use the existing views (canvas, profile, etc.)

Can you point me to an example that uses option 1? Although I think I
understand what you are saying I'm having trouble writing an example
app that does this.

Regarding option 2, I like the idea of having multiple content
sections for each logical piece of functionality. However, it looks
like there are only a limited number of views- profile, canvas, and
home (is this right??). Each has a very specific purpose and I was
hoping I could 'create' my own named content sections like
'thingsListSection' and 'thingsDetailsSection'. I tried writing a
sample app that had these named content sections but they were not
recognized. Any suggestions??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
OpenSocial Application Development group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~--~~~~--~~--~--~---



[OpenSocial] Re: Navigating between functional elements of a social app

2009-02-07 Thread osanil maria goncalves


BUONGIONO.IO NON CAPOCO ...FOR AMORE ...IO VIVO ITALIA SCRIVO ITALIANO SPERO 
CHE MI CAPICA MIO MESSAGGIO OK

 Date: Sat, 7 Feb 2009 15:26:02 -0800
 Subject: [OpenSocial] Re: Navigating between functional elements of a social 
 app
 From: markm...@gmail.com
 To: opensocial-api@googlegroups.com
 
 
 I really appreciate your help... however, I'm still a little confused.
 I think you are saying there are two ways of doing this
 1. assign a view to a div
 2. use the existing views (canvas, profile, etc.)
 
 Can you point me to an example that uses option 1? Although I think I
 understand what you are saying I'm having trouble writing an example
 app that does this.
 
 Regarding option 2, I like the idea of having multiple content
 sections for each logical piece of functionality. However, it looks
 like there are only a limited number of views- profile, canvas, and
 home (is this right??). Each has a very specific purpose and I was
 hoping I could 'create' my own named content sections like
 'thingsListSection' and 'thingsDetailsSection'. I tried writing a
 sample app that had these named content sections but they were not
 recognized. Any suggestions??
  
_
Quali sono le più cliccate della settimana?
http://livesearch.it.msn.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
OpenSocial Application Development group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~--~~~~--~~--~--~---