summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/js
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-01-06 07:12:30 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-01-06 07:12:30 +0000
commit6860b985ae504a1375ee3dfadc1f5a59fe198bac (patch)
treed8dc4556b9feda788e3a07a381d42e881dbfec9f /sca-cpp/trunk/modules/js
parentb175edffceb282100b0359db6d90715ce70b4864 (diff)
Support service promotion and improve component layout algorithm.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1055767 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/js')
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/scdl.js22
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/ui.js14
2 files changed, 35 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/scdl.js b/sca-cpp/trunk/modules/js/htdocs/scdl.js
index baba0078fe..08cde5ed3d 100644
--- a/sca-cpp/trunk/modules/js/htdocs/scdl.js
+++ b/sca-cpp/trunk/modules/js/htdocs/scdl.js
@@ -33,6 +33,26 @@ scdl.components = function(l) {
};
/**
+ * Returns a list of service promotions in a composite.
+ */
+scdl.promotions = function(l) {
+ var cs = namedElementChildren("'composite", l);
+ if (isNil(cs))
+ return cs;
+ return namedElementChildren("'service", car(cs));
+};
+
+/**
+ * Returns the target of a service promotion.
+ */
+scdl.promote = function(l) {
+ var puri = namedAttributeValue("'promote", l);
+ if (isNil(puri))
+ return puri;
+ return car(tokens(puri));
+};
+
+/**
* Returns the name of a component, service or reference.
*/
scdl.name = function(l) {
@@ -121,7 +141,7 @@ scdl.target = function(l) {
function bindingsTarget(l) {
if (isNil(l))
return null;
- var u = uri(car(l));
+ var u = scdl.uri(car(l));
if (!isNil(u))
return u;
return bindingsTarget(cdr(l));
diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js
index 2f5c6d3ae9..d8266c7af6 100644
--- a/sca-cpp/trunk/modules/js/htdocs/ui.js
+++ b/sca-cpp/trunk/modules/js/htdocs/ui.js
@@ -204,6 +204,20 @@ function $(id) {
};
/**
+ * Return a dictionary of the query parameters.
+ */
+ui.queryParams = function() {
+ var qp = new Array();
+ var qs = window.location.search.substring(1).split('&');
+ for (var i = 0; i < qs.length; i++) {
+ var e = qs[i].indexOf('=');
+ if (e > 0)
+ qp[qs[i].substring(0, e)] = unescape(qs[i].substring(e + 1));
+ }
+ return qp;
+}
+
+/**
* Bind a widget iframe to an element.
*/
ui.widgets = new Array();