Hi Raj,

You are right using a, container to render your gadgets is the best
way.  We have a set of JavaScript APIs that are part of Shindig called
the common container which is meant to help you construct your own
container.  The APIs are documented in the OpenSocial spec [1].  The
spec contains a number of code samples to help you get started.  In
addition you may find it useful to look at the source code as well
[2].  The source code is contained within the folders that begin with
container*.

[1] http://opensocial.github.io/spec/2.5.1/Core-Container.xml
[2] 
https://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/

On Sat, Jul 26, 2014 at 8:03 PM, Raj Janorkar <[email protected]> wrote:
> Hi All,
>
> I am new to apache shindig and learning it since last 20 to 25 days, and
> finally i decided to implement it because it is great. (but don't
> understand the fully the concept of gadget and container communication)
>
>
> I am currently using PHP for my website development and JAVA shindig for
> gadget rendering.
>
> I am  rendering gadget  using iframe dynamically  src to
> *http://localhost/shindig/gadgets/ifr?url=http://gadgets.example.com/complex/amazon/amazon.xml
> <http://localhost/shindig/gadgets/ifr?url=http://gadgets.example.com/complex/amazon/amazon.xml>*
>
> with other parameters it renders fine no issue. But as i am using iframe i
> need to *Auto Resize iframe, *but it is not happening. after reading
> shindig doc i came to know that i need to build container.
>
> 1) Can i build container in javascript ? and make communication between
> gadget and container? because i don't want to use TOMCAT for all my
> website. So use apache PHP for website and just use Tomcat for gadget
> rendering.
Yes the common container uses a feature called RPC which allows
gadgets and containers to communicate.  There are APIs within the
common container which are meant to assist you with doing this.  See
Container.rpcRegister.
>
> 2) how i can auto resize iframe
There is a gadget feature that is meant to help you do this called
dynamic-height and dynamic-width.  They provide the gadget with the
APIs gadgets.window.adjustHeight() and gadgets.window.adjustWidth() to
auto resize the iframe.

>
> 3) how i can retrieve/submit user preferences from/to gadget to display to
> user for edit.
Shindig does not provide any UI to edit gadget preferences nor does it
provide a mechanism to persist gadget preferences, that is up to you.
However we do provide APIs you can use to get the gadget before you
render the gadget for the first time so you know what the preferences
are.  The Container.preloadGadget method allows you to load metadata
for a gadget before rendering the gadget.  Part of the metadata
provided to you are details about the gadget preferences.

>
>
> It looks like i may be asking very basic questions, but if any buddy can
> help me that would be really great.
>
> Thank you in advance.
>
> Regards,
> Raj

Reply via email to