Almost complete implementation of the flow namespace
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 14 Jan 2010 21:18:24 +0000 (21:18 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 14 Jan 2010 21:18:24 +0000 (21:18 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@3287 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

demo/site/org.argeo.slc.demo.basic/conf/canonic-ns.xml [new file with mode: 0644]
demo/site/org.argeo.slc.demo.basic/conf/namespace.xml
demo/site/org.argeo.slc.demo.basic/conf/testCases/canonic-ns-001.xml [new file with mode: 0644]
demo/site/org.argeo.slc.demo.basic/conf/testCases/canonic-ns-002.xml [new file with mode: 0644]

diff --git a/demo/site/org.argeo.slc.demo.basic/conf/canonic-ns.xml b/demo/site/org.argeo.slc.demo.basic/conf/canonic-ns.xml
new file mode 100644 (file)
index 0000000..978d107
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
+       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:flow="http://www.argeo.org/schema/slc-flow"\r
+       xsi:schemaLocation="\r
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+       http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd\r
+       http://www.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
+\r
+       <flow:spec id="canonic-ns.spec">\r
+               <flow:primitive name="parameterAtInstantiation"\r
+                       isParameter="true" type="integer" />\r
+               <flow:primitive name="displayWithoutControl" value="100"\r
+                       isParameter="true" type="integer" isFrozen="true" />\r
+               <flow:primitive name="displayWithControl" value="200"\r
+                       isParameter="true" type="integer" />\r
+               <flow:primitive name="hide" value="300" isParameter="true"\r
+                       type="integer" isHidden="true" />\r
+               <flow:ref name="refWithValue" targetClass="org.argeo.slc.core.test.BasicTestData"\r
+                       isParameter="true" value-ref="testDataNok" />\r
+               <flow:ref name="refWithoutValue" targetClass="org.argeo.slc.core.test.BasicTestData" />\r
+               <flow:ref name="refWithoutValueFrozen" targetClass="org.argeo.slc.core.test.BasicTestData"\r
+                       isParameter="true" isFrozen="true">\r
+                       <flow:value>\r
+                               <bean class="org.argeo.slc.core.test.BasicTestData">\r
+                                       <aop:scoped-proxy />\r
+                                       <property name="expected" value="tata" />\r
+                                       <property name="reached" value="tata" />\r
+                               </bean>\r
+                       </flow:value>\r
+               </flow:ref>\r
+       </flow:spec>\r
+\r
+       <flow:flow id="canonic-ns.flowTemplate" abstract="true"\r
+               spec="canonic-ns.spec">\r
+               <bean parent="task.echo"\r
+                       p:message="Canonical: displayWithControl=@{displayWithControl}, displayWithoutControl=@{displayWithoutControl}, hide=@{hide}"\r
+                       scope="execution">\r
+                       <aop:scoped-proxy />\r
+               </bean>\r
+       </flow:flow>\r
+\r
+       <bean id="testDataOk" class="org.argeo.slc.core.test.BasicTestData">\r
+               <aop:scoped-proxy />\r
+               <property name="expected" value="tata" />\r
+               <property name="reached" value="tata" />\r
+       </bean>\r
+\r
+       <bean id="testDataNok" class="org.argeo.slc.core.test.BasicTestData">\r
+               <aop:scoped-proxy />\r
+               <property name="expected" value="tata" />\r
+               <property name="reached" value="toto" />\r
+       </bean>\r
+\r
+\r
+</beans>
\ No newline at end of file
index 48ab9105488aaf98603d3000b02b76287bc41783..c0767ecbbb786e30dbb65987b854267e68a1e2b7 100644 (file)
        -->\r
        <bean id="standaloneRunnable" flow:as-flow="implicitFlow"\r
                p:message="TEST in implicit flow" class="org.argeo.slc.core.execution.tasks.Echo" />\r
+\r
+       <!-- Specs definition is also simplified -->\r
+       <flow:spec id="namespaceSpec">\r
+               <flow:primitive name="primitive" value="100"\r
+                       isParameter="true" type="integer" />\r
+       </flow:spec>\r
+\r
+       <flow:flow id="flowSpec" spec="namespaceSpec" path="/namespace">\r
+               <bean p:message="TEST in flow @{primitive}" class="org.argeo.slc.core.execution.tasks.Echo"\r
+                       scope="execution">\r
+                       <aop:scoped-proxy />\r
+               </bean>\r
+               <ref bean="referencedRunnable" />\r
+       </flow:flow>\r
+\r
 </beans>
\ No newline at end of file
diff --git a/demo/site/org.argeo.slc.demo.basic/conf/testCases/canonic-ns-001.xml b/demo/site/org.argeo.slc.demo.basic/conf/testCases/canonic-ns-001.xml
new file mode 100644 (file)
index 0000000..5b1dbf6
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
+       xmlns:aop="http://www.springframework.org/schema/aop"\r
+       xsi:schemaLocation="\r
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+       http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
+\r
+       <bean id="canonic-ns.001" parent="canonic-ns.flowTemplate">\r
+               <description>Canonic 001</description>\r
+               <constructor-arg>\r
+                       <map>\r
+                               <entry key="parameterAtInstantiation" value="1" />\r
+                       </map>\r
+               </constructor-arg>\r
+       </bean>\r
+</beans>\r
diff --git a/demo/site/org.argeo.slc.demo.basic/conf/testCases/canonic-ns-002.xml b/demo/site/org.argeo.slc.demo.basic/conf/testCases/canonic-ns-002.xml
new file mode 100644 (file)
index 0000000..b1c4713
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
+       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:flow="http://www.argeo.org/schema/slc-flow"\r
+       xsi:schemaLocation="\r
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd\r
+       http://www.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
+\r
+       <flow:flow id="canonic-ns.002" parent="canonic.flowTemplate">\r
+               <flow:arg name="parameterAtInstantiation" value="2" />\r
+               <flow:arg name="displayWithoutControl" value="102" />\r
+               <flow:arg name="displayWithControl" value="202" />\r
+               <flow:arg name="hide" value="202" />\r
+       </flow:flow>\r
+</beans>\r