diff options
-rw-r--r-- | sca-cpp/trunk/modules/edit/apps/testsocial/app.composite | 45 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/edit/apps/testtext/app.composite | 41 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/edit/apps/testvalues/app.composite | 175 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/edit/htdocs/graph/graph.js | 58 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/edit/mkapplinks | 34 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/edit/palettes/list/palette.composite | 19 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/edit/ssl-start | 3 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/edit/start | 3 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/scdl.js | 7 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/util.js | 8 |
10 files changed, 233 insertions, 160 deletions
diff --git a/sca-cpp/trunk/modules/edit/apps/testsocial/app.composite b/sca-cpp/trunk/modules/edit/apps/testsocial/app.composite index 17188aae1e..d1121d9206 100644 --- a/sca-cpp/trunk/modules/edit/apps/testsocial/app.composite +++ b/sca-cpp/trunk/modules/edit/apps/testsocial/app.composite @@ -31,29 +31,11 @@ <t:binding.http uri="https://graph.facebook.com"/> </reference> </component> - <component t:x="111" t:y="18" name="assoc" t:title="assoc" t:color="orange1"> - <t:implementation.python script="nuvem/assoc.py"/> - <service name="assoc"/> - <reference target="name" name="name"/> - <reference target="fbprofile" name="value"/> - </component> - <component t:x="187" t:y="155" name="assoc2" t:title="assoc" t:color="orange1"> - <t:implementation.python script="nuvem/assoc.py"/> - <service name="assoc"/> - <reference target="name2" name="name"/> - <reference target="twprofile" name="value"/> - </component> <component t:x="169" t:y="17" name="name" t:title="name" t:color="orange1"> <t:implementation.python script="nuvem/name.py"/> <service name="name"/> <property>facebook</property> </component> - <component t:x="68" t:y="350" name="list" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="assoc" name="first"/> - <reference target="list2" name="rest"/> - </component> <component t:x="66" t:y="14" name="name3" t:title="name" t:color="orange1"> <t:implementation.python script="nuvem/name.py"/> <service name="name"/> @@ -63,7 +45,7 @@ <t:implementation.python script="nuvem/assoc.py"/> <service name="assoc"/> <reference target="name3" name="name"/> - <reference target="list" name="value"/> + <reference target="list3" name="value"/> </component> <service name="page" promote="page"/> <component t:x="0" t:y="12" name="page" t:title="when page opened" t:color="green1"> @@ -73,12 +55,6 @@ </service> <reference target="me360" name="content"/> </component> - <component t:x="269" t:y="163" name="list2" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="assoc2" name="first"/> - <reference name="rest"/> - </component> <component t:x="404" t:y="162" name="name2" t:title="name" t:color="orange1"> <t:implementation.python script="nuvem/name.py"/> <service name="name"/> @@ -97,4 +73,23 @@ <t:binding.http uri="http://api.twitter.com/1/users/show.json"/> </reference> </component> + <component t:x="184" t:y="58" name="list3" t:title="make list" t:color="yellow1"> + <t:implementation.python script="nuvem/list_.py"/> + <service name="list"/> + <reference target="assoc" name="item" t:clonable="true"/> + <reference target="assoc2" name="item" t:clonable="true"/> + <reference name="item" t:clonable="true"/> + </component> + <component t:x="260" t:y="57" name="assoc" t:title="assoc" t:color="orange1"> + <t:implementation.python script="nuvem/assoc.py"/> + <service name="assoc"/> + <reference target="name" name="name"/> + <reference target="fbprofile" name="value"/> + </component> + <component t:x="262" t:y="152" name="assoc2" t:title="assoc" t:color="orange1"> + <t:implementation.python script="nuvem/assoc.py"/> + <service name="assoc"/> + <reference target="name2" name="name"/> + <reference target="twprofile" name="value"/> + </component> </composite> diff --git a/sca-cpp/trunk/modules/edit/apps/testtext/app.composite b/sca-cpp/trunk/modules/edit/apps/testtext/app.composite index 8309ca0018..f286689590 100644 --- a/sca-cpp/trunk/modules/edit/apps/testtext/app.composite +++ b/sca-cpp/trunk/modules/edit/apps/testtext/app.composite @@ -37,7 +37,7 @@ <t:implementation.python script="nuvem/join.py"/> <service name="join"/> <reference target="text6" name="separator"/> - <reference target="list" name="list"/> + <reference target="list2" name="list"/> </component> <service name="replace" promote="replace"/> <component t:x="310" t:y="21" name="replace" t:title="replace" t:color="magenta1"> @@ -84,28 +84,6 @@ <service name="text"/> <property>y</property> </component> - <component t:x="88" t:y="256" name="list" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="text7" name="first"/> - <reference target="list2" name="rest"/> - </component> - <component t:x="165" t:y="288" name="list2" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="text8" name="first"/> - <reference name="rest"/> - </component> - <component t:x="165" t:y="262" name="text7" t:title="text" t:color="orange1"> - <t:implementation.python script="nuvem/text.py"/> - <service name="text"/> - <property>abc</property> - </component> - <component t:x="244" t:y="302" name="text8" t:title="text" t:color="orange1"> - <t:implementation.python script="nuvem/text.py"/> - <service name="text"/> - <property>def</property> - </component> <component t:x="107" t:y="56" name="text9" t:title="text" t:color="orange1"> <t:implementation.python script="nuvem/text.py"/> <service name="text"/> @@ -131,4 +109,21 @@ <service name="text"/> <property>abcxdefxghi</property> </component> + <component t:x="583" t:y="60" name="list2" t:title="make list" t:color="yellow1"> + <t:implementation.python script="nuvem/list_.py"/> + <service name="list"/> + <reference target="text7" name="item" t:clonable="true"/> + <reference target="text8" name="item" t:clonable="true"/> + <reference name="item" t:clonable="true"/> + </component> + <component t:x="662" t:y="61" name="text7" t:title="text" t:color="orange1"> + <t:implementation.python script="nuvem/text.py"/> + <service name="text"/> + <property>abc</property> + </component> + <component t:x="655" t:y="98" name="text8" t:title="text" t:color="orange1"> + <t:implementation.python script="nuvem/text.py"/> + <service name="text"/> + <property>def</property> + </component> </composite> diff --git a/sca-cpp/trunk/modules/edit/apps/testvalues/app.composite b/sca-cpp/trunk/modules/edit/apps/testvalues/app.composite index 2ee6ee8312..be3f503243 100644 --- a/sca-cpp/trunk/modules/edit/apps/testvalues/app.composite +++ b/sca-cpp/trunk/modules/edit/apps/testvalues/app.composite @@ -40,57 +40,18 @@ <t:implementation.python script="nuvem/false_.py"/> <service name="false"/> </component> - <service name="nothing" promote="nothing"/> - <component t:x="4" t:y="263" name="nothing" t:title="nothing" t:color="orange1"> - <t:implementation.python script="nuvem/nothing.py"/> - <service name="nothing"/> - </component> - <component t:x="190" t:y="250" name="list" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="number2" name="first"/> - <reference target="list2" name="rest"/> - </component> - <component t:x="286" t:y="213" name="list2" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="number3" name="first"/> - <reference name="rest"/> - </component> - <component t:x="285" t:y="170" name="number2" t:title="number" t:color="orange1"> - <t:implementation.python script="nuvem/number.py"/> - <service name="number"/> - <property>123</property> - </component> - <component t:x="359" t:y="214" name="number3" t:title="number" t:color="orange1"> - <t:implementation.python script="nuvem/number.py"/> - <service name="number"/> - <property>456</property> - </component> <service name="find" promote="find"/> <component t:x="728" t:y="9" name="find" t:title="find by name" t:color="yellow1"> <t:implementation.python script="nuvem/find.py"/> <service name="find"/> <reference target="name3" name="name"/> - <reference target="list3" name="assoc"/> + <reference target="list2" name="assoc"/> </component> <component t:x="283" t:y="351" name="name3" t:title="name" t:color="orange1"> <t:implementation.python script="nuvem/name.py"/> <service name="name"/> <property>d</property> </component> - <component t:x="281" t:y="390" name="list3" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="assoc2" name="first"/> - <reference target="list4" name="rest"/> - </component> - <component t:x="360" t:y="392" name="assoc2" t:title="assoc" t:color="orange1"> - <t:implementation.python script="nuvem/assoc.py"/> - <service name="assoc"/> - <reference target="name4" name="name"/> - <reference target="text3" name="value"/> - </component> <component t:x="420" t:y="390" name="name4" t:title="name" t:color="orange1"> <t:implementation.python script="nuvem/name.py"/> <service name="name"/> @@ -101,18 +62,6 @@ <service name="text"/> <property>abc</property> </component> - <component t:x="358" t:y="487" name="list4" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="assoc3" name="first"/> - <reference name="rest"/> - </component> - <component t:x="433" t:y="485" name="assoc3" t:title="assoc" t:color="orange1"> - <t:implementation.python script="nuvem/assoc.py"/> - <service name="assoc"/> - <reference target="name5" name="name"/> - <reference target="text4" name="value"/> - </component> <component t:x="495" t:y="486" name="name5" t:title="name" t:color="orange1"> <t:implementation.python script="nuvem/name.py"/> <service name="name"/> @@ -143,35 +92,13 @@ <component t:x="93" t:y="10" name="first" t:title="first item" t:color="yellow1"> <t:implementation.python script="nuvem/first.py"/> <service name="first"/> - <reference target="list" name="list"/> + <reference target="list7" name="list"/> </component> <service name="rest" promote="rest"/> <component t:x="408" t:y="6" name="rest" t:title="rest of list" t:color="yellow1"> <t:implementation.python script="nuvem/rest.py"/> <service name="rest"/> - <reference target="list5" name="list"/> - </component> - <component t:x="210" t:y="210" name="list5" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="number" name="first"/> - <reference target="list6" name="rest"/> - </component> - <component t:x="286" t:y="251" name="list6" t:title="make list" t:color="yellow1"> - <t:implementation.python script="nuvem/list_.py"/> - <service name="list"/> - <reference target="number7" name="first"/> - <reference name="rest"/> - </component> - <component t:x="284" t:y="207" name="number" t:title="number" t:color="orange1"> - <t:implementation.python script="nuvem/number.py"/> - <service name="number"/> - <property>12</property> - </component> - <component t:x="361" t:y="249" name="number7" t:title="number" t:color="orange1"> - <t:implementation.python script="nuvem/number.py"/> - <service name="number"/> - <property>34</property> + <reference target="list" name="list"/> </component> <service name="empty" promote="empty"/> <component t:x="5" t:y="320" name="empty" t:title="empty list" t:color="yellow1"> @@ -190,19 +117,6 @@ <service name="number"/> <property>3</property> </component> - <component t:x="228" t:y="324" name="multiply" t:title="*" t:color="magenta1"> - <t:implementation.python script="nuvem/multiply.py"/> - <service name="multiply"> - <documentation>*</documentation> - </service> - <reference target="valueof" name="value1"/> - <reference target="number6" name="value2"/> - </component> - <component t:x="228" t:y="358" name="reverse" t:title="reverse" t:color="yellow1"> - <t:implementation.python script="nuvem/reverse.py"/> - <service name="reverse"/> - <reference target="range" name="list"/> - </component> <component t:x="225" t:y="293" name="name2" t:title="name" t:color="orange1"> <t:implementation.python script="nuvem/name.py"/> <service name="name"/> @@ -256,11 +170,6 @@ <service name="number"/> <property>2</property> </component> - <component t:x="226" t:y="331" name="valueof" t:title="value of" t:color="orange1"> - <t:implementation.python script="nuvem/valueof.py"/> - <service name="valueof"/> - <property>nb</property> - </component> <component t:x="533" t:y="265" name="valueof2" t:title="value of" t:color="orange1"> <t:implementation.python script="nuvem/valueof.py"/> <service name="valueof"/> @@ -271,7 +180,83 @@ <service name="valueof"/> <property>i</property> </component> - <component t:x="193" t:y="226" name="foreach" t:title="foreach" t:color="yellow1"> + <component t:x="253" t:y="266" name="multiply" t:title="*" t:color="magenta1"> + <t:implementation.python script="nuvem/multiply.py"/> + <service name="multiply"> + <documentation>*</documentation> + </service> + <reference target="valueof" name="value1"/> + <reference target="number6" name="value2"/> + </component> + <component t:x="254" t:y="287" name="reverse" t:title="reverse" t:color="yellow1"> + <t:implementation.python script="nuvem/reverse.py"/> + <service name="reverse"/> + <reference target="range" name="list"/> + </component> + <component t:x="280" t:y="264" name="valueof" t:title="value of" t:color="orange1"> + <t:implementation.python script="nuvem/valueof.py"/> + <service name="valueof"/> + <property>nb</property> + </component> + <component t:x="167" t:y="13" name="list7" t:title="make list" t:color="yellow1"> + <t:implementation.python script="nuvem/list_.py"/> + <service name="list"/> + <reference target="number2" name="item" t:clonable="true"/> + <reference target="number3" name="item" t:clonable="true"/> + <reference name="item" t:clonable="true"/> + </component> + <component t:x="241" t:y="11" name="number2" t:title="number" t:color="orange1"> + <t:implementation.python script="nuvem/number.py"/> + <service name="number"/> + <property>123</property> + </component> + <component t:x="241" t:y="48" name="number3" t:title="number" t:color="orange1"> + <t:implementation.python script="nuvem/number.py"/> + <service name="number"/> + <property>456</property> + </component> + <service name="nothing" promote="nothing"/> + <component t:x="7" t:y="260" name="nothing" t:title="nothing" t:color="orange1"> + <t:implementation.python script="nuvem/nothing.py"/> + <service name="nothing"/> + </component> + <component t:x="488" t:y="11" name="list" t:title="make list" t:color="yellow1"> + <t:implementation.python script="nuvem/list_.py"/> + <service name="list"/> + <reference target="number" name="item" t:clonable="true"/> + <reference target="number7" name="item" t:clonable="true"/> + <reference name="item" t:clonable="true"/> + </component> + <component t:x="558" t:y="6" name="number" t:title="number" t:color="orange1"> + <t:implementation.python script="nuvem/number.py"/> + <service name="number"/> + <property>12</property> + </component> + <component t:x="559" t:y="46" name="number7" t:title="number" t:color="orange1"> + <t:implementation.python script="nuvem/number.py"/> + <service name="number"/> + <property>34</property> + </component> + <component t:x="902" t:y="56" name="assoc2" t:title="assoc" t:color="orange1"> + <t:implementation.python script="nuvem/assoc.py"/> + <service name="assoc"/> + <reference target="name4" name="name"/> + <reference target="text3" name="value"/> + </component> + <component t:x="896" t:y="137" name="assoc3" t:title="assoc" t:color="orange1"> + <t:implementation.python script="nuvem/assoc.py"/> + <service name="assoc"/> + <reference target="name5" name="name"/> + <reference target="text4" name="value"/> + </component> + <component t:x="823" t:y="49" name="list2" t:title="make list" t:color="yellow1"> + <t:implementation.python script="nuvem/list_.py"/> + <service name="list"/> + <reference target="assoc2" name="item" t:clonable="true"/> + <reference target="assoc3" name="item" t:clonable="true"/> + <reference name="item" t:clonable="true"/> + </component> + <component t:x="189" t:y="224" name="foreach" t:title="foreach" t:color="yellow1"> <t:implementation.python script="nuvem/map_.py"/> <service name="foreach"/> <reference target="name2" name="item"/> diff --git a/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js b/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js index a6a7a7d9ea..724720b19f 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js +++ b/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js @@ -218,7 +218,7 @@ if (ui.isIE()) { // Wire component to neighboring reference if (!isNil(graph.dragging.svcpos)) { var compos = scdl.composite(vmlg.compos); - setElement(compos, graph.wire(graph.dragging, compos, vmlg)); + setElement(compos, grah.clonerefs(graph.wire(graph.dragging, compos, vmlg))); } } else { @@ -227,7 +227,7 @@ if (ui.isIE()) { vmlg.removeChild(graph.dragging); if (!isNil(graph.dragging.compos)) { var compos = scdl.composite(vmlg.compos); - setElement(compos, graph.removecomp(graph.dragging.comp, compos)); + setElement(compos, graph.clonerefs(graph.gcollect(graph.removecomp(graph.dragging.comp, compos)))); } // Reset current selection @@ -698,7 +698,7 @@ if (ui.isIE()) { // Wire component to neighboring reference if (!isNil(graph.dragging.svcpos)) { var compos = scdl.composite(svg.compos); - setElement(compos, graph.wire(graph.dragging, compos, svg)); + setElement(compos, graph.clonerefs(graph.wire(graph.dragging, compos, svg))); } } else { @@ -707,7 +707,7 @@ if (ui.isIE()) { svg.removeChild(graph.dragging); if (!isNil(graph.dragging.compos)) { var compos = scdl.composite(svg.compos); - setElement(compos, graph.removecomp(graph.dragging.comp, compos)); + setElement(compos, graph.clonerefs(graph.gcollect(graph.removecomp(graph.dragging.comp, compos)))); } // Reset current selection @@ -1652,6 +1652,52 @@ graph.removecomp = function(comp, compos) { }; /** + * Garbage collect components not referenced or promoted. + */ +graph.gcollect = function(compos) { + + // List the promoted components + var proms = map(function(s) { return mklist(scdl.promote(s), true); }, scdl.promotions(mklist(compos))); + + // List the referenced components + var refs = reduce(function(a, comp) { + return append(a, + map(function(ref) { return mklist(scdl.target(ref), true); }, filter(function(ref) { return scdl.target(ref) != null; }, scdl.references(comp)))); + }, mklist(), scdl.components(mklist(compos))); + + // Filter out the unused components + var used = append(proms, refs); + return append(mklist(element, "'composite"), + filter(function(c) { return !(isElement(c) && elementName(c) == "'component" && isNil(assoc(scdl.name(c), used))); }, elementChildren(compos))); +} + +/** + * Clone and cleanup clonable references. + */ +graph.clonerefs = function(compos) { + return append(mklist(element, "'composite"), + map(function(c) { + if (elementName(c) != "'component") + return c; + + // If the references are clonable + var refs = scdl.references(c); + if (isNil(refs)) + return c; + if (scdl.clonable(car(refs)) != 'true') + return c; + + // Filter out the unwired references and add a fresh unwired + // reference at the end of the list + var cc = append( + filter(function(e) { return !(elementName(e) == "'reference" && scdl.target(e) == null); }, elementChildren(c)), + mklist(mklist(element, "'reference", mklist(attribute, "'name", scdl.name(car(refs))), mklist(attribute, "'t:clonable", "true")))); + return append(mklist(element, "'component"), cc); + + }, elementChildren(compos))); +} + +/** * Rename a component. */ graph.renamecomp = function(comp, compos, name) { @@ -1789,8 +1835,8 @@ graph.wire = function(n, compos, g) { if (cadddr(cref) == 25000000) return compos; - // Wire component to that reference, update the SCDL - // reference and composite + // Wire component to that reference, un-promote it, and + // update the SCDL reference and composite n.compos = null; setElement(car(cref), append(mklist(element, "'reference", mklist(attribute, "'target", scdl.name(n.comp))), elementChildren(car(cref)))); var name = scdl.name(n.comp); diff --git a/sca-cpp/trunk/modules/edit/mkapplinks b/sca-cpp/trunk/modules/edit/mkapplinks new file mode 100755 index 0000000000..66becf1618 --- /dev/null +++ b/sca-cpp/trunk/modules/edit/mkapplinks @@ -0,0 +1,34 @@ +#!/bin/sh + +# 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. + +# Create app links and sub-directories if needed +for n in `ls apps | awk '{ printf "apps/%s/nuvem\n", $1 }'`; do + if [ ! -e "$n" ]; then + ln -s ../../../../../nuvem/nuvem-parallel/nuvem "$n" + fi +done + +for n in `ls apps | awk '{ printf "apps/%s/htdocs\n", $1 }'`; do + if [ ! -e "$n" ]; then + mkdir "$n" + ln -s ../../../htdocs/login "$n/login" + ln -s ../../../htdocs/logout "$n/logout" + fi +done + diff --git a/sca-cpp/trunk/modules/edit/palettes/list/palette.composite b/sca-cpp/trunk/modules/edit/palettes/list/palette.composite index 8e31f0e8b5..be3f15ea66 100644 --- a/sca-cpp/trunk/modules/edit/palettes/list/palette.composite +++ b/sca-cpp/trunk/modules/edit/palettes/list/palette.composite @@ -26,16 +26,15 @@ <service name="first" promote="first"/> <service name="rest" promote="rest"/> <service name="empty" promote="empty"/> + <service name="append" promote="append"/> <service name="itemnb" promote="itemnb"/> <service name="find" promote="find"/> <service name="range" promote="range"/> - <service name="append" promote="append"/> <component name="list" t:title="make list" t:color="yellow1"> <t:implementation.python script="nuvem/list_.py"/> <service name="list"/> - <reference name="first"/> - <reference name="rest"/> + <reference name="item" t:clonable="true"/> </component> <component name="first" t:title="first item" t:color="yellow1"> @@ -55,6 +54,13 @@ <service name="empty"/> </component> + <component name="append" t:title="append" t:color="yellow1"> + <t:implementation.python script="nuvem/append.py"/> + <service name="append"/> + <reference name="first"/> + <reference name="second"/> + </component> + <component name="itemnb" t:title="item number" t:color="yellow1"> <t:implementation.python script="nuvem/itemnb.py"/> <service name="itemnb"/> @@ -76,11 +82,4 @@ <reference name="last"/> </component> - <component name="append" t:title="append" t:color="yellow1"> - <t:implementation.python script="nuvem/append.py"/> - <service name="append"/> - <reference name="first"/> - <reference name="second"/> - </component> - </composite> diff --git a/sca-cpp/trunk/modules/edit/ssl-start b/sca-cpp/trunk/modules/edit/ssl-start index 5e0429755a..73491e8fdc 100755 --- a/sca-cpp/trunk/modules/edit/ssl-start +++ b/sca-cpp/trunk/modules/edit/ssl-start @@ -70,6 +70,9 @@ Alias /ui.css $jsprefix/htdocs/uicyan.css EOF +# Create app links and sub-directories if needed +./mkapplinks + # Start memcached ../../components/cache/memcached-start diff --git a/sca-cpp/trunk/modules/edit/start b/sca-cpp/trunk/modules/edit/start index 938b0bf205..8410ba6167 100755 --- a/sca-cpp/trunk/modules/edit/start +++ b/sca-cpp/trunk/modules/edit/start @@ -71,6 +71,9 @@ Alias /ui.css $jsprefix/htdocs/uicyan.css EOF +# Create app links and sub-directories if needed +./mkapplinks + # Start memcached ../../components/cache/memcached-start 11211 diff --git a/sca-cpp/trunk/modules/js/htdocs/scdl.js b/sca-cpp/trunk/modules/js/htdocs/scdl.js index f1bf498305..b2e1464b9e 100644 --- a/sca-cpp/trunk/modules/js/htdocs/scdl.js +++ b/sca-cpp/trunk/modules/js/htdocs/scdl.js @@ -153,6 +153,13 @@ scdl.visible = function(l) { }; /** + * Returns the clonable attribute of a reference. + */ +scdl.clonable = function(l) { + return namedAttributeValue("'t:clonable", l); +}; + +/** * Returns a list of services in a component or componentType. */ scdl.services = function(l) { diff --git a/sca-cpp/trunk/modules/js/htdocs/util.js b/sca-cpp/trunk/modules/js/htdocs/util.js index 2521b82311..336248d34c 100644 --- a/sca-cpp/trunk/modules/js/htdocs/util.js +++ b/sca-cpp/trunk/modules/js/htdocs/util.js @@ -129,7 +129,7 @@ function assoc(k, l) { } /** - * Map and filter functions. + * Map, filter and reduce functions. */ function map(f, l) { if (isNil(l)) @@ -145,6 +145,12 @@ function filter(f, l) { return filter(f, cdr(l)); } +function reduce(f, i, l) { + if (isNil(l)) + return i; + return reduce(f, f(i, car(l)), cdr(l)); +} + /** * Split a path into a list of segments. */ |