You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by li...@apache.org on 2010/07/19 16:30:24 UTC

svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Author: lindner
Date: Mon Jul 19 14:30:24 2010
New Revision: 965499

URL: http://svn.apache.org/viewvc?rev=965499&view=rev
Log:
SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC Javascript Errors

Added:
    shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
    shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
Modified:
    shindig/trunk/features/pom.xml
    shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
    shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
    shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js

Modified: shindig/trunk/features/pom.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
==============================================================================
--- shindig/trunk/features/pom.xml (original)
+++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
@@ -108,6 +108,8 @@
                 <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
                 <source>globals/globals.js</source>
                 <source>core.config/config.js</source>
+                <source>core.config/configcontainer.js</source>
+                <source>core.config/configgadget.js</source>
                 <source>core.json/json.js</source>
                 <source>shindig.auth/auth.js</source>
                 <source>core.util/util.js</source>

Added: shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js (added)
+++ shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js Mon Jul 19 14:30:24 2010
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @fileoverview Provides gadget/container configuration flags.
+ */
+
+/** @type {boolean} */
+gadgets.config.isGadget = false;
+/** @type {boolean} */
+gadgets.config.isContainer = true;

Added: shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js (added)
+++ shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js Mon Jul 19 14:30:24 2010
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @fileoverview Provides gadget/container configuration flags.
+ */
+/** @type {boolean} */
+gadgets.config.isGadget = true;
+/** @type {boolean} */
+gadgets.config.isContainer = false;

Modified: shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.config/feature.xml (original)
+++ shindig/trunk/features/src/main/javascript/features/core.config/feature.xml Mon Jul 19 14:30:24 2010
@@ -21,8 +21,10 @@
   <dependency>globals</dependency>
   <gadget>
     <script src="config.js"/>
+    <script src="configgadget.js"/>
   </gadget>
   <container>
     <script src="config.js"/>
+    <script src="configcontainer.js"/>
   </container>
 </feature>

Modified: shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js (original)
+++ shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js Mon Jul 19 14:30:24 2010
@@ -110,7 +110,7 @@ if (gadgets && gadgets.rpc) { //Dont bin
     }
 
     // Do not run this in container mode.
-    if (gadgets.config) {
+    if (gadgets.config && gadgets.config.isGadget) {
       gadgets.config.register("osapi.services", null, init);
     }
   })();

Modified: shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js (original)
+++ shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js Mon Jul 19 14:30:24 2010
@@ -89,7 +89,7 @@
   }
 
   // Do not run this in container mode.
-  if (gadgets.config) {
+  if (gadgets.config && gadgets.config.isGadget) {
     gadgets.config.register("osapi.services", null, init);
   }
 



Re: svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Posted by Evgeny Bogdanov <ev...@epfl.ch>.
I updated the trunk and added an osapi into shindig-container (gadget part)
<script src="osapi.js"/>

Have js warning: " Duplicate osapi method definition container.listMethods"
Othervise, seems to be working ok, rpc requests are sent.

If I see any problem I will let you know ...

Evgeny

On 19.07.10 22:47, John Hjelmstad wrote:
> Cool, so it generally does work the way it's intended to already ;) We
> hadn't gotten around to testing this case yet.
>
> As aforementioned, I suspect there will be a few rough edges, particularly
> in the configuration department. I'll be keen to hear your results and
> further thoughts, Evgeny.
>
> Best,
> John
>
> On Mon, Jul 19, 2010 at 1:38 PM, Evgeny Bogdanov<ev...@epfl.ch>wrote:
>
>    
>> Well, what I did is I added into shindig.container
>> the following part
>> <gadget>
>> <script src="util.js"/>
>> <script src="cookies.js"/>
>> <script src="shindig-container.js"/>
>> </gadget>
>>
>> and then into gadget (which is basically a container)
>> <Require feature="shindig-container" />
>>
>> This way I managed to render other gadgets inside my gadget.
>> I see such container gadget as a portable container.
>>
>> I will check tomorrow if it still work with the newest trunk tomorrow
>> and report here
>>
>> Evgeny
>>
>>
>> On 19/7/10 21:23, John Hjelmstad wrote:
>>
>>      
>>> On Mon, Jul 19, 2010 at 11:59 AM, Randy Watler<wa...@wispertel.net>
>>>   wrote:
>>>
>>>
>>>
>>>        
>>>> John/All,
>>>>
>>>> Sorry guys... I had no idea that a gadget could be a container! I think a
>>>> quick patch might be to only set a single flag value to "true" in each of
>>>> the feature scripts, (an not set the other flags to "false"). That way,
>>>> both
>>>> flags could be set to true if both scripts were included. We could
>>>> certainly
>>>> do that for a shindig.container gadget feature.
>>>>
>>>>
>>>>
>>>>          
>>> In various forms, at this point. The Shindig code doesn't yet accommodate
>>> this very smoothly, not least of which b/c shindig.container isn't fully
>>> fleshed out. I'm interested in hearing Evgeny's case, but as noted I'm not
>>> actually too concerned about this patch yet. It's just one of those
>>> primitives I'd like to make sure we use carefully to avoid future pain.
>>> I'm
>>> not even sure exactly _what_ objective hazards could result :)
>>>
>>> Re: the patch, that approach sounds quite reasonable to me.
>>>
>>>
>>>
>>>
>>>        
>>>> BTW... is there a way to share feature scripts between features?
>>>>
>>>>
>>>>
>>>>          
>>> By convention, we haven't done this widely. But feature.xml files can
>>> point
>>> anywhere, with the caveat that the underlying feature JS serving system
>>> doesn't de-dupe when emitting code right now, so the code itself needs to
>>> be
>>> sensitive to double-inclusion.
>>>
>>> Best,
>>> John
>>>
>>>
>>>
>>>
>>>        
>>>> I am willing to work toward that end if it seems appropriate to you guys.
>>>>
>>>> Randy
>>>>
>>>>
>>>> John Hjelmstad wrote:
>>>>
>>>>
>>>>
>>>>          
>>>>> If you've got some code that does this declaratively (esp. using
>>>>> shindig.container), feel free to post some patches ;)
>>>>>
>>>>> More directly, does this CL complicate your implementation and if so,
>>>>> how?
>>>>>
>>>>> --j
>>>>>
>>>>> On Mon, Jul 19, 2010 at 10:31 AM, Evgeny Bogdanov
>>>>> <ev...@epfl.ch>wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>            
>>>>>> Agree here
>>>>>> I already have gadgets, that behave as containers.
>>>>>>
>>>>>> Evgeny
>>>>>>
>>>>>>
>>>>>> On 19/7/10 16:59, John Hjelmstad wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>              
>>>>>>> While not quite relevant yet to deployed use cases, what's our
>>>>>>> thinking
>>>>>>> on
>>>>>>> how these flags will affect behavior at such time as it's possible for
>>>>>>> a
>>>>>>> gadget to *be* a container? Eg.<Require feature="shindig.container"/>,
>>>>>>> enabling nested gadgets.
>>>>>>>
>>>>>>> In this case, anything that's acting in a gadget context should
>>>>>>> register
>>>>>>> osapi.services. I'm sure there will be more ambiguity to navigate than
>>>>>>> just
>>>>>>> these flags, but did want to point out one downstream impact.
>>>>>>>
>>>>>>> --j
>>>>>>>
>>>>>>> On Mon, Jul 19, 2010 at 7:30 AM,<li...@apache.org>    wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>                
>>>>>>>> Author: lindner
>>>>>>>> Date: Mon Jul 19 14:30:24 2010
>>>>>>>> New Revision: 965499
>>>>>>>>
>>>>>>>> URL: http://svn.apache.org/viewvc?rev=965499&view=rev
>>>>>>>> Log:
>>>>>>>> SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC
>>>>>>>> Javascript
>>>>>>>> Errors
>>>>>>>>
>>>>>>>> Added:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>>>> Modified:
>>>>>>>>    shindig/trunk/features/pom.xml
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>>>
>>>>>>>> Modified: shindig/trunk/features/pom.xml
>>>>>>>> URL:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ==============================================================================
>>>>>>>> --- shindig/trunk/features/pom.xml (original)
>>>>>>>> +++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
>>>>>>>> @@ -108,6 +108,8 @@
>>>>>>>>
>>>>>>>>
>>>>>>>> <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
>>>>>>>>                 <source>globals/globals.js</source>
>>>>>>>>                 <source>core.config/config.js</source>
>>>>>>>> +<source>core.config/configcontainer.js</source>
>>>>>>>> +<source>core.config/configgadget.js</source>
>>>>>>>>                 <source>core.json/json.js</source>
>>>>>>>>                 <source>shindig.auth/auth.js</source>
>>>>>>>>                 <source>core.util/util.js</source>
>>>>>>>>
>>>>>>>> Added:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>>> URL:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ==============================================================================
>>>>>>>> ---
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>>> (added)
>>>>>>>> +++
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>>> @@ -0,0 +1,27 @@
>>>>>>>> +/*
>>>>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>>>>> + * distributed with this work for additional information
>>>>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>>>>> + * "License"); you may not use this file except in compliance
>>>>>>>> + * with the License.  You may obtain a copy of the License at
>>>>>>>> + *
>>>>>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>>>>>> + *
>>>>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>>>>> + * software distributed under the License is distributed on an
>>>>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>>>>> + * KIND, either express or implied.  See the License for the
>>>>>>>> + * specific language governing permissions and limitations
>>>>>>>> + * under the License.
>>>>>>>> + */
>>>>>>>> +
>>>>>>>> +/**
>>>>>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>>>>>> + */
>>>>>>>> +
>>>>>>>> +/** @type {boolean} */
>>>>>>>> +gadgets.config.isGadget = false;
>>>>>>>> +/** @type {boolean} */
>>>>>>>> +gadgets.config.isContainer = true;
>>>>>>>>
>>>>>>>> Added:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>>>> URL:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ==============================================================================
>>>>>>>> ---
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>>>> (added)
>>>>>>>> +++
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>>> @@ -0,0 +1,26 @@
>>>>>>>> +/*
>>>>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>>>>> + * distributed with this work for additional information
>>>>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>>>>> + * "License"); you may not use this file except in compliance
>>>>>>>> + * with the License.  You may obtain a copy of the License at
>>>>>>>> + *
>>>>>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>>>>>> + *
>>>>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>>>>> + * software distributed under the License is distributed on an
>>>>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>>>>> + * KIND, either express or implied.  See the License for the
>>>>>>>> + * specific language governing permissions and limitations
>>>>>>>> + * under the License.
>>>>>>>> + */
>>>>>>>> +
>>>>>>>> +/**
>>>>>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>>>>>> + */
>>>>>>>> +/** @type {boolean} */
>>>>>>>> +gadgets.config.isGadget = true;
>>>>>>>> +/** @type {boolean} */
>>>>>>>> +gadgets.config.isContainer = false;
>>>>>>>>
>>>>>>>> Modified:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>>> URL:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ==============================================================================
>>>>>>>> ---
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>>> (original)
>>>>>>>> +++
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>>> @@ -21,8 +21,10 @@
>>>>>>>>   <dependency>globals</dependency>
>>>>>>>>   <gadget>
>>>>>>>>     <script src="config.js"/>
>>>>>>>> +<script src="configgadget.js"/>
>>>>>>>>   </gadget>
>>>>>>>>   <container>
>>>>>>>>     <script src="config.js"/>
>>>>>>>> +<script src="configcontainer.js"/>
>>>>>>>>   </container>
>>>>>>>>   </feature>
>>>>>>>>
>>>>>>>> Modified:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>>> URL:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ==============================================================================
>>>>>>>> ---
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>>> (original)
>>>>>>>> +++
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>>> @@ -110,7 +110,7 @@ if (gadgets&&    gadgets.rpc) { //Dont bin
>>>>>>>>     }
>>>>>>>>
>>>>>>>>     // Do not run this in container mode.
>>>>>>>> -    if (gadgets.config) {
>>>>>>>> +    if (gadgets.config&&    gadgets.config.isGadget) {
>>>>>>>>       gadgets.config.register("osapi.services", null, init);
>>>>>>>>     }
>>>>>>>>   })();
>>>>>>>>
>>>>>>>> Modified:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>>> URL:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ==============================================================================
>>>>>>>> ---
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>>> (original)
>>>>>>>> +++
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>>> @@ -89,7 +89,7 @@
>>>>>>>>   }
>>>>>>>>
>>>>>>>>   // Do not run this in container mode.
>>>>>>>> -  if (gadgets.config) {
>>>>>>>> +  if (gadgets.config&&    gadgets.config.isGadget) {
>>>>>>>>     gadgets.config.register("osapi.services", null, init);
>>>>>>>>   }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                  
>>>>>>> .
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>                
>>>>>>
>>>>>>              
>>>>>
>>>>>
>>>>>            
>>>>
>>>>
>>>>          
>>> .
>>>
>>>
>>>
>>>        
>>      
> .
>
>    

Re: svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Posted by John Hjelmstad <fa...@google.com>.
Cool, so it generally does work the way it's intended to already ;) We
hadn't gotten around to testing this case yet.

As aforementioned, I suspect there will be a few rough edges, particularly
in the configuration department. I'll be keen to hear your results and
further thoughts, Evgeny.

Best,
John

On Mon, Jul 19, 2010 at 1:38 PM, Evgeny Bogdanov <ev...@epfl.ch>wrote:

> Well, what I did is I added into shindig.container
> the following part
> <gadget>
> <script src="util.js"/>
> <script src="cookies.js"/>
> <script src="shindig-container.js"/>
> </gadget>
>
> and then into gadget (which is basically a container)
> <Require feature="shindig-container" />
>
> This way I managed to render other gadgets inside my gadget.
> I see such container gadget as a portable container.
>
> I will check tomorrow if it still work with the newest trunk tomorrow
> and report here
>
> Evgeny
>
>
> On 19/7/10 21:23, John Hjelmstad wrote:
>
>> On Mon, Jul 19, 2010 at 11:59 AM, Randy Watler<wa...@wispertel.net>
>>  wrote:
>>
>>
>>
>>> John/All,
>>>
>>> Sorry guys... I had no idea that a gadget could be a container! I think a
>>> quick patch might be to only set a single flag value to "true" in each of
>>> the feature scripts, (an not set the other flags to "false"). That way,
>>> both
>>> flags could be set to true if both scripts were included. We could
>>> certainly
>>> do that for a shindig.container gadget feature.
>>>
>>>
>>>
>> In various forms, at this point. The Shindig code doesn't yet accommodate
>> this very smoothly, not least of which b/c shindig.container isn't fully
>> fleshed out. I'm interested in hearing Evgeny's case, but as noted I'm not
>> actually too concerned about this patch yet. It's just one of those
>> primitives I'd like to make sure we use carefully to avoid future pain.
>> I'm
>> not even sure exactly _what_ objective hazards could result :)
>>
>> Re: the patch, that approach sounds quite reasonable to me.
>>
>>
>>
>>
>>> BTW... is there a way to share feature scripts between features?
>>>
>>>
>>>
>> By convention, we haven't done this widely. But feature.xml files can
>> point
>> anywhere, with the caveat that the underlying feature JS serving system
>> doesn't de-dupe when emitting code right now, so the code itself needs to
>> be
>> sensitive to double-inclusion.
>>
>> Best,
>> John
>>
>>
>>
>>
>>> I am willing to work toward that end if it seems appropriate to you guys.
>>>
>>> Randy
>>>
>>>
>>> John Hjelmstad wrote:
>>>
>>>
>>>
>>>> If you've got some code that does this declaratively (esp. using
>>>> shindig.container), feel free to post some patches ;)
>>>>
>>>> More directly, does this CL complicate your implementation and if so,
>>>> how?
>>>>
>>>> --j
>>>>
>>>> On Mon, Jul 19, 2010 at 10:31 AM, Evgeny Bogdanov
>>>> <ev...@epfl.ch>wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Agree here
>>>>> I already have gadgets, that behave as containers.
>>>>>
>>>>> Evgeny
>>>>>
>>>>>
>>>>> On 19/7/10 16:59, John Hjelmstad wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> While not quite relevant yet to deployed use cases, what's our
>>>>>> thinking
>>>>>> on
>>>>>> how these flags will affect behavior at such time as it's possible for
>>>>>> a
>>>>>> gadget to *be* a container? Eg.<Require feature="shindig.container"/>,
>>>>>> enabling nested gadgets.
>>>>>>
>>>>>> In this case, anything that's acting in a gadget context should
>>>>>> register
>>>>>> osapi.services. I'm sure there will be more ambiguity to navigate than
>>>>>> just
>>>>>> these flags, but did want to point out one downstream impact.
>>>>>>
>>>>>> --j
>>>>>>
>>>>>> On Mon, Jul 19, 2010 at 7:30 AM,<li...@apache.org>   wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Author: lindner
>>>>>>> Date: Mon Jul 19 14:30:24 2010
>>>>>>> New Revision: 965499
>>>>>>>
>>>>>>> URL: http://svn.apache.org/viewvc?rev=965499&view=rev
>>>>>>> Log:
>>>>>>> SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC
>>>>>>> Javascript
>>>>>>> Errors
>>>>>>>
>>>>>>> Added:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>>> Modified:
>>>>>>>   shindig/trunk/features/pom.xml
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>>
>>>>>>> Modified: shindig/trunk/features/pom.xml
>>>>>>> URL:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> --- shindig/trunk/features/pom.xml (original)
>>>>>>> +++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
>>>>>>> @@ -108,6 +108,8 @@
>>>>>>>
>>>>>>>
>>>>>>> <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
>>>>>>>                <source>globals/globals.js</source>
>>>>>>>                <source>core.config/config.js</source>
>>>>>>> +<source>core.config/configcontainer.js</source>
>>>>>>> +<source>core.config/configgadget.js</source>
>>>>>>>                <source>core.json/json.js</source>
>>>>>>>                <source>shindig.auth/auth.js</source>
>>>>>>>                <source>core.util/util.js</source>
>>>>>>>
>>>>>>> Added:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>> URL:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> ---
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>> (added)
>>>>>>> +++
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>> @@ -0,0 +1,27 @@
>>>>>>> +/*
>>>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>>>> + * distributed with this work for additional information
>>>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>>>> + * "License"); you may not use this file except in compliance
>>>>>>> + * with the License.  You may obtain a copy of the License at
>>>>>>> + *
>>>>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>>>>> + *
>>>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>>>> + * software distributed under the License is distributed on an
>>>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>>>> + * KIND, either express or implied.  See the License for the
>>>>>>> + * specific language governing permissions and limitations
>>>>>>> + * under the License.
>>>>>>> + */
>>>>>>> +
>>>>>>> +/**
>>>>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>>>>> + */
>>>>>>> +
>>>>>>> +/** @type {boolean} */
>>>>>>> +gadgets.config.isGadget = false;
>>>>>>> +/** @type {boolean} */
>>>>>>> +gadgets.config.isContainer = true;
>>>>>>>
>>>>>>> Added:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>>> URL:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> ---
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>>> (added)
>>>>>>> +++
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>> @@ -0,0 +1,26 @@
>>>>>>> +/*
>>>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>>>> + * distributed with this work for additional information
>>>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>>>> + * "License"); you may not use this file except in compliance
>>>>>>> + * with the License.  You may obtain a copy of the License at
>>>>>>> + *
>>>>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>>>>> + *
>>>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>>>> + * software distributed under the License is distributed on an
>>>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>>>> + * KIND, either express or implied.  See the License for the
>>>>>>> + * specific language governing permissions and limitations
>>>>>>> + * under the License.
>>>>>>> + */
>>>>>>> +
>>>>>>> +/**
>>>>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>>>>> + */
>>>>>>> +/** @type {boolean} */
>>>>>>> +gadgets.config.isGadget = true;
>>>>>>> +/** @type {boolean} */
>>>>>>> +gadgets.config.isContainer = false;
>>>>>>>
>>>>>>> Modified:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>> URL:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> ---
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>> (original)
>>>>>>> +++
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>> @@ -21,8 +21,10 @@
>>>>>>>  <dependency>globals</dependency>
>>>>>>>  <gadget>
>>>>>>>    <script src="config.js"/>
>>>>>>> +<script src="configgadget.js"/>
>>>>>>>  </gadget>
>>>>>>>  <container>
>>>>>>>    <script src="config.js"/>
>>>>>>> +<script src="configcontainer.js"/>
>>>>>>>  </container>
>>>>>>>  </feature>
>>>>>>>
>>>>>>> Modified:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>> URL:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> ---
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>> (original)
>>>>>>> +++
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>> @@ -110,7 +110,7 @@ if (gadgets&&   gadgets.rpc) { //Dont bin
>>>>>>>    }
>>>>>>>
>>>>>>>    // Do not run this in container mode.
>>>>>>> -    if (gadgets.config) {
>>>>>>> +    if (gadgets.config&&   gadgets.config.isGadget) {
>>>>>>>      gadgets.config.register("osapi.services", null, init);
>>>>>>>    }
>>>>>>>  })();
>>>>>>>
>>>>>>> Modified:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>> URL:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> ---
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>> (original)
>>>>>>> +++
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>> Mon Jul 19 14:30:24 2010
>>>>>>> @@ -89,7 +89,7 @@
>>>>>>>  }
>>>>>>>
>>>>>>>  // Do not run this in container mode.
>>>>>>> -  if (gadgets.config) {
>>>>>>> +  if (gadgets.config&&   gadgets.config.isGadget) {
>>>>>>>    gadgets.config.register("osapi.services", null, init);
>>>>>>>  }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> .
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>> .
>>
>>
>>
>

Re: svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Posted by Evgeny Bogdanov <ev...@epfl.ch>.
Well, what I did is I added into shindig.container
the following part
<gadget>
<script src="util.js"/>
<script src="cookies.js"/>
<script src="shindig-container.js"/>
</gadget>

and then into gadget (which is basically a container)
<Require feature="shindig-container" />

This way I managed to render other gadgets inside my gadget.
I see such container gadget as a portable container.

I will check tomorrow if it still work with the newest trunk tomorrow
and report here

Evgeny

On 19/7/10 21:23, John Hjelmstad wrote:
> On Mon, Jul 19, 2010 at 11:59 AM, Randy Watler<wa...@wispertel.net>  wrote:
>
>    
>> John/All,
>>
>> Sorry guys... I had no idea that a gadget could be a container! I think a
>> quick patch might be to only set a single flag value to "true" in each of
>> the feature scripts, (an not set the other flags to "false"). That way, both
>> flags could be set to true if both scripts were included. We could certainly
>> do that for a shindig.container gadget feature.
>>
>>      
> In various forms, at this point. The Shindig code doesn't yet accommodate
> this very smoothly, not least of which b/c shindig.container isn't fully
> fleshed out. I'm interested in hearing Evgeny's case, but as noted I'm not
> actually too concerned about this patch yet. It's just one of those
> primitives I'd like to make sure we use carefully to avoid future pain. I'm
> not even sure exactly _what_ objective hazards could result :)
>
> Re: the patch, that approach sounds quite reasonable to me.
>
>
>    
>> BTW... is there a way to share feature scripts between features?
>>
>>      
> By convention, we haven't done this widely. But feature.xml files can point
> anywhere, with the caveat that the underlying feature JS serving system
> doesn't de-dupe when emitting code right now, so the code itself needs to be
> sensitive to double-inclusion.
>
> Best,
> John
>
>
>    
>> I am willing to work toward that end if it seems appropriate to you guys.
>>
>> Randy
>>
>>
>> John Hjelmstad wrote:
>>
>>      
>>> If you've got some code that does this declaratively (esp. using
>>> shindig.container), feel free to post some patches ;)
>>>
>>> More directly, does this CL complicate your implementation and if so, how?
>>>
>>> --j
>>>
>>> On Mon, Jul 19, 2010 at 10:31 AM, Evgeny Bogdanov
>>> <ev...@epfl.ch>wrote:
>>>
>>>
>>>
>>>        
>>>> Agree here
>>>> I already have gadgets, that behave as containers.
>>>>
>>>> Evgeny
>>>>
>>>>
>>>> On 19/7/10 16:59, John Hjelmstad wrote:
>>>>
>>>>
>>>>
>>>>          
>>>>> While not quite relevant yet to deployed use cases, what's our thinking
>>>>> on
>>>>> how these flags will affect behavior at such time as it's possible for a
>>>>> gadget to *be* a container? Eg.<Require feature="shindig.container"/>,
>>>>> enabling nested gadgets.
>>>>>
>>>>> In this case, anything that's acting in a gadget context should register
>>>>> osapi.services. I'm sure there will be more ambiguity to navigate than
>>>>> just
>>>>> these flags, but did want to point out one downstream impact.
>>>>>
>>>>> --j
>>>>>
>>>>> On Mon, Jul 19, 2010 at 7:30 AM,<li...@apache.org>   wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>            
>>>>>> Author: lindner
>>>>>> Date: Mon Jul 19 14:30:24 2010
>>>>>> New Revision: 965499
>>>>>>
>>>>>> URL: http://svn.apache.org/viewvc?rev=965499&view=rev
>>>>>> Log:
>>>>>> SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC
>>>>>> Javascript
>>>>>> Errors
>>>>>>
>>>>>> Added:
>>>>>>
>>>>>>
>>>>>>
>>>>>>   shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>>
>>>>>>
>>>>>>
>>>>>>   shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>> Modified:
>>>>>>    shindig/trunk/features/pom.xml
>>>>>>
>>>>>>
>>>>>>
>>>>>>   shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>>
>>>>>>
>>>>>>
>>>>>>   shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>>
>>>>>>
>>>>>>
>>>>>>   shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>>
>>>>>> Modified: shindig/trunk/features/pom.xml
>>>>>> URL:
>>>>>>
>>>>>>
>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>
>>>>>>
>>>>>>
>>>>>> ==============================================================================
>>>>>> --- shindig/trunk/features/pom.xml (original)
>>>>>> +++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
>>>>>> @@ -108,6 +108,8 @@
>>>>>>
>>>>>> <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
>>>>>>                 <source>globals/globals.js</source>
>>>>>>                 <source>core.config/config.js</source>
>>>>>> +<source>core.config/configcontainer.js</source>
>>>>>> +<source>core.config/configgadget.js</source>
>>>>>>                 <source>core.json/json.js</source>
>>>>>>                 <source>shindig.auth/auth.js</source>
>>>>>>                 <source>core.util/util.js</source>
>>>>>>
>>>>>> Added:
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>> URL:
>>>>>>
>>>>>>
>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
>>>>>>
>>>>>>
>>>>>>
>>>>>> ==============================================================================
>>>>>> ---
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>> (added)
>>>>>> +++
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>> Mon Jul 19 14:30:24 2010
>>>>>> @@ -0,0 +1,27 @@
>>>>>> +/*
>>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>>> + * distributed with this work for additional information
>>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>>> + * "License"); you may not use this file except in compliance
>>>>>> + * with the License.  You may obtain a copy of the License at
>>>>>> + *
>>>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>>>> + *
>>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>>> + * software distributed under the License is distributed on an
>>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>>> + * KIND, either express or implied.  See the License for the
>>>>>> + * specific language governing permissions and limitations
>>>>>> + * under the License.
>>>>>> + */
>>>>>> +
>>>>>> +/**
>>>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>>>> + */
>>>>>> +
>>>>>> +/** @type {boolean} */
>>>>>> +gadgets.config.isGadget = false;
>>>>>> +/** @type {boolean} */
>>>>>> +gadgets.config.isContainer = true;
>>>>>>
>>>>>> Added:
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>> URL:
>>>>>>
>>>>>>
>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
>>>>>>
>>>>>>
>>>>>>
>>>>>> ==============================================================================
>>>>>> ---
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>> (added)
>>>>>> +++
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>>> Mon Jul 19 14:30:24 2010
>>>>>> @@ -0,0 +1,26 @@
>>>>>> +/*
>>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>>> + * distributed with this work for additional information
>>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>>> + * "License"); you may not use this file except in compliance
>>>>>> + * with the License.  You may obtain a copy of the License at
>>>>>> + *
>>>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>>>> + *
>>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>>> + * software distributed under the License is distributed on an
>>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>>> + * KIND, either express or implied.  See the License for the
>>>>>> + * specific language governing permissions and limitations
>>>>>> + * under the License.
>>>>>> + */
>>>>>> +
>>>>>> +/**
>>>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>>>> + */
>>>>>> +/** @type {boolean} */
>>>>>> +gadgets.config.isGadget = true;
>>>>>> +/** @type {boolean} */
>>>>>> +gadgets.config.isContainer = false;
>>>>>>
>>>>>> Modified:
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>> URL:
>>>>>>
>>>>>>
>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>
>>>>>>
>>>>>>
>>>>>> ==============================================================================
>>>>>> ---
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>> (original)
>>>>>> +++
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>> Mon Jul 19 14:30:24 2010
>>>>>> @@ -21,8 +21,10 @@
>>>>>>   <dependency>globals</dependency>
>>>>>>   <gadget>
>>>>>>     <script src="config.js"/>
>>>>>> +<script src="configgadget.js"/>
>>>>>>   </gadget>
>>>>>>   <container>
>>>>>>     <script src="config.js"/>
>>>>>> +<script src="configcontainer.js"/>
>>>>>>   </container>
>>>>>>   </feature>
>>>>>>
>>>>>> Modified:
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>> URL:
>>>>>>
>>>>>>
>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>
>>>>>>
>>>>>>
>>>>>> ==============================================================================
>>>>>> ---
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>> (original)
>>>>>> +++
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>> Mon Jul 19 14:30:24 2010
>>>>>> @@ -110,7 +110,7 @@ if (gadgets&&   gadgets.rpc) { //Dont bin
>>>>>>     }
>>>>>>
>>>>>>     // Do not run this in container mode.
>>>>>> -    if (gadgets.config) {
>>>>>> +    if (gadgets.config&&   gadgets.config.isGadget) {
>>>>>>       gadgets.config.register("osapi.services", null, init);
>>>>>>     }
>>>>>>   })();
>>>>>>
>>>>>> Modified:
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>> URL:
>>>>>>
>>>>>>
>>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>>>
>>>>>>
>>>>>>
>>>>>> ==============================================================================
>>>>>> ---
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>> (original)
>>>>>> +++
>>>>>>
>>>>>>
>>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>> Mon Jul 19 14:30:24 2010
>>>>>> @@ -89,7 +89,7 @@
>>>>>>   }
>>>>>>
>>>>>>   // Do not run this in container mode.
>>>>>> -  if (gadgets.config) {
>>>>>> +  if (gadgets.config&&   gadgets.config.isGadget) {
>>>>>>     gadgets.config.register("osapi.services", null, init);
>>>>>>   }
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>              
>>>>> .
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>            
>>>>          
>>>
>>>        
>>
>>      
> .
>
>    

Re: svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Posted by John Hjelmstad <fa...@google.com>.
On Mon, Jul 19, 2010 at 11:59 AM, Randy Watler <wa...@wispertel.net> wrote:

> John/All,
>
> Sorry guys... I had no idea that a gadget could be a container! I think a
> quick patch might be to only set a single flag value to "true" in each of
> the feature scripts, (an not set the other flags to "false"). That way, both
> flags could be set to true if both scripts were included. We could certainly
> do that for a shindig.container gadget feature.
>

In various forms, at this point. The Shindig code doesn't yet accommodate
this very smoothly, not least of which b/c shindig.container isn't fully
fleshed out. I'm interested in hearing Evgeny's case, but as noted I'm not
actually too concerned about this patch yet. It's just one of those
primitives I'd like to make sure we use carefully to avoid future pain. I'm
not even sure exactly _what_ objective hazards could result :)

Re: the patch, that approach sounds quite reasonable to me.


>
> BTW... is there a way to share feature scripts between features?
>

By convention, we haven't done this widely. But feature.xml files can point
anywhere, with the caveat that the underlying feature JS serving system
doesn't de-dupe when emitting code right now, so the code itself needs to be
sensitive to double-inclusion.

Best,
John


>
> I am willing to work toward that end if it seems appropriate to you guys.
>
> Randy
>
>
> John Hjelmstad wrote:
>
>> If you've got some code that does this declaratively (esp. using
>> shindig.container), feel free to post some patches ;)
>>
>> More directly, does this CL complicate your implementation and if so, how?
>>
>> --j
>>
>> On Mon, Jul 19, 2010 at 10:31 AM, Evgeny Bogdanov
>> <ev...@epfl.ch>wrote:
>>
>>
>>
>>> Agree here
>>> I already have gadgets, that behave as containers.
>>>
>>> Evgeny
>>>
>>>
>>> On 19/7/10 16:59, John Hjelmstad wrote:
>>>
>>>
>>>
>>>> While not quite relevant yet to deployed use cases, what's our thinking
>>>> on
>>>> how these flags will affect behavior at such time as it's possible for a
>>>> gadget to *be* a container? Eg.<Require feature="shindig.container"/>,
>>>> enabling nested gadgets.
>>>>
>>>> In this case, anything that's acting in a gadget context should register
>>>> osapi.services. I'm sure there will be more ambiguity to navigate than
>>>> just
>>>> these flags, but did want to point out one downstream impact.
>>>>
>>>> --j
>>>>
>>>> On Mon, Jul 19, 2010 at 7:30 AM,<li...@apache.org>  wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Author: lindner
>>>>> Date: Mon Jul 19 14:30:24 2010
>>>>> New Revision: 965499
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=965499&view=rev
>>>>> Log:
>>>>> SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC
>>>>> Javascript
>>>>> Errors
>>>>>
>>>>> Added:
>>>>>
>>>>>
>>>>>
>>>>>  shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>>
>>>>>
>>>>>
>>>>>  shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>> Modified:
>>>>>   shindig/trunk/features/pom.xml
>>>>>
>>>>>
>>>>>
>>>>>  shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>>
>>>>>
>>>>>
>>>>>  shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>>
>>>>>
>>>>>
>>>>>  shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>>
>>>>> Modified: shindig/trunk/features/pom.xml
>>>>> URL:
>>>>>
>>>>>
>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>>
>>>>>
>>>>>
>>>>> ==============================================================================
>>>>> --- shindig/trunk/features/pom.xml (original)
>>>>> +++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
>>>>> @@ -108,6 +108,8 @@
>>>>>
>>>>> <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
>>>>>                <source>globals/globals.js</source>
>>>>>                <source>core.config/config.js</source>
>>>>> +<source>core.config/configcontainer.js</source>
>>>>> +<source>core.config/configgadget.js</source>
>>>>>                <source>core.json/json.js</source>
>>>>>                <source>shindig.auth/auth.js</source>
>>>>>                <source>core.util/util.js</source>
>>>>>
>>>>> Added:
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>> URL:
>>>>>
>>>>>
>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
>>>>>
>>>>>
>>>>>
>>>>> ==============================================================================
>>>>> ---
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>> (added)
>>>>> +++
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>> Mon Jul 19 14:30:24 2010
>>>>> @@ -0,0 +1,27 @@
>>>>> +/*
>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>> + * distributed with this work for additional information
>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>> + * "License"); you may not use this file except in compliance
>>>>> + * with the License.  You may obtain a copy of the License at
>>>>> + *
>>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>>> + *
>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>> + * software distributed under the License is distributed on an
>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> + * KIND, either express or implied.  See the License for the
>>>>> + * specific language governing permissions and limitations
>>>>> + * under the License.
>>>>> + */
>>>>> +
>>>>> +/**
>>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>>> + */
>>>>> +
>>>>> +/** @type {boolean} */
>>>>> +gadgets.config.isGadget = false;
>>>>> +/** @type {boolean} */
>>>>> +gadgets.config.isContainer = true;
>>>>>
>>>>> Added:
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>> URL:
>>>>>
>>>>>
>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
>>>>>
>>>>>
>>>>>
>>>>> ==============================================================================
>>>>> ---
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>> (added)
>>>>> +++
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>>> Mon Jul 19 14:30:24 2010
>>>>> @@ -0,0 +1,26 @@
>>>>> +/*
>>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>>> + * or more contributor license agreements.  See the NOTICE file
>>>>> + * distributed with this work for additional information
>>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>>> + * to you under the Apache License, Version 2.0 (the
>>>>> + * "License"); you may not use this file except in compliance
>>>>> + * with the License.  You may obtain a copy of the License at
>>>>> + *
>>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>>> + *
>>>>> + * Unless required by applicable law or agreed to in writing,
>>>>> + * software distributed under the License is distributed on an
>>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> + * KIND, either express or implied.  See the License for the
>>>>> + * specific language governing permissions and limitations
>>>>> + * under the License.
>>>>> + */
>>>>> +
>>>>> +/**
>>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>>> + */
>>>>> +/** @type {boolean} */
>>>>> +gadgets.config.isGadget = true;
>>>>> +/** @type {boolean} */
>>>>> +gadgets.config.isContainer = false;
>>>>>
>>>>> Modified:
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>> URL:
>>>>>
>>>>>
>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>>
>>>>>
>>>>>
>>>>> ==============================================================================
>>>>> ---
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>> (original)
>>>>> +++
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>> Mon Jul 19 14:30:24 2010
>>>>> @@ -21,8 +21,10 @@
>>>>>  <dependency>globals</dependency>
>>>>>  <gadget>
>>>>>    <script src="config.js"/>
>>>>> +<script src="configgadget.js"/>
>>>>>  </gadget>
>>>>>  <container>
>>>>>    <script src="config.js"/>
>>>>> +<script src="configcontainer.js"/>
>>>>>  </container>
>>>>>  </feature>
>>>>>
>>>>> Modified:
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>> URL:
>>>>>
>>>>>
>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>>
>>>>>
>>>>>
>>>>> ==============================================================================
>>>>> ---
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>> (original)
>>>>> +++
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>> Mon Jul 19 14:30:24 2010
>>>>> @@ -110,7 +110,7 @@ if (gadgets&&  gadgets.rpc) { //Dont bin
>>>>>    }
>>>>>
>>>>>    // Do not run this in container mode.
>>>>> -    if (gadgets.config) {
>>>>> +    if (gadgets.config&&  gadgets.config.isGadget) {
>>>>>      gadgets.config.register("osapi.services", null, init);
>>>>>    }
>>>>>  })();
>>>>>
>>>>> Modified:
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>> URL:
>>>>>
>>>>>
>>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>>
>>>>>
>>>>>
>>>>> ==============================================================================
>>>>> ---
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>> (original)
>>>>> +++
>>>>>
>>>>>
>>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>> Mon Jul 19 14:30:24 2010
>>>>> @@ -89,7 +89,7 @@
>>>>>  }
>>>>>
>>>>>  // Do not run this in container mode.
>>>>> -  if (gadgets.config) {
>>>>> +  if (gadgets.config&&  gadgets.config.isGadget) {
>>>>>    gadgets.config.register("osapi.services", null, init);
>>>>>  }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> .
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>
>

Re: svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Posted by Randy Watler <wa...@wispertel.net>.
John/All,

Sorry guys... I had no idea that a gadget could be a container! I think 
a quick patch might be to only set a single flag value to "true" in each 
of the feature scripts, (an not set the other flags to "false"). That 
way, both flags could be set to true if both scripts were included. We 
could certainly do that for a shindig.container gadget feature.

BTW... is there a way to share feature scripts between features?

I am willing to work toward that end if it seems appropriate to you guys.

Randy

John Hjelmstad wrote:
> If you've got some code that does this declaratively (esp. using
> shindig.container), feel free to post some patches ;)
>
> More directly, does this CL complicate your implementation and if so, how?
>
> --j
>
> On Mon, Jul 19, 2010 at 10:31 AM, Evgeny Bogdanov
> <ev...@epfl.ch>wrote:
>
>   
>> Agree here
>> I already have gadgets, that behave as containers.
>>
>> Evgeny
>>
>>
>> On 19/7/10 16:59, John Hjelmstad wrote:
>>
>>     
>>> While not quite relevant yet to deployed use cases, what's our thinking on
>>> how these flags will affect behavior at such time as it's possible for a
>>> gadget to *be* a container? Eg.<Require feature="shindig.container"/>,
>>> enabling nested gadgets.
>>>
>>> In this case, anything that's acting in a gadget context should register
>>> osapi.services. I'm sure there will be more ambiguity to navigate than
>>> just
>>> these flags, but did want to point out one downstream impact.
>>>
>>> --j
>>>
>>> On Mon, Jul 19, 2010 at 7:30 AM,<li...@apache.org>  wrote:
>>>
>>>
>>>
>>>       
>>>> Author: lindner
>>>> Date: Mon Jul 19 14:30:24 2010
>>>> New Revision: 965499
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=965499&view=rev
>>>> Log:
>>>> SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC Javascript
>>>> Errors
>>>>
>>>> Added:
>>>>
>>>>
>>>>  shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>>
>>>>
>>>>  shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>> Modified:
>>>>    shindig/trunk/features/pom.xml
>>>>
>>>>
>>>>  shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>>
>>>>
>>>>  shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>>
>>>>
>>>>  shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>>
>>>> Modified: shindig/trunk/features/pom.xml
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>> --- shindig/trunk/features/pom.xml (original)
>>>> +++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
>>>> @@ -108,6 +108,8 @@
>>>>
>>>> <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
>>>>                 <source>globals/globals.js</source>
>>>>                 <source>core.config/config.js</source>
>>>> +<source>core.config/configcontainer.js</source>
>>>> +<source>core.config/configgadget.js</source>
>>>>                 <source>core.json/json.js</source>
>>>>                 <source>shindig.auth/auth.js</source>
>>>>                 <source>core.util/util.js</source>
>>>>
>>>> Added:
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
>>>>
>>>>
>>>> ==============================================================================
>>>> ---
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>> (added)
>>>> +++
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>> Mon Jul 19 14:30:24 2010
>>>> @@ -0,0 +1,27 @@
>>>> +/*
>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>> + * or more contributor license agreements.  See the NOTICE file
>>>> + * distributed with this work for additional information
>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>> + * to you under the Apache License, Version 2.0 (the
>>>> + * "License"); you may not use this file except in compliance
>>>> + * with the License.  You may obtain a copy of the License at
>>>> + *
>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>> + *
>>>> + * Unless required by applicable law or agreed to in writing,
>>>> + * software distributed under the License is distributed on an
>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> + * KIND, either express or implied.  See the License for the
>>>> + * specific language governing permissions and limitations
>>>> + * under the License.
>>>> + */
>>>> +
>>>> +/**
>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>> + */
>>>> +
>>>> +/** @type {boolean} */
>>>> +gadgets.config.isGadget = false;
>>>> +/** @type {boolean} */
>>>> +gadgets.config.isContainer = true;
>>>>
>>>> Added:
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
>>>>
>>>>
>>>> ==============================================================================
>>>> ---
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>> (added)
>>>> +++
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>>> Mon Jul 19 14:30:24 2010
>>>> @@ -0,0 +1,26 @@
>>>> +/*
>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>> + * or more contributor license agreements.  See the NOTICE file
>>>> + * distributed with this work for additional information
>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>> + * to you under the Apache License, Version 2.0 (the
>>>> + * "License"); you may not use this file except in compliance
>>>> + * with the License.  You may obtain a copy of the License at
>>>> + *
>>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>>> + *
>>>> + * Unless required by applicable law or agreed to in writing,
>>>> + * software distributed under the License is distributed on an
>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> + * KIND, either express or implied.  See the License for the
>>>> + * specific language governing permissions and limitations
>>>> + * under the License.
>>>> + */
>>>> +
>>>> +/**
>>>> + * @fileoverview Provides gadget/container configuration flags.
>>>> + */
>>>> +/** @type {boolean} */
>>>> +gadgets.config.isGadget = true;
>>>> +/** @type {boolean} */
>>>> +gadgets.config.isContainer = false;
>>>>
>>>> Modified:
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>> ---
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>> (original)
>>>> +++
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>> Mon Jul 19 14:30:24 2010
>>>> @@ -21,8 +21,10 @@
>>>>   <dependency>globals</dependency>
>>>>   <gadget>
>>>>     <script src="config.js"/>
>>>> +<script src="configgadget.js"/>
>>>>   </gadget>
>>>>   <container>
>>>>     <script src="config.js"/>
>>>> +<script src="configcontainer.js"/>
>>>>   </container>
>>>>  </feature>
>>>>
>>>> Modified:
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>> ---
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>> (original)
>>>> +++
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>> Mon Jul 19 14:30:24 2010
>>>> @@ -110,7 +110,7 @@ if (gadgets&&  gadgets.rpc) { //Dont bin
>>>>     }
>>>>
>>>>     // Do not run this in container mode.
>>>> -    if (gadgets.config) {
>>>> +    if (gadgets.config&&  gadgets.config.isGadget) {
>>>>       gadgets.config.register("osapi.services", null, init);
>>>>     }
>>>>   })();
>>>>
>>>> Modified:
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>> ---
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>> (original)
>>>> +++
>>>>
>>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>> Mon Jul 19 14:30:24 2010
>>>> @@ -89,7 +89,7 @@
>>>>   }
>>>>
>>>>   // Do not run this in container mode.
>>>> -  if (gadgets.config) {
>>>> +  if (gadgets.config&&  gadgets.config.isGadget) {
>>>>     gadgets.config.register("osapi.services", null, init);
>>>>   }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>         
>>> .
>>>
>>>
>>>
>>>       
>
>   


Re: svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Posted by John Hjelmstad <fa...@google.com>.
If you've got some code that does this declaratively (esp. using
shindig.container), feel free to post some patches ;)

More directly, does this CL complicate your implementation and if so, how?

--j

On Mon, Jul 19, 2010 at 10:31 AM, Evgeny Bogdanov
<ev...@epfl.ch>wrote:

> Agree here
> I already have gadgets, that behave as containers.
>
> Evgeny
>
>
> On 19/7/10 16:59, John Hjelmstad wrote:
>
>> While not quite relevant yet to deployed use cases, what's our thinking on
>> how these flags will affect behavior at such time as it's possible for a
>> gadget to *be* a container? Eg.<Require feature="shindig.container"/>,
>> enabling nested gadgets.
>>
>> In this case, anything that's acting in a gadget context should register
>> osapi.services. I'm sure there will be more ambiguity to navigate than
>> just
>> these flags, but did want to point out one downstream impact.
>>
>> --j
>>
>> On Mon, Jul 19, 2010 at 7:30 AM,<li...@apache.org>  wrote:
>>
>>
>>
>>> Author: lindner
>>> Date: Mon Jul 19 14:30:24 2010
>>> New Revision: 965499
>>>
>>> URL: http://svn.apache.org/viewvc?rev=965499&view=rev
>>> Log:
>>> SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC Javascript
>>> Errors
>>>
>>> Added:
>>>
>>>
>>>  shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>>
>>>
>>>  shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>> Modified:
>>>    shindig/trunk/features/pom.xml
>>>
>>>
>>>  shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>>
>>>
>>>  shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>>
>>>
>>>  shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>>
>>> Modified: shindig/trunk/features/pom.xml
>>> URL:
>>>
>>> http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>
>>>
>>> ==============================================================================
>>> --- shindig/trunk/features/pom.xml (original)
>>> +++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
>>> @@ -108,6 +108,8 @@
>>>
>>> <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
>>>                 <source>globals/globals.js</source>
>>>                 <source>core.config/config.js</source>
>>> +<source>core.config/configcontainer.js</source>
>>> +<source>core.config/configgadget.js</source>
>>>                 <source>core.json/json.js</source>
>>>                 <source>shindig.auth/auth.js</source>
>>>                 <source>core.util/util.js</source>
>>>
>>> Added:
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>> URL:
>>>
>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
>>>
>>>
>>> ==============================================================================
>>> ---
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>> (added)
>>> +++
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>> Mon Jul 19 14:30:24 2010
>>> @@ -0,0 +1,27 @@
>>> +/*
>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>> + * or more contributor license agreements.  See the NOTICE file
>>> + * distributed with this work for additional information
>>> + * regarding copyright ownership.  The ASF licenses this file
>>> + * to you under the Apache License, Version 2.0 (the
>>> + * "License"); you may not use this file except in compliance
>>> + * with the License.  You may obtain a copy of the License at
>>> + *
>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>> + *
>>> + * Unless required by applicable law or agreed to in writing,
>>> + * software distributed under the License is distributed on an
>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> + * KIND, either express or implied.  See the License for the
>>> + * specific language governing permissions and limitations
>>> + * under the License.
>>> + */
>>> +
>>> +/**
>>> + * @fileoverview Provides gadget/container configuration flags.
>>> + */
>>> +
>>> +/** @type {boolean} */
>>> +gadgets.config.isGadget = false;
>>> +/** @type {boolean} */
>>> +gadgets.config.isContainer = true;
>>>
>>> Added:
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>> URL:
>>>
>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
>>>
>>>
>>> ==============================================================================
>>> ---
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>> (added)
>>> +++
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>>> Mon Jul 19 14:30:24 2010
>>> @@ -0,0 +1,26 @@
>>> +/*
>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>> + * or more contributor license agreements.  See the NOTICE file
>>> + * distributed with this work for additional information
>>> + * regarding copyright ownership.  The ASF licenses this file
>>> + * to you under the Apache License, Version 2.0 (the
>>> + * "License"); you may not use this file except in compliance
>>> + * with the License.  You may obtain a copy of the License at
>>> + *
>>> + *     http://www.apache.org/licenses/LICENSE-2.0
>>> + *
>>> + * Unless required by applicable law or agreed to in writing,
>>> + * software distributed under the License is distributed on an
>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> + * KIND, either express or implied.  See the License for the
>>> + * specific language governing permissions and limitations
>>> + * under the License.
>>> + */
>>> +
>>> +/**
>>> + * @fileoverview Provides gadget/container configuration flags.
>>> + */
>>> +/** @type {boolean} */
>>> +gadgets.config.isGadget = true;
>>> +/** @type {boolean} */
>>> +gadgets.config.isContainer = false;
>>>
>>> Modified:
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>> URL:
>>>
>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
>>>
>>>
>>> ==============================================================================
>>> ---
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>> (original)
>>> +++
>>>
>>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>> Mon Jul 19 14:30:24 2010
>>> @@ -21,8 +21,10 @@
>>>   <dependency>globals</dependency>
>>>   <gadget>
>>>     <script src="config.js"/>
>>> +<script src="configgadget.js"/>
>>>   </gadget>
>>>   <container>
>>>     <script src="config.js"/>
>>> +<script src="configcontainer.js"/>
>>>   </container>
>>>  </feature>
>>>
>>> Modified:
>>>
>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>> URL:
>>>
>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>
>>>
>>> ==============================================================================
>>> ---
>>>
>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>> (original)
>>> +++
>>>
>>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>> Mon Jul 19 14:30:24 2010
>>> @@ -110,7 +110,7 @@ if (gadgets&&  gadgets.rpc) { //Dont bin
>>>     }
>>>
>>>     // Do not run this in container mode.
>>> -    if (gadgets.config) {
>>> +    if (gadgets.config&&  gadgets.config.isGadget) {
>>>       gadgets.config.register("osapi.services", null, init);
>>>     }
>>>   })();
>>>
>>> Modified:
>>>
>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>> URL:
>>>
>>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>>
>>>
>>> ==============================================================================
>>> ---
>>>
>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>> (original)
>>> +++
>>>
>>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>> Mon Jul 19 14:30:24 2010
>>> @@ -89,7 +89,7 @@
>>>   }
>>>
>>>   // Do not run this in container mode.
>>> -  if (gadgets.config) {
>>> +  if (gadgets.config&&  gadgets.config.isGadget) {
>>>     gadgets.config.register("osapi.services", null, init);
>>>   }
>>>
>>>
>>>
>>>
>>>
>>>
>> .
>>
>>
>>
>

Re: svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Posted by Evgeny Bogdanov <ev...@epfl.ch>.
Agree here
I already have gadgets, that behave as containers.

Evgeny

On 19/7/10 16:59, John Hjelmstad wrote:
> While not quite relevant yet to deployed use cases, what's our thinking on
> how these flags will affect behavior at such time as it's possible for a
> gadget to *be* a container? Eg.<Require feature="shindig.container"/>,
> enabling nested gadgets.
>
> In this case, anything that's acting in a gadget context should register
> osapi.services. I'm sure there will be more ambiguity to navigate than just
> these flags, but did want to point out one downstream impact.
>
> --j
>
> On Mon, Jul 19, 2010 at 7:30 AM,<li...@apache.org>  wrote:
>
>    
>> Author: lindner
>> Date: Mon Jul 19 14:30:24 2010
>> New Revision: 965499
>>
>> URL: http://svn.apache.org/viewvc?rev=965499&view=rev
>> Log:
>> SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC Javascript
>> Errors
>>
>> Added:
>>
>>   shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>>
>>   shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>> Modified:
>>     shindig/trunk/features/pom.xml
>>
>>   shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>>
>>   shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>>
>>   shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>>
>> Modified: shindig/trunk/features/pom.xml
>> URL:
>> http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
>>
>> ==============================================================================
>> --- shindig/trunk/features/pom.xml (original)
>> +++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
>> @@ -108,6 +108,8 @@
>>
>> <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
>>                  <source>globals/globals.js</source>
>>                  <source>core.config/config.js</source>
>> +<source>core.config/configcontainer.js</source>
>> +<source>core.config/configgadget.js</source>
>>                  <source>core.json/json.js</source>
>>                  <source>shindig.auth/auth.js</source>
>>                  <source>core.util/util.js</source>
>>
>> Added:
>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>> URL:
>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
>>
>> ==============================================================================
>> ---
>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>> (added)
>> +++
>> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>> Mon Jul 19 14:30:24 2010
>> @@ -0,0 +1,27 @@
>> +/*
>> + * Licensed to the Apache Software Foundation (ASF) under one
>> + * or more contributor license agreements.  See the NOTICE file
>> + * distributed with this work for additional information
>> + * regarding copyright ownership.  The ASF licenses this file
>> + * to you under the Apache License, Version 2.0 (the
>> + * "License"); you may not use this file except in compliance
>> + * with the License.  You may obtain a copy of the License at
>> + *
>> + *     http://www.apache.org/licenses/LICENSE-2.0
>> + *
>> + * Unless required by applicable law or agreed to in writing,
>> + * software distributed under the License is distributed on an
>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> + * KIND, either express or implied.  See the License for the
>> + * specific language governing permissions and limitations
>> + * under the License.
>> + */
>> +
>> +/**
>> + * @fileoverview Provides gadget/container configuration flags.
>> + */
>> +
>> +/** @type {boolean} */
>> +gadgets.config.isGadget = false;
>> +/** @type {boolean} */
>> +gadgets.config.isContainer = true;
>>
>> Added:
>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>> URL:
>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
>>
>> ==============================================================================
>> ---
>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>> (added)
>> +++
>> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
>> Mon Jul 19 14:30:24 2010
>> @@ -0,0 +1,26 @@
>> +/*
>> + * Licensed to the Apache Software Foundation (ASF) under one
>> + * or more contributor license agreements.  See the NOTICE file
>> + * distributed with this work for additional information
>> + * regarding copyright ownership.  The ASF licenses this file
>> + * to you under the Apache License, Version 2.0 (the
>> + * "License"); you may not use this file except in compliance
>> + * with the License.  You may obtain a copy of the License at
>> + *
>> + *     http://www.apache.org/licenses/LICENSE-2.0
>> + *
>> + * Unless required by applicable law or agreed to in writing,
>> + * software distributed under the License is distributed on an
>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> + * KIND, either express or implied.  See the License for the
>> + * specific language governing permissions and limitations
>> + * under the License.
>> + */
>> +
>> +/**
>> + * @fileoverview Provides gadget/container configuration flags.
>> + */
>> +/** @type {boolean} */
>> +gadgets.config.isGadget = true;
>> +/** @type {boolean} */
>> +gadgets.config.isContainer = false;
>>
>> Modified:
>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>> URL:
>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
>>
>> ==============================================================================
>> ---
>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>> (original)
>> +++
>> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>> Mon Jul 19 14:30:24 2010
>> @@ -21,8 +21,10 @@
>>    <dependency>globals</dependency>
>>    <gadget>
>>      <script src="config.js"/>
>> +<script src="configgadget.js"/>
>>    </gadget>
>>    <container>
>>      <script src="config.js"/>
>> +<script src="configcontainer.js"/>
>>    </container>
>>   </feature>
>>
>> Modified:
>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>> URL:
>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>
>> ==============================================================================
>> ---
>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>> (original)
>> +++
>> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>> Mon Jul 19 14:30:24 2010
>> @@ -110,7 +110,7 @@ if (gadgets&&  gadgets.rpc) { //Dont bin
>>      }
>>
>>      // Do not run this in container mode.
>> -    if (gadgets.config) {
>> +    if (gadgets.config&&  gadgets.config.isGadget) {
>>        gadgets.config.register("osapi.services", null, init);
>>      }
>>    })();
>>
>> Modified:
>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>> URL:
>> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>>
>> ==============================================================================
>> ---
>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>> (original)
>> +++
>> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>> Mon Jul 19 14:30:24 2010
>> @@ -89,7 +89,7 @@
>>    }
>>
>>    // Do not run this in container mode.
>> -  if (gadgets.config) {
>> +  if (gadgets.config&&  gadgets.config.isGadget) {
>>      gadgets.config.register("osapi.services", null, init);
>>    }
>>
>>
>>
>>
>>      
> .
>
>    

Re: svn commit: r965499 - in /shindig/trunk/features: ./ src/main/javascript/features/core.config/ src/main/javascript/features/osapi/

Posted by John Hjelmstad <fa...@google.com>.
While not quite relevant yet to deployed use cases, what's our thinking on
how these flags will affect behavior at such time as it's possible for a
gadget to *be* a container? Eg. <Require feature="shindig.container"/>,
enabling nested gadgets.

In this case, anything that's acting in a gadget context should register
osapi.services. I'm sure there will be more ambiguity to navigate than just
these flags, but did want to point out one downstream impact.

--j

On Mon, Jul 19, 2010 at 7:30 AM, <li...@apache.org> wrote:

> Author: lindner
> Date: Mon Jul 19 14:30:24 2010
> New Revision: 965499
>
> URL: http://svn.apache.org/viewvc?rev=965499&view=rev
> Log:
> SHINDIG-1380 | Patch from Randy Watler | Sample Container RPC Javascript
> Errors
>
> Added:
>
>  shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
>
>  shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
> Modified:
>    shindig/trunk/features/pom.xml
>
>  shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
>
>  shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
>
>  shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
>
> Modified: shindig/trunk/features/pom.xml
> URL:
> http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=965499&r1=965498&r2=965499&view=diff
>
> ==============================================================================
> --- shindig/trunk/features/pom.xml (original)
> +++ shindig/trunk/features/pom.xml Mon Jul 19 14:30:24 2010
> @@ -108,6 +108,8 @@
>
> <source>../../../../src/test/javascript/features/mocks/xhr.js</source>
>                 <source>globals/globals.js</source>
>                 <source>core.config/config.js</source>
> +                <source>core.config/configcontainer.js</source>
> +                <source>core.config/configgadget.js</source>
>                 <source>core.json/json.js</source>
>                 <source>shindig.auth/auth.js</source>
>                 <source>core.util/util.js</source>
>
> Added:
> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
> URL:
> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js?rev=965499&view=auto
>
> ==============================================================================
> ---
> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
> (added)
> +++
> shindig/trunk/features/src/main/javascript/features/core.config/configcontainer.js
> Mon Jul 19 14:30:24 2010
> @@ -0,0 +1,27 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + *     http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + */
> +
> +/**
> + * @fileoverview Provides gadget/container configuration flags.
> + */
> +
> +/** @type {boolean} */
> +gadgets.config.isGadget = false;
> +/** @type {boolean} */
> +gadgets.config.isContainer = true;
>
> Added:
> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
> URL:
> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js?rev=965499&view=auto
>
> ==============================================================================
> ---
> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
> (added)
> +++
> shindig/trunk/features/src/main/javascript/features/core.config/configgadget.js
> Mon Jul 19 14:30:24 2010
> @@ -0,0 +1,26 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + *     http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + */
> +
> +/**
> + * @fileoverview Provides gadget/container configuration flags.
> + */
> +/** @type {boolean} */
> +gadgets.config.isGadget = true;
> +/** @type {boolean} */
> +gadgets.config.isContainer = false;
>
> Modified:
> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
> URL:
> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/feature.xml?rev=965499&r1=965498&r2=965499&view=diff
>
> ==============================================================================
> ---
> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
> (original)
> +++
> shindig/trunk/features/src/main/javascript/features/core.config/feature.xml
> Mon Jul 19 14:30:24 2010
> @@ -21,8 +21,10 @@
>   <dependency>globals</dependency>
>   <gadget>
>     <script src="config.js"/>
> +    <script src="configgadget.js"/>
>   </gadget>
>   <container>
>     <script src="config.js"/>
> +    <script src="configcontainer.js"/>
>   </container>
>  </feature>
>
> Modified:
> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
> URL:
> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>
> ==============================================================================
> ---
> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
> (original)
> +++
> shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
> Mon Jul 19 14:30:24 2010
> @@ -110,7 +110,7 @@ if (gadgets && gadgets.rpc) { //Dont bin
>     }
>
>     // Do not run this in container mode.
> -    if (gadgets.config) {
> +    if (gadgets.config && gadgets.config.isGadget) {
>       gadgets.config.register("osapi.services", null, init);
>     }
>   })();
>
> Modified:
> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
> URL:
> http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js?rev=965499&r1=965498&r2=965499&view=diff
>
> ==============================================================================
> ---
> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
> (original)
> +++
> shindig/trunk/features/src/main/javascript/features/osapi/jsonrpctransport.js
> Mon Jul 19 14:30:24 2010
> @@ -89,7 +89,7 @@
>   }
>
>   // Do not run this in container mode.
> -  if (gadgets.config) {
> +  if (gadgets.config && gadgets.config.isGadget) {
>     gadgets.config.register("osapi.services", null, init);
>   }
>
>
>
>