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);
>   }
>
>
>
>

Reply via email to