summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/js/htdocs/scdl.js
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-12-12 18:37:57 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-12-12 18:37:57 +0000
commitaaffeb998351334a423f833b46066bc8f3a82357 (patch)
treeaab28e35de2bfc9c1ef906f3dc9519b281ae1d63 /sca-cpp/trunk/modules/js/htdocs/scdl.js
parente1a9fc541e79a545a696fd4a6373d1fa9ade1987 (diff)
Refactor some of the Javascript scripts to use a different namespace per script.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1044875 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/scdl.js65
1 files changed, 40 insertions, 25 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/scdl.js b/sca-cpp/trunk/modules/js/htdocs/scdl.js
index 5f3934b060..afdb74ac3b 100644
--- a/sca-cpp/trunk/modules/js/htdocs/scdl.js
+++ b/sca-cpp/trunk/modules/js/htdocs/scdl.js
@@ -20,28 +20,36 @@
/**
* SCDL parsing functions.
*/
+var scdl = new Object();
/**
* Returns a list of components in a composite.
*/
-function components(l) {
+scdl.components = function(l) {
var cs = namedElementChildren("'composite", l);
if (isNil(cs))
return cs;
return namedElementChildren("'component", car(cs));
-}
+};
/**
* Returns the name of a component, service or reference.
*/
-function name(l) {
+scdl.name = function(l) {
return namedAttributeValue("'name", l);
-}
+};
+
+/**
+ * Returns the color of a component.
+ */
+scdl.color = function(l) {
+ return namedAttributeValue("'color", l);
+};
/**
* Returns the implementation of a component.
*/
-function implementation(l) {
+scdl.implementation = function(l) {
function filterImplementation(v) {
return isElement(v) && cadr(v).match("implementation.") != null;
}
@@ -50,58 +58,65 @@ function implementation(l) {
if (isNil(n))
return null;
return car(n);
-}
+};
/**
* Returns the type of an implementation.
*/
-function implementationType(l) {
+scdl.implementationType = function(l) {
return elementName(l).substring(1);
-}
+};
/**
* Returns the URI of a service, reference or implementation.
*/
-function uri(l) {
+scdl.uri = function(l) {
return namedAttributeValue("'uri", l);
-}
+};
+
+/**
+ * Returns the align attribute of a service or reference.
+ */
+scdl.align = function(l) {
+ return namedAttributeValue("'align", l);
+};
/**
* Returns a list of services in a component.
*/
-function services(l) {
+scdl.services = function(l) {
return namedElementChildren("'service", l);
-}
+};
/**
* Returns a list of references in a component.
*/
-function references(l) {
+scdl.references = function(l) {
return namedElementChildren("'reference", l);
-}
+};
/**
* Returns a list of bindings in a service or reference.
*/
-function bindings(l) {
+scdl.bindings = function(l) {
function filterBinding(v) {
return isElement(v) && cadr(v).match("binding.") != null;
}
return filter(filterBinding, l);
-}
+};
/**
* Returns the type of a binding.
*/
-function bindingType(l) {
+scdl.bindingType = function(l) {
return elementName(l).substring(1);
-}
+};
/**
* Returns the target of a reference.
*/
-function target(l) {
+scdl.target = function(l) {
function bindingsTarget(l) {
if (isNil(l))
return null;
@@ -114,20 +129,20 @@ function target(l) {
var t = namedAttributeValue("'target", l);
if (!isNil(t))
return t;
- return bindingsTarget(bindings(l));
-}
+ return bindingsTarget(scdl.bindings(l));
+};
/**
* Returns a list of properties in a component.
*/
-function properties(l) {
+scdl.properties = function(l) {
return namedElementChildren("'property", l);
-}
+};
/**
* Returns the value of a property.
*/
-function propertyValue(l) {
+scdl.propertyValue = function(l) {
return elementValue(l);
-}
+};