Author: chabotc
Date: Thu Jun 18 06:28:40 2009
New Revision: 785922
URL: http://svn.apache.org/viewvc?rev=785922&view=rev
Log:
Inject a default osapi service config if none is set, helps the out-of-the-box
experience
Modified:
incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php
incubator/shindig/trunk/php/src/gadgets/render/GadgetBaseRenderer.php
incubator/shindig/trunk/php/src/gadgets/templates/TemplateParser.php
Modified: incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php?rev=785922&r1=785921&r2=785922&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php Thu Jun 18
06:28:40 2009
@@ -62,7 +62,7 @@
$this->config[$container][$key] = $val;
}
}
-
+
public static function removeComments($str) {
// remove /* */ style comments
$str = preg_replace('@/\\*.*?\\*/@s', '', $str);
Modified: incubator/shindig/trunk/php/src/gadgets/render/GadgetBaseRenderer.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/render/GadgetBaseRenderer.php?rev=785922&r1=785921&r2=785922&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/render/GadgetBaseRenderer.php
(original)
+++ incubator/shindig/trunk/php/src/gadgets/render/GadgetBaseRenderer.php Thu
Jun 18 06:28:40 2009
@@ -376,6 +376,17 @@
$requires[$feature] = new EmptyClass();
}
$gadgetConfig['core.util'] = $requires;
+ if (isset($gadgetConfig['osml'])) {
+ unset($gadgetConfig['osml']);
+ }
+ if (!isset($gadgetConfig['osapi.services']) ||
count($gadgetConfig['osapi.services']) == 1) {
+ // this should really be set in config/container.js, but if not, we
build a complete default set so at least most of it works out-of-the-box
+ $gadgetConfig['osapi.services'] = array(
+ 'gadgets.rpc' => array('container.listMethods'),
+ 'http://%host%/social/rpc' =>
array("messages.update","albums.update","activities.delete","activities.update","activities.supportedFields","albums.get","activities.get","mediaitems.update","messages.get","appdata.get","system.listMethods","people.supportedFields","messages.create","mediaitems.delete","mediaitems.create","people.get","people.create","albums.delete","messages.delete","appdata.update","activities.create","mediaitems.get","albums.create","appdata.delete","people.update","appdata.create"),
+ 'http://%host%/gadgets/api/rpc' => array('cache.invalidate',
'system.listMethods')
+ );
+ }
return "gadgets.config.init(" . json_encode($gadgetConfig) . ");\n";
}
Modified: incubator/shindig/trunk/php/src/gadgets/templates/TemplateParser.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/templates/TemplateParser.php?rev=785922&r1=785921&r2=785922&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/templates/TemplateParser.php
(original)
+++ incubator/shindig/trunk/php/src/gadgets/templates/TemplateParser.php Thu
Jun 18 06:28:40 2009
@@ -21,7 +21,6 @@
//TODO for some reason the OSML spec stats you have to <Require
feature="osml"> to use the os:Name etc tags yet no such feature exists, and for
the code path's here it's not required at all..
//TODO remove the os-templates javascript if all the templates are rendered on
the server (saves many Kb's in gadget size)
//TODO support for OSML tags (os:name, os:peopleselector, os:badge) and OSML
functions (os:render, osx:flash, osx:parsejson, etc)
-//TODO add variable resolving by checking the order of precedence: ${Cur},
${My} and then ${Top} (top == global data context)
//TODO support os-template tags on OSML tags, ie this should work: <os:Html
if="${Foo}" repeat="${Bar}" />
require_once 'ExpressionParser.php';