On Mon, Jul 19, 2010 at 11:59 AM, Randy Watler <[email protected]> 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 >> <[email protected]>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,<[email protected]> 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); >>>>> } >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> . >>>> >>>> >>>> >>>> >>>> >>> >> >> > >
