+++ /dev/null
-Development Environment
-
- First, you need to create a development environment.
\ No newline at end of file
+++ /dev/null
-Upload of attachments to a test result
-
- This allows to attach ANY Spring resource (for example the one created above but not only, since it can also be classpath: or osgibundle: Resources or ANY file on the file system where the agent is running (e.g. Mx *.mxres files on a server...))
-
- In order to use it:
-
- [[1]] First reference an attachment uploader service via OSGi (it is provided by the standard agent):
-
-+-------------------------------+
-<reference id="attachmentUploader" interface="org.argeo.slc.core.attachment.AttachmentUploader" />
-+-------------------------------+
-
- [[1]] Then use an UploadAttachment task:
-
-+-------------------------------+
-<bean parent="task.uploadAttachments">
- <property name="attachmentUploader" ref="attachmentUploader" />
- <property name="attachment">
- <bean parent="taskArg.attachment">
- <property name="name" value="myAttachment.txt" />
- </bean>
- </property>
- <property name="resource" ref="basic.writeTo" />
- <property name="attachTo">
- <list>
- <ref bean="basic.testResult" />
- </list>
- </property>
-</bean>
-+-------------------------------+
-
- You have to specify an Attachment object with at least a 'name', you can also specify a 'contentType', but the server will recognize common extension of the name.
- You have to specify a (Spring) Resource, for example the one that you created before (the name of the attachment doesn't have to be the name of the file).
- Just doing this will already upload a file to the server, but if you want to access it you need to bind it to some object, typically a TreeTestResult. You can provide a list of AttachmentEnabled objects (only TreeTestResult implements it so far).
-
- You could use directly Spring Resource URL, e.g.:
-
-+-------------------------------+
-<property name="resource" value="osgibundle:/conf/main.xml" />
-+-------------------------------+
-
- You can also upload and attach many attachments in one shot. In that case provide a Map with the keys being Attachment objects and the values Resource objects. E.g.:
-
-+-------------------------------+
-<bean parent="task.uploadAttachments">
- <property name="attachmentUploader" ref="attachmentUploader" />
- <property name="attachments">
- <map>
- <entry>
- <key>
- <bean parent="taskArg.attachment">
- <property name="name" value="Reached.csv" />
- </bean>
- </key>
- <bean factory-bean="fileDiff.testData" factory-method="getReached"
- scope="execution">
- <aop:scoped-proxy />
- </bean>
- </entry>
- <entry>
- <key>
- <bean parent="taskArg.attachment">
- <property name="name" value="Expected.csv" />
- </bean>
- </key>
- <bean factory-bean="fileDiff.testData" factory-method="getExpected"
- scope="execution">
- <aop:scoped-proxy />
- </bean>
- </entry>
- </map>
- </property>
- <property name="attachTo">
- <list>
- <ref bean="fileDiff.testResult" />
- </list>
- </property>
-</bean>
-+-------------------------------+
-
- Retrieving the resources from this bean:
-
-+-------------------------------+
-<bean id="fileDiff.testData" parent="testData.reachedExpected"
- scope="execution">
- <aop:scoped-proxy />
- <property name="expected" value="osgibundle:/inputs/csvdiff/@{fileName}.csv" />
- <property name="reached"
- value="osgibundle:/inputs/csvdiff/@{fileName}_mod.csv" />
-</bean>
-+-------------------------------+
-
- [[1]] You can access the attachments from the Web UI by selecting a result in the list in the results perspective.
- You will see that a new button 'Attachment' in the toolbar get activated (if there are any attachments).
+++ /dev/null
-Management of writable files within tests
-
- This provides an abstraction for files generated by the test.
-
- The files are stored in the standard osgi instance area (argument -data <my data area> to an OSGi launch, default is a ./data directory in the execution directory) under a ${osgi.instance.area}/executionResources directory.
-
- A subdirectory is created for each execution, thus avoiding that the files override each other.
-
- The format of this directory is yyyyMMdd_HHmmss_<execution context uuid>
-
- In order to use it:
-
- [[1]] First declare a ResourcesManager in your application context. It has to reference the SLC Execution Context (always available):
-
-+-------------------------------+
-<bean id="basic.resourcesManager" parent="slcTemplate.fileResources">
- <property name="executionContext" ref="executionContext" />
-</bean>
-+-------------------------------+
-
- [[1]] Then you can retrieve Spring Resources via a call to this manager. For example (it could also be an inner bean):
-
-+-------------------------------+
-<bean id="basic.writeTo" factory-bean="basic.resourcesManager"
- factory-method="getWritableResource" scope="execution">
- <constructor-arg value="subdir/writeTo" />
- <aop:scoped-proxy />
-</bean>
-+-------------------------------+
-
- The "constructor argument" (just a Spring notation in this case) is a relative path that you want to give to this file.
- Within a given execution, repeated calls on the manager with the same relative path will always point to the same file.
-
- [[1]] Then simply use this standard Spring Resource where required:
-
-+-------------------------------+
-<bean parent="task.echo">
- <property name="message" value="DATA" />
- <property name="writeTo" ref="basic.writeTo" />
-</bean>
-+-------------------------------+
-
- Underlying calls to the getFile() method of this resource won't fail (since they are writable).
-
-Factory bean for execution resources
-
- Here is an enhancement to declare execution resources:
-
-+-------------------------------+
-<bean id="executionResources.placeholderPass" parent="slcTemplate.simpleFlow">
- <constructor-arg ref="executionResources.spec" />
- <property name="executables">
- <list>
- <bean parent="task.echo">
- <property name="message" value="DATA" />
- <property name="writeTo">
- <bean parent="slcTemplate.resourcesFactoryBean" scope="execution">
- <property name="executionResources" ref="executionResources" />
- <property name="relativePath" value="subdir/@{var}" />
- <aop:scoped-proxy />
- </bean>
- </property>
- </bean>
- </list>
- </property>
-</bean>
-+-------------------------------+
-
- This allows to pass @{} execution parameters.
-
- The other form WON'T WORK if you try to passe @{} in the constructor-arg tag (but still works if the relative path does not contain a @{}):
-
-+-------------------------------+
-<bean id="executionResources.placeholderFail" parent="slcTemplate.simpleFlow">
- <constructor-arg ref="executionResources.spec" />
- <property name="executables">
- <list>
- <bean parent="task.echo">
- <property name="message" value="DATA" />
- <property name="writeTo">
- <bean factory-bean="executionResources" factory-method="getWritableResource"
- scope="execution">
- <constructor-arg value="subdir/@{var}" />
- <aop:scoped-proxy />
- </bean>
- </property>
- </bean>
- </list>
- </property>
-</bean>
-+-------------------------------+
-
+++ /dev/null
-New naming for Argeo Maven Plugins
-
- Update your maven plugin shortcut in ~/.m2/settings.xml
-
-+-------------------------------+
-<settings xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
- http://maven.apache.org/xsd/settings-1.0.0.xsd">
- <pluginGroups>
- <pluginGroup>org.argeo.maven.plugins</pluginGroup>
- </pluginGroups>
-
-</settings>
-+-------------------------------+
-
-Execution Modules Setup
-
- The following modules needs to be renamed in the Required-Bundle header of the MANIFEST.MF :
-*-----------------------------------+-------------------------------+
-|0.11.3 |0.11.4 |
-*-----------------------------------+-------------------------------+
-|org.argeo.slc.support.simple |org.argeo.slc.core |
-*-----------------------------------+-------------------------------+
-|org.argeoslc.support.equinox |org.argeo.slc.support.osgi |
-*-----------------------------------+-------------------------------+
+++ /dev/null
-Systems Life Cycle (SLC)
-
- SLC provides systems management and QA tools.
+++ /dev/null
-<faqs id="slcFaq">
- <part id="general">
- <title>General</title>
-
- <faq id="slcName">
- <question>What is SLC for?</question>
- <answer>
- <p>
- It provides QA tools.
- </p>
- </answer>
- </faq>
- </part>
-
- <part id="techBasic">
- <title>Technical</title>
- <faq id="startDemo">
- <question>How do I start the demo?</question>
- <answer>
- <p>
- From the demo directory (
- <code>cd demo</code>
- ) of the source distribution (or workingcopy) run:
- <br />
- <code>mvn argeo-osgi:equinox -Pserver</code>
- <br />
- then, in another console, also in the demo directory:
- <br />
- <code>mvn argeo-osgi:equinox -Pagent</code>
- <br />
- Then open
- <a href="http://localhost:7070/org.argeo.slc.ria">http://localhost:7070/org.argeo.slc.ria
- </a>
- </p>
- </answer>
- </faq>
- </part>
-</faqs>
\ No newline at end of file
+++ /dev/null
-<!--
-
- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
-
- Licensed 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.
-
--->
-
-<project xmlns="http://maven.apache.org/DECORATION/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
- <version />
- <publishDate format="yyyy-MM-dd HH:mm" />
- <body>
- <menu name="Overview">
- <item name="Home" href="${project.url}/index.html" />
- <!--<item name="Getting Started" href="${project.url}/gettingStarted.html" />-->
- <!--<item name="FAQ" href="${project.url}/faq.html" />-->
- <item name="API (Javadoc)" href="${project.url}/apidocs/index.html" />
- <item name="Browse Code" href="${project.url}/xref/index.html" />
- <item name="FIXMEs / TODOs" href="${project.url}/taglist.html" />
- </menu>
- <!--
- <menu name="How-To">
- <item name="Execution Resources"
- href="${project.url}/howtos/howto-executionResources.html" />
- <item name="Attachments" href="${project.url}/howtos/howto-attachments.html" />
- </menu>
- -->
- <menu ref="reports" />
- </body>
- <skin>
- <groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-default-skin</artifactId>
- <version>1.0</version>
- </skin>
-</project>
--- /dev/null
+Development Environment
+
+ First, you need to create a development environment.
\ No newline at end of file
--- /dev/null
+Upload of attachments to a test result
+
+ This allows to attach ANY Spring resource (for example the one created above but not only, since it can also be classpath: or osgibundle: Resources or ANY file on the file system where the agent is running (e.g. Mx *.mxres files on a server...))
+
+ In order to use it:
+
+ [[1]] First reference an attachment uploader service via OSGi (it is provided by the standard agent):
+
++-------------------------------+
+<reference id="attachmentUploader" interface="org.argeo.slc.core.attachment.AttachmentUploader" />
++-------------------------------+
+
+ [[1]] Then use an UploadAttachment task:
+
++-------------------------------+
+<bean parent="task.uploadAttachments">
+ <property name="attachmentUploader" ref="attachmentUploader" />
+ <property name="attachment">
+ <bean parent="taskArg.attachment">
+ <property name="name" value="myAttachment.txt" />
+ </bean>
+ </property>
+ <property name="resource" ref="basic.writeTo" />
+ <property name="attachTo">
+ <list>
+ <ref bean="basic.testResult" />
+ </list>
+ </property>
+</bean>
++-------------------------------+
+
+ You have to specify an Attachment object with at least a 'name', you can also specify a 'contentType', but the server will recognize common extension of the name.
+ You have to specify a (Spring) Resource, for example the one that you created before (the name of the attachment doesn't have to be the name of the file).
+ Just doing this will already upload a file to the server, but if you want to access it you need to bind it to some object, typically a TreeTestResult. You can provide a list of AttachmentEnabled objects (only TreeTestResult implements it so far).
+
+ You could use directly Spring Resource URL, e.g.:
+
++-------------------------------+
+<property name="resource" value="osgibundle:/conf/main.xml" />
++-------------------------------+
+
+ You can also upload and attach many attachments in one shot. In that case provide a Map with the keys being Attachment objects and the values Resource objects. E.g.:
+
++-------------------------------+
+<bean parent="task.uploadAttachments">
+ <property name="attachmentUploader" ref="attachmentUploader" />
+ <property name="attachments">
+ <map>
+ <entry>
+ <key>
+ <bean parent="taskArg.attachment">
+ <property name="name" value="Reached.csv" />
+ </bean>
+ </key>
+ <bean factory-bean="fileDiff.testData" factory-method="getReached"
+ scope="execution">
+ <aop:scoped-proxy />
+ </bean>
+ </entry>
+ <entry>
+ <key>
+ <bean parent="taskArg.attachment">
+ <property name="name" value="Expected.csv" />
+ </bean>
+ </key>
+ <bean factory-bean="fileDiff.testData" factory-method="getExpected"
+ scope="execution">
+ <aop:scoped-proxy />
+ </bean>
+ </entry>
+ </map>
+ </property>
+ <property name="attachTo">
+ <list>
+ <ref bean="fileDiff.testResult" />
+ </list>
+ </property>
+</bean>
++-------------------------------+
+
+ Retrieving the resources from this bean:
+
++-------------------------------+
+<bean id="fileDiff.testData" parent="testData.reachedExpected"
+ scope="execution">
+ <aop:scoped-proxy />
+ <property name="expected" value="osgibundle:/inputs/csvdiff/@{fileName}.csv" />
+ <property name="reached"
+ value="osgibundle:/inputs/csvdiff/@{fileName}_mod.csv" />
+</bean>
++-------------------------------+
+
+ [[1]] You can access the attachments from the Web UI by selecting a result in the list in the results perspective.
+ You will see that a new button 'Attachment' in the toolbar get activated (if there are any attachments).
--- /dev/null
+Management of writable files within tests
+
+ This provides an abstraction for files generated by the test.
+
+ The files are stored in the standard osgi instance area (argument -data <my data area> to an OSGi launch, default is a ./data directory in the execution directory) under a ${osgi.instance.area}/executionResources directory.
+
+ A subdirectory is created for each execution, thus avoiding that the files override each other.
+
+ The format of this directory is yyyyMMdd_HHmmss_<execution context uuid>
+
+ In order to use it:
+
+ [[1]] First declare a ResourcesManager in your application context. It has to reference the SLC Execution Context (always available):
+
++-------------------------------+
+<bean id="basic.resourcesManager" parent="slcTemplate.fileResources">
+ <property name="executionContext" ref="executionContext" />
+</bean>
++-------------------------------+
+
+ [[1]] Then you can retrieve Spring Resources via a call to this manager. For example (it could also be an inner bean):
+
++-------------------------------+
+<bean id="basic.writeTo" factory-bean="basic.resourcesManager"
+ factory-method="getWritableResource" scope="execution">
+ <constructor-arg value="subdir/writeTo" />
+ <aop:scoped-proxy />
+</bean>
++-------------------------------+
+
+ The "constructor argument" (just a Spring notation in this case) is a relative path that you want to give to this file.
+ Within a given execution, repeated calls on the manager with the same relative path will always point to the same file.
+
+ [[1]] Then simply use this standard Spring Resource where required:
+
++-------------------------------+
+<bean parent="task.echo">
+ <property name="message" value="DATA" />
+ <property name="writeTo" ref="basic.writeTo" />
+</bean>
++-------------------------------+
+
+ Underlying calls to the getFile() method of this resource won't fail (since they are writable).
+
+Factory bean for execution resources
+
+ Here is an enhancement to declare execution resources:
+
++-------------------------------+
+<bean id="executionResources.placeholderPass" parent="slcTemplate.simpleFlow">
+ <constructor-arg ref="executionResources.spec" />
+ <property name="executables">
+ <list>
+ <bean parent="task.echo">
+ <property name="message" value="DATA" />
+ <property name="writeTo">
+ <bean parent="slcTemplate.resourcesFactoryBean" scope="execution">
+ <property name="executionResources" ref="executionResources" />
+ <property name="relativePath" value="subdir/@{var}" />
+ <aop:scoped-proxy />
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+</bean>
++-------------------------------+
+
+ This allows to pass @{} execution parameters.
+
+ The other form WON'T WORK if you try to passe @{} in the constructor-arg tag (but still works if the relative path does not contain a @{}):
+
++-------------------------------+
+<bean id="executionResources.placeholderFail" parent="slcTemplate.simpleFlow">
+ <constructor-arg ref="executionResources.spec" />
+ <property name="executables">
+ <list>
+ <bean parent="task.echo">
+ <property name="message" value="DATA" />
+ <property name="writeTo">
+ <bean factory-bean="executionResources" factory-method="getWritableResource"
+ scope="execution">
+ <constructor-arg value="subdir/@{var}" />
+ <aop:scoped-proxy />
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+</bean>
++-------------------------------+
+
--- /dev/null
+New naming for Argeo Maven Plugins
+
+ Update your maven plugin shortcut in ~/.m2/settings.xml
+
++-------------------------------+
+<settings xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <pluginGroups>
+ <pluginGroup>org.argeo.maven.plugins</pluginGroup>
+ </pluginGroups>
+
+</settings>
++-------------------------------+
+
+Execution Modules Setup
+
+ The following modules needs to be renamed in the Required-Bundle header of the MANIFEST.MF :
+*-----------------------------------+-------------------------------+
+|0.11.3 |0.11.4 |
+*-----------------------------------+-------------------------------+
+|org.argeo.slc.support.simple |org.argeo.slc.core |
+*-----------------------------------+-------------------------------+
+|org.argeoslc.support.equinox |org.argeo.slc.support.osgi |
+*-----------------------------------+-------------------------------+
--- /dev/null
+Systems Life Cycle (SLC)
+
+ SLC provides systems management and QA tools.
--- /dev/null
+<faqs id="slcFaq">
+ <part id="general">
+ <title>General</title>
+
+ <faq id="slcName">
+ <question>What is SLC for?</question>
+ <answer>
+ <p>
+ It provides QA tools.
+ </p>
+ </answer>
+ </faq>
+ </part>
+
+ <part id="techBasic">
+ <title>Technical</title>
+ <faq id="startDemo">
+ <question>How do I start the demo?</question>
+ <answer>
+ <p>
+ From the demo directory (
+ <code>cd demo</code>
+ ) of the source distribution (or workingcopy) run:
+ <br />
+ <code>mvn argeo-osgi:equinox -Pserver</code>
+ <br />
+ then, in another console, also in the demo directory:
+ <br />
+ <code>mvn argeo-osgi:equinox -Pagent</code>
+ <br />
+ Then open
+ <a href="http://localhost:7070/org.argeo.slc.ria">http://localhost:7070/org.argeo.slc.ria
+ </a>
+ </p>
+ </answer>
+ </faq>
+ </part>
+</faqs>
\ No newline at end of file
--- /dev/null
+<!--
+
+ Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+
+ Licensed 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.
+
+-->
+
+<project xmlns="http://maven.apache.org/DECORATION/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+ <version />
+ <publishDate format="yyyy-MM-dd HH:mm" />
+ <body>
+ <menu name="Overview">
+ <item name="Home" href="${project.url}/index.html" />
+ <!--<item name="Getting Started" href="${project.url}/gettingStarted.html" />-->
+ <!--<item name="FAQ" href="${project.url}/faq.html" />-->
+ <item name="API (Javadoc)" href="${project.url}/apidocs/index.html" />
+ <item name="Browse Code" href="${project.url}/xref/index.html" />
+ <item name="FIXMEs / TODOs" href="${project.url}/taglist.html" />
+ </menu>
+ <!--
+ <menu name="How-To">
+ <item name="Execution Resources"
+ href="${project.url}/howtos/howto-executionResources.html" />
+ <item name="Attachments" href="${project.url}/howtos/howto-attachments.html" />
+ </menu>
+ -->
+ <menu ref="reports" />
+ </body>
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-default-skin</artifactId>
+ <version>1.0</version>
+ </skin>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xmlns:util="http://www.springframework.org/schema/util"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ http://www.springframework.org/schema/beans \r
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+ http://www.springframework.org/schema/util\r
+ http://www.springframework.org/schema/util/spring-util-2.5.xsd">\r
+\r
+ <!-- REFERENCES -->\r
+ <reference id="authenticationManager"\r
+ interface="org.springframework.security.AuthenticationManager" />\r
+\r
+ <reference id="modulesManager"\r
+ interface="org.argeo.slc.execution.ExecutionModulesManager" />\r
+\r
+ <!-- SERVICES -->\r
+ <service ref="agent" interface="org.argeo.slc.execution.SlcAgent" />\r
+ <service ref="agentCli" interface="org.argeo.slc.execution.SlcAgentCli" />\r
+\r
+ <service ref="fileSystemManager" interface="org.apache.commons.vfs.FileSystemManager" />\r
+</beans:beans>
\ No newline at end of file
--- /dev/null
+<?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"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <bean id="agent" class="org.argeo.slc.core.execution.DefaultAgent"\r
+ init-method="init" destroy-method="destroy">\r
+ <property name="modulesManager" ref="modulesManager" />\r
+ </bean>\r
+\r
+ <bean id="agentCli" class="org.argeo.slc.core.execution.DefaultAgentCli">\r
+ <property name="agent" ref="agent" />\r
+ <property name="authenticationManager" ref="authenticationManager" />\r
+ </bean>\r
+\r
+ <bean\r
+ class="org.argeo.security.core.AuthenticatedApplicationContextInitialization">\r
+ <property name="authenticationManager" ref="authenticationManager" />\r
+ </bean>\r
+\r
+ <bean name="fileSystemManager" class="org.apache.commons.vfs.impl.StandardFileSystemManager"\r
+ init-method="init" destroy-method="close" />\r
+</beans>
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>modules</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.agent.cli</artifactId>
+ <name>SLC Agent CLI</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Import-Package>
+ *,
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>modules</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.ext.castor</artifactId>
+ <name>SLC Castor Extension</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Fragment-Host>org.castor</Fragment-Host>
+ <Import-Package>
+ org.argeo.slc.detached;resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.server.repo.webapp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+ <import resource="osgi.xml" />
+ <import resource="security.xml" />
+
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
+ ">
+
+ <bean
+ class="org.springframework.web.servlet.handler.SimpleServletPostProcessor" />
+
+ <bean id="servletHandler"
+ class="org.springframework.web.servlet.handler.SimpleServletHandlerAdapter" />
+
+ <bean id="handlerMapping"
+ class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+ <property name="mappings">
+ <props>
+ <prop key="*">mavenProxyServlet</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="mavenProxyServlet" class="org.argeo.jcr.mvc.ResourceProxyServlet">
+ <property name="proxy" ref="mavenProxy" />
+ </bean>
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xmlns:security="http://www.springframework.org/schema/security"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ http://www.springframework.org/schema/beans \r
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">\r
+\r
+ <!-- REFERENCES -->\r
+ <!-- Security -->\r
+ <reference id="authenticationManager"\r
+ interface="org.springframework.security.AuthenticationManager" />\r
+\r
+ <!-- JCR -->\r
+ <reference id="jcrRepository" interface="javax.jcr.Repository"\r
+ filter="(argeo.jcr.repository.alias=java)" />\r
+\r
+ <!-- Maven -->\r
+ <reference id="mavenProxy" interface="org.argeo.slc.repo.MavenProxyService" />\r
+ <reference id="rpmProxy" interface="org.argeo.slc.rpmfactory.RpmProxyService" />\r
+\r
+</beans:beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
+ ">
+
+ <bean
+ class="org.springframework.web.servlet.handler.SimpleServletPostProcessor" />
+
+ <bean id="servletHandler"
+ class="org.springframework.web.servlet.handler.SimpleServletHandlerAdapter" />
+
+ <bean id="handlerMapping"
+ class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+ <property name="mappings">
+ <props>
+ <prop key="*">rpmProxyServlet</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="rpmProxyServlet" class="org.argeo.jcr.mvc.ResourceProxyServlet">
+ <property name="proxy" ref="rpmProxy" />
+ </bean>
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:sec="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
+
+ <bean id="springSecurityFilterChain" class="org.springframework.security.util.FilterChainProxy">
+ <sec:filter-chain-map path-type="ant">
+ <sec:filter-chain pattern="/**"
+ filters="httpSessionContextIntegrationFilter,logoutFilter,basicProcessingFilter,anonymousProcessingFilter,securityContextHolderAwareRequestFilter,exceptionTranslationFilter,filterInvocationInterceptor" />
+ </sec:filter-chain-map>
+ </bean>
+
+ <!-- The actual authorization checks (called last, but first here for ease
+ of configuration) -->
+ <bean id="filterInvocationInterceptor" parent="filterInvocationInterceptorTemplate">
+ <property name="objectDefinitionSource">
+ <value>
+ CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
+ PATTERN_TYPE_APACHE_ANT
+ /private/**=ROLE_USER
+ /**=IS_AUTHENTICATED_ANONYMOUSLY
+ </value>
+ </property>
+ </bean>
+
+ <!-- Integrates the authentication information in the http sessions -->
+ <bean id="httpSessionContextIntegrationFilter"
+ class="org.springframework.security.context.HttpSessionContextIntegrationFilter">
+ <property name="allowSessionCreation" value="true" />
+ </bean>
+
+ <!-- Processes logouts, removing both session informations and the remember-me
+ cookie from the browser -->
+ <bean id="logoutFilter" class="org.springframework.security.ui.logout.LogoutFilter">
+ <constructor-arg value="/web/" />
+ <!-- URL redirected to after logout -->
+ <constructor-arg>
+ <list>
+ <bean
+ class="org.springframework.security.ui.logout.SecurityContextLogoutHandler" />
+ </list>
+ </constructor-arg>
+ </bean>
+
+ <!-- Double check, this may not be necessary -->
+ <bean id="securityContextHolderAwareRequestFilter"
+ class="org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter" />
+
+ <!-- Basic authentication -->
+ <bean id="basicProcessingFilter"
+ class="org.springframework.security.ui.basicauth.BasicProcessingFilter">
+ <property name="authenticationManager">
+ <ref bean="authenticationManager" />
+ </property>
+ <property name="authenticationEntryPoint">
+ <ref local="basicProcessingFilterEntryPoint" />
+ </property>
+ </bean>
+
+ <!-- Activate basic auth when needed -->
+ <bean id="basicProcessingFilterEntryPoint"
+ class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">
+ <property name="realmName">
+ <value>Argeo Repository</value>
+ </property>
+ </bean>
+
+ <!-- If everything else failed, anonymous authentication -->
+ <bean id="anonymousProcessingFilter"
+ class="org.springframework.security.providers.anonymous.AnonymousProcessingFilter">
+ <property name="key" value="${argeo.security.systemKey}" />
+ <property name="userAttribute" value="anonymous,ROLE_ANONYMOUS" />
+ </bean>
+
+ <!-- Reacts to security related exceptions -->
+ <bean id="exceptionTranslationFilter"
+ class="org.springframework.security.ui.ExceptionTranslationFilter">
+ <property name="authenticationEntryPoint">
+ <ref bean="basicProcessingFilterEntryPoint" />
+ </property>
+ <property name="accessDeniedHandler">
+ <bean class="org.springframework.security.ui.AccessDeniedHandlerImpl">
+ <property name="errorPage" value="/accessDenied.jsp" />
+ </bean>
+ </property>
+ </bean>
+
+ <!-- Template for authorization checks -->
+ <bean id="filterInvocationInterceptorTemplate" abstract="true"
+ class="org.springframework.security.intercept.web.FilterSecurityInterceptor">
+ <property name="authenticationManager" ref="authenticationManager" />
+ <property name="accessDecisionManager">
+ <bean class="org.springframework.security.vote.AffirmativeBased">
+ <property name="allowIfAllAbstainDecisions" value="false" />
+ <property name="decisionVoters">
+ <list>
+ <bean class="org.springframework.security.vote.RoleVoter" />
+ <bean class="org.springframework.security.vote.AuthenticatedVoter" />
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <display-name>Argeo SLC Repo Webapp</display-name>
+
+ <!-- General -->
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>/WEB-INF/applicationContext.xml</param-value>
+ </context-param>
+
+ <listener>
+ <display-name>Spring Context</display-name>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+ <context-param>
+ <param-name>contextClass</param-name>
+ <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
+ </context-param>
+
+ <!-- RPM -->
+ <servlet>
+ <servlet-name>rpm</servlet-name>
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+ <init-param>
+ <param-name>contextClass</param-name>
+ <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>rpm</servlet-name>
+ <url-pattern>/rpm/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- Maven -->
+ <!-- <servlet> -->
+ <!-- <servlet-name>maven</servlet-name> -->
+ <!-- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> -->
+ <!-- <init-param> -->
+ <!-- <param-name>contextClass</param-name> -->
+ <!-- <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value> -->
+ <!-- </init-param> -->
+ <!-- <load-on-startup>1</load-on-startup> -->
+ <!-- </servlet> -->
+ <!-- <servlet-mapping> -->
+ <!-- <servlet-name>maven</servlet-name> -->
+ <!-- <url-pattern>/maven/*</url-pattern> -->
+ <!-- </servlet-mapping> -->
+
+ <!-- Security -->
+ <filter>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+</web-app>
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>SLC Repository</title>
+<link href="style.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<h1>SLC Repository</h1>
+<p>This is a repository of OSGi bundles, which is compatible with Maven conventions.
+</p>
+<p>The first level refers to <b>products</b>, the second one to <b>version branches</b> of these products.
+</p>
+<p>When clicking on a version branch, an editors opens which allows to efficiently browse the available bundles.
+</p>
+
+<h2>Usage with maven repository compatible tools</h2>
+<p>There is one maven-style repository per branch.
+</p>
+<p>It is accessible anonymously at the following URL (if public access has been explicitly given to this branch):<br>
+<pre>http://[host]/data/public/java/[org.example.product]-[major.minor.x]</pre>
+</p>
+<p>Or as an authenticated user (BASIC auth) belonging to <i>ROLE_SLC</i>, with read/write WebDav access:<br/>
+<pre>https://[host]/data/files/java/[org.example.product]-[major.minor.x]</pre>
+</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>modules</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.server.repo.webapp</artifactId>
+ <name>SLC Repo Web App</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Web-ContextPath>repo</Web-ContextPath>
+ <!-- TODO optimize -->
+ <Import-Package>
+ *,
+ javax.jcr,
+ javax.servlet,
+ javax.servlet.http,
+ javax.servlet.resources,
+ org.argeo.jcr.mvc,
+ org.argeo.security.core,
+ org.argeo.security.jcr,
+ org.argeo.slc.aether.spring,
+ org.argeo.slc.repo,
+ org.argeo.slc.rpmfactory,
+ org.springframework.osgi.web.context.support,
+ org.springframework.security,
+ org.springframework.security.context,
+ org.springframework.security.intercept.web,
+ org.springframework.security.providers.anonymous,
+ org.springframework.security.ui,
+ org.springframework.security.ui.basicauth,
+ org.springframework.security.ui.logout,
+ org.springframework.security.util,
+ org.springframework.security.vote,
+ org.springframework.security.wrapper,
+ org.springframework.web.context,
+ org.springframework.web.filter,
+ org.springframework.web.servlet,
+ org.springframework.web.servlet.handler
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
--- /dev/null
+/* Generic Selectors */\r
+body {\r
+ font-family: sans-serif;\r
+ font-size: 12px;\r
+ color: black;\r
+ background-color: white;\r
+}\r
+\r
+li {\r
+ list-style-type: none;\r
+}\r
+\r
+h1 {\r
+ font-family: sans-serif;\r
+ font-size: 16px;\r
+ font-weight: bold;\r
+ color: #000000;\r
+ padding: 0px 0px 5px 0px;\r
+ margin: 0px;\r
+}\r
+\r
+h2 {\r
+ font-family: sans-serif;\r
+ font-size: 14px;\r
+ font-weight: bold;\r
+ color: #000000;\r
+ padding: 5px 0px 5px 0px;\r
+ margin: 0px;\r
+ margin-top: 5px;\r
+}\r
+\r
+table,form {\r
+ margin: 0px;\r
+}\r
+\r
+img {\r
+ border: none;\r
+}\r
+\r
+div {\r
+ font-size: 100%;\r
+}\r
+\r
+tr.list:hover {\r
+ background-color: lightgrey;\r
+}\r
+\r
+td.list {\r
+ border-top: 1px solid lighgrey;\r
+ padding: 2px 20px 2px 2px;\r
+ padding-right: 15px;\r
+}\r
+\r
+th {\r
+ font-size: 12px;\r
+ padding: 2px 20px 2px 2px;\r
+ vertical-align: top;\r
+ text-align: left;\r
+}\r
+\r
+td {\r
+ font-size: 12px;\r
+ padding: 1px;\r
+ vertical-align: middle;\r
+ text-align: left;\r
+}\r
+\r
+/**************** Navigation ****************/\r
+td.nav1 {\r
+ padding: 5px 0px 0px 0px;\r
+ font-size: 12px;\r
+ font-weight: bold;\r
+}\r
+\r
+td.nav2 {\r
+ padding: 0px 0px 0px 5px;\r
+ font-size: 12px;\r
+}\r
+\r
+/**************** Forms ****************/\r
+input.submit {\r
+ border: solid 1px grey;\r
+ background-color: lightgrey;\r
+ align: right;\r
+}\r
+\r
+input.submit:hover {\r
+ border: solid 1px #3399FF;\r
+ background-color: white;\r
+ color: #3399FF;\r
+}\r
+\r
+input.std {\r
+ border: solid 1px lightgrey;\r
+ padding: 1px;\r
+ margin: 2px;\r
+}\r
+\r
+.formError {\r
+ color: red;\r
+ padding: 1px;\r
+ margin: 2px;\r
+ font-weight: bold;\r
+}\r
+\r
+/**************** Pseudo classes ****************/\r
+a:link {\r
+ color: #0066CC;\r
+ text-decoration: none;\r
+}\r
+\r
+a:visited {\r
+ color: #0066CC;\r
+ text-decoration: none;\r
+}\r
+\r
+a:hover {\r
+ color: #3399FF;\r
+ text-decoration: none;\r
+}\r
+\r
+/************************* ID's *************************/\r
+#main {\r
+ position: absolute;\r
+ margin-left: 180px;\r
+ padding-top: 65px;\r
+}\r
+\r
+#navigation {\r
+ position: absolute;\r
+ width: 150px;\r
+ height: 800px;\r
+ border-right: 1px solid #0066CC;\r
+ font-weight: normal;\r
+ margin-top: 60px;\r
+ margin-left: 10px;\r
+}\r
+\r
+#banner {\r
+ position: absolute;\r
+ width: 400px;\r
+ height: 50px;\r
+}\r
+\r
+#upperRight {\r
+ position: absolute;\r
+ top: 0;\r
+ right: 0;\r
+ margin-top: 20px;\r
+ margin-right: 10px;\r
+}
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>argeo-slc</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>modules</artifactId>
+ <name>SLC Modules</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.argeo.slc.ext.castor</module>
+ <module>org.argeo.slc.agent</module>
+ <module>org.argeo.slc.agent.jcr</module>
+ <module>org.argeo.slc.agent.cli</module>
+ <module>org.argeo.slc.node.jackrabbit</module>
+ <module>org.argeo.slc.server.repo</module>
+ <module>org.argeo.slc.server.repo.webapp</module>
+ </modules>
+ <build>
+ <resources>
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>.*</exclude>
+ <exclude>.*/**</exclude>
+ <exclude>pom.xml</exclude>
+ <exclude>build.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.client.rcp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Wed Aug 04 16:32:22 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <!-- RCP Specific open JCR file command -->
+ <bean id="org.argeo.slc.client.rcp.openJcrFile" class="org.argeo.slc.client.ui.specific.OpenJcrFile"
+ scope="prototype">
+ <property name="repoService" ref="repoService" />
+ </bean>
+
+ <bean id="repoService" class="org.argeo.slc.repo.core.RepoServiceImpl">
+ <property name="repositoryFactory" ref="repositoryFactory" />
+ <property name="keyring" ref="keyring" />
+ <property name="nodeRepository" ref="nodeRepository" />
+ </bean>
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xmlns:osgi="http://www.springframework.org/schema/osgi"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ http://www.springframework.org/schema/beans \r
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
+ osgi:default-timeout="30000">\r
+\r
+ <beans:description>SLC UI RCP</beans:description>\r
+\r
+ <reference id="nodeRepository" interface="javax.jcr.Repository"\r
+ filter="(argeo.jcr.repository.alias=node)" />\r
+ <reference id="repositoryFactory" interface="javax.jcr.RepositoryFactory" />\r
+ <reference id="keyring" interface="org.argeo.security.crypto.CryptoKeyring" />\r
+\r
+</beans:beans>
\ No newline at end of file
--- /dev/null
+source.. = src/main/java
+output.. = target/classes
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ splash.bmp,\
+ plugin_customization.ini
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ id="org.argeo.slc.client.rcp.product"
+ point="org.eclipse.core.runtime.products">
+ <product
+ application="org.argeo.slc.client.rcp.application"
+ name="SLC">
+ <property
+ name="windowImages"
+ value="icons/argeo-icon-256.png">
+ </property>
+ <property
+ name="appName"
+ value="SLC">
+ </property>
+ <property
+ name="preferenceCustomization"
+ value="plugin_customization.ini">
+ </property>
+ </product>
+ </extension>
+ <extension
+ id="org.argeo.slc.client.rcp.application"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="org.argeo.slc.client.rcp.SlcSecureClientApplication">
+ </run>
+ </application>
+ </extension>
+
+ <!-- COMMANDS -->
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.argeo.slc.client.rcp.openJcrFile"
+ defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+ name="Open Workspace Editor">
+ <commandParameter
+ id="param.repoNodePath"
+ name="Repo node path">
+ </commandParameter>
+ <commandParameter
+ id="param.repoUri"
+ name="Repo URI">
+ </commandParameter>
+ <commandParameter
+ id="param.workspaceName"
+ name="Workspace name">
+ </commandParameter>
+ <commandParameter
+ id="param.filePath"
+ name="File Path">
+ </commandParameter>
+ </command>
+ </extension>
+
+ <!-- RCP Specific, does not work with RAP -->
+ <extension
+ point="org.eclipse.ui.bindings">
+ <!-- <key
+ commandId="org.argeo.slc.client.ui.refreshExecutionModulesView"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="CTRL+R">
+ </key> -->
+ </extension>
+</plugin>
--- /dev/null
+org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
+org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
+org.eclipse.ui/PERSPECTIVE_BAR_SIZE=100
+org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=true
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>plugins</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.client.rcp</artifactId>
+ <name>SLC Client RCP</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-Activator>org.argeo.slc.client.rcp.SlcRcpPlugin</Bundle-Activator>
+ <Require-Bundle>
+ org.eclipse.ui,
+ org.eclipse.core.runtime
+ </Require-Bundle>
+ <Import-Package>
+ org.argeo.eclipse.spring,
+ org.argeo.slc.repo.core,
+ javax.jcr.nodetype,
+ *,
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <!-- SLC -->
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.repo</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Bundles to start -->
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.node.jackrabbit</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.agent</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.commons.security</groupId>
+ <artifactId>org.argeo.security.dao.jackrabbit</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.commons.server</groupId>
+ <artifactId>org.argeo.node.repo.jackrabbit</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+
+ <!-- Security UI -->
+ <dependency>
+ <groupId>org.argeo.commons.base</groupId>
+ <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.commons.security</groupId>
+ <artifactId>org.argeo.security.ui.rcp</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.client.rcp;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class SlcRcpPlugin extends AbstractUIPlugin {
+ public static final String PLUGIN_ID = "org.argeo.slc.client.rcp";
+ private static SlcRcpPlugin plugin;
+
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ public static SlcRcpPlugin getDefault() {
+ return plugin;
+ }
+
+ @Override
+ protected void initializeImageRegistry(ImageRegistry reg) {
+ // TODO make it configurable
+ reg.put("argeoTrayIcon",
+ getImageDescriptor("icons/argeo-trayIcon-256.png"));
+ }
+
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.client.rcp;
+
+import org.argeo.security.ui.rcp.SecureRcp;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.window.Window.IExceptionHandler;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+
+/**
+ * This class controls all aspects of the application's execution
+ */
+public class SlcSecureClientApplication extends SecureRcp {
+
+ @Override
+ protected WorkbenchAdvisor createWorkbenchAdvisor(String username) {
+ Window.setExceptionHandler(new IExceptionHandler() {
+
+ public void handleException(Throwable t) {
+ System.err.println("Unexpected SLC UI exception: " + t);
+
+ }
+ });
+
+ return new SlcSecureWorkbenchAdvisor(username);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.client.rcp;
+
+import org.argeo.security.ui.rcp.SecureWorkbenchAdvisor;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+/**
+ * Custom {@link SecureWorkbenchAdvisor} in order to create a
+ * {@link SlcSecureWorkbenchWindowAdvisor}.
+ */
+public class SlcSecureWorkbenchAdvisor extends SecureWorkbenchAdvisor {
+ public SlcSecureWorkbenchAdvisor(String username) {
+ super(username);
+ }
+
+ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
+ IWorkbenchWindowConfigurer configurer) {
+ return new SlcSecureWorkbenchWindowAdvisor(configurer, getUsername());
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.client.rcp;
+
+import org.argeo.security.ui.rcp.SecureWorkbenchWindowAdvisor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tray;
+import org.eclipse.swt.widgets.TrayItem;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.part.EditorInputTransfer;
+
+/**
+ * Custom {@link SecureWorkbenchWindowAdvisor} which can add a tray. TODO: to
+ * be factorized in Argeo Commons and made more generic.
+ */
+public class SlcSecureWorkbenchWindowAdvisor extends
+ SecureWorkbenchWindowAdvisor {
+ public final static String IN_TRAY_PROPERTY = "org.argeo.slc.ui.inTray";
+
+ private TrayItem trayItem;
+
+ public SlcSecureWorkbenchWindowAdvisor(
+ IWorkbenchWindowConfigurer configurer, String username) {
+ super(configurer, username);
+ }
+
+ public void postWindowOpen() {
+ String inTray = System.getProperty(IN_TRAY_PROPERTY);
+ if (inTray != null && inTray.equals("true")) {
+ initTray();
+ }
+ }
+
+ @Override
+ public void preWindowOpen() {
+ getWindowConfigurer().addEditorAreaTransfer(
+ EditorInputTransfer.getInstance());
+ getWindowConfigurer().configureEditorAreaDropListener(
+ new DropTargetAdapter() {
+
+ @Override
+ public void dragEnter(DropTargetEvent event) {
+ System.out.println("DROP enter!!! " + event);
+ }
+
+ @Override
+ public void dragLeave(DropTargetEvent event) {
+ System.out.println("DROP leave!!! " + event);
+ }
+
+ public void drop(DropTargetEvent event) {
+ System.out.println("DROP drop!!! " + event);
+
+ }
+
+ @Override
+ public void dropAccept(DropTargetEvent event) {
+ System.out.println("DROP accept!!! " + event);
+ super.dropAccept(event);
+ }
+
+ });
+ super.preWindowOpen();
+ }
+
+ @Override
+ public boolean preWindowShellClose() {
+ // hide but do not dispose if tray is supported
+ if (trayItem != null) {
+ getWindowConfigurer().getWindow().getShell().setVisible(false);
+ return false;
+ } else
+ return true;
+ }
+
+ /** Init tray support */
+ protected void initTray() {
+ IWorkbenchWindow window = getWindowConfigurer().getWindow();
+ Shell shell = window.getShell();
+ final Tray tray = shell.getDisplay().getSystemTray();
+ trayItem = new TrayItem(tray, SWT.NONE);
+ if (trayItem == null)
+ return;
+
+ // image
+ Image trayImage = SlcRcpPlugin.getDefault().getImageRegistry()
+ .get("argeoTrayIcon");
+ trayItem.setImage(trayImage);
+ trayItem.setToolTipText("Argeo SLC");
+
+ // add pop-menu
+ // TODO: contribute more commands
+ trayItem.addListener(SWT.MenuDetect, new Listener() {
+ public void handleEvent(Event event) {
+ IWorkbenchWindow window = getWindowConfigurer().getWindow();
+ Menu menu = new Menu(window.getShell(), SWT.POP_UP);
+ MenuItem exit = new MenuItem(menu, SWT.NONE);
+ exit.setText("Exit");
+ exit.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ getWindowConfigurer().getWorkbenchConfigurer()
+ .getWorkbench().close();
+ }
+ });
+ menu.setVisible(true);
+ }
+ });
+
+ // add behavior when clicked upon
+ trayItem.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ Shell shell = getWindowConfigurer().getWindow().getShell();
+ if (shell.isVisible()) {
+ if (shell.getMinimized())
+ shell.setMinimized(false);
+ else {
+ shell.setVisible(false);
+ shell.setMinimized(true);
+ }
+ } else {
+ shell.setVisible(true);
+ shell.setActive();
+ shell.setFocus();
+ shell.setMinimized(false);
+ }
+ }
+ });
+
+ // start hidden
+ // shell.setVisible(false);
+ }
+
+ @Override
+ public void dispose() {
+ if (trayItem != null)
+ trayItem.dispose();
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.client.ui.specific;
+
+import java.awt.Desktop;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.commons.io.IOUtils;
+import org.argeo.jcr.JcrUtils;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.repo.RepoService;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+
+/**
+ * RCP specific command handler to open a file retrieved from a local or distant
+ * JCR Repository.
+ */
+public class OpenJcrFile extends AbstractHandler {
+ // private final static Log log = LogFactory.getLog(OpenJcrFile.class);
+
+ // Here is the trick that enable single sourcing: the ID is determined at
+ // runtime so use (new OpenJcrFileCmdId()).getCmdId() instead of the usual
+ // public final String ID = SlcRcpPlugin.PLUGIN_ID + ".openJcrFile";
+
+ public final static String PARAM_REPO_NODE_PATH = "param.repoNodePath";
+ public final static String PARAM_REPO_URI = "param.repoUri";
+ public final static String PARAM_WORKSPACE_NAME = "param.workspaceName";
+ public final static String PARAM_FILE_PATH = "param.filePath";
+
+ /* DEPENDENCY INJECTION */
+ private RepoService repoService;
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ String repoNodePath = event.getParameter(PARAM_REPO_NODE_PATH);
+ String repoUri = event.getParameter(PARAM_REPO_URI);
+ String wkspName = event.getParameter(PARAM_WORKSPACE_NAME);
+ String filePath = event.getParameter(PARAM_FILE_PATH);
+
+ // TODO sanity check
+ if (filePath == null || "".equals(filePath.trim()))
+ return null;
+ retrieveAndOpen(repoNodePath, repoUri, wkspName, filePath);
+
+ return null;
+ }
+
+ protected void retrieveAndOpen(String repoNodePath, String repoUri,
+ String wkspName, String filePath) {
+ Session businessSession = null;
+ try {
+ businessSession = repoService.getRemoteSession(repoNodePath,
+ repoUri, wkspName);
+ Node result = businessSession.getNode(filePath);
+
+ boolean isValid = true;
+ Node child = null;
+ if (!result.isNodeType(NodeType.NT_FILE))
+ isValid = false;
+ else {
+ child = result.getNode(Property.JCR_CONTENT);
+ if (!(child.isNodeType(NodeType.NT_RESOURCE) || child
+ .hasProperty(Property.JCR_DATA)))
+ isValid = false;
+ }
+
+ if (!isValid)
+ return;
+
+ InputStream fis = null;
+ String prefix = "", extension = "";
+ String fileName = JcrUtils.lastPathElement(filePath);
+ int ind = fileName.lastIndexOf('.');
+ if (ind > 0) {
+ prefix = fileName.substring(0, ind);
+ extension = fileName.substring(ind);
+ }
+ try {
+
+ fis = (InputStream) child.getProperty(Property.JCR_DATA)
+ .getBinary().getStream();
+ File file = createTmpFile(prefix, extension, fis);
+ Desktop desktop = null;
+ if (Desktop.isDesktopSupported()) {
+ desktop = Desktop.getDesktop();
+ }
+ desktop.open(file);
+ } catch (Exception e) {
+ throw new SlcException(
+ "Stream error while opening file " + filePath
+ + " from repo " + repoUri == null ? repoNodePath
+ : repoUri, e);
+ } finally {
+ IOUtils.closeQuietly(fis);
+ }
+ } catch (RepositoryException e) {
+ throw new SlcException("Unexpected error while "
+ + "getting repoNode info for repoNode at path "
+ + repoNodePath, e);
+ } finally {
+ JcrUtils.logoutQuietly(businessSession);
+ }
+ }
+
+ private File createTmpFile(String prefix, String suffix, InputStream is) {
+ File tmpFile = null;
+ OutputStream os = null;
+ try {
+ tmpFile = File.createTempFile(prefix, suffix);
+ os = new FileOutputStream(tmpFile);
+ IOUtils.copy(is, os);
+ } catch (IOException e) {
+ throw new SlcException("Cannot open file " + prefix + "." + suffix,
+ e);
+ } finally {
+ IOUtils.closeQuietly(os);
+ }
+ return tmpFile;
+ }
+
+ /* DEPENDENCY INJECTION */
+ public void setRepoService(RepoService repoService) {
+ this.repoService = repoService;
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.argeo.slc.client.ui.specific;
+
+import org.argeo.slc.client.rcp.SlcRcpPlugin;
+
+/**
+ * Workaround a single sourcing problem:
+ *
+ * final static variable are imported at compilation time (we build against RCP)
+ * and we still must have a different ID (the prefix must be the PLUGIN ID) for
+ * RAP and RCP in order to be able to inject beans in the corresponding commands
+ */
+public class OpenJcrFileCmdId {
+
+ public String getCmdId() {
+ return SlcRcpPlugin.PLUGIN_ID + ".openJcrFile";
+ }
+}
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>argeo-slc</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>plugins</artifactId>
+ <name>SLC Eclipse Plugins</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.argeo.slc.client.rcp</module>
+ <module>org.argeo.slc.client.rap</module>
+ <module>org.argeo.slc.client.ui</module>
+ <module>org.argeo.slc.client.ui.dist</module>
+ </modules>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.artifactId};singleton:=true</Bundle-SymbolicName>
+ <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <!-- Prevents source jars to contain misleading data -->
+ <excludes>
+ <exclude>plugin.xml</exclude>
+ <exclude>META-INF/MANIFEST.MF</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java" output="target/classes" />
+ <classpathentry kind="src" path="src/main/resources"
+ output="target/classes" />
+ <classpathentry kind="src" output="target/test-classes"
+ path="src/test/java" />
+ <classpathentry kind="src" output="target/test-classes"
+ path="src/test/resources" />
+ <classpathentry kind="con"
+ path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
+ path="org.eclipse.pde.core.requiredPlugins" />
+ <classpathentry kind="output" path="target/classes" />
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Sat Jun 27 17:07:29 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+#Mon Feb 14 20:13:06 CET 2011
+eclipse.preferences.version=1
+pluginProject.equinox=false
+pluginProject.extensions=false
+resolve.requirebundle=false
+selfhosting.binExcludes=/org.argeo.slc.core/target/test-classes,/org.argeo.slc.core/target/test-classes
--- /dev/null
+additional.bundles = slf4j.api,\
+ slf4j.log4j,\
+ org.apache.log4j,\
+ slf4j.org.apache.commons.logging,\
+ org.aopalliance,\
+ org.aspectj.weaver,\
+ net.sf.cglib,\
+ org.springframework.context.support,\
+ org.springframework.context
+source.. = src/main/java/,\
+ src/main/resources/,\
+ src/test/java/,\
+ src/test/resources/
+bin.includes = META-INF/spring.handlers,\
+ META-INF/spring.schemas
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.core</artifactId>
+ <name>SLC Core</name>
+ <description>Basic implementations of SLC Specifications</description>
+ <build>
+ <outputDirectory>bin</outputDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.*,org.argeo.slc.core.test.spring
+ </Export-Package>
+ <Import-Package>
+ org.w3c.dom;version="0.0.0",
+ org.dbunit;resolution:="optional",
+ org.dbunit.database;resolution:="optional",
+ org.dbunit.dataset;resolution:="optional",
+ org.dbunit.dataset.xml;resolution:="optional",
+ org.dbunit.operation;resolution:="optional",
+ junit.framework;resolution:="optional",
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.specs</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.commons.base</groupId>
+ <artifactId>org.argeo.util</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.commons.security</groupId>
+ <artifactId>org.argeo.security.core</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.aspectj.runtime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.aspectj.weaver</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.exec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.cli</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.org.apache.commons.logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.commons.base</groupId>
+ <artifactId>org.argeo.dep.log4j</artifactId>
+ <version>${version.argeo-commons}</version>
+ <type>pom</type>
+ </dependency>
+
+ <!-- Spring -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.aop</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.security.core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>net.sf.cglib</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.codec</artifactId>
+ </dependency>
+
+ <!-- Test -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:slc="http://argeo.org/projects/slc/schemas"
+ elementFormDefault="qualified"
+ targetNamespace="http://argeo.org/projects/slc/schemas">
+ <!-- TREE TEST RESULT -->
+ <xs:element name="tree-test-result" type="slc:TreeTestResultType" />
+ <xs:element name="tree-test-result-collection"
+ type="slc:TreeTestResultCollectionType" />
+
+ <xs:complexType name="TreeTestResultCollectionType">
+ <xs:all>
+ <xs:element name="results" minOccurs="0"
+ type="slc:ResultsType" />
+ </xs:all>
+ <xs:attribute name="id" use="required" />
+ </xs:complexType>
+ <xs:complexType name="ResultsType">
+ <xs:sequence>
+ <xs:element name="tree-test-result"
+ type="slc:TreeTestResultType" minOccurs="0"
+ maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="TreeTestResultType">
+ <xs:all>
+ <xs:element name="close-date" type="xs:dateTime"
+ minOccurs="0" />
+ <xs:element name="attributes" minOccurs="0"
+ type="slc:AttributesType" />
+ <xs:element name="result-parts" minOccurs="0"
+ type="slc:ResultPartsType" />
+ <xs:element name="elements" minOccurs="0"
+ type="slc:ElementsType" />
+ </xs:all>
+ <xs:attribute name="uuid" use="required" />
+ </xs:complexType>
+ <xs:complexType name="ResultPartsType">
+ <xs:sequence>
+ <xs:element name="result-part" type="slc:ResultPartType"
+ minOccurs="0" maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ResultPartType">
+ <xs:all>
+ <xs:element name="part-sub-list" type="slc:PartSubListType" />
+ </xs:all>
+ <xs:attribute name="path" type="xs:string" use="required" />
+ </xs:complexType>
+ <xs:complexType name="PartSubListType">
+ <xs:all>
+ <xs:element name="parts" minOccurs="0" type="slc:PartsType" />
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="PartsType">
+ <xs:sequence>
+ <xs:element name="simple-result-part"
+ type="slc:SimpleResultPartType" maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="SimpleResultPartType">
+ <xs:all>
+ <xs:element name="status">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="PASSED" />
+ <xs:enumeration value="FAILED" />
+ <xs:enumeration value="ERROR" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="message" type="xs:string" />
+ <xs:element name="exception-message" minOccurs="0"
+ type="xs:string" />
+ <xs:element name="stack-lines" minOccurs="0"
+ type="slc:StackLinesType" />
+ <xs:element name="test-run-uuid" type="xs:string"
+ minOccurs="0" />
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="StackLinesType">
+ <xs:sequence>
+ <xs:element name="stack-line" maxOccurs="unbounded"
+ type="xs:string" />
+ </xs:sequence>
+ <xs:attribute name="message" type="xs:string" />
+ </xs:complexType>
+ <xs:complexType name="ElementsType">
+ <xs:sequence>
+ <xs:element name="element" type="slc:ElementType"
+ minOccurs="0" maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ElementType">
+ <xs:all>
+ <xs:element name="simple-sElement"
+ type="slc:SimpleSElementType" />
+ </xs:all>
+ <xs:attribute name="path" type="xs:string" use="required" />
+ </xs:complexType>
+ <xs:complexType name="SimpleSElementType">
+ <xs:all>
+ <xs:element name="label" type="xs:string" />
+ <xs:element name="tags" type="slc:TagsType" minOccurs="0" />
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="TagsType">
+ <xs:sequence>
+ <xs:element name="tag" type="slc:TagType" minOccurs="0"
+ maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="TagType">
+ <xs:all>
+ <xs:element name="tag-value" type="xs:string" />
+ </xs:all>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ <xs:complexType name="TreeSPathType">
+ <xs:attribute name="as-unique-string" type="xs:string"
+ use="required" />
+ </xs:complexType>
+ <xs:complexType name="TestRunDescriptorType">
+ <xs:all>
+ <xs:element name="test-run-uuid" type="xs:string" />
+ <xs:element name="slc-execution-uuid" type="xs:string"
+ minOccurs="0" />
+ <xs:element name="slc-execution-step-uuid" type="xs:string"
+ minOccurs="0" />
+ <xs:element name="deployed-sytem-id" type="xs:string"
+ minOccurs="0" />
+ <xs:element name="test-result-uuid" type="xs:string"
+ minOccurs="0" />
+ </xs:all>
+ </xs:complexType>
+
+ <!-- BASIC MESSAGES -->
+ <xs:element name="execution-answer">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="status"
+ type="xs:string" maxOccurs="1" minOccurs="1" />
+ <xs:element name="message"
+ type="xs:string" maxOccurs="1" minOccurs="1"/>
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TREE TEST RESULT REQUESTS -->
+ <xs:element name="create-tree-test-result-request">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="tree-test-result"
+ type="slc:TreeTestResultType" />
+ <xs:element name="test-run-descriptor"
+ type="slc:TestRunDescriptorType" maxOccurs="1" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="close-tree-test-result-request">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="result-uuid" type="xs:string" />
+ <xs:element name="close-date" type="xs:dateTime" />
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="result-part-request">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="result-uuid" type="xs:string" />
+ <xs:element name="simple-result-part"
+ type="slc:SimpleResultPartType" />
+ <xs:element name="related-elements"
+ type="slc:ElementsType" />
+ <xs:element name="tree-sPath" type="slc:TreeSPathType" />
+ <xs:element name="test-run-descriptor"
+ type="slc:TestRunDescriptorType" />
+ <xs:element name="attributes" minOccurs="0"
+ type="slc:AttributesType" />
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- SLC EXECUTION -->
+ <xs:element name="slc-execution" type="slc:SlcExecutionType" />
+ <xs:complexType name="SlcExecutionType">
+ <xs:all>
+ <xs:element name="status" type="xs:string" />
+ <xs:element name="type" type="xs:string" />
+ <xs:element name="host" type="xs:string" />
+ <xs:element name="user" type="xs:string" />
+ <xs:element name="steps" minOccurs="0"
+ type="slc:SlcExecutionStepsType" />
+ <xs:element name="attributes" minOccurs="0"
+ type="slc:AttributesType" />
+ </xs:all>
+ <xs:attribute name="uuid" type="xs:string" use="required" />
+ </xs:complexType>
+ <xs:complexType name="SlcExecutionStepsType">
+ <xs:sequence>
+ <xs:element name="slc-execution-step"
+ type="slc:SlcExecutionStepType" maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="SlcExecutionStepType">
+ <xs:all>
+ <xs:element name="type" type="xs:string" />
+ <xs:element name="thread" type="xs:string" />
+ <xs:element name="timestamp" type="xs:dateTime" />
+ <xs:element name="log-lines" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="log-line" type="xs:string"
+ maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ <xs:attribute name="uuid" type="xs:string" use="required" />
+ </xs:complexType>
+ <xs:complexType name="AttributesType">
+ <xs:sequence>
+ <xs:element name="attribute" type="slc:AttributeType"
+ minOccurs="0" maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="AttributeType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="name" type="xs:string"
+ use="required" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <!-- SLC EXECUTION REQUESTS-->
+ <xs:element name="slc-execution-request">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="slc-execution"
+ type="slc:SlcExecutionType" />
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="slc-execution-steps-request">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="slc-execution-uuid" type="xs:string" />
+ <xs:element name="steps"
+ type="slc:SlcExecutionStepsType" />
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="slc-execution-status-request">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="slc-execution-uuid" type="xs:string" />
+ <xs:element name="new-status" type="xs:string" />
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
\ No newline at end of file
--- /dev/null
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
+ default-lazy-init="true">\r
+\r
+ <bean id="slcDefault.xml.xsdValidator"\r
+ factory-bean="slcDefault.xml.xsdSchema" factory-method="createValidator" />\r
+\r
+ <bean id="slcDefault.xml.xsdSchema"\r
+ class="org.springframework.xml.xsd.SimpleXsdSchema">\r
+ <property name="xsd"\r
+ value="classpath:/org/argeo/slc/xml/slc.xsd" />\r
+ </bean>\r
+</beans>\r
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+# Slc\r
+log4j.logger.org.argeo=DEBUG\r
+\r
+# Castor\r
+log4j.logger.org.exolab.castor=WARN\r
+\r
+# Spring\r
+log4j.logger.org.springframework=WARN\r
+\r
+\r
+## Appenders\r
+# A1 is set to be a ConsoleAppender.\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+\r
+# A1 uses PatternLayout.\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <bean id="relativeResourceSet" class="org.argeo.slc.core.deploy.DefaultResourceSet">\r
+ <property name="base" value="classpath:/org/argeo/slc/core/deploy/data" />\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="imports.xml" /> \r
+\r
+ <bean id="executionModule_1" class="org.argeo.slc.core.execution.SimpleSpringExecutionModule" >\r
+ <property name="executionContext">\r
+ <ref bean="executionContext" />\r
+ </property> \r
+ <property name="name" value="dummyname" />\r
+ <property name="version" value="dummyversion" />\r
+ </bean>\r
+ \r
+ <bean id="main" parent="slcTemplate.simpleFlow">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="testKey">\r
+ <bean parent="specAttr.primitive" p:value="660" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ <property name="executables">\r
+ <list>\r
+ <ref local="echo1" />\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="echo1" parent="task.echo" scope="execution">\r
+ <property name="message"\r
+ value="From main! @{testKey}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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
+ <import resource="canonic.xml" />\r
+\r
+ <bean id="canonic.001" parent="canonic.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="parameterAtInstantiation" value="1" />\r
+ </map>\r
+ </constructor-arg>\r
+ </bean>\r
+</beans>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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
+ <import resource="canonic.xml" />\r
+\r
+ <bean id="canonic.002" parent="canonic.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="parameterAtInstantiation" value="2" />\r
+ <entry key="displayWithoutControl" value="102" />\r
+ <entry key="displayWithControl" value="202" />\r
+ <entry key="hide" value="202" />\r
+ <entry key="notParameterAtInstantiation" value="202" />\r
+ </map>\r
+ </constructor-arg>\r
+ </bean>\r
+</beans>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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
+ <import resource="canonic.xml" />\r
+\r
+ <bean id="canonic.003" parent="canonic.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <!-- missing parameter -->\r
+ <entry key="displayWithoutControl" value="102" />\r
+ <entry key="displayWithControl" value="202" />\r
+ <entry key="hide" value="202" />\r
+ </map>\r
+ </constructor-arg>\r
+ </bean>\r
+</beans>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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
+ <import resource="canonic.xml" />\r
+\r
+ <bean id="canonic.004" parent="canonic.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="parameterAtInstantiation" value="2" />\r
+ <entry key="displayWithoutControl" value="102" />\r
+ <entry key="displayWithControl" value="202" />\r
+ <entry key="hide" value="202" />\r
+ <entry key="unknownParameter" value="1" />\r
+ </map>\r
+ </constructor-arg>\r
+ </bean>\r
+</beans>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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
+ <import resource="imports.xml" />\r
+\r
+ <bean id="canonic.spec" parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="parameterAtInstantiation">\r
+ <bean parent="specAttr.primitive" p:isParameter="true" p:type="integer" />\r
+ </entry>\r
+ <entry key="displayWithoutControl">\r
+ <bean parent="specAttr.primitive" p:value="100" p:isParameter="true"\r
+ p:isFrozen="true" p:type="integer" />\r
+ </entry>\r
+ <entry key="displayWithControl">\r
+ <bean parent="specAttr.primitive" p:value="200" p:isParameter="true"\r
+ p:isFrozen="false" p:type="integer" />\r
+ </entry>\r
+ <entry key="hide">\r
+ <bean parent="specAttr.primitive" p:value="300" p:isParameter="true"\r
+ p:isFrozen="false" p:isHidden="true" p:type="integer" />\r
+ </entry> \r
+ <entry key="notParameterAtInstantiation">\r
+ <bean parent="specAttr.primitive" p:value="400" p:isParameter="false"\r
+ p:isFrozen="false" p:isHidden="false" p:type="integer" />\r
+ </entry> \r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="canonic.flowTemplate" parent="slcTemplate.simpleFlow"\r
+ abstract="true">\r
+ <constructor-arg ref="canonic.spec" />\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo"\r
+ p:message="Canonical: displayWithControl=@{displayWithControl}, displayWithoutControl=@{displayWithoutControl}, hide=@{hide}">\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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
+ <import resource="imports.xml" />\r
+\r
+ <bean id="executionResources.spec" parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="var">\r
+ <bean parent="specAttr.primitive" p:isParameter="false"\r
+ p:type="integer" p:value="60" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="executionResources.placeholderPass" parent="slcTemplate.simpleFlow">\r
+ <constructor-arg ref="executionResources.spec" />\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo">\r
+ <property name="message" value="DATA" />\r
+ <property name="writeTo">\r
+ <bean parent="slcTemplate.resourcesFactoryBean" scope="execution">\r
+ <property name="executionResources" ref="executionResources" />\r
+ <property name="relativePath" value="subdir/@{var}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="executionResources.placeholderFail" parent="slcTemplate.simpleFlow">\r
+ <constructor-arg ref="executionResources.spec" />\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo">\r
+ <property name="message" value="DATA" />\r
+ <property name="writeTo">\r
+ <bean factory-bean="executionResources" factory-method="getWritableResource"\r
+ scope="execution">\r
+ <constructor-arg value="subdir/@{var}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="executionResources.simple" parent="slcTemplate.simpleFlow">\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo">\r
+ <property name="message" value="DATA" />\r
+ <property name="writeTo">\r
+ <bean factory-bean="executionResources" factory-method="getWritableResource"\r
+ scope="execution">\r
+ <constructor-arg value="subdir/writeTo" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="executionResources" parent="slcTemplate.fileResources">\r
+ <property name="executionContext" ref="executionContext" />\r
+ <property name="withExecutionSubdirectory" value="false" />\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<!-- Copyright (C) 2007-2012 Mathieu Baudier Licensed 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. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+ <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />
+ <import resource="classpath:/org/argeo/slc/core/test/spring.xml" />
+
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="imports.xml" /> \r
+\r
+ <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="basic.testDef" />\r
+ <property name="testResult" ref="myTestResult"/>\r
+ </bean> \r
+\r
+ <bean id="myFlow" parent="slcTemplate.simpleFlow">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="testKey">\r
+ <bean parent="specAttr.primitive" p:value="myValue" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ <property name="executables">\r
+ <list>\r
+ <ref local="echo1" />\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="simpleMap.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingMap.testData" />\r
+ </bean> \r
+ \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="simpleList.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingList.testData" />\r
+ </bean> \r
+ \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="simpleSet.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingSet.testData" />\r
+ </bean> \r
+ \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingListMap.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingSetMap.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingComplex.testData" />\r
+ </bean> \r
+ \r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+\r
+ <bean id="simpleMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <map>\r
+ <entry key="key1" value="myValue_myValue" />\r
+ </map>\r
+ </property>\r
+ <property name="reached">\r
+ <map>\r
+ <entry key="key1" value="@{testKey}_@{testKey}" />\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ \r
+ <bean id="cascadingMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <map>\r
+ <entry key="key3">\r
+ <map>\r
+ <entry key="key2">\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map>\r
+ </entry>\r
+ <entry key="key2bis" value="myValue" />\r
+ </map>\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ <property name="reached">\r
+ <map>\r
+ <entry key="key3">\r
+ <map>\r
+ <entry key="key2">\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map>\r
+ </entry>\r
+ <entry key="key2bis" value="@{testKey}" />\r
+ </map>\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="simpleList.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <list>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </list>\r
+ </property>\r
+ <property name="reached">\r
+ <list>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value> \r
+ </list>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingList.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <list>\r
+ <list>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </list>\r
+ <value>myValue</value>\r
+ </list>\r
+ </property>\r
+ <property name="reached">\r
+ <list>\r
+ <list>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value>\r
+ </list>\r
+ <value>@{testKey}</value>\r
+ </list>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="simpleSet.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <set>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </set>\r
+ </property>\r
+ <property name="reached">\r
+ <set>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value> \r
+ </set>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingSet.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <set>\r
+ <set>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </set>\r
+ <value>myValue</value>\r
+ </set>\r
+ </property>\r
+ <property name="reached">\r
+ <set>\r
+ <set>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value>\r
+ </set>\r
+ <value>@{testKey}</value>\r
+ </set>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingListMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <list>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ </list>\r
+ </property>\r
+ <property name="reached">\r
+ <list>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ </list>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingSetMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ </set>\r
+ </property>\r
+ <property name="reached">\r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ </set>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingComplex.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ <list>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ <set>\r
+ <set>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ <list>\r
+ <list>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </list>\r
+ <value>myValue</value>\r
+ </list> \r
+ </set>\r
+ <value>myValue</value>\r
+ </set> \r
+ </list> \r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ </set> \r
+ </set>\r
+ </property>\r
+ <property name="reached">\r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ <list>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ <set>\r
+ <set>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value>\r
+ <list>\r
+ <list>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value>\r
+ </list>\r
+ <value>@{testKey}</value>\r
+ </list> \r
+ </set>\r
+ <value>@{testKey}</value>\r
+ </set> \r
+ </list> \r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ </set> \r
+ </set>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="basic.testDef" class="org.argeo.slc.core.test.BasicTestDefinition">\r
+ </bean> \r
+\r
+\r
+ <bean id="echo1" parent="task.echo" scope="prototype">\r
+ <property name="message"\r
+ value="testKey=@{testKey}" />\r
+ </bean>\r
+ \r
+ <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="imports.xml" /> \r
+\r
+ <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="basic.testDef" />\r
+ <property name="testResult" ref="myTestResult"/>\r
+ </bean> \r
+\r
+ <bean id="abstractFlow" parent="slcTemplate.simpleFlow" abstract="true">\r
+ <property name="executables">\r
+ <list>\r
+ <ref local="echo1" />\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="simpleMap.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingMap.testData" />\r
+ </bean> \r
+ \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="simpleList.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingList.testData" />\r
+ </bean> \r
+ \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="simpleSet.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingSet.testData" />\r
+ </bean> \r
+ \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingListMap.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingSetMap.testData" />\r
+ </bean> \r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData" ref="cascadingComplex.testData" />\r
+ </bean> \r
+ \r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flow1" parent="abstractFlow" scope="prototype">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="testKey">\r
+ <bean parent="specAttr.primitive" p:value="myValue" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ </bean> \r
+\r
+ <bean id="flow2" parent="abstractFlow" scope="prototype">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="testKey">\r
+ <bean parent="specAttr.primitive" p:value="myValue2" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ </bean> \r
+\r
+\r
+ <bean id="simpleMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <map>\r
+ <entry key="key1" value="myValue_myValue" />\r
+ </map>\r
+ </property>\r
+ <property name="reached">\r
+ <map>\r
+ <entry key="key1" value="@{testKey}_@{testKey}" />\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ \r
+ <bean id="cascadingMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <map>\r
+ <entry key="key3">\r
+ <map>\r
+ <entry key="key2">\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map>\r
+ </entry>\r
+ <entry key="key2bis" value="myValue" />\r
+ </map>\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ <property name="reached">\r
+ <map>\r
+ <entry key="key3">\r
+ <map>\r
+ <entry key="key2">\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map>\r
+ </entry>\r
+ <entry key="key2bis" value="@{testKey}" />\r
+ </map>\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="simpleList.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <list>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </list>\r
+ </property>\r
+ <property name="reached">\r
+ <list>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value> \r
+ </list>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingList.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <list>\r
+ <list>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </list>\r
+ <value>myValue</value>\r
+ </list>\r
+ </property>\r
+ <property name="reached">\r
+ <list>\r
+ <list>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value>\r
+ </list>\r
+ <value>@{testKey}</value>\r
+ </list>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="simpleSet.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <set>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </set>\r
+ </property>\r
+ <property name="reached">\r
+ <set>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value> \r
+ </set>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingSet.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <set>\r
+ <set>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </set>\r
+ <value>myValue</value>\r
+ </set>\r
+ </property>\r
+ <property name="reached">\r
+ <set>\r
+ <set>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value>\r
+ </set>\r
+ <value>@{testKey}</value>\r
+ </set>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingListMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <list>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ </list>\r
+ </property>\r
+ <property name="reached">\r
+ <list>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ </list>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingSetMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ </set>\r
+ </property>\r
+ <property name="reached">\r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ </set>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="cascadingComplex.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
+ <property name="expected">\r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ <list>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ <set>\r
+ <set>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ <list>\r
+ <list>\r
+ <value>myValue</value>\r
+ <value>_myValue_</value>\r
+ </list>\r
+ <value>myValue</value>\r
+ </list> \r
+ </set>\r
+ <value>myValue</value>\r
+ </set> \r
+ </list> \r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="myValue" />\r
+ </map> \r
+ </set> \r
+ </set>\r
+ </property>\r
+ <property name="reached">\r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ <list>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ <set>\r
+ <set>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value>\r
+ <list>\r
+ <list>\r
+ <value>@{testKey}</value>\r
+ <value>_@{testKey}_</value>\r
+ </list>\r
+ <value>@{testKey}</value>\r
+ </list> \r
+ </set>\r
+ <value>@{testKey}</value>\r
+ </set> \r
+ </list> \r
+ <set>\r
+ <map>\r
+ <entry key="key1" value="@{testKey}" />\r
+ </map> \r
+ </set> \r
+ </set>\r
+ </property>\r
+ </bean> \r
+ \r
+ <bean id="basic.testDef" class="org.argeo.slc.core.test.BasicTestDefinition">\r
+ </bean> \r
+\r
+\r
+ <bean id="echo1" parent="task.echo" scope="prototype">\r
+ <property name="message"\r
+ value="testKey=@{testKey}" />\r
+ </bean>\r
+ \r
+ <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="imports.xml" /> \r
+\r
+ <bean id="minimal" parent="slcTemplate.simpleFlow">\r
+ <property name="executionSpec">\r
+ <bean parent="slcTemplate.simpleSpec">\r
+<!-- <property name="attributes">\r
+ <map>\r
+ <entry key="testKey">\r
+ <bean parent="specAttr.primitive" p:value="660" />\r
+ </entry>\r
+ </map>\r
+ </property> -->\r
+ </bean>\r
+ </property>\r
+ <property name="executables">\r
+ <list>\r
+ <ref local="echo1" />\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="echo1" parent="task.echo" scope="execution">\r
+ <property name="message"\r
+ value="From minimal" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="imports.xml" /> \r
+\r
+ <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+ <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+\r
+ <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="myTestDef" />\r
+ <property name="testResult" ref="myTestResult"/>\r
+ </bean> \r
+\r
+ <bean id="fileDiff.spec" parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="fileName">\r
+ <bean parent="specAttr.primitive" p:isParameter="true" p:type="string"\r
+ p:isFrozen="true" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+\r
+ <bean id="fileDiff.flowTemplate" parent="slcTemplate.simpleFlow"\r
+ abstract="true">\r
+ <property name="path" value="/fileDiff/testcases" />\r
+ <constructor-arg ref="fileDiff.spec" />\r
+ <property name="executables">\r
+ <list> \r
+ <bean parent="task.echo">\r
+ <property name="message" value="fileName=@{fileName}" />\r
+ </bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="file1" />\r
+ <property name="reached" value="@{fileName}" />\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+ \r
+ <bean id="echo" parent="task.echo" scope="prototype">\r
+ <property name="message" value="fileName=@{fileName}" />\r
+ </bean> \r
+ \r
+ <bean id="flow1" parent="fileDiff.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="fileName" value="file1" />\r
+ </map>\r
+ </constructor-arg>\r
+ </bean> \r
+\r
+ <bean id="flow2" parent="fileDiff.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="fileName" value="file2" />\r
+ </map>\r
+ </constructor-arg>\r
+ </bean> \r
+ \r
+ \r
+ <!-- \r
+ <bean id="flow1" parent="slcTemplate.simpleFlow">\r
+ <property name="path" value="/fileDiff/testcases" />\r
+ <constructor-arg ref="fileDiff.spec" />\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="fileName" value="file1" />\r
+ </map>\r
+ </constructor-arg> \r
+ <property name="executables">\r
+ <list> \r
+ <bean parent="task.echo" scope="execution">\r
+ <property name="message" value="fileName=@{fileName}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flow2" parent="slcTemplate.simpleFlow">\r
+ <property name="path" value="/fileDiff/testcases" />\r
+ <constructor-arg ref="fileDiff.spec" />\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="fileName" value="file2" />\r
+ </map>\r
+ </constructor-arg> \r
+ <property name="executables">\r
+ <list> \r
+ <bean parent="task.echo" scope="execution">\r
+ <property name="message" value="fileName=@{fileName}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+ -->\r
+<!-- \r
+ <bean id="main" parent="slcTemplate.simpleFlow">\r
+ <property name="executables">\r
+ <list> \r
+ <ref bean="flow1"/> \r
+ <ref bean="flow2"/> \r
+ </list>\r
+ </property>\r
+ </bean>\r
+ -->\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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
+ <import resource="imports.xml" />\r
+\r
+ <!-- DEFINITIONS -->\r
+ <bean id="parameterRef.spec" parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="exceptionIfInitCalledTwice">\r
+ <bean parent="specAttr.ref"\r
+ p:targetClass="org.argeo.slc.core.execution.ExceptionIfInitCalledTwice"\r
+ p:isParameter="true" p:isFrozen="true" />\r
+ </entry>\r
+ <entry key="testData1">\r
+ <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ p:isParameter="true" p:isFrozen="true" />\r
+ </entry>\r
+ <entry key="testData2">\r
+ <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ p:isParameter="true" p:isFrozen="true" />\r
+ </entry>\r
+ <entry key="testedComponentId">\r
+ <bean parent="specAttr.primitive" p:value="100" p:isParameter="true"\r
+ p:type="integer" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="parameterRef.flowTemplate" parent="slcTemplate.simpleFlow"\r
+ abstract="true">\r
+ <constructor-arg ref="parameterRef.spec" />\r
+ <property name="executables">\r
+ <list>\r
+ <!-- Primitive -->\r
+ <bean parent="task.echo" scope="execution">\r
+ <property name="message" value="testedComponentId=@{testedComponentId}" />\r
+ </bean>\r
+\r
+ <!-- Exception if init called twice -->\r
+ <bean parent="parameterRef">\r
+ <constructor-arg value="exceptionIfInitCalledTwice" />\r
+ </bean>\r
+ <bean parent="parameterRef">\r
+ <property name="name" value="exceptionIfInitCalledTwice" />\r
+ </bean>\r
+\r
+ <!-- Basic tests -->\r
+ <bean parent="parameterRef.testRun">\r
+ <property name="testData">\r
+ <bean parent="parameterRef">\r
+ <constructor-arg value="testData1" />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+ <bean parent="parameterRef.testRun">\r
+ <property name="testData" ref="ref1" />\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <!-- TEST CASES -->\r
+ <bean id="parameterRef.001" parent="parameterRef.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="exceptionIfInitCalledTwice">\r
+ <bean class="org.argeo.slc.core.execution.ExceptionIfInitCalledTwice" />\r
+ </entry>\r
+ <entry key="testData1">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="toto" />\r
+ <property name="reached" value="toto" />\r
+ </bean>\r
+ </entry>\r
+ <entry key="testData2">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="tata" />\r
+ <property name="reached" value="toto" />\r
+ </bean>\r
+ </entry>\r
+ </map>\r
+ </constructor-arg>\r
+ </bean>\r
+\r
+ <!-- UTILITIES -->\r
+\r
+ <bean id="ref1" parent="parameterRef">\r
+ <constructor-arg value="testData2" />\r
+ </bean>\r
+\r
+ <bean id="parameterRef.testResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+ <bean id="parameterRef.testRun" class="org.argeo.slc.core.test.SimpleTestRun"\r
+ abstract="true">\r
+ <property name="testResult" ref="parameterRef.testResult" />\r
+ <property name="testDefinition">\r
+ <bean class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+ </property>\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="imports.xml" /> \r
+\r
+ <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+ <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+\r
+ <bean id="echo1" parent="task.echo">\r
+ <property name="message" value="From minimal" />\r
+ </bean>\r
+\r
+ <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="myTestDef" />\r
+ <property name="testResult" ref="myTestResult"/>\r
+ </bean> \r
+\r
+ <!-- \r
+ The Flow A contains the flow B as executable.\r
+ \r
+ Parameters\r
+ p1: flow A: default - flow B: - \r
+ p2: flow A: set - flow B: - \r
+ p3: flow A: default - flow B: default \r
+ p4: flow A: set - flow B: default\r
+ p5: flow A: default - flow B: set \r
+ p6: flow A: set - flow B: set\r
+ p7: flow A: - - flow B: default\r
+ p8: flow A: - - flow B: set\r
+ \r
+ \r
+ -->\r
+\r
+ <bean id="flowA" parent="slcTemplate.simpleFlow">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="p1"><bean parent="specAttr.primitive" p:value="da1" /></entry>\r
+ <entry key="p2"><bean parent="specAttr.primitive" p:value="da2" /></entry> \r
+ <entry key="p3"><bean parent="specAttr.primitive" p:value="da3" /></entry> \r
+ <entry key="p4"><bean parent="specAttr.primitive" p:value="da4" /></entry> \r
+ <entry key="p5"><bean parent="specAttr.primitive" p:value="da5" /></entry> \r
+ <entry key="p6"><bean parent="specAttr.primitive" p:value="da6" /></entry> \r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ <constructor-arg> \r
+ <map>\r
+ <entry key="p2" value="va2"/>\r
+ <entry key="p4" value="va4"/>\r
+ <entry key="p6" value="va6"/>\r
+ </map>\r
+ </constructor-arg>\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo"><property name="message" value="p1=@{p1}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da1" />\r
+ <property name="reached" value="@{p1}" />\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ <bean parent="task.echo"><property name="message" value="p2=@{p2}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va2" />\r
+ <property name="reached" value="@{p2}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p3=@{p3}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da3" />\r
+ <property name="reached" value="@{p3}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p4=@{p4}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va4" />\r
+ <property name="reached" value="@{p4}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p5=@{p5}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da5" />\r
+ <property name="reached" value="@{p5}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p6=@{p6}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va6" />\r
+ <property name="reached" value="@{p6}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <ref bean="flowB"/> \r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flowB" parent="slcTemplate.simpleFlow" scope="prototype">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="p3"><bean parent="specAttr.primitive" p:value="db3" /></entry> \r
+ <entry key="p4"><bean parent="specAttr.primitive" p:value="db4" /></entry>\r
+ <entry key="p5"><bean parent="specAttr.primitive" p:value="db5" /></entry> \r
+ <entry key="p6"><bean parent="specAttr.primitive" p:value="db6" /></entry>\r
+ <entry key="p7"><bean parent="specAttr.primitive" p:value="db7" /></entry> \r
+ <entry key="p8"><bean parent="specAttr.primitive" p:value="db8" /></entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ <constructor-arg> \r
+ <map>\r
+ <entry key="p3" value="vb3"/>\r
+ <entry key="p4" value="vb4"/>\r
+ <entry key="p7" value="vb7"/>\r
+ </map>\r
+ </constructor-arg> \r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo"><property name="message" value="p1=@{p1}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da1" />\r
+ <property name="reached" value="@{p1}" />\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ <bean parent="task.echo"><property name="message" value="p2=@{p2}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va2" />\r
+ <property name="reached" value="@{p2}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p3=@{p3}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da3" />\r
+ <property name="reached" value="@{p3}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p4=@{p4}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va4" />\r
+ <property name="reached" value="@{p4}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p5=@{p5}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da5" />\r
+ <property name="reached" value="@{p5}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p6=@{p6}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va6" />\r
+ <property name="reached" value="@{p6}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p7=@{p7}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="vb7" />\r
+ <property name="reached" value="@{p7}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p8=@{p8}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="db8" />\r
+ <property name="reached" value="@{p8}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ \r
+ <!-- test in scope execution -->\r
+ <bean parent="task.echo" scope="execution"><property name="message" value="p1=@{p1}" /><aop:scoped-proxy /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <property name="expected" value="e1" />\r
+ <property name="reached" value="@{p1}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ <bean parent="task.echo" scope="execution"><property name="message" value="p2=@{p2}" /><aop:scoped-proxy /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <property name="expected" value="e2" />\r
+ <property name="reached" value="@{p2}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo" scope="execution"><property name="message" value="p3=@{p3}" /><aop:scoped-proxy /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <property name="expected" value="e3" />\r
+ <property name="reached" value="@{p3}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo" scope="execution"><property name="message" value="p4=@{p4}" /><aop:scoped-proxy /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <property name="expected" value="e4" />\r
+ <property name="reached" value="@{p4}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo" scope="execution"><property name="message" value="p5=@{p5}" /><aop:scoped-proxy /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <property name="expected" value="e5" />\r
+ <property name="reached" value="@{p5}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo" scope="execution"><property name="message" value="p6=@{p6}" /><aop:scoped-proxy /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <property name="expected" value="e6" />\r
+ <property name="reached" value="@{p6}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ \r
+ <!-- \r
+ p7 and p8 are not in the spec of FlowA and therefore can not be overridden\r
+ at the execution\r
+ -->\r
+ <bean parent="task.echo" scope="execution"><property name="message" value="p7=@{p7}" /><aop:scoped-proxy /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <property name="expected" value="vb7" />\r
+ <property name="reached" value="@{p7}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo" scope="execution"><property name="message" value="p8=@{p8}" /><aop:scoped-proxy /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <property name="expected" value="db8" />\r
+ <property name="reached" value="@{p8}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ \r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="imports.xml" /> \r
+\r
+ <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+ <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+\r
+ <bean id="echo1" parent="task.echo">\r
+ <property name="message" value="From minimal" />\r
+ </bean>\r
+\r
+ <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="myTestDef" />\r
+ <property name="testResult" ref="myTestResult"/>\r
+ </bean> \r
+\r
+ <!-- \r
+ The Flow A contains the flow B as executable.\r
+ \r
+ Parameters\r
+ p1: flow A: default - flow B: - \r
+ p2: flow A: set - flow B: - \r
+ p3: flow A: default - flow B: default \r
+ p4: flow A: set - flow B: default\r
+ p5: flow A: default - flow B: set \r
+ p6: flow A: set - flow B: set\r
+ p7: flow A: - - flow B: default\r
+ p8: flow A: - - flow B: set\r
+ \r
+ \r
+ -->\r
+\r
+ <bean id="flowA" parent="slcTemplate.simpleFlow">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="p1"><bean parent="specAttr.primitive" p:value="da1" /></entry>\r
+ <entry key="p2"><bean parent="specAttr.primitive" p:value="da2" /></entry> \r
+ <entry key="p3"><bean parent="specAttr.primitive" p:value="da3" /></entry> \r
+ <entry key="p4"><bean parent="specAttr.primitive" p:value="da4" /></entry> \r
+ <entry key="p5"><bean parent="specAttr.primitive" p:value="da5" /></entry> \r
+ <entry key="p6"><bean parent="specAttr.primitive" p:value="da6" /></entry> \r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ <constructor-arg> \r
+ <map>\r
+ <entry key="p2" value="va2"/>\r
+ <entry key="p4" value="va4"/>\r
+ <entry key="p6" value="va6"/>\r
+ </map>\r
+ </constructor-arg>\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo"><property name="message" value="p1=@{p1}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da1" />\r
+ <property name="reached" value="@{p1}" />\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ <bean parent="task.echo"><property name="message" value="p2=@{p2}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va2" />\r
+ <property name="reached" value="@{p2}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p3=@{p3}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da3" />\r
+ <property name="reached" value="@{p3}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p4=@{p4}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va4" />\r
+ <property name="reached" value="@{p4}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p5=@{p5}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da5" />\r
+ <property name="reached" value="@{p5}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p6=@{p6}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va6" />\r
+ <property name="reached" value="@{p6}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <ref bean="flowB"/> \r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flowB" parent="slcTemplate.simpleFlow" scope="prototype">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="p3"><bean parent="specAttr.primitive" p:value="db3" /></entry> \r
+ <entry key="p4"><bean parent="specAttr.primitive" p:value="db4" /></entry>\r
+ <entry key="p5"><bean parent="specAttr.primitive" p:value="db5" /></entry> \r
+ <entry key="p6"><bean parent="specAttr.primitive" p:value="db6" /></entry>\r
+ <entry key="p7"><bean parent="specAttr.primitive" p:value="db7" /></entry> \r
+ <entry key="p8"><bean parent="specAttr.primitive" p:value="db8" /></entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ <constructor-arg> \r
+ <map>\r
+ <entry key="p3" value="vb3"/>\r
+ <entry key="p4" value="vb4"/>\r
+ <entry key="p7" value="vb7"/>\r
+ </map>\r
+ </constructor-arg> \r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo"><property name="message" value="p1=@{p1}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da1" />\r
+ <property name="reached" value="@{p1}" />\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ <bean parent="task.echo"><property name="message" value="p2=@{p2}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va2" />\r
+ <property name="reached" value="@{p2}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p3=@{p3}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da3" />\r
+ <property name="reached" value="@{p3}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p4=@{p4}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va4" />\r
+ <property name="reached" value="@{p4}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p5=@{p5}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="da5" />\r
+ <property name="reached" value="@{p5}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p6=@{p6}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="va6" />\r
+ <property name="reached" value="@{p6}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p7=@{p7}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="vb7" />\r
+ <property name="reached" value="@{p7}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ <bean parent="task.echo"><property name="message" value="p8=@{p8}" /></bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="db8" />\r
+ <property name="reached" value="@{p8}" />\r
+ </bean>\r
+ </property> \r
+ </bean> \r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="imports.xml" /> \r
+ \r
+ <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+ <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+\r
+ <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="myTestDef" />\r
+ <property name="testResult" ref="myTestResult"/>\r
+ </bean> \r
+ \r
+ <bean id="spec1" parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="testedComponentId">\r
+ <bean parent="specAttr.primitive" p:isParameter="true"\r
+ p:type="integer" />\r
+ </entry>\r
+ <entry key="testData1">\r
+ <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ p:isParameter="true" p:isFrozen="true" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flowTemplate1" parent="slcTemplate.simpleFlow"\r
+ abstract="true">\r
+ <constructor-arg ref="spec1" />\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo" scope="execution">\r
+ <property name="message" value="From basic @{testedComponentId}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean parent="parameterRef">\r
+ <constructor-arg value="testData1" />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flow1" parent="flowTemplate1" scope="prototype">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="testedComponentId" value="200" />\r
+ <entry key="testData1">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <aop:scoped-proxy/>\r
+ <property name="expected" value="tata101" />\r
+ <property name="reached" value="tata@{testedComponentId}" />\r
+ </bean>\r
+ </entry>\r
+ </map> \r
+ </constructor-arg>\r
+ </bean>\r
+\r
+ <bean id="spec2" parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="testData1">\r
+ <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ p:isParameter="true" p:isFrozen="true" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flowTemplate2" parent="slcTemplate.simpleFlow" abstract="true">\r
+ <constructor-arg ref="spec2" />\r
+ <property name="executables">\r
+ <list>\r
+ <ref bean="flow1"/>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+ \r
+ <bean id="flow2" parent="flowTemplate2">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="testData1">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected" value="tata100" />\r
+ <property name="reached" value="tata100" />\r
+ </bean>\r
+ </entry>\r
+ </map> \r
+ </constructor-arg>\r
+ </bean> \r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="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
+\r
+ <import resource="../imports.xml" />\r
+\r
+ <bean id="systemCallSimple" parent="slcTemplate.simpleFlow">\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo">\r
+ <property name="message" value="os.name=${os.name}" />\r
+ </bean>\r
+ <bean parent="task.systemCall">\r
+ <property name="cmd" value="echo Hello World" />\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="systemCallList" parent="slcTemplate.simpleFlow">\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.systemCall">\r
+ <property name="command">\r
+ <list>\r
+ <value>echo</value>\r
+ <value>Hello</value>\r
+ <value>World</value>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="systemCallOsSpecific" parent="slcTemplate.simpleFlow">\r
+ <!-- Direct call to dir under Windows isnot working -->\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.systemCall">\r
+ <property name="cmd" value="dir" />\r
+ <property name="execDir" value="../.." />\r
+ <property name="osCmds">\r
+ <map>\r
+ <entry key="Linux" value="ls" />\r
+ <entry key="Mac OS X" value="ls" />\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ <bean parent="task.systemCall">\r
+ <property name="command">\r
+ <list>\r
+ <value>dir</value>\r
+ </list>\r
+ </property>\r
+ <property name="osCommands">\r
+ <map>\r
+ <entry key="Linux">\r
+ <list>\r
+ <value>ls</value>\r
+ </list>\r
+ </entry>\r
+ <entry key="Mac OS X">\r
+ <list>\r
+ <value>ls</value>\r
+ </list>\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="systemCallWithVar" parent="slcTemplate.simpleFlow">\r
+ <constructor-arg>\r
+ <bean parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="var">\r
+ <bean parent="specAttr.primitive" p:value="660" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+ </constructor-arg>\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.systemCall" scope="execution">\r
+ <property name="cmd" value="echo var=@{var}" />\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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
+ <import resource="imports.xml" /> \r
+\r
+ <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+ <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+\r
+ <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="myTestDef" />\r
+ <property name="testResult" ref="myTestResult"/>\r
+ </bean> \r
+ \r
+ <bean id="spec1" parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="testedComponentId">\r
+ <bean parent="specAttr.primitive" p:isParameter="true"\r
+ p:type="integer" />\r
+ </entry>\r
+ <entry key="testData1">\r
+ <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ p:isParameter="true" p:isFrozen="true" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flowTemplate1" parent="slcTemplate.simpleFlow"\r
+ abstract="true">\r
+ <constructor-arg ref="spec1" />\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo">\r
+ <property name="message" value="From basic @{testedComponentId}" />\r
+ </bean>\r
+ <bean parent="myTestRunTemplate">\r
+ <property name="testData">\r
+ <bean parent="parameterRef">\r
+ <constructor-arg value="testData1" />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+ <bean parent="task.echo">\r
+ <property name="message"><value>From basic @{testedComponentId}</value></property>\r
+ </bean> \r
+ <bean parent="task.echo">\r
+ <property name="message"><value>testData1='@{testData1}'</value></property>\r
+ </bean> \r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="flow1" parent="flowTemplate1" scope="prototype">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="testedComponentId" value="200" />\r
+ <entry key="testData1">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
+ <aop:scoped-proxy/>\r
+ <property name="expected" value="tata101" />\r
+ <property name="reached" value="tata@{testedComponentId}" />\r
+ </bean>\r
+ </entry>\r
+ </map> \r
+ </constructor-arg>\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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: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.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
+\r
+ <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />\r
+ <import resource="classpath:/org/argeo/slc/core/test/spring.xml" />\r
+\r
+ <bean id="testResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+ <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+\r
+ <bean id="testRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="testDef" />\r
+ <property name="testResult" ref="testResult"/>\r
+ </bean> \r
+\r
+ <flow:spec id="advanced.spec">\r
+ <description>spec description</description>\r
+ <flow:primitive name="param1" isParameter="true"\r
+ type="integer" />\r
+ <flow:primitive name="param2" isParameter="true"\r
+ type="integer" /> \r
+ </flow:spec>\r
+\r
+\r
+ <flow:flow id="advanced.flowTemplate" abstract="true" spec="advanced.spec"\r
+ path="/path">\r
+ <description>flow description</description>\r
+ <bean parent="task.echo">\r
+ <property name="message" value="Advanced: param1=@{param1}, param2=@{param2}" />\r
+ <flow:variable/>\r
+ </bean> \r
+ <flow:flow>\r
+ <bean parent="task.echo" p:message="Flow in Flow - param1=@{param1}, param2=@{param2} [Not variable]" />\r
+ </flow:flow>\r
+ \r
+ <bean parent="testRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <flow:variable/>\r
+ <property name="expected" value="@{param1}" />\r
+ <property name="reached" value="@{param2}" />\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ \r
+ </flow:flow>\r
+\r
+ <flow:flow id="advanced.flowTemplate2" abstract="true" spec="advanced.spec"\r
+ path="/path">\r
+ <bean parent="task.echo" p:message="Advanced2: param1=@{param1}, param2=@{param2}">\r
+ <flow:variable/>\r
+ </bean>\r
+ <flow:flow parent="advanced.flowTemplate">\r
+ <flow:arg name="param1" value="@{param1}"/>\r
+ <flow:arg name="param2">\r
+ <!-- flow:param in flow:arg -->\r
+ <flow:param name="param2" />\r
+ </flow:arg>\r
+ </flow:flow>\r
+ </flow:flow>\r
+\r
+ \r
+ <flow:flow id="flow1" parent="advanced.flowTemplate">\r
+ <flow:arg name="param1" value="1" />\r
+ <flow:arg name="param2" value="1" />\r
+ </flow:flow>\r
+ \r
+ <flow:flow id="flow2">\r
+ <flow:flow parent="advanced.flowTemplate">\r
+ <flow:arg name="param1" value="2" />\r
+ <flow:arg name="param2" value="2" />\r
+ </flow:flow>\r
+ </flow:flow>\r
+\r
+ <flow:flow id="flow3" parent="advanced.flowTemplate2">\r
+ <flow:arg name="param1" value="3" />\r
+ <flow:arg name="param2" value="3" />\r
+ </flow:flow>\r
+ \r
+ <flow:flow id="flow4" parent="advanced.flowTemplate">\r
+ <description>Would fail if param 2 is not changed at execution</description>\r
+ <flow:arg name="param1" value="4" />\r
+ <flow:arg name="param2" value="3" />\r
+ </flow:flow> \r
+\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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: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.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans:beans xmlns="http://www.argeo.org/schema/slc-flow"\r
+ xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:p="http://www.springframework.org/schema/p"\r
+ xsi:schemaLocation="\r
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+ http://www.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
+\r
+ <flow id="canonic-ns.002" parent="canonic-ns.flowTemplate">\r
+ <arg name="parameterAtInstantiation" value="2" />\r
+ <arg name="displayWithoutControl" value="102" />\r
+ <arg name="displayWithControl" value="202" />\r
+ <arg name="hide" value="202" />\r
+ <arg name="refWithoutValue">\r
+ <beans:bean id="testDataOk" p:expected="tata" p:reached="tata"\r
+ class="org.argeo.slc.core.test.BasicTestData" />\r
+ </arg>\r
+ </flow>\r
+</beans:beans>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans:beans xmlns="http://www.argeo.org/schema/slc-flow"\r
+ xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xmlns:p="http://www.springframework.org/schema/p" 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/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
+ <beans:import resource="classpath:org/argeo/slc/core/execution/spring.xml" />\r
+ <beans:import resource="classpath:/org/argeo/slc/core/test/spring.xml" />\r
+\r
+ <beans:import resource="canonic-ns-001.xml" />\r
+ <beans:import resource="canonic-ns-002.xml" />\r
+ <beans:import resource="tests.xml" />\r
+\r
+ <!--\r
+ Specifications definition is greatly simplified by the flow namespace\r
+ -->\r
+ <spec id="canonic-ns.spec">\r
+ <primitive name="parameterAtInstantiation" isParameter="true"\r
+ type="integer" />\r
+ <primitive name="displayWithoutControl" value="100"\r
+ isParameter="true" type="integer" isFrozen="true" />\r
+ <primitive name="displayWithControl" value="200"\r
+ isParameter="true" type="integer" />\r
+ <primitive name="hide" value="300" isParameter="true" type="integer"\r
+ isHidden="true" />\r
+ <ref name="refWithValue" targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ isParameter="true" ref="testDataNok" />\r
+ <ref name="refWithoutValue" targetClass="org.argeo.slc.core.test.BasicTestData" />\r
+ <ref name="refWithoutValueFrozen" targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ isParameter="true" isFrozen="true">\r
+ <value>\r
+ <beans:bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <aop:scoped-proxy />\r
+ <beans:property name="expected" value="tata" />\r
+ <beans:property name="reached" value="tata" />\r
+ </beans:bean>\r
+ </value>\r
+ </ref>\r
+ </spec>\r
+\r
+ <flow id="canonic-ns.flowTemplate" abstract="true" spec="canonic-ns.spec"\r
+ path="/path">\r
+ <beans:bean parent="task.echo"\r
+ p:message="Canonical: displayWithControl=@{displayWithControl}, displayWithoutControl=@{displayWithoutControl}, hide=@{hide}"\r
+ scope="execution">\r
+ <aop:scoped-proxy />\r
+ </beans:bean>\r
+ <beans:ref bean="testRun" />\r
+ </flow>\r
+\r
+ <beans:bean id="testDataOk" class="org.argeo.slc.core.test.BasicTestData">\r
+ <aop:scoped-proxy />\r
+ <beans:property name="expected" value="tata" />\r
+ <beans:property name="reached" value="tata" />\r
+ </beans:bean>\r
+\r
+ <beans:bean id="testDataNok" class="org.argeo.slc.core.test.BasicTestData">\r
+ <aop:scoped-proxy />\r
+ <beans:property name="expected" value="tata" />\r
+ <beans:property name="reached" value="toto" />\r
+ </beans:bean>\r
+</beans:beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\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:flow="http://www.argeo.org/schema/slc-flow" 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
+ http://www.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
+\r
+ <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />\r
+ <import resource="classpath:/org/argeo/slc/core/test/spring.xml" />\r
+\r
+ <bean id="testResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
+\r
+ <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+\r
+ <bean id="testRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
+ <property name="testDefinition" ref="testDef" />\r
+ <property name="testResult" ref="testResult"/>\r
+ </bean> \r
+\r
+ <flow:spec id="test.list.spec">\r
+ <flow:ref name="list1" targetClass="java.util.List">\r
+ <flow:value>\r
+ <!-- a list element can be used directly as default value-->\r
+ <list>\r
+ <value>val1</value>\r
+ </list>\r
+ </flow:value>\r
+ </flow:ref>\r
+ <flow:ref name="list2" targetClass="java.util.List" />\r
+ <!-- following parameters are not used in flow -->\r
+ <flow:ref name="dummyMap" targetClass="java.util.Map">\r
+ <flow:value>\r
+ <map></map>\r
+ </flow:value>\r
+ </flow:ref>\r
+ <flow:ref name="dummySet" targetClass="java.util.Set">\r
+ <flow:value>\r
+ <set></set>\r
+ </flow:value>\r
+ </flow:ref>\r
+ <flow:ref name="dummyProperties" targetClass="java.util.Properties">\r
+ <flow:value>\r
+ <props></props>\r
+ </flow:value>\r
+ </flow:ref>\r
+ \r
+ </flow:spec>\r
+\r
+\r
+ <flow:flow id="test.list.flowTemplate" abstract="true" spec="test.list.spec"\r
+ path="/path">\r
+ <bean parent="task.echo">\r
+ <property name="message" value="list1=@{list1}, list2=@{list2}" />\r
+ <flow:variable/>\r
+ </bean> \r
+\r
+ <bean parent="testRunTemplate">\r
+ <property name="testData">\r
+ <bean class="org.argeo.slc.core.test.BasicTestData">\r
+ <property name="expected">\r
+ <flow:param name="list1"/>\r
+ </property>\r
+ <property name="reached">\r
+ <flow:param name="list2"/>\r
+ </property>\r
+ </bean>\r
+ </property> \r
+ </bean>\r
+ \r
+ </flow:flow>\r
+\r
+ <flow:flow id="test.list.flow1" parent="test.list.flowTemplate">\r
+ <flow:arg name="list1">\r
+ <list>\r
+ <value>val1</value>\r
+ <value>val2</value> \r
+ </list>\r
+ </flow:arg>\r
+ <flow:arg name="list2">\r
+ <list>\r
+ <value>val1</value>\r
+ <value>val2</value> \r
+ </list>\r
+ </flow:arg>\r
+ \r
+ <!-- not used in flow (just to test that the syntax is accepted): -->\r
+ <flow:arg name="dummyMap">\r
+ <map></map>\r
+ </flow:arg>\r
+ <flow:arg name="dummySet">\r
+ <set></set>\r
+ </flow:arg>\r
+ <flow:arg name="dummyProperties">\r
+ <props></props>\r
+ </flow:arg> \r
+ \r
+ </flow:flow>\r
+ \r
+ <flow:flow id="test.list.flow2" parent="test.list.flowTemplate">\r
+ <description>use default value for parameter "list1"</description>\r
+ <flow:arg name="list2">\r
+ <list>\r
+ <value>val1</value>\r
+ </list>\r
+ </flow:arg>\r
+ </flow:flow>\r
+\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flow="http://www.argeo.org/schema/slc-flow"\r
+ xmlns:p="http://www.springframework.org/schema/p" 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/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
+ <bean id="testRun" class="org.argeo.slc.core.test.SimpleTestRun">\r
+ <property name="testDefinition">\r
+ <bean class="org.argeo.slc.core.test.BasicTestDefinition" />\r
+ </property>\r
+ <property name="testData">\r
+ <flow:param name="refWithValue" />\r
+ </property>\r
+ <!-- <property name="testData">-->\r
+ <!-- <bean parent="parameterRef">-->\r
+ <!-- <constructor-arg value="refWithValue" />-->\r
+ <!-- </bean>-->\r
+ <!-- </property>-->\r
+ <property name="testResult">\r
+ <bean parent="slcDefault.test.basicSimpleTestResult" scope="execution">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="displayWithControl" value="@{displayWithControl}" />\r
+ </map>\r
+ </property>\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <bean id="parentContext.pc1" parent="parentContext.template">\r
+ <property name="values">\r
+ <map>\r
+ <entry key="rootvar" value="text" />\r
+ </map>\r
+ </property>\r
+ <property name="expectedValues">\r
+ <map>\r
+ <entry key="reference" value="20" />\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="context.c1" parent="context.template">\r
+ <property name="parentContext" ref="parentContext.pc1" />\r
+ <property name="values">\r
+ <map>\r
+ <entry key="reference" value="20" />\r
+ <entry key="any" value="999" />\r
+ <entry key="skipped" value="999" />\r
+ </map>\r
+ </property>\r
+ <property name="expectedValues">\r
+ <map>\r
+ <entry key="reference" value="21" />\r
+ <entry key="any" value="*" />\r
+ <entry key="skipped" value="!" />\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="context.c2" parent="context.template">\r
+ <property name="parentContext" ref="parentContext.pc1" />\r
+ <property name="values">\r
+ <map>\r
+ <entry key="var" value="37" />\r
+ <entry key="bad" value="56" />\r
+ </map>\r
+ </property>\r
+ <property name="expectedValues">\r
+ <map>\r
+ <entry key="var" value="37" />\r
+ <entry key="bad" value="57" />\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="parentContext.pc2" parent="parentContext.template">\r
+ <property name="parentContext" ref="parentContext.pc1" />\r
+ <property name="expectedValues">\r
+ <map>\r
+ <entry key="reference" value="40" />\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="context.c3" parent="context.template">\r
+ <property name="parentContext" ref="parentContext.pc2" />\r
+ <property name="values">\r
+ <map>\r
+ <entry key="reference" value="41" />\r
+ <entry key="rootvar" value="textX" />\r
+ </map>\r
+ </property>\r
+ <property name="expectedValues">\r
+ <map>\r
+ <entry key="reference" value="40" />\r
+ <entry key="rootvar" value="text" />\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+\r
+ <bean id="parentContext.template"\r
+ class="org.argeo.slc.core.test.context.SimpleParentContextAware"\r
+ abstract="true">\r
+ </bean>\r
+\r
+ <bean id="context.template"\r
+ class="org.argeo.slc.core.test.context.SimpleContextAware"\r
+ abstract="true">\r
+ </bean>\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.detached.launcher</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Mon Nov 17 14:48:56 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
--- /dev/null
+#Wed Sep 24 16:04:14 CEST 2008
+activeProfiles=
+eclipse.preferences.version=1
+filterResources=false
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+useMavenFolders=false
+version=1
--- /dev/null
+source.. = src/main/java/,\
+ src/main/resources/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.detached.launcher</artifactId>
+ <name>SLC Detached Launcher</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>
+ org.argeo.slc.detached.launcher.Main
+ </mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Bundle-RequiredExecutionEnvironment>J2SE-1.4</Bundle-RequiredExecutionEnvironment>
+ <Export-Package>
+ org.argeo.slc.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<assembly xmlns="http://maven.apache.org/POM/4.0.0"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">\r
+ <id>dist</id>\r
+ <includeBaseDirectory>false</includeBaseDirectory>\r
+ <formats>\r
+ <format>tar.gz</format>\r
+ </formats>\r
+ <fileSets>\r
+ <fileSet>\r
+ <directory>src/main/base</directory>\r
+ <outputDirectory></outputDirectory>\r
+ <fileMode>0755</fileMode>\r
+ </fileSet>\r
+ </fileSets>\r
+</assembly>
\ No newline at end of file
--- /dev/null
+@echo off\r
+\r
+rem Target application\r
+set JAVA_HOME=[the target JRE]\r
+set SLC_USER_CLASSPATH=[classpath of the application to test]\r
+set SLC_DETACHED_APPCLASS=[main class of the application to test]\r
+set SLC_DETACHED_APPARGS=[arguments of the application to test]\r
+set SLC_DETACHED_JVM_ARGS=[additional JVM arguments]\r
+\r
+rem Runtime\r
+set PROJECT_BASE=[base of the project to being developed]\r
+set SLC_WORK_DIR=%PROJECT_BASE%/src/main/slc/work\r
+set SLC_USER_BUNDLES=reference:file:%PROJECT_BASE%/target/classes\r
+\r
--- /dev/null
+@echo off
+echo SLC Detached
+set SLC_HOME=%~dp0..
+echo SLC_HOME=%SLC_HOME%
+set SLC_LIB_DETACHED=%SLC_HOME%\lib\detached
+
+call slc-detached-settings.bat
+
+rem FOR %%f IN (%SLC_HOME%\lib\detached\*.jar) DO set CLASSPATH=%CLASSPATH%;%%f
+FOR %%f IN (%SLC_HOME%\lib\detached\org.argeo.slc.detached.launcher-*.jar) DO set SLC_DETACHED_LAUNCHER_JAR=%%f
+FOR %%f IN (%SLC_HOME%\lib\org.argeo.slc.detached-*.jar) DO set SLC_DETACHED_JAR=%%f
+
+set CLASSPATH=%SLC_DETACHED_LAUNCHER_JAR%;%SLC_USER_CLASSPATH%;%SLC_LIB_DETACHED%\com.springsource.org.aopalliance-1.0.0.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.commons.io-1.4.0.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.commons.logging-1.1.1.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.log4j-1.2.15.jar;%SLC_LIB_DETACHED%\org.apache.felix.main-1.2.1.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.xerces-2.8.1.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.xalan-2.7.0.jar
+
+set CMD=%JAVA_HOME%\bin\java %SLC_DETACHED_JVM_ARGS% -Dslc.detached.jar=%SLC_DETACHED_JAR% -Dslc.home=%SLC_HOME% -Dslc.workDir=%SLC_WORK_DIR% "-Dslc.detached.userBundles=%SLC_USER_BUNDLES%" -Dslc.detached.appclass=%SLC_DETACHED_APPCLASS% "-Dslc.detached.appargs=%SLC_DETACHED_APPARGS%" -classpath %CLASSPATH% org.argeo.slc.detached.launcher.Main
+rem echo CMD=%CMD%
+
+start %CMD%
+
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.launcher;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.TreeMap;
+import java.util.Vector;
+
+import org.eclipse.core.runtime.adaptor.EclipseStarter;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+public class Main {
+ public final static String PROP_SLC_HOME = "slc.home";
+ public final static String PROP_SLC_DETACHED_PROEPRTIES = "slc.detached.properties";
+ public final static String PROP_SLC_OSGI_START = "slc.osgi.start";
+ public final static String PROP_SLC_OSGI_SCAN_CLASSPATH = "slc.osgi.scanClasspath";
+ public final static String PROP_SLC_OSGI_EQUINOX_ARGS = "slc.osgi.equinox.args";
+
+ private final static String DEV_BUNDLE_PREFIX = "slc.osgi.devbundle.";
+
+ public static void main(String[] args) {
+ info("Argeo SLC Detached launcher starting...");
+ try {
+ // Load properties
+ String propertyPath = System.getProperty("slc.detached.properties",
+ "slc-detached.properties");
+ Properties config = prepareConfig(propertyPath);
+
+ // Start app (in main class loader)
+ startApp(config);
+
+ // Start OSGi framework
+ startEquinox(config);
+ info("Argeo SLC Detached launcher started.");
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ protected static Properties prepareConfig(String propertyFilePath)
+ throws Exception {
+ // Load config
+ Properties config = new Properties();
+ InputStream in = null;
+ try {
+ File file = new File(propertyFilePath);
+ if (file.exists()) {
+ in = new FileInputStream(propertyFilePath);
+ config.load(in);
+ }
+ } finally {
+ if (in != null)
+ in.close();
+ }
+
+ // Format slc.home
+ String slcHome = System.getProperty(Main.PROP_SLC_HOME);
+ if (slcHome == null) {
+ slcHome = config.getProperty(Main.PROP_SLC_HOME);
+ }
+ if (slcHome != null) {
+ slcHome = new File(slcHome).getCanonicalPath();
+ System.setProperty(Main.PROP_SLC_HOME, slcHome);
+ }
+
+ // System properties have priority.
+ config.putAll(System.getProperties());
+
+ // SET ALL PROPERTIES AS SYSTEM PROPERTIES
+ TreeMap ordered = new TreeMap(config);
+ for (Iterator it = ordered.keySet().iterator(); it.hasNext();) {
+ String key = it.next().toString();
+ String value = ordered.get(key).toString();
+ System.out.println(key + "=" + value);
+ System.setProperty(key, value);
+ }
+
+ return config;
+ }
+
+ public static void startEquinox(Properties config) throws Exception {
+ info("java.home=" + System.getProperty("java.home"));
+ info("java.class.path=" + System.getProperty("java.class.path"));
+
+ File baseDir = new File(System.getProperty("user.dir"))
+ .getCanonicalFile();
+ String equinoxConfigurationPath = baseDir.getPath() + File.separator
+ + "slc-detached" + File.separator + "equinoxConfiguration";
+
+ String equinoxArgsLineDefault = "-console -noExit -clean -debug -configuration "
+ + equinoxConfigurationPath;
+ String equinoxArgsLine = config.getProperty(PROP_SLC_OSGI_EQUINOX_ARGS,
+ equinoxArgsLineDefault);
+ // String[] equinoxArgs = { "-console", "-noExit", "-clean", "-debug",
+ // "-configuration", equinoxConfigurationPath };
+ String[] equinoxArgs = equinoxArgsLine.split(" ");
+
+ BundleContext context = EclipseStarter.startup(equinoxArgs, null);
+
+ List installBundleNames = new ArrayList();
+
+ // Load from class path (dev environment, maven)
+ if (config.getProperty(PROP_SLC_OSGI_SCAN_CLASSPATH, "false").equals(
+ "true")) {
+ StringTokenizer st = new StringTokenizer(System
+ .getProperty("java.class.path"), File.pathSeparator);
+ while (st.hasMoreTokens()) {
+ try {
+ String path = st.nextToken();
+ String url = "reference:file:"
+ + new File(path).getCanonicalPath();
+ Bundle bundle = context.installBundle(url);
+ if (bundle.getSymbolicName() != null)
+ installBundleNames.add(bundle.getSymbolicName());
+ info("Installed from classpath " + url);
+ } catch (Exception e) {
+ bundleInstallWarn(e.getMessage());
+ }
+ }
+ }
+
+ // Load from dev bundles
+ Map devBundleUrls = getDevBundleUrls(config);
+ Iterator devBundles = devBundleUrls.keySet().iterator();
+ while (devBundles.hasNext()) {
+ try {
+ String bundleName = (String) devBundles.next();
+ String url = (String) devBundleUrls.get(bundleName);
+ Bundle bundle = context.installBundle(url);
+ installBundleNames.add(bundle.getSymbolicName());
+ info("Installed as dev bundle " + url);
+ } catch (Exception e) {
+ bundleInstallWarn(e.getMessage());
+ }
+ }
+
+ // Load from distribution
+ String slcHome = config.getProperty(PROP_SLC_HOME);
+ if (slcHome != null) {
+ File libDir = new File(slcHome + File.separator + "lib");
+ File[] bundleFiles = libDir.listFiles();
+ for (int i = 0; i < bundleFiles.length; i++) {
+ try {
+ String url = "reference:file:"
+ + bundleFiles[i].getCanonicalPath();
+ Bundle bundle = context.installBundle(url);
+ installBundleNames.add(bundle.getSymbolicName());
+ info("INFO: Installed from SLC home " + url);
+ } catch (Exception e) {
+ bundleInstallWarn(e.getMessage());
+ }
+
+ }
+ }
+
+ // Start bundles
+ String bundleStart = config.getProperty(PROP_SLC_OSGI_START,
+ "org.springframework.osgi.extender,org.argeo.slc.detached");
+
+ if (bundleStart.trim().equals("*")) {
+ for (int i = 0; i < installBundleNames.size(); i++) {
+ Object obj = installBundleNames.get(i);
+ if (obj != null) {
+ String bundleSymbolicName = obj.toString();
+ try {
+ startBundle(context, bundleSymbolicName);
+ } catch (Exception e) {
+ bundleInstallWarn("Cannot start " + bundleSymbolicName
+ + ": " + e.getMessage());
+ }
+ }
+ }
+ } else {
+ StringTokenizer stBundleStart = new StringTokenizer(bundleStart,
+ ",");
+ while (stBundleStart.hasMoreTokens()) {
+ String bundleSymbolicName = stBundleStart.nextToken();
+ startBundle(context, bundleSymbolicName);
+ }
+ }
+ }
+
+ private static Map getDevBundleUrls(Properties config) {
+ Map bundles = new Hashtable();
+ Iterator keys = config.keySet().iterator();
+ while (keys.hasNext()) {
+ String key = (String) keys.next();
+ if (key.startsWith(DEV_BUNDLE_PREFIX)) {
+ String bundle = key.substring(DEV_BUNDLE_PREFIX.length());
+ String path = config.getProperty(key);
+ bundles.put(bundle, path);
+ }
+ }
+ return bundles;
+ }
+
+ private static void startBundle(BundleContext bundleContext,
+ String symbolicName) throws BundleException {
+ // info("Starting bundle " + symbolicName + "...");
+ Bundle bundle = findBundleBySymbolicName(bundleContext, symbolicName);
+ if (bundle != null)
+ bundle.start();
+ else
+ throw new RuntimeException("Bundle " + symbolicName + " not found");
+ info("Started " + symbolicName);
+ }
+
+ /** WARNING: return the first one found! */
+ private static Bundle findBundleBySymbolicName(BundleContext bundleContext,
+ String symbolicName) {
+ Bundle[] bundles = bundleContext.getBundles();
+ for (int i = 0; i < bundles.length; i++) {
+ Bundle bundle = bundles[i];
+ String bundleSymbolicName = bundle.getSymbolicName();
+ if (bundleSymbolicName != null) {
+ // throw new RuntimeException("Bundle " + bundle.getBundleId()
+ // + " (" + bundle.getLocation()
+ // + ") has no symbolic name.");
+
+ if (bundleSymbolicName.equals(symbolicName)) {
+ return bundle;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static void startApp(Properties config) throws Exception {
+ String className = config.getProperty("slc.detached.appclass");
+ String[] uiArgs = readArgumentsFromLine(config.getProperty(
+ "slc.detached.appargs", ""));
+
+ if (className == null) {
+ info("No slc.detached.appclass property define: does not try to launch an app from the standard classpath.");
+ } else {
+ // Launch main method using reflection
+ Class clss = Class.forName(className);
+ Class[] mainArgsClasses = new Class[] { uiArgs.getClass() };
+ Object[] mainArgs = { uiArgs };
+ Method mainMethod = clss.getMethod("main", mainArgsClasses);
+ mainMethod.invoke(null, mainArgs);
+ }
+ }
+
+ /* UTILITIES */
+
+ /**
+ * Transform a line into an array of arguments, taking "" as single
+ * arguments. (nested \" are not supported)
+ */
+ private static String[] readArgumentsFromLine(String lineOrig) {
+
+ String line = lineOrig.trim();// remove trailing spaces
+ // System.out.println("line=" + line);
+ List args = new Vector();
+ StringBuffer curr = new StringBuffer("");
+ boolean inQuote = false;
+ char[] arr = line.toCharArray();
+ for (int i = 0; i < arr.length; i++) {
+ char c = arr[i];
+ switch (c) {
+ case '\"':
+ inQuote = !inQuote;
+ break;
+ case ' ':
+ if (!inQuote) {// otherwise, no break: goes to default
+ if (curr.length() > 0) {
+ args.add(curr.toString());
+ curr = new StringBuffer("");
+ }
+ break;
+ }
+ default:
+ curr.append(c);
+ break;
+ }
+ }
+
+ // Add last arg
+ if (curr.length() > 0) {
+ args.add(curr.toString());
+ curr = null;
+ }
+
+ String[] res = new String[args.size()];
+ for (int i = 0; i < args.size(); i++) {
+ res[i] = args.get(i).toString();
+ // System.out.println("res[i]=" + res[i]);
+ }
+ return res;
+ }
+
+ private static void info(Object obj) {
+ System.out.println("[INFO] " + obj);
+ }
+
+ private static void bundleInstallWarn(Object obj) {
+ System.err.println("[WARN] " + obj);
+ // Thread.dumpStack();
+ }
+}
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+# Slc\r
+log4j.logger.org.argeo.slc=DEBUG\r
+log4j.logger.org.springframework=WARN\r
+\r
+## Appenders\r
+# A1 is set to be a ConsoleAppender.\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+\r
+# A1 uses PatternLayout.\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c %n\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.detached</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Sat Nov 22 15:15:12 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
--- /dev/null
+#Thu Sep 18 18:28:43 CEST 2008
+activeProfiles=
+eclipse.preferences.version=1
+filterResources=false
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+useMavenFolders=false
+version=1
--- /dev/null
+source.. = src/main/java/,\
+ src/main/resources/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.detached</artifactId>
+ <name>SLC Detached</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Bundle-RequiredExecutionEnvironment>J2SE-1.4</Bundle-RequiredExecutionEnvironment>
+ <Export-Package>
+ org.argeo.slc.detached.*
+ </Export-Package>
+ <Import-Package>
+ org.w3c.dom;version="0.0.0",
+ javax.xml.*;version="0.0.0",
+ org.springframework.core,
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.osgi.extender</artifactId>
+ </dependency>
+
+ <!-- Required under JDK 1.4 -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>edu.emory.mathcs.backport</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.xmlcommons</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.org.apache.commons.logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.log4j</artifactId>
+ </dependency>
+
+ <!-- JRE 1.4 -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.xerces</artifactId>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+public class AppLauncher {
+ private Properties systemProperties = new Properties();
+ private String mainClass = null;
+ private List arguments = new ArrayList();
+
+ public void launch() {
+
+ Properties base = System.getProperties();
+ Properties fake = new Properties(base);
+
+ try {
+ if (mainClass == null)
+ throw new DetachedException(
+ "A main class name has to be specified.");
+
+ System.getProperties().putAll(systemProperties);
+
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ Class clss = cl.loadClass(mainClass);
+
+ String[] args = new String[arguments.size()];
+ for (int i = 0; i < arguments.size(); i++) {
+ args[i] = arguments.get(i).toString();
+ }
+
+ Class[] mainArgsClasses = new Class[] { args.getClass() };
+ Object[] mainArgs = { args };
+ Method mainMethod = clss.getMethod("main", mainArgsClasses);
+
+ System.setProperties(fake);
+
+ mainMethod.invoke(null, mainArgs);
+
+ } catch (Exception e) {
+ throw new DetachedException("Unexpected exception while launching "
+ + mainClass, e);
+ } finally {
+ System.setProperties(base);
+ }
+
+ }
+
+ public void setSystemProperties(Properties systemProperties) {
+ this.systemProperties = systemProperties;
+ }
+
+ public void setMainClass(String mainClass) {
+ this.mainClass = mainClass;
+ }
+
+ public void setArguments(List arguments) {
+ this.arguments = arguments;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+public interface DetachedAdminCommand {
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.util.Properties;
+
+/** An answer returned by the detached server. Always related to a request. */
+public class DetachedAnswer implements DetachedCommunication {
+ static final long serialVersionUID = 1l;
+
+ public final static int UNKOWN = -1;
+ public final static int PROCESSED = 0;
+ public final static int ERROR = 1;
+ public final static int SKIPPED = 2;
+ public final static int CLOSED_SESSION = 10;
+
+ private Properties properties = new Properties();
+ private int status = UNKOWN;
+ private String log;
+ private String uuid;
+
+ public DetachedAnswer() {
+
+ }
+
+ public DetachedAnswer(DetachedRequest request) {
+ uuid = request.getUuid();
+ }
+
+ public DetachedAnswer(DetachedRequest request, String message) {
+ this(request);
+ log = message;
+ status = PROCESSED;
+ }
+
+ public Properties getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Properties outputParameters) {
+ this.properties = outputParameters;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int outputStatus) {
+ this.status = outputStatus;
+ }
+
+ public String getLog() {
+ return log;
+ }
+
+ public void setLog(String log) {
+ this.log = log;
+ }
+
+ public void addToLog(String msg) {
+ this.log = new StringBuffer(this.log).append(msg).toString();
+ }
+
+ /** The unique identifier of this answer. */
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getStatusAsString() {
+ return convertStatus(getStatus());
+ }
+
+ public static String convertStatus(int status) {
+ switch (status) {
+ case UNKOWN:
+ return "UNKOWN";
+ case PROCESSED:
+ return "PROCESSED";
+ case SKIPPED:
+ return "SKIPPED";
+ case ERROR:
+ return "ERROR";
+ case CLOSED_SESSION:
+ return "CLOSED_SESSION";
+ default:
+ throw new DetachedException("Unkown status " + status);
+ }
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer("detached answer ");
+ buf.append('#').append(uuid);
+ buf.append(" status=").append(convertStatus(status));
+ buf.append(" properties=").append(properties);
+ buf.append(" log=").append(log);
+ return buf.toString();
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+/**
+ * Sends Request and receives answers. Meant to be used on runtime side to
+ * communicate with a Detached.
+ */
+public interface DetachedClient {
+ public void sendRequest(DetachedRequest request) throws Exception;
+
+ /** Blocks until next answer. */
+ public DetachedAnswer receiveAnswer() throws Exception;
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.io.Serializable;
+
+/**
+ * Common interface for all communications between the source context and the
+ * detached server.
+ */
+public interface DetachedCommunication extends Serializable {
+ /** The unique identifier of this answer. */
+ public String getUuid();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.util.List;
+import java.util.Set;
+
+public interface DetachedContext {
+ public Object getDynamicRef(String ref);
+
+ public void setDynamicRef(String ref, Object obj);
+
+ public String getCurrentPath();
+
+ public List getExecutedPaths();
+
+ public Set getDynamicRefKeys();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.Vector;
+
+public class DetachedContextImpl implements DetachedContext {
+ private List executedPaths = new Vector();
+ private String currentPath;
+ private Map dynamicRefs = new TreeMap();
+
+ public String getCurrentPath() {
+ return currentPath;
+ }
+
+ public void setDynamicRef(String ref, Object obj) {
+ dynamicRefs.put(ref, obj);
+ }
+
+ public Object getDynamicRef(String ref) {
+ if (dynamicRefs.containsKey(ref))
+ return dynamicRefs.get(ref);
+ else
+ return null;
+ }
+
+ public List getExecutedPaths() {
+ return new ArrayList(executedPaths);
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer(getClass().getName());
+ buf.append(" currentPath=").append(currentPath);
+ buf.append(" executedPaths=").append(executedPaths);
+ return buf.toString();
+ }
+
+ public Set getDynamicRefKeys() {
+ return dynamicRefs.keySet();
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+/**
+ * Receives Request and sends answers. Meant to be used on detached side to
+ * communicate with the runtime.
+ */
+public interface DetachedDriver {
+ /** Blocks until it receives a request. */
+ public DetachedRequest receiveRequest() throws Exception;
+ public void sendAnswer(DetachedAnswer answer) throws Exception;
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+public class DetachedException extends RuntimeException {
+ static final long serialVersionUID = 1l;
+
+ public DetachedException(String message) {
+ super(message);
+ }
+
+ public DetachedException(String message, Exception cause) {
+ super(message, cause);
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+/**
+ * Interface between the detached and the source context via request and
+ * answers.
+ */
+public interface DetachedExecutionServer {
+ /** Actually executes the request. */
+ public DetachedAnswer executeRequest(DetachedRequest request);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.detached.admin.CloseSession;
+import org.argeo.slc.detached.admin.OpenSession;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.util.tracker.ServiceTracker;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.osgi.context.BundleContextAware;
+
+/** Default implementation of a detached server. */
+public class DetachedExecutionServerImpl implements DetachedExecutionServer,
+ BundleContextAware, InitializingBean, DisposableBean,
+ ApplicationContextAware {
+ private final static Log log = LogFactory
+ .getLog(DetachedExecutionServerImpl.class);
+
+ private final DetachedContextImpl detachedContext;
+
+ private DetachedSession currentSession;
+
+ /**
+ * Session being replayed, skipping the steps in the current session. If
+ * null, no session is replayed
+ */
+ private DetachedSession replayedSession = null;
+
+ private BundleContext bundleContext;
+ private ApplicationContext applicationContext;
+
+ private final static String ALL_APP_CONTEXTS_KEY = "__allApplicationContexts";
+
+ private Map/* <String,ServiceTracker> */appContextServiceTrackers = Collections
+ .synchronizedMap(new HashMap());
+
+ public DetachedExecutionServerImpl() {
+ detachedContext = new DetachedContextImpl();
+ currentSession = new DetachedSession();
+ currentSession.setUuid(Long.toString(System.currentTimeMillis()));
+ }
+
+ public synchronized DetachedAnswer executeRequest(DetachedRequest request) {
+ if(log.isDebugEnabled())
+ log.debug("Received " + request);
+
+ DetachedAnswer answer = null;
+ try {
+ Object obj = retrieveStep(request);
+
+ if (obj == null)
+ throw new DetachedException("Could not find action with ref "
+ + request.getRef());
+
+ // Execute actions
+ if (obj instanceof DetachedStep) {
+ answer = processStep((DetachedStep) obj, request);
+
+ } else if (obj instanceof DetachedAdminCommand) {
+ answer = processAdminCommand((DetachedAdminCommand) obj,
+ request);
+ }
+
+ if (answer == null) {
+ throw new DetachedException("Unknown action type "
+ + obj.getClass() + " for action with ref "
+ + request.getRef());
+ }
+ } catch (Exception e) {
+ answer = new DetachedAnswer(request);
+ answer.setStatus(DetachedAnswer.ERROR);
+ log.error("Error executing request " + request, e);
+ }
+
+ currentSession.getRequests().add(request);
+ currentSession.getAnswers().add(answer);
+ if(log.isDebugEnabled())
+ log.debug("Sent " + answer);
+ return answer;
+ }
+
+ protected synchronized Object retrieveStep(DetachedRequest request)
+ throws Exception {
+
+ // Check whether there is a cached object
+ if (request.getCachedObject() != null) {
+ Object cachedObj = request.getCachedObject();
+ if (log.isTraceEnabled())
+ log.trace("Use cached object " + cachedObj + " for request "
+ + request);
+ return cachedObj;
+ }
+
+ // Check its own app context (typically for admin steps)
+ if (applicationContext.containsBean(request.getRef())) {
+ try {
+ Object obj = applicationContext.getBean(request.getRef());
+ if (log.isTraceEnabled())
+ log.trace("Retrieve from server app context " + obj
+ + " for request " + request);
+ return obj;
+ } catch (Exception e) {
+ if (log.isTraceEnabled())
+ log.trace("Could not retrieve " + request.getRef()
+ + " from server app context: " + e);
+ }
+ }
+
+ // Check whether the source bundle is set
+ String bundleName = request.getProperties().getProperty(
+ Constants.BUNDLE_SYMBOLICNAME);
+
+ ApplicationContext sourceAppContext = null;
+ if (bundleName != null) {
+ if (!appContextServiceTrackers.containsKey(bundleName)) {
+ ServiceTracker nSt = new ServiceTracker(bundleContext,
+ bundleContext.createFilter("(Bundle-SymbolicName="
+ + bundleName + ")"), null);
+ nSt.open();
+ appContextServiceTrackers.put(bundleName, nSt);
+ }
+ ServiceTracker st = (ServiceTracker) appContextServiceTrackers
+ .get(bundleName);
+ sourceAppContext = (ApplicationContext) st.getService();
+ if (log.isTraceEnabled())
+ log.trace("Use source application context from bundle "
+ + bundleName);
+
+ Object obj = null;
+ try {
+ obj = sourceAppContext.getBean(request.getRef());
+ } catch (Exception e) {
+ if (log.isTraceEnabled())
+ log.trace("Could not retrieve " + request.getRef()
+ + " from app context of " + bundleName + ": " + e);
+ }
+ return obj;
+ }
+
+ // no bundle name specified or it failed
+ if (!appContextServiceTrackers.containsKey(ALL_APP_CONTEXTS_KEY)) {
+ ServiceTracker nSt = new ServiceTracker(bundleContext,
+ ApplicationContext.class.getName(), null);
+ nSt.open();
+ appContextServiceTrackers.put(ALL_APP_CONTEXTS_KEY, nSt);
+ }
+ ServiceTracker st = (ServiceTracker) appContextServiceTrackers
+ .get(ALL_APP_CONTEXTS_KEY);
+ Object[] arr = st.getServices();
+ for (int i = 0; i < arr.length; i++) {
+ ApplicationContext appC = (ApplicationContext) arr[i];
+ if (appC.containsBean(request.getRef())) {
+ sourceAppContext = appC;
+ if (log.isTraceEnabled())
+ log
+ .trace("Retrieved source application context "
+ + "by scanning all published application contexts.");
+ try {
+ Object obj = sourceAppContext.getBean(request.getRef());
+ return obj;
+ } catch (Exception e) {
+ if (log.isTraceEnabled())
+ log.trace("Could not retrieve " + request.getRef()
+ + " from app context " + appC + ": " + e);
+ }
+ }
+ }
+
+ throw new Exception(
+ "Cannot find any published application context containing bean "
+ + request.getRef());
+ }
+
+ protected synchronized DetachedAnswer processStep(DetachedStep obj,
+ DetachedRequest request) {
+ DetachedAnswer answer;
+
+ StringBuffer skippedLog = new StringBuffer();
+ boolean execute = true;
+
+ if (replayedSession != null) {
+ // Skip execution of already successful steps
+ int stepIndex = currentSession.getExecutedStepCount();
+
+ if (stepIndex < replayedSession.getExecutedStepCount()) {
+ DetachedAnswer previousAnswer = (DetachedAnswer) replayedSession
+ .getAnswers().get(stepIndex);
+ DetachedRequest previousRequest = (DetachedRequest) replayedSession
+ .getRequests().get(stepIndex);
+
+ // check step names
+ if (!previousRequest.getRef().equals(request.getRef())) {
+ String msg = "New request is not consistent with previous ref. previousRef="
+ + previousRequest.getRef()
+ + ", newRef="
+ + request.getRef() + "\n";
+ skippedLog.append(msg);
+ log.warn(msg);
+ }
+
+ if (previousAnswer.getStatus() != DetachedAnswer.ERROR) {
+ // if no error occurred in the replayedSession,
+ // skip the step
+ execute = false;
+ String msg = "Skipped Step " + request.getRef()
+ + " (stepIndex=" + stepIndex + ")";
+ skippedLog.append(msg);
+ log.info(msg);
+
+ } else {
+ // if an error occurred, execute the step and leave
+ // skipUntillError mode (even if replayedSession
+ // has more steps)
+ log.info("### End of SkipUntilError Mode ###");
+ log.info("Step " + request.getRef()
+ + " was previously in error, executing it again."
+ + " (stepIndex=" + stepIndex + ").");
+ replayedSession = null;
+ }
+ } else {
+ // went further as skip count, doing nothing.
+ }
+ }
+
+ if (execute) {
+ DetachedStep step = (DetachedStep) obj;
+ // Actually execute the step
+ answer = step.execute(detachedContext, request);
+ } else {
+ answer = new DetachedAnswer(request);
+ answer.setStatus(DetachedAnswer.SKIPPED);
+ answer.setLog(skippedLog.toString());
+ }
+ return answer;
+ }
+
+ protected synchronized DetachedAnswer processAdminCommand(
+ DetachedAdminCommand obj, DetachedRequest request) {
+ DetachedAnswer answer;
+ if (obj instanceof OpenSession) {
+ DetachedSession newSession = ((OpenSession) obj).execute(request,
+ bundleContext);
+
+ log.debug("Creating new DetachedSession : " + newSession);
+
+ if ((currentSession != null) && currentSession.lastActionIsError()
+ && DetachedSession.SKIP_UNTIL_ERROR.equals(newSession.getDoItAgainPolicy())) {
+ // switch to replay mode
+ log.info("### Start SkipUntilError Mode ###");
+ replayedSession = currentSession;
+ }
+
+ currentSession = newSession;
+
+ answer = new DetachedAnswer(request, "Session #"
+ + currentSession.getUuid() + " open.");
+ } else if (obj instanceof CloseSession) {
+ if (currentSession == null)
+ throw new DetachedException("There is no open session to close");
+ answer = new DetachedAnswer(request, "Session #"
+ + currentSession.getUuid() + " closed.");
+ answer.setStatus(DetachedAnswer.CLOSED_SESSION);
+ } else {
+ answer = null;
+ }
+ return answer;
+ }
+
+ protected synchronized String dumpSessionsHistory(
+ DetachedRequest requestCurrent, DetachedAnswer answerCurrent) {
+ StringBuffer buf = new StringBuffer(
+ "##\n## SESSIONS HISTORY DUMP\n##\n");
+ buf.append("# CURRENT\n");
+ buf.append("Current session: ").append(currentSession)
+ .append('\n');
+ buf.append("Current request: ").append(requestCurrent).append('\n');
+ buf.append("Current answer: ").append(answerCurrent).append('\n');
+
+ buf.append("# CURRENT SESSION\n");
+
+ List requests = currentSession.getRequests();
+ List answers = currentSession.getAnswers();
+ for (int j = 0; j < requests.size(); j++) {
+ DetachedRequest request = (DetachedRequest) requests.get(j);
+ buf.append('\t').append(j).append(". ").append(request)
+ .append('\n');
+ if (answers.size() > j) {
+ DetachedAnswer answer = (DetachedAnswer) answers.get(j);
+ buf.append('\t').append(j).append(". ").append(answer).append(
+ '\n');
+ }
+ }
+
+ buf.append("# DETACHED CONTEXT\n");
+ buf.append(detachedContext).append('\n');
+
+ buf.append("##\n## END OF SESSIONS HISTORY DUMP\n##\n");
+ return buf.toString();
+ }
+
+ public void setBundleContext(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ log.debug("Detached execution server initialized.");
+ }
+
+ public synchronized void destroy() throws Exception {
+ Iterator/* <String> */keys = appContextServiceTrackers.keySet()
+ .iterator();
+ while (keys.hasNext()) {
+ ServiceTracker st = (ServiceTracker) appContextServiceTrackers
+ .get(keys.next());
+ st.close();
+ }
+ appContextServiceTrackers.clear();
+
+ log.debug("Detached execution server closed.");
+ }
+
+ public void setApplicationContext(ApplicationContext applicationContext) {
+ this.applicationContext = applicationContext;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.util.Properties;
+
+/** A request sent to the detached server. */
+public class DetachedRequest implements DetachedCommunication {
+ static final long serialVersionUID = 1l;
+
+ private String uuid;
+ private Properties properties = new Properties();
+ private String ref;
+
+ private Object cachedObject = null;
+
+ public DetachedRequest() {
+
+ }
+
+ public DetachedRequest(String uuid) {
+ this.uuid = uuid;
+ }
+
+ /** The properties configuring this request. */
+ public Properties getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Properties inputParameters) {
+ this.properties = inputParameters;
+ }
+
+ /**
+ * A reference to the underlying implementation which will process the
+ * request.
+ */
+ public String getRef() {
+ return ref;
+ }
+
+ public void setRef(String stepRef) {
+ this.ref = stepRef;
+ }
+
+ /** The unique identifier of this request. */
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer("detached request for ref ");
+ buf.append(ref);
+ buf.append(" #").append(uuid);
+ buf.append(" cachedObject=").append((cachedObject != null));
+ buf.append(" properties=").append(properties);
+ return buf.toString();
+ }
+
+ /**
+ * Optimization. Allows the driver to eagerly cache the object in the
+ * request, in order to relieve the detached server of the task to look for
+ * it. No implementation should rely on this to be set.
+ */
+ public Object getCachedObject() {
+ return cachedObject;
+ }
+
+ public void setCachedObject(Object cachedObject) {
+ this.cachedObject = cachedObject;
+ }
+
+}
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.detached;\r
+\r
+import org.apache.commons.logging.Log;\r
+import org.apache.commons.logging.LogFactory;\r
+import org.osgi.framework.BundleContext;\r
+import org.osgi.framework.Constants;\r
+import org.springframework.beans.BeansException;\r
+import org.springframework.context.ApplicationContext;\r
+import org.springframework.context.ApplicationContextAware;\r
+import org.springframework.osgi.context.BundleContextAware;\r
+\r
+/**\r
+ * When started, processes <code>DetachedRequest</code> through a\r
+ * <code>DetachedExecutionServer</code> and sends <code>DetachedAnswer</code>\r
+ * back\r
+ */\r
+public class DetachedServer implements BundleContextAware, ApplicationContextAware {\r
+\r
+ private final static Log log = LogFactory.getLog(DetachedServer.class); \r
+ \r
+ private boolean active = true;\r
+ private DetachedExecutionServer executionServer = null;\r
+\r
+ private boolean cacheObjects = true;\r
+\r
+ /** May be null */\r
+ private ApplicationContext applicationContext;\r
+ /** May be null */\r
+ private BundleContext bundleContext;\r
+ \r
+ /**\r
+ * Used to receive Request and send answers\r
+ */\r
+ private DetachedDriver detachedDriver;\r
+\r
+ public synchronized void start() {\r
+\r
+ log.info("Starting DetachedServer");\r
+ \r
+ Thread driverThread = new Thread(new Runnable() {\r
+\r
+ public void run() {\r
+ while (active) {\r
+ try {\r
+ // no timeout to receive a request\r
+ DetachedRequest request = detachedDriver.receiveRequest();\r
+ if (!active)\r
+ break;\r
+\r
+ String driverBundleName = null;\r
+ if (bundleContext != null)\r
+ driverBundleName = bundleContext.getBundle()\r
+ .getSymbolicName();\r
+\r
+ if (applicationContext != null && cacheObjects) {\r
+ try {\r
+ String ref = request.getRef();\r
+ if (applicationContext.containsBean(ref)) {\r
+ Object obj = applicationContext\r
+ .getBean(request.getRef());\r
+ request.setCachedObject(obj);\r
+ if (log.isTraceEnabled())\r
+ log.trace("Cached bean '" + ref\r
+ + "' in request " + request);\r
+ } else {\r
+ log\r
+ .warn("Cannot cache object in request because no bean '"\r
+ + ref\r
+ + "' was found in application context"\r
+ + (driverBundleName != null ? " (driver bundle "\r
+ + driverBundleName\r
+ + ")"\r
+ : ""));\r
+ }\r
+ } catch (Exception e) {\r
+ if (log.isTraceEnabled())\r
+ log\r
+ .trace("Could not retrieve "\r
+ + request.getRef()\r
+ + " from driver application context because of "\r
+ + e);\r
+ driverBundleName = null;// do not publish bundle\r
+ // name\r
+ }\r
+ }\r
+\r
+ if (driverBundleName != null)\r
+ request.getProperties().put(\r
+ Constants.BUNDLE_SYMBOLICNAME,\r
+ driverBundleName);\r
+\r
+ DetachedAnswer answer = executionServer\r
+ .executeRequest(request);\r
+ detachedDriver.sendAnswer(answer);\r
+ } catch (Exception e) {\r
+ // if (e instanceof RuntimeException)\r
+ // throw (RuntimeException) e;\r
+ // else\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+\r
+ }\r
+ }, "driverThread (" + getClass() + ")");\r
+ driverThread.start();\r
+\r
+ }\r
+\r
+ public void setExecutionServer(DetachedExecutionServer executionServer) {\r
+ this.executionServer = executionServer;\r
+ }\r
+\r
+ public synchronized void stop() {\r
+ active = false;\r
+ notifyAll();\r
+ }\r
+\r
+ public synchronized boolean isActive() {\r
+ return active;\r
+ }\r
+\r
+ public synchronized void setActive(boolean active) {\r
+ this.active = active;\r
+ }\r
+\r
+ public void setApplicationContext(ApplicationContext applicationContext)\r
+ throws BeansException {\r
+ this.applicationContext = applicationContext;\r
+ }\r
+\r
+ public void setBundleContext(BundleContext bundleContext) {\r
+ this.bundleContext = bundleContext;\r
+ }\r
+\r
+ public void setCacheObjects(boolean cacheObjects) {\r
+ this.cacheObjects = cacheObjects;\r
+ }\r
+\r
+ public void setDetachedDriver(DetachedDriver detachedDriver) {\r
+ this.detachedDriver = detachedDriver;\r
+ } \r
+ \r
+}\r
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
+/** A session within the detached context. */
+public class DetachedSession {
+ public final static String PROP_DO_IT_AGAIN_POLICY = "slc.detached.doItAgainPolicy";
+ public final static String SKIP_UNTIL_ERROR = "skipUntilError";
+ public final static String REPLAY = "replay";
+
+ private String uuid = null;
+ private List requests = new Vector();
+ private List answers = new Vector();
+ private String doItAgainPolicy = REPLAY;
+ private List refreshedBundleNames = new ArrayList();
+
+ public boolean isClosed() {
+ if (answers.size() > 0) {
+ DetachedAnswer answer = (DetachedAnswer) answers
+ .get(answers.size() - 1);
+ return answer.getStatus() == DetachedAnswer.CLOSED_SESSION;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean lastActionIsError() {
+ if (answers.size() > 0) {
+ DetachedAnswer answer = (DetachedAnswer) answers
+ .get(answers.size() - 1);
+ return answer.getStatus() == DetachedAnswer.ERROR;
+ } else {
+ return false;
+ }
+ }
+
+ public int getExecutedStepCount() {
+ if(requests.size() != answers.size()) {
+ throw new DetachedException("requests.size() != answers.size() in DetachedSession");
+ }
+ return answers.size();
+ }
+
+ public String getDoItAgainPolicy() {
+ return doItAgainPolicy;
+ }
+
+ public void setDoItAgainPolicy(String doItAgainPolicy) {
+ this.doItAgainPolicy = doItAgainPolicy;
+ }
+
+ public List getRequests() {
+ return requests;
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public List getAnswers() {
+ return answers;
+ }
+
+ public List getRefreshedBundleNames() {
+ return refreshedBundleNames;
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer(getClass().getName());
+ buf.append("#").append(uuid);
+ buf.append(" doItAgainPolicy=").append(doItAgainPolicy);
+ return buf.toString();
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+
+public interface DetachedStep {
+ public DetachedAnswer execute(DetachedContext detachedContext,
+ DetachedRequest detachedStepRequest);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+public interface DetachedXmlConverter {
+ public void marshallCommunication(DetachedCommunication detCom,
+ Result result);
+
+ public DetachedCommunication unmarshallCommunication(Source source);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.Enumeration;
+import java.util.Properties;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * For compatibility with old JDKs (pre 1.5). Use Spring base one when possible.
+ */
+public class DetachedXmlConverterCompat implements DetachedXmlConverter {
+ public final static String SLC_DETACHED_NAMESPACE_URI = "http://argeo.org/projects/slc/schemas/detached";
+ private final static Log log = LogFactory
+ .getLog(DetachedXmlConverterCompat.class);
+
+ private final Transformer copy;
+
+ public DetachedXmlConverterCompat() {
+ try {
+ copy = TransformerFactory.newInstance().newTransformer();
+ } catch (Exception e) {
+ throw new DetachedException("Could not create transformer.", e);
+ }
+ }
+
+ public void marshallCommunication(DetachedCommunication detCom,
+ Result result) {
+ if (detCom instanceof DetachedRequest) {
+ marshallRequest((DetachedRequest) detCom, result);
+ } else if (detCom instanceof DetachedAnswer) {
+ marshallAnswer((DetachedAnswer) detCom, result);
+ } else {
+ throw new DetachedException("Unkown communication type "
+ + detCom.getClass());
+ }
+ }
+
+ public DetachedCommunication unmarshallCommunication(Source source) {
+ // Parse
+ DOMResult result = new DOMResult();
+ try {
+ copy.transform(source, result);
+ } catch (TransformerException e) {
+ throw new DetachedException("Could not copy xml source", e);
+ }
+
+ if (log.isTraceEnabled()) {
+ try {
+ DOMSource domSource = new DOMSource(result.getNode());
+ StringWriter stringWriter = new StringWriter();
+ StreamResult streamResult = new StreamResult(stringWriter);
+ copy.transform(domSource, streamResult);
+ log.trace("Unmarshall communication:\n"
+ + stringWriter.toString());
+ IOUtils.closeQuietly(stringWriter);
+ } catch (TransformerException e) {
+ log.warn("Could not log xml source", e);
+ }
+ }
+ Element root = (Element) ((Document) result.getNode())
+ .getDocumentElement();
+
+ // Create objects
+ String requestType = root.getLocalName();
+ if (requestType.equals("detached-request")) {
+ DetachedRequest request = new DetachedRequest();
+ request.setUuid(root.getElementsByTagNameNS(
+ SLC_DETACHED_NAMESPACE_URI, "uuid").item(0)
+ .getTextContent());
+ request
+ .setRef(root.getElementsByTagNameNS(
+ SLC_DETACHED_NAMESPACE_URI, "ref").item(0)
+ .getTextContent());
+ Element propertiesElement = (Element) root.getElementsByTagNameNS(
+ SLC_DETACHED_NAMESPACE_URI, "properties").item(0);
+ NodeList propElements = propertiesElement.getElementsByTagNameNS(
+ SLC_DETACHED_NAMESPACE_URI, "prop");
+ Properties properties = new Properties();
+ for (int i = 0; i < propElements.getLength(); i++) {
+ Element propElement = (Element) propElements.item(i);
+ String key = propElement.getAttribute("key");
+ String value = propElement.getTextContent();
+ properties.setProperty(key, value);
+ }
+ request.setProperties(properties);
+ return request;
+ } else {
+ throw new DetachedException(requestType + " not implemented.");
+ }
+ }
+
+ public void marshallAnswer(DetachedAnswer answer, Result result) {
+ StringBuffer buf = new StringBuffer("");
+ buf.append("<slc-det:detached-answer xmlns:slc-det=\""
+ + SLC_DETACHED_NAMESPACE_URI + "\">");
+ if (answer.getUuid() != null)
+ buf.append("<slc-det:uuid>").append(answer.getUuid()).append(
+ "</slc-det:uuid>");
+ buf.append("<slc-det:status>").append(answer.getStatus()).append(
+ "</slc-det:status>");
+ if (answer.getLog() != null)
+ buf.append("<slc-det:log>").append(answer.getLog()).append(
+ "</slc-det:log>");
+ if (answer.getProperties().size() != 0) {
+ buf.append("<slc-det:properties>");
+ Enumeration keys = answer.getProperties().keys();
+ while (keys.hasMoreElements()) {
+ String key = (String) keys.nextElement();
+ buf.append("<slc-det:prop key=\"").append(key).append("\">");
+ buf.append(answer.getProperties().getProperty(key));
+ buf.append("</slc-det:prop>");
+ }
+ buf.append("</slc-det:properties>");
+ }
+ buf.append("</slc-det:detached-answer>");
+ StringReader reader = new StringReader(buf.toString());
+ Source source = new StreamSource(reader);
+ try {
+ copy.transform(source, result);
+ } catch (TransformerException e) {
+ throw new DetachedException("Could not copy xml to result", e);
+ } finally {
+ IOUtils.closeQuietly(reader);
+ }
+ }
+
+ public void marshallRequest(DetachedRequest request, Result result) {
+ throw new DetachedException(" Not implemented.");
+ }
+
+ public DetachedRequest unmarshallRequest(Source source) {
+ DOMResult result = new DOMResult();
+ try {
+ copy.transform(source, result);
+ } catch (TransformerException e) {
+ throw new DetachedException("Could not copy xml source", e);
+ }
+ Element node = (Element) ((Document) result.getNode())
+ .getDocumentElement();
+ DetachedRequest request = new DetachedRequest();
+ request.setUuid(node.getElementsByTagNameNS(SLC_DETACHED_NAMESPACE_URI,
+ "uuid").item(0).getTextContent());
+ request.setRef(node.getElementsByTagNameNS(SLC_DETACHED_NAMESPACE_URI,
+ "ref").item(0).getTextContent());
+ Element propertiesElement = (Element) node.getElementsByTagNameNS(
+ SLC_DETACHED_NAMESPACE_URI, "properties").item(0);
+ NodeList propElements = propertiesElement.getElementsByTagNameNS(
+ SLC_DETACHED_NAMESPACE_URI, "prop");
+ Properties properties = new Properties();
+ for (int i = 0; i < propElements.getLength(); i++) {
+ Element propElement = (Element) propElements.item(i);
+ String key = propElement.getAttribute("key");
+ String value = propElement.getTextContent();
+ properties.setProperty(key, value);
+ }
+ request.setProperties(properties);
+ return request;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached;
+
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Dummy detached step which copies the request into the answer and log. Useful
+ * for testing.
+ */
+public class MirrorStep implements DetachedStep {
+ private final static Log log = LogFactory.getLog(MirrorStep.class);
+
+ public DetachedAnswer execute(DetachedContext detachedContext,
+ DetachedRequest req) {
+ log.debug(" uuid=" + req.getUuid());
+ log.debug(" ref=" + req.getRef());
+ log.debug(" properties=" + req.getProperties());
+
+ DetachedAnswer answer = new DetachedAnswer(req, "Mirror");
+ Properties answerProps = new Properties();
+ answerProps.putAll(req.getProperties());
+ answer.setProperties(answerProps);
+ return answer;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.admin;
+
+import org.argeo.slc.detached.DetachedAdminCommand;
+
+public class CloseSession implements DetachedAdminCommand {
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.admin;
+
+import org.argeo.slc.detached.DetachedAdminCommand;
+import org.argeo.slc.detached.DetachedAnswer;
+import org.argeo.slc.detached.DetachedException;
+import org.argeo.slc.detached.DetachedRequest;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public class FelixShellCommand implements DetachedAdminCommand {
+ public final static String PROP_FELIX_CMDLINE = "slc.detached.felix.cmdline";
+
+ public DetachedAnswer execute(DetachedRequest request,
+ BundleContext bundleContext) {
+ ServiceReference ref = bundleContext
+ .getServiceReference("org.apache.felix.shell.ShellService");
+ if (ref == null)
+ throw new DetachedException("Felix shell service not found.");
+
+ String cmdLine = request.getProperties()
+ .getProperty(PROP_FELIX_CMDLINE);
+ if (cmdLine == null)
+ throw new DetachedException("Property " + PROP_FELIX_CMDLINE
+ + " must be defined.");
+
+ // TODO: check were to put Felix dependency
+ // see http://felix.apache.org/site/apache-felix-shell-service.html
+ throw new DetachedException("Not yet implemented.");
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.admin;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkEvent;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * Wraps low-level access to a {@link BundleContext}. Hacked from the related
+ * class in org.argeo.slc.support.osgi.
+ */
+class MinimalBundlesManager implements FrameworkListener {
+ private final static Log log = LogFactory
+ .getLog(MinimalBundlesManager.class);
+
+ private final BundleContext bundleContext;
+
+ private long defaultTimeout = 10000l;
+ private final Object refreshedPackageSem = new Object();
+
+ public MinimalBundlesManager(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ bundleContext.addFrameworkListener(this);
+ }
+
+ protected void finalize() throws Throwable {
+ bundleContext.removeFrameworkListener(this);
+ }
+
+ /**
+ * @see #upgradeSynchronous(Bundle[])
+ */
+ public void upgradeSynchronous(Bundle bundle) {
+ upgradeSynchronous(new Bundle[] { bundle });
+ }
+
+ /**
+ * Stop the active bundles, update them, refresh them and restart the
+ * initially active bundles. All synchronously.
+ */
+ public void upgradeSynchronous(Bundle[] bundles) {
+ try {
+ // State (ACTIVE or other) before upgrading
+ int[] initialStates = new int[bundles.length];
+
+ // store initial state and stop active bundles
+ for (int i = 0; i < bundles.length; ++i) {
+ initialStates[i] = bundles[i].getState();
+ if (initialStates[i] == Bundle.ACTIVE) {
+ stopSynchronous(bundles[i]);
+ }
+ }
+
+ // update the bundles
+ for (int i = 0; i < bundles.length; ++i) {
+ updateSynchronous(bundles[i]);
+ }
+
+ // refresh the bundles
+ refreshSynchronous(bundles);
+
+ // restart the bundles that were ACTIVE before upgrading
+ for (int i = 0; i < bundles.length; ++i) {
+ if (initialStates[i] == Bundle.ACTIVE) {
+ startSynchronous(bundles[i]);
+
+ String filter = "(Bundle-SymbolicName="
+ + bundles[i].getSymbolicName() + ")";
+ // Wait for application context to be ready
+ // TODO: use service tracker
+ try {
+ getServiceRefSynchronous(
+ "org.springframework.context.ApplicationContext",
+ filter);
+ }
+ // in case of exception, catch and go on
+ catch (Exception e) {
+ log.error("getServiceRefSynchronous failed", e);
+ }
+ }
+ }
+ } catch (Exception e) {
+ throw new RuntimeException("Cannot update bundles", e);
+ }
+ }
+
+ /** Updates bundle synchronously. */
+ protected void updateSynchronous(Bundle bundle) throws BundleException {
+ bundle.update();
+ boolean waiting = true;
+
+ long begin = System.currentTimeMillis();
+ do {
+ int state = bundle.getState();
+ if (state == Bundle.INSTALLED || state == Bundle.ACTIVE
+ || state == Bundle.RESOLVED)
+ waiting = false;
+
+ sleep(100);
+ if (System.currentTimeMillis() - begin > defaultTimeout)
+ throw new RuntimeException("Update of bundle "
+ + bundle.getSymbolicName()
+ + " timed out. Bundle state = " + bundle.getState());
+ } while (waiting);
+
+ if (log.isDebugEnabled())
+ log.debug("Bundle " + bundle.getSymbolicName() + " updated.");
+ }
+
+ /** Starts bundle synchronously. Does nothing if already started. */
+ protected void startSynchronous(Bundle bundle) throws BundleException {
+ int originalState = bundle.getState();
+ if (originalState == Bundle.ACTIVE)
+ return;
+
+ bundle.start();
+ boolean waiting = true;
+
+ long begin = System.currentTimeMillis();
+ do {
+ if (bundle.getState() == Bundle.ACTIVE)
+ waiting = false;
+
+ sleep(100);
+ if (System.currentTimeMillis() - begin > defaultTimeout)
+ throw new RuntimeException("Start of bundle "
+ + bundle.getSymbolicName()
+ + " timed out. Bundle state = " + bundle.getState());
+ } while (waiting);
+
+ if (log.isDebugEnabled())
+ log.debug("Bundle " + bundle.getSymbolicName() + " started.");
+ }
+
+ /** Stops bundle synchronously. Does nothing if already started. */
+ protected void stopSynchronous(Bundle bundle) throws BundleException {
+ int originalState = bundle.getState();
+ if (originalState != Bundle.ACTIVE)
+ return;
+
+ bundle.stop();
+ boolean waiting = true;
+
+ long begin = System.currentTimeMillis();
+ do {
+ if (bundle.getState() != Bundle.ACTIVE
+ && bundle.getState() != Bundle.STOPPING)
+ waiting = false;
+
+ sleep(100);
+ if (System.currentTimeMillis() - begin > defaultTimeout)
+ throw new RuntimeException("Stop of bundle "
+ + bundle.getSymbolicName()
+ + " timed out. Bundle state = " + bundle.getState());
+ } while (waiting);
+
+ if (log.isDebugEnabled())
+ log.debug("Bundle " + bundle.getSymbolicName() + " stopped.");
+ }
+
+ /** Refresh bundle synchronously. Does nothing if already started. */
+ protected void refreshSynchronous(Bundle[] bundles) throws BundleException {
+ ServiceReference packageAdminRef = bundleContext
+ .getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin packageAdmin = (PackageAdmin) bundleContext
+ .getService(packageAdminRef);
+ packageAdmin.refreshPackages(bundles);
+
+ synchronized (refreshedPackageSem) {
+ try {
+ refreshedPackageSem.wait(defaultTimeout);
+ } catch (InterruptedException e) {
+ // silent
+ }
+ }
+
+ if (log.isDebugEnabled())
+ log.debug("Bundles refreshed.");
+ }
+
+ public void frameworkEvent(FrameworkEvent event) {
+ if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) {
+ synchronized (refreshedPackageSem) {
+ refreshedPackageSem.notifyAll();
+ }
+ }
+ }
+
+ public ServiceReference[] getServiceRefSynchronous(String clss,
+ String filter) throws InvalidSyntaxException {
+ if (log.isTraceEnabled())
+ log.trace("Filter: '" + filter + "'");
+ ServiceReference[] sfs = null;
+ boolean waiting = true;
+ long begin = System.currentTimeMillis();
+ do {
+ sfs = bundleContext.getServiceReferences(clss, filter);
+
+ if (sfs != null)
+ waiting = false;
+
+ sleep(100);
+ if (System.currentTimeMillis() - begin > defaultTimeout)
+ throw new RuntimeException("Search of services " + clss
+ + " with filter " + filter + " timed out.");
+ } while (waiting);
+
+ return sfs;
+ }
+
+ protected void sleep(long ms) {
+ try {
+ Thread.sleep(ms);
+ } catch (InterruptedException e) {
+ // silent
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.admin;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.detached.DetachedAdminCommand;
+import org.argeo.slc.detached.DetachedException;
+import org.argeo.slc.detached.DetachedRequest;
+import org.argeo.slc.detached.DetachedSession;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+public class OpenSession implements DetachedAdminCommand {
+ private final static Log log = LogFactory.getLog(OpenSession.class);
+
+ public DetachedSession execute(DetachedRequest request,
+ BundleContext bundleContext) {
+
+ DetachedSession session = new DetachedSession();
+ session.setUuid(Long.toString(System.currentTimeMillis()));
+
+ Properties props = request.getProperties();
+ if (props.containsKey(DetachedSession.PROP_DO_IT_AGAIN_POLICY))
+ session.setDoItAgainPolicy(props
+ .getProperty(DetachedSession.PROP_DO_IT_AGAIN_POLICY));
+
+ String refreshedBundles = props
+ .getProperty("slc.detached.refreshedBundles");
+ if (refreshedBundles != null) {
+
+ List refreshedBundleNames = new ArrayList();
+ StringTokenizer st = new StringTokenizer(refreshedBundles, ",");
+ while (st.hasMoreTokens()) {
+ refreshedBundleNames.add(st.nextElement());
+ }
+
+ Bundle[] allBundles = bundleContext.getBundles();
+ Bundle[] bundlesToRefresh = new Bundle[refreshedBundleNames.size()];
+
+ log.debug("Bundles to refresh for DetachedSession:");
+
+ for(int i = 0; i < bundlesToRefresh.length; ++i) {
+ bundlesToRefresh[i] = getBundleForName((String)refreshedBundleNames.get(i), allBundles);
+ if(log.isDebugEnabled())
+ log.debug(" " + refreshedBundleNames.get(i));
+ }
+
+ (new MinimalBundlesManager(bundleContext)).upgradeSynchronous(bundlesToRefresh);
+ }
+
+ return session;
+ }
+
+ private Bundle getBundleForName(String symbolicName, Bundle[] bundles) {
+ for (int i = 0; i < bundles.length; i++) {
+ if (symbolicName.equals(bundles[i].getSymbolicName())) {
+ return bundles[i];
+ }
+ }
+ throw new DetachedException("No Bundle found for symbolic name " + symbolicName);
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.drivers;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.filefilter.NotFileFilter;
+import org.apache.commons.io.filefilter.SuffixFileFilter;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.detached.DetachedAnswer;
+import org.argeo.slc.detached.DetachedClient;
+import org.argeo.slc.detached.DetachedCommunication;
+import org.argeo.slc.detached.DetachedDriver;
+import org.argeo.slc.detached.DetachedException;
+import org.argeo.slc.detached.DetachedRequest;
+import org.argeo.slc.detached.DetachedXmlConverter;
+import org.springframework.beans.factory.InitializingBean;
+
+/**
+ * Implements both <code>DetachedClient</code> and <code>DetachedDriver</code>
+ * using File protocol
+ */
+public class FileDriver implements DetachedClient, DetachedDriver,
+ InitializingBean {
+ private final static Log log = LogFactory.getLog(FileDriver.class);
+ private final static SimpleDateFormat sdf = new SimpleDateFormat(
+ "yyMMdd_HHmmss_SSS");
+ private final static MessageFormat mf = new MessageFormat("{0,number,000}");
+
+ private File baseDir;
+ private File requestsDir;
+ private File answersDir;
+ private File processedRequestsDir;
+ private File processedAnswersDir;
+ private File cleanedRequestsDir;
+ private File cleanedAnswersDir;
+
+ private String lockFileExt = "lck";
+ private FileFilter notLockFileFilter = new NotFileFilter(
+ new SuffixFileFilter("." + lockFileExt));
+
+ // Counters to avoid naming files with same prefix
+ private long lastSentTime = 0;
+ private int counter = 0;
+
+ private DetachedXmlConverter xmlConverter = null;
+
+ private long receiveAnswerTimeout = 10000l;
+
+ private boolean active = true;
+
+ public synchronized DetachedRequest receiveRequest() throws Exception {
+ DetachedRequest request = (DetachedRequest) receiveFile(requestsDir,
+ processedRequestsDir, 0);
+ if (request != null)
+ if (log.isTraceEnabled())
+ log.trace("Received detached request #" + request.getUuid()
+ + " for ref '" + request.getRef());
+ return request;
+ }
+
+ public synchronized void sendAnswer(DetachedAnswer answer) throws Exception {
+ sendFile(answersDir, answer);
+ if (log.isTraceEnabled())
+ log.trace("Sent detached answer #" + answer.getUuid());
+ }
+
+ public synchronized DetachedAnswer receiveAnswer() throws Exception {
+ DetachedAnswer answer = (DetachedAnswer) receiveFile(answersDir,
+ processedAnswersDir, getReceiveAnswerTimeout());
+ if (answer != null)
+ if (log.isTraceEnabled())
+ log.trace("Received detached answer #" + answer.getUuid());
+ return answer;
+ }
+
+ public synchronized void sendRequest(DetachedRequest request)
+ throws Exception {
+ sendFile(requestsDir, request);
+ if (log.isTraceEnabled())
+ log.trace("Sent detached request #" + request.getUuid()
+ + " for ref '" + request.getRef());
+ }
+
+ protected synchronized void sendFile(File dir, DetachedCommunication detCom)
+ throws Exception {
+ final String ext;
+ if (getXmlConverter() != null)
+ ext = ".xml";
+ else
+ ext = "";
+
+ // Check counters
+ Date nowDate = new Date();
+ long nowMs = nowDate.getTime();
+ if (nowMs == lastSentTime) {
+ counter++;
+ } else {
+ counter = 0;
+ }
+
+ // Create file path
+ StringBuffer filePath = new StringBuffer(dir.getPath());
+ filePath.append(File.separatorChar).append(sdf.format(nowDate))
+ .append('-');
+ filePath.append(mf.format(new Object[] { new Long(counter) })).append(
+ '-');
+ filePath.append(detCom.getUuid()).append(ext);
+ File file = new File(filePath.toString());
+
+ File lockFile = createLockFile(file);
+ if (getXmlConverter() != null) {// xml
+ FileOutputStream outFile = new FileOutputStream(file);
+ try {
+ StreamResult result = new StreamResult(outFile);
+ getXmlConverter().marshallCommunication(detCom, result);
+ } finally {
+ IOUtils.closeQuietly(outFile);
+ }
+ } else {// serialize
+ ObjectOutputStream out = new ObjectOutputStream(
+ new FileOutputStream(file));
+ try {
+ out.writeObject(detCom);
+ } finally {
+ IOUtils.closeQuietly(out);
+ }
+ }
+ lockFile.delete();
+ }
+
+ /**
+ * @param timeout
+ * in ms, 0 is no timeout
+ */
+ protected synchronized DetachedCommunication receiveFile(File dir,
+ File processedDir, long timeout) throws Exception {
+ long begin = System.currentTimeMillis();
+ File file = null;
+ while (file == null && isActive()) {
+ if (!dir.exists())
+ throw new DetachedException("Dir " + dir + " does not exist.");
+
+ File[] files = dir.listFiles(notLockFileFilter);
+ if (files.length > 0)
+ file = files[0];
+ else {
+ try {
+ wait(100);
+ } catch (InterruptedException e) {
+ // silent
+ }
+ }
+
+ long duration = System.currentTimeMillis() - begin;
+ if (timeout != 0 && duration > timeout) {
+ throw new DetachedException("Receive file timed out after "
+ + duration + "ms.");
+ }
+ }
+
+ if (!isActive()) {
+ log.debug("DetachedDriver is not active. Leaving receiveFile");
+ return null;
+ }
+
+ File lockFile = nameLockFile(file);
+ while (lockFile.exists())
+ // FIXME: implements time out
+ Thread.sleep(100);
+
+ // Read the file
+ final DetachedCommunication detCom;
+ if (FilenameUtils.getExtension(file.getName()).equals("xml")) {
+ if (getXmlConverter() == null)
+ throw new DetachedException("No XML converter defined.");
+ FileInputStream in = new FileInputStream(file);
+ try {
+ StreamSource source = new StreamSource(in);
+ detCom = getXmlConverter().unmarshallCommunication(source);
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+ } else {
+ ObjectInputStream in = new ObjectInputStream(new FileInputStream(
+ file));
+ try {
+ detCom = (DetachedCommunication) in.readObject();
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+ }
+ // Move to processed dir
+ FileUtils.moveFileToDirectory(file, processedDir, false);
+ return detCom;
+ }
+
+ public synchronized void stop() {
+ log.debug("Stopping Detached Driver");
+ active = false;
+ notifyAll();
+ }
+
+ private synchronized boolean isActive() {
+ return active;
+ }
+
+ protected File createLockFile(File file) {
+ File lockFile = nameLockFile(file);
+ try {
+ lockFile.createNewFile();
+ } catch (IOException e) {
+ throw new DetachedException("Cannot create lock file " + lockFile);
+ }
+ return lockFile;
+ }
+
+ protected File nameLockFile(File file) {
+ return new File(file.getAbsolutePath() + "." + lockFileExt);
+ }
+
+ public void setBaseDir(File baseDir) {
+ this.baseDir = baseDir;
+ }
+
+ private void createIfNotExist(File dir) {
+ if (!dir.exists()) {
+ log.warn("Dir " + dir.getAbsolutePath()
+ + " does not exist. Creating it...");
+ dir.mkdirs();
+ }
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ this.requestsDir = new File(baseDir.getAbsolutePath() + File.separator
+ + "requests");
+ this.answersDir = new File(baseDir.getAbsolutePath() + File.separator
+ + "answers");
+ this.processedRequestsDir = new File(baseDir.getAbsolutePath()
+ + File.separator + "processed" + File.separator + "requests");
+ this.processedAnswersDir = new File(baseDir.getAbsolutePath()
+ + File.separator + "processed" + File.separator + "answers");
+ this.cleanedRequestsDir = new File(baseDir.getAbsolutePath()
+ + File.separator + "cleaned" + File.separator + "requests");
+ this.cleanedAnswersDir = new File(baseDir.getAbsolutePath()
+ + File.separator + "cleaned" + File.separator + "answers");
+
+ createIfNotExist(requestsDir);
+ createIfNotExist(answersDir);
+ createIfNotExist(processedRequestsDir);
+ createIfNotExist(processedAnswersDir);
+ createIfNotExist(cleanedRequestsDir);
+ createIfNotExist(cleanedAnswersDir);
+ if (log.isDebugEnabled())
+ log.debug("Detached File Driver initialized on " + baseDir);
+ }
+
+ public void cleanPreviousRuns() throws Exception {
+
+ // Clean requests and answers from previous builds
+ File[] remainingRequests = requestsDir.listFiles();
+ for (int i = 0; i < remainingRequests.length; i++) {
+ FileUtils.moveFileToDirectory(remainingRequests[i],
+ cleanedRequestsDir, false);
+ }
+
+ File[] remainingAnswers = answersDir.listFiles();
+ for (int i = 0; i < remainingAnswers.length; i++) {
+ FileUtils.moveFileToDirectory(remainingAnswers[i],
+ cleanedAnswersDir, false);
+ }
+ log.info("Clean previous runs of File Driver on " + baseDir);
+
+ }
+
+ public long getReceiveAnswerTimeout() {
+ return receiveAnswerTimeout;
+ }
+
+ public void setReceiveAnswerTimeout(long receiveAnswerTimeout) {
+ this.receiveAnswerTimeout = receiveAnswerTimeout;
+ }
+
+ public DetachedXmlConverter getXmlConverter() {
+ return xmlConverter;
+ }
+
+ public void setXmlConverter(DetachedXmlConverter xmlConverter) {
+ this.xmlConverter = xmlConverter;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.drivers;
+
+import org.argeo.slc.detached.DetachedAnswer;
+import org.argeo.slc.detached.DetachedClient;
+import org.argeo.slc.detached.DetachedDriver;
+import org.argeo.slc.detached.DetachedRequest;
+
+/**
+ * Implements both <code>DetachedClient</code> and <code>DetachedDriver</code>
+ * using memory access
+ */
+public class MemoryDriver implements DetachedClient, DetachedDriver {
+ private DetachedRequest currentRequest = null;
+ private DetachedAnswer currentAnswer = null;
+
+ // DRIVER
+ public synchronized DetachedRequest receiveRequest() throws Exception {
+ while (currentRequest == null)
+ this.wait(500);
+ return currentRequest;
+ }
+
+ public synchronized void sendAnswer(DetachedAnswer answer) throws Exception {
+ currentAnswer = answer;
+ this.notify();
+ }
+
+ // CLIENT
+ public synchronized DetachedAnswer receiveAnswer() throws Exception {
+ while (currentAnswer == null)
+ this.wait(500);
+ DetachedAnswer answer = currentAnswer;
+ currentAnswer = null;
+ currentRequest = null;
+ return answer;
+ }
+
+ public synchronized void sendRequest(DetachedRequest request)
+ throws Exception {
+ currentRequest = request;
+ this.notify();
+ }
+
+ public void stop() {
+ // NOTHING
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.ui;
+
+import org.argeo.slc.detached.DetachedContext;
+import org.argeo.slc.detached.DetachedRequest;
+
+public abstract class UiPart {
+ private boolean initialized = false;
+
+ public synchronized final void init(DetachedContext context,
+ DetachedRequest request) {
+ initUi(context, request);
+ initialized = true;
+ }
+
+ public synchronized final void reset(DetachedContext context,
+ DetachedRequest request) {
+ resetUi(context, request);
+ initialized = false;
+ }
+
+ protected abstract void initUi(DetachedContext context,
+ DetachedRequest request);
+
+ protected void resetUi(DetachedContext context, DetachedRequest request) {
+
+ }
+
+ public synchronized boolean isInitialized() {
+ return initialized;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.detached.ui;
+
+import org.argeo.slc.detached.DetachedAnswer;
+import org.argeo.slc.detached.DetachedContext;
+import org.argeo.slc.detached.DetachedRequest;
+import org.argeo.slc.detached.DetachedStep;
+import org.springframework.beans.factory.BeanNameAware;
+
+public abstract class UiStep implements DetachedStep, BeanNameAware {
+ private String beanName;
+
+ public final DetachedAnswer execute(DetachedContext detachedContext,
+ DetachedRequest detachedStepRequest) {
+ // uiPart.init(detachedContext, detachedStepRequest);
+ return executeUiStep(detachedContext, detachedStepRequest);
+ }
+
+ protected abstract DetachedAnswer executeUiStep(DetachedContext context,
+ DetachedRequest request);
+
+ public void setBeanName(String name) {
+ this.beanName = name;
+ }
+
+ public String getBeanName() {
+ return beanName;
+ }
+
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi
+ http://www.springframework.org/schema/osgi/spring-osgi.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+<!--
+ <service id="slcDetached.service.driver.fileXmlCompat" ref="slcDetached.driver.fileXmlCompat"
+ interface="org.argeo.slc.detached.DetachedDriver" />
+ -->
+ <service id="executionServer.service" ref="executionServer"
+ interface="org.argeo.slc.detached.DetachedExecutionServer" />
+
+</beans:beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <import resource="classpath:/org/argeo/slc/detached/spring.xml" />
+
+ <bean id="executionServer" class="org.argeo.slc.detached.DetachedExecutionServerImpl">
+ </bean>
+
+ <!--
+ <bean id="slcDetached.driver.fileXmlCompat"
+ parent="slcTemplate.detached.fileDriver"> <property name="baseDir"
+ value="${slc.workDir}/detached" /> <property name="xmlConverter"
+ ref="slcDefault.detached.xmlConverterCompat" /> </bean>
+ -->
+</beans>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
+ targetNamespace="http://argeo.org/projects/slc/schemas/detached"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ xmlns:slc-det="http://argeo.org/projects/slc/schemas/detached">
+
+ <xs:element name="detached-request">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="uuid" type="xs:string" maxOccurs="1" />
+ <xs:element name="ref" type="xs:string" minOccurs="0"
+ maxOccurs="1" />
+ <xs:element name="path" type="xs:string" minOccurs="0"
+ maxOccurs="1" />
+ <xs:element name="properties" minOccurs="0"
+ maxOccurs="1" type="slc-det:PropertiesType" />
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="detached-answer">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="uuid" type="xs:string" maxOccurs="1" />
+ <xs:element name="status" minOccurs="0" maxOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer">
+ <xs:enumeration value="-1" />
+ <xs:enumeration value="0" />
+ <xs:enumeration value="1" />
+ <xs:enumeration value="2" />
+ <xs:enumeration value="10" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="log" type="xs:string" minOccurs="0"
+ maxOccurs="1" />
+ <xs:element name="properties" minOccurs="0"
+ maxOccurs="1" type="slc-det:PropertiesType" />
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="PropertiesType">
+ <xs:sequence>
+ <xs:element name="prop" type="slc-det:PropType"
+ minOccurs="0" maxOccurs="unbounded">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="PropType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="key" type="xs:string"
+ use="required" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+
+</xs:schema>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
+ default-lazy-init="true">
+
+ <bean id="slcDefault.detached.admin.openSession" class="org.argeo.slc.detached.admin.OpenSession">
+ </bean>
+
+ <bean id="slcDefault.detached.admin.closeSession" class="org.argeo.slc.detached.admin.CloseSession">
+ </bean>
+
+ <bean id="slcDefault.detached.xmlConverterCompat" class="org.argeo.slc.detached.DetachedXmlConverterCompat">
+ </bean>
+
+ <bean id="slcTemplate.detached.fileDriver" class="org.argeo.slc.detached.drivers.FileDriver"
+ abstract="true">
+ </bean>
+
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.launcher</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Fri Aug 29 11:31:46 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+source.. = src/main/java/,\
+ src/main/resources/
--- /dev/null
+NIX {
+ com.sun.security.auth.module.UnixLoginModule required;
+};
+
+WINDOWS {
+ com.sun.security.auth.module.NTLoginModule required;
+};
--- /dev/null
+log4j.rootLogger=WARN, console
+#log4j.rootLogger=DEBUG, development
+
+## Levels
+log4j.logger.org.argeo=INFO
+
+log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
+log4j.logger.org.apache.jackrabbit.core.config.ConfigurationErrorHandler=ERROR
+log4j.logger.org.apache.jackrabbit.core.util.db.DbUtility=FATAL
+
+## Appenders
+# default appender
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %m%n
+
+# development appender
+log4j.appender.development=org.apache.log4j.ConsoleAppender
+log4j.appender.development.layout=org.apache.log4j.PatternLayout
+#log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%16.16t] %5p %m (%F:%L) %c%n
+log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p %m [%16.16t] %c%n
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.launcher</artifactId>
+ <packaging>jar</packaging>
+ <name>SLC Launcher</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/base.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>assembly-base</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Main-Class>org.argeo.slc.cli.SlcMain</Main-Class>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/base</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/base</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.commons.base</groupId>
+ <artifactId>org.argeo.osgi.boot</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+ <id>base</id>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>target/base</directory>
+ <outputDirectory></outputDirectory>
+ <fileMode>0755</fileMode>
+ <includes>
+ <include>*.sh</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target/base</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>*.bat</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target/base</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>work/**</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
\ No newline at end of file
--- /dev/null
+@echo off\r
+set ROOT_DIR=%~dp0\r
+set LIB_DIR=%ROOT_DIR%\lib\r
+set WORK_DIR=%ROOT_DIR%\work\%1\r
+\r
+TITLE %1\r
+\r
+cd %WORK_DIR%\r
+\r
+java %JAVA_OPTS% -jar "%LIB_DIR%\org.eclipse.osgi-${version.equinox}.jar" -clean -console -configuration "%WORK_DIR%\conf" -data "%WORK_DIR%\data"
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+INSTANCE=$1
+
+ROOT_DIR=`pwd`
+LIB_DIR=$ROOT_DIR/lib
+
+# Defaults
+if [ -z "$INSTANCE" ]; then
+ INSTANCE=agent
+fi
+
+echo "Using configuration: $INSTANCE"
+
+WORK_DIR=$ROOT_DIR/work/$INSTANCE
+if [ -z "$JAVA_OPTS" ]; then
+ JAVA_OPTS=-Xmx256m
+fi
+
+if [ -d "$WORK_DIR" ]; then
+cd $WORK_DIR
+java $JAVA_OPTS -jar $LIB_DIR/org.eclipse.osgi-${version.equinox}.jar \
+ -clean -console \
+ -configuration $WORK_DIR/conf \
+ -data $WORK_DIR/data
+else
+ echo "$WORK_DIR does not exist. Please specify a proper configuration name."
+fi
--- /dev/null
+osgi.bundles=org.argeo.osgi.boot-${version.argeo-commons}.jar@start
+argeo.osgi.bundles=${osgi.install.area};in=*.jar
+argeo.osgi.start=org.springframework.osgi.extender,\
+ org.argeo.slc.agent,\
+ org.argeo.slc.agent.jms,\
+ org.argeo.slc.support.equinox
+
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.cli;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.UUID;
+
+import javax.security.auth.Subject;
+import javax.security.auth.login.LoginContext;
+
+import org.argeo.osgi.boot.OsgiBoot;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/** Configures an SLC runtime and runs a process. */
+public class SlcMain implements PrivilegedAction<String> {
+ public final static String NIX = "NIX";
+ public final static String WINDOWS = "WINDOWS";
+ public final static String SOLARIS = "SOLARIS";
+
+ public final static String os;
+ public final static String slcDirName = ".slc";
+ final static File homeDir = new File(System.getProperty("user.home"));
+
+ static {
+ String osName = System.getProperty("os.name");
+ if (osName.startsWith("Win"))
+ os = WINDOWS;
+ else if (osName.startsWith("Solaris"))
+ os = SOLARIS;
+ else
+ os = NIX;
+ }
+
+ private Long timeout = 30 * 1000l;
+ private final String[] args;
+ private final File confDir;
+ private final File dataDir;
+ private final File modulesDir;
+
+ private final List<String> bundlesToStart = new ArrayList<String>();
+
+ public SlcMain(String[] args, File confDir, File dataDir, File modulesDir) {
+ this.args = args;
+ this.confDir = confDir;
+ this.dataDir = dataDir;
+ this.modulesDir = modulesDir;
+ bundlesToStart.add("org.springframework.osgi.extender");
+ bundlesToStart.add("org.argeo.node.repo.jackrabbit");
+ bundlesToStart.add("org.argeo.security.dao.os");
+ bundlesToStart.add("org.argeo.slc.node.jackrabbit");
+ bundlesToStart.add("org.argeo.slc.agent");
+ bundlesToStart.add("org.argeo.slc.agent.jcr");
+ if (args.length == 0)
+ bundlesToStart.add("org.argeo.slc.support.equinox");
+ // bundlesToStart.add("org.argeo.slc.agent.cli");
+ }
+
+ public String run() {
+ long begin = System.currentTimeMillis();
+
+ Framework framework = null;
+ try {
+ info("## Date : " + new Date());
+ info("## Data : " + dataDir.getCanonicalPath());
+
+ // Start Equinox
+ ServiceLoader<FrameworkFactory> ff = ServiceLoader
+ .load(FrameworkFactory.class);
+ FrameworkFactory frameworkFactory = ff.iterator().next();
+ Map<String, String> configuration = new HashMap<String, String>();
+ configuration.put("osgi.configuration.area",
+ confDir.getCanonicalPath());
+ configuration.put("osgi.instance.area", dataDir.getCanonicalPath());
+ // Do clean
+ configuration.put("osgi.clean", "true");
+ if (args.length == 0) {
+ configuration.put("osgi.console", "");
+ }
+
+ // Spring configs currently require System properties
+ System.getProperties().putAll(configuration);
+
+ framework = frameworkFactory.newFramework(configuration);
+ framework.start();
+ BundleContext bundleContext = framework.getBundleContext();
+
+ // OSGi bootstrap
+ OsgiBoot osgiBoot = new OsgiBoot(bundleContext);
+
+ // working copy modules
+ if (modulesDir.exists())
+ osgiBoot.installUrls(osgiBoot.getBundlesUrls(modulesDir
+ .getCanonicalPath() + ";in=*;ex=.gitignore"));
+
+ // system modules
+ if (System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BUNDLES) != null)
+ osgiBoot.installUrls(osgiBoot.getBundlesUrls(System
+ .getProperty(OsgiBoot.PROP_ARGEO_OSGI_BUNDLES)));
+ else
+ osgiBoot.installUrls(osgiBoot.getBundlesUrls(System
+ .getProperty("user.home") + "/.slc/modules/;in=**"));
+
+ // Start runtime
+ osgiBoot.startBundles(bundlesToStart);
+
+ // Find SLC Agent
+ ServiceReference sr = null;
+ while (sr == null) {
+ sr = bundleContext
+ .getServiceReference("org.argeo.slc.execution.SlcAgentCli");
+ if (System.currentTimeMillis() - begin > timeout)
+ throw new RuntimeException("Cannot find SLC agent CLI");
+ Thread.sleep(100);
+ }
+ Object agentCli = bundleContext.getService(sr);
+
+ // Initialization completed
+ long duration = System.currentTimeMillis() - begin;
+ info("[[ Initialized in " + (duration / 1000) + "s "
+ + (duration % 1000) + "ms ]]");
+
+ if (args.length == 0)
+ return null;// console mode
+
+ // Subject.doAs(Subject.getSubject(AccessController.getContext()),
+ // new AgentCliCall(agentCli));
+ Class<?>[] parameterTypes = { String[].class };
+ Method method = agentCli.getClass().getMethod("process",
+ parameterTypes);
+ Object[] methodArgs = { args };
+ Object ret = method.invoke(agentCli, methodArgs);
+
+ // Shutdown OSGi runtime
+ framework.stop();
+ framework.waitForStop(60 * 1000);
+
+ return ret.toString();
+ } catch (Exception e) {
+ // Shutdown OSGi runtime
+ if (framework != null)
+ try {
+ framework.stop();
+ framework.waitForStop(15 * 1000);
+ } catch (Exception silent) {
+ }
+ throw new RuntimeException("Cannot run SLC command line", e);
+ } finally {
+
+ }
+ }
+
+ public static void main(String[] args) {
+ try {
+ // Prepare directories
+ File executionDir = new File(System.getProperty("user.dir"));
+ File slcDir;
+ Boolean isTransient = false;
+ if (isTransient) {
+ File tempDir = new File(System.getProperty("java.io.tmpdir")
+ + "/" + System.getProperty("user.name"));
+ slcDir = new File(tempDir, "slc-"
+ + UUID.randomUUID().toString());
+ slcDir.mkdirs();
+ System.setProperty("argeo.node.repo.configuration",
+ "osgibundle:repository-memory.xml");
+ } else {
+ slcDir = findSlcDir(executionDir);
+ if (slcDir == null) {
+ slcDir = new File(executionDir, slcDirName);
+ slcDir.mkdirs();
+ info("## Creating an SLC node at " + slcDir + " ...");
+ }
+ }
+
+ File dataDir = new File(slcDir, "data");
+ if (!dataDir.exists())
+ dataDir.mkdirs();
+
+ File confDir = new File(slcDir, "conf");
+ if (!confDir.exists())
+ confDir.mkdirs();
+
+ File modulesDir = new File(slcDir, "modules");
+
+ // JAAS
+ File jaasFile = new File(confDir, "jaas.config");
+ if (!jaasFile.exists())
+ copyResource("/org/argeo/slc/cli/jaas.config", jaasFile);
+ System.setProperty("java.security.auth.login.config",
+ jaasFile.getCanonicalPath());
+
+ // log4j
+ File log4jFile = new File(confDir, "log4j.properties");
+ if (!log4jFile.exists())
+ copyResource("/org/argeo/slc/cli/log4j.properties", log4jFile);
+ System.setProperty("log4j.configuration",
+ "file://" + log4jFile.getCanonicalPath());
+ // Run as a privileged action
+ LoginContext lc = new LoginContext(os);
+ lc.login();
+
+ Subject subject = Subject.getSubject(AccessController.getContext());
+ Subject.doAs(subject, new SlcMain(args, confDir, dataDir,
+ modulesDir));
+
+ if (args.length != 0)
+ System.exit(0);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ /**
+ * Recursively look in parent directories for a directory named
+ * {@link #slcDirName}
+ */
+ protected static File findSlcDir(File currentDir) {
+ File slcDir = new File(currentDir, slcDirName);
+ // covers the use case of running from the home directory
+ if (slcDir.exists() && slcDir.isDirectory())
+ return slcDir;
+ File parentDir = currentDir.getParentFile();
+ if (parentDir == null)
+ return null;
+ try {
+ // ~/.slc reserved for agent
+ if (parentDir.getCanonicalPath().equals(homeDir.getCanonicalPath()))
+ return null;
+ } catch (IOException e) {
+ throw new RuntimeException("Cannot check home directory", e);
+ }
+ return findSlcDir(parentDir);
+ }
+
+ protected static void copyResource(String resource, File targetFile) {
+ InputStream input = null;
+ FileOutputStream output = null;
+ try {
+ input = SlcMain.class.getResourceAsStream(resource);
+ output = new FileOutputStream(targetFile);
+ byte[] buf = new byte[8192];
+ while (true) {
+ int length = input.read(buf);
+ if (length < 0)
+ break;
+ output.write(buf, 0, length);
+ }
+ } catch (Exception e) {
+ throw new RuntimeException("Cannot write " + resource + " file to "
+ + targetFile, e);
+ } finally {
+ try {
+ input.close();
+ } catch (Exception ignore) {
+ }
+ try {
+ output.close();
+ } catch (Exception ignore) {
+ }
+ }
+
+ }
+
+ protected static void info(Object msg) {
+ System.out.println(msg);
+ }
+
+ protected static void err(Object msg) {
+ System.err.println(msg);
+ }
+
+ protected static void debug(Object msg) {
+ System.out.println(msg);
+ }
+
+}
+
+// private String bundlesToInstall = System.getProperty("user.home")
+// +
+// "/dev/src/slc/dep/org.argeo.slc.dep.minimal/target/dependency;in=*.jar,"
+// + System.getProperty("user.home")
+// + "/dev/src/slc/demo/modules;in=*;ex=pom.xml;ex=.svn";
+
+// ServiceTracker agentTracker = new ServiceTracker(bundleContext,
+// "org.argeo.slc.execution.SlcAgentCli", null);
+// agentTracker.open();
+// final Object agentCli = agentTracker.waitForService(30 * 1000);
+// if (agentCli == null)
+// throw new RuntimeException("Cannot find SLC agent CLI");
+
+// protected class AgentCliCall implements PrivilegedAction<String> {
+// private final Object agentCli;
+//
+// public AgentCliCall(Object agentCli) {
+// super();
+// this.agentCli = agentCli;
+// }
+//
+// public String run() {
+// try {
+// Class<?>[] parameterTypes = { String[].class };
+// Method method = agentCli.getClass().getMethod("process",
+// parameterTypes);
+// Object[] methodArgs = { args };
+// Object ret = method.invoke(agentCli, methodArgs);
+// return ret.toString();
+// } catch (Exception e) {
+// throw new RuntimeException("Cannot run "
+// + Arrays.toString(args) + " on " + agentCli, e);
+// }
+// }
+//
+// }
+
--- /dev/null
+NIX {
+ com.sun.security.auth.module.UnixLoginModule required;
+};
+
+WINDOWS {
+ com.sun.security.auth.module.NTLoginModule required;
+};
--- /dev/null
+log4j.rootLogger=WARN, console
+#log4j.rootLogger=DEBUG, development
+
+## Levels
+log4j.logger.org.argeo=INFO
+
+log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
+log4j.logger.org.apache.jackrabbit.core.config.ConfigurationErrorHandler=ERROR
+log4j.logger.org.apache.jackrabbit.core.util.db.DbUtility=FATAL
+
+## Appenders
+# default appender
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %m%n
+
+# development appender
+log4j.appender.development=org.apache.log4j.ConsoleAppender
+log4j.appender.development.layout=org.apache.log4j.PatternLayout
+log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p %m [%16.16t] %c%n
--- /dev/null
+Argeo SLC Site
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>\r
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.lib.detached</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Fri Aug 29 11:31:46 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+additional.bundles = org.springframework.xml,\
+ org.argeo.slc.unit,\
+ junit
+source.. = src/main/java/,\
+ src/main/resources/,\
+ src/test/java/,\
+ src/test/resources/
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.lib.detached</artifactId>
+ <name>SLC Lib Detached</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.*
+ </Export-Package>
+ <Import-Package>javax.xml.*;version="0.0.0",org.argeo.slc.ant.*;resolution:="optional",*</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.support.simple</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.detached</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.oxm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.castor</artifactId>
+ </dependency>
+
+ <!-- Unit Tests -->
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.unit</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.lib.detached;
+
+import java.util.Properties;
+import java.util.UUID;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.detached.DetachedAnswer;
+import org.argeo.slc.detached.DetachedClient;
+import org.argeo.slc.detached.DetachedRequest;
+
+public class DetachedAdminTask implements Runnable {
+ private final static Log log = LogFactory.getLog(DetachedAdminTask.class);
+
+ private String action;
+ private DetachedClient client;
+ private Properties properties;
+
+ public void run() {
+ // Prepare and send request
+ DetachedRequest request = new DetachedRequest(UUID.randomUUID()
+ .toString());
+ request.setRef(action);
+
+ if (properties != null) {
+ request.setProperties(properties);
+ }
+
+ try {
+ client.sendRequest(request);
+ DetachedAnswer answer = client.receiveAnswer();
+ if (answer.getStatus() == DetachedAnswer.ERROR)
+ throw new SlcException("Error when executing request "
+ + answer.getUuid() + ": " + answer.getLog());
+ else
+ log.info("Admin answer: " + answer.getLog());
+ } catch (Exception e) {
+ throw new SlcException("Could not send request.", e);
+ }
+ }
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public void setClient(DetachedClient detachedClient) {
+ this.client = detachedClient;
+ }
+
+ public void setProperties(Properties properties) {
+ this.properties = properties;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.lib.detached;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.core.execution.tasks.JvmProcess;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.context.ResourceLoaderAware;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.ResourceLoader;
+import org.springframework.osgi.context.BundleContextAware;
+
+public class DetachedLauncher extends JvmProcess implements BundleContextAware,
+ InitializingBean, ResourceLoaderAware {
+ private final static Log log = LogFactory.getLog(DetachedLauncher.class);
+
+ private BundleContext bundleContext = null;
+ private ResourceLoader resourceLoader = null;
+
+ private Resource osgiFramework = null;
+ private String osgibootBundleName = "org.argeo.osgi.boot";
+ private String equinoxBundleName = "org.eclipse.osgi";
+ private String xmlapisBundleName = "org.apache.xmlcommons";
+ private String xercesBundleName = "org.apache.xerces";
+
+ private List<String> excludeBundleNames = new ArrayList<String>();
+ private List<String> includeBundleUrls = new ArrayList<String>();
+
+ /**
+ * Required by Spring for JDK 1.4. see
+ * http://forum.springsource.org/showthread.php?t=74555
+ */
+ private Boolean prependXmlJars = false;
+
+ public DetachedLauncher() {
+ // Override defaults
+ setSynchronous(false);
+ setMainClass("org.argeo.osgi.boot.Launcher");
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ if (bundleContext == null)
+ throw new SlcException("An OSGi bundle context is required.");
+
+ // Equinox jar
+ if (osgiFramework == null)
+ getClasspath()
+ .add(asResource(System.getProperty("osgi.framework")));
+ else
+ getClasspath().add(osgiFramework);
+
+ StringBuffer osgiBundles = new StringBuffer("");
+ StringBuffer osgiLocations = new StringBuffer("");
+ bundles: for (Bundle bundle : bundleContext.getBundles()) {
+ String name = bundle.getSymbolicName();
+
+ if (excludeBundleNames.contains(name)) {
+ if (log.isDebugEnabled())
+ log.debug("Exclude bundle " + name);
+ continue bundles;// skip excluded
+ }
+
+ String originalLocation = bundle.getLocation();
+ if (log.isTraceEnabled())
+ log.trace("Original location of bundle " + name + ": "
+ + originalLocation);
+ String location = removeInitialReference(originalLocation);
+
+ // Special bundles
+ if (osgibootBundleName.equals(name))
+ getClasspath().add(asResource(location));
+ else if (equinoxBundleName.equals(name))
+ continue bundles;// skip framework
+ else if (xmlapisBundleName.equals(name) && prependXmlJars)
+ getPBootClasspath().add(asResource(location));
+ else if (xercesBundleName.equals(name) && prependXmlJars)
+ getPBootClasspath().add(asResource(location));
+
+ if (location.startsWith("file:")) {
+ File file = new File(location.substring("file:".length()));
+ if (osgiLocations.length() != 0)
+ osgiLocations.append(File.pathSeparatorChar);
+ location = file.getPath().replace('/', File.separatorChar);
+ osgiLocations.append(location);
+ if (log.isTraceEnabled())
+ log.trace("Added bundle " + name
+ + " to argeo.osgi.locations: " + location);
+ } else {
+ if (osgiBundles.length() != 0)
+ osgiBundles.append(',');
+ location = location.replace('/', File.separatorChar);
+ osgiBundles.append(location);
+ if (log.isTraceEnabled())
+ log.trace("Added bundle " + name + " to osgi.bundles: "
+ + location);
+ }
+ }
+
+ for (String url : includeBundleUrls) {
+ if (osgiBundles.length() != 0)
+ osgiBundles.append(',');
+ osgiBundles.append(url);
+ if (log.isDebugEnabled())
+ log.debug("Include url" + url);
+ }
+
+ getSystemProperties().setProperty("osgi.bundles",
+ osgiBundles.toString());
+ getSystemProperties().setProperty("argeo.osgi.locations",
+ osgiLocations.toString());
+
+ super.afterPropertiesSet();
+ }
+
+ protected String removeInitialReference(String location) {
+ if (location.startsWith("initial@reference:file:"))
+ location = System.getProperty("osgi.install.area")
+ + location.substring("initial@reference:file:".length());
+ if (location.charAt(location.length() - 1) == '/')
+ location.substring(0, location.length() - 1);
+ return location;
+ }
+
+ protected Resource asResource(String location) {
+ // Resource res = resourceLoader.getResource(location);
+
+ final Resource res;
+ if (location.startsWith("file:")) {
+ File file = new File(location.substring("file:".length()));
+ if (!file.exists())
+ throw new SlcException("File " + file + " does not exist");
+
+ try {
+ res = new FileSystemResource(file.getCanonicalFile());
+ } catch (IOException e) {
+ throw new SlcException("Cannot create resource based on "
+ + file, e);
+ }
+ } else
+ res = resourceLoader.getResource(location);
+
+ if (log.isDebugEnabled())
+ log.debug("Converted " + location + " to " + res);
+ return res;
+ }
+
+ public void setBundleContext(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+
+ public void setResourceLoader(ResourceLoader resourceLoader) {
+ this.resourceLoader = resourceLoader;
+ }
+
+ public void setOsgibootBundleName(String osgibootBundleName) {
+ this.osgibootBundleName = osgibootBundleName;
+ }
+
+ public void setXmlapisBundleName(String xmlapisBundleName) {
+ this.xmlapisBundleName = xmlapisBundleName;
+ }
+
+ public void setXercesBundleName(String xercesBundleName) {
+ this.xercesBundleName = xercesBundleName;
+ }
+
+ public void setOsgiFramework(Resource osgiFramework) {
+ this.osgiFramework = osgiFramework;
+ }
+
+ public void setEquinoxBundleName(String equinoxBundleName) {
+ this.equinoxBundleName = equinoxBundleName;
+ }
+
+ public void setPrependXmlJars(Boolean prependXmlJars) {
+ this.prependXmlJars = prependXmlJars;
+ }
+
+ public void setExcludeBundleNames(List<String> excludeBundleNames) {
+ this.excludeBundleNames = excludeBundleNames;
+ }
+
+ public void setIncludeBundleUrls(List<String> includeBundleUrls) {
+ this.includeBundleUrls = includeBundleUrls;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.lib.detached;
+
+import org.argeo.slc.core.test.context.DefaultContextTestData;
+
+/**
+ * @deprecated
+ *
+ */
+public class DetachedTestData extends DefaultContextTestData {
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.lib.detached;
+
+import java.util.Map;
+import java.util.Properties;
+import java.util.UUID;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.core.test.SimpleResultPart;
+import org.argeo.slc.core.test.context.ContextUtils;
+import org.argeo.slc.core.test.context.DefaultContextTestData;
+import org.argeo.slc.detached.DetachedAnswer;
+import org.argeo.slc.detached.DetachedClient;
+import org.argeo.slc.detached.DetachedRequest;
+import org.argeo.slc.detached.DetachedStep;
+import org.argeo.slc.detached.ui.UiStep;
+import org.argeo.slc.test.TestDefinition;
+import org.argeo.slc.test.TestResult;
+import org.argeo.slc.test.TestRun;
+import org.argeo.slc.test.TestStatus;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
+import org.springframework.beans.factory.BeanInitializationException;
+import org.springframework.beans.factory.BeanNameAware;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanReference;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+
+public class DetachedTestDefinition implements TestDefinition, BeanNameAware,
+ BeanFactoryAware, InitializingBean {
+ private final static Log log = LogFactory
+ .getLog(DetachedTestDefinition.class);
+
+ private DetachedStep step;
+ private DetachedClient client;
+
+ // Spring properties
+ private String testDefBeanName = null;
+ private BeanDefinitionRegistry beanDefinitionRegistry = null;
+ private String stepRef = null;
+
+ public void execute(TestRun testRun) {
+ // Look for step bean name
+ String stepBeanNameT = null;
+ if (this.stepRef == null && step != null) {
+ if (step instanceof UiStep) {
+ stepBeanNameT = ((UiStep) step).getBeanName();
+ } else {
+ // Introspects bean factory in order to find step bean name
+ BeanDefinition thisBeanDef = beanDefinitionRegistry
+ .getBeanDefinition(testDefBeanName);
+ PropertyValue propValue = thisBeanDef.getPropertyValues()
+ .getPropertyValue("step");
+ Object stepBeanRef = propValue.getValue();
+ BeanReference ref = (BeanReference) stepBeanRef;
+ stepBeanNameT = ref.getBeanName();
+ }
+ } else if (this.stepRef != null) {
+ stepBeanNameT = this.stepRef;
+ }
+
+ // Execute
+ DetachedRequest request = new DetachedRequest();
+ request.setUuid(UUID.randomUUID().toString());
+ request.setRef(stepBeanNameT);
+
+ DefaultContextTestData testData = testRun.getTestData();
+ if (testData != null) {
+ Map<String, Object> values = testData.getValues();
+ Properties inputParameters = new Properties();
+ inputParameters.putAll(values);// TODO: check conversions to string
+ request.setProperties(inputParameters);
+ }
+
+ try {
+ client.sendRequest(request);
+ } catch (Exception e) {
+ throw new SlcException("Could not send request for step "
+ + stepBeanNameT, e);
+ }
+
+ DetachedAnswer answer;
+ try {
+ answer = client.receiveAnswer();
+ } catch (Exception e) {
+ throw new SlcException("Could not receive answer #"
+ + request.getUuid() + " for step " + stepBeanNameT, e);
+ }
+
+ if (answer.getStatus() == DetachedAnswer.ERROR)
+ throw new SlcException("Error when executing step "
+ + answer.getUuid() + ": " + answer.getLog());
+ else
+ log.info("Received answer for '" + request.getRef() + "' ("
+ + answer.getStatusAsString() + "):" + answer.getLog());
+
+ if (testData != null) {
+ Properties outputParameters = answer.getProperties();
+ for (Object key : outputParameters.keySet())
+ testData.getValues().put(key.toString(),
+ outputParameters.get(key));
+ }
+
+ if (testData != null) {
+ ContextUtils.compareReachedExpected(testData,
+ testRun.getTestResult());
+ } else {
+ ((TestResult) testRun.getTestResult())
+ .addResultPart(new SimpleResultPart(TestStatus.PASSED,
+ "Step " + stepBeanNameT + " executed successfully"));
+ }
+ }
+
+ public void setBeanName(String name) {
+ this.testDefBeanName = name;
+ }
+
+ public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
+ if (beanFactory instanceof BeanDefinitionRegistry)
+ beanDefinitionRegistry = (BeanDefinitionRegistry) beanFactory;
+ else
+ throw new BeanInitializationException(
+ "Require BeanDefinitionRegistry");
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ }
+
+ public void setStep(DetachedStep step) {
+ this.step = step;
+ }
+
+ public void setClient(DetachedClient client) {
+ this.client = client;
+ }
+
+ public void setStepRef(String stepBeanName) {
+ this.stepRef = stepBeanName;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.lib.detached;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.detached.DetachedAnswer;
+import org.argeo.slc.detached.DetachedCommunication;
+import org.argeo.slc.detached.DetachedException;
+import org.argeo.slc.detached.DetachedRequest;
+import org.argeo.slc.detached.DetachedXmlConverter;
+import org.springframework.oxm.Marshaller;
+import org.springframework.oxm.Unmarshaller;
+
+public class DetachedXmlConverterSpring implements DetachedXmlConverter {
+ private Marshaller marshaller;
+ private Unmarshaller unmarshaller;
+
+ public void marshallCommunication(DetachedCommunication detCom,
+ Result result) {
+ if (detCom instanceof DetachedRequest) {
+ marshallRequest((DetachedRequest) detCom, result);
+ } else if (detCom instanceof DetachedAnswer) {
+ marshallAnswer((DetachedAnswer) detCom, result);
+ } else {
+ throw new DetachedException("Unkown communication type "
+ + detCom.getClass());
+ }
+ }
+
+ public DetachedCommunication unmarshallCommunication(Source source) {
+ try {
+ return (DetachedCommunication) unmarshaller.unmarshal(source);
+ } catch (Exception e) {
+ throw new SlcException("Could not unmarshall", e);
+ }
+ }
+
+ public void marshallRequest(DetachedRequest request, Result result) {
+ try {
+ marshaller.marshal(request, result);
+ } catch (Exception e) {
+ throw new SlcException("Could not marshall", e);
+ }
+ }
+
+ public void marshallAnswer(DetachedAnswer answer, Result result) {
+ try {
+ marshaller.marshal(answer, result);
+ } catch (Exception e) {
+ throw new SlcException("Could not marshall", e);
+ }
+ }
+
+ public void setMarshaller(Marshaller marshaller) {
+ this.marshaller = marshaller;
+ }
+
+ public void setUnmarshaller(Unmarshaller unmarshaller) {
+ this.unmarshaller = unmarshaller;
+ }
+
+}
--- /dev/null
+<?xml version="1.0"?>
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<!DOCTYPE doc [
+<!ENTITY slc-detached-namespace-uri "http://argeo.org/projects/slc/schemas/detached">
+<!ENTITY slc-detached-namespace-prefix "slc-det">
+]>
+
+<mapping>
+ <description>Mapping of SLC detached types</description>
+
+ <class name="org.argeo.slc.detached.DetachedRequest">
+ <map-to ns-uri="&slc-detached-namespace-uri;"
+ ns-prefix="&slc-detached-namespace-prefix;" />
+ <field name="uuid" />
+ <field name="ref" />
+ <field name="properties" collection="map">
+ <bind-xml name="prop" location="properties">
+ <class name="org.exolab.castor.mapping.MapItem">
+ <map-to ns-uri="&slc-detached-namespace-uri;"
+ ns-prefix="&slc-detached-namespace-prefix;" />
+ <field name="key" type="string">
+ <bind-xml name="key" node="attribute" />
+ </field>
+ <field name="value" type="string">
+ <bind-xml node="text" />
+ </field>
+ </class>
+ </bind-xml>
+ </field>
+ </class>
+
+ <class name="org.argeo.slc.detached.DetachedAnswer">
+ <map-to ns-uri="&slc-detached-namespace-uri;"
+ ns-prefix="&slc-detached-namespace-prefix;" />
+ <field name="uuid" />
+ <field name="status" />
+ <field name="log" />
+ <field name="properties" collection="map">
+ <bind-xml name="prop" location="properties">
+ <class name="org.exolab.castor.mapping.MapItem">
+ <map-to ns-uri="&slc-detached-namespace-uri;"
+ ns-prefix="&slc-detached-namespace-prefix;" />
+ <field name="key" type="string">
+ <bind-xml name="key" node="attribute" />
+ </field>
+ <field name="value" type="string">
+ <bind-xml node="text" />
+ </field>
+ </class>
+ </bind-xml>
+ </field>
+ </class>
+</mapping>
\ No newline at end of file
--- /dev/null
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
+ default-lazy-init="true">
+
+ <bean id="slcTemplate.detached.testDefinition"
+ class="org.argeo.slc.lib.detached.DetachedTestDefinition"
+ abstract="true">
+ </bean>
+
+ <bean id="slcDefault.detached.xmlConverterCastor"
+ class="org.argeo.slc.lib.detached.DetachedXmlConverterSpring">
+ <property name="marshaller"
+ ref="slcDefault.detached.castor.marshaller" />
+ <property name="unmarshaller"
+ ref="slcDefault.detached.castor.marshaller" />
+ </bean>
+
+ <bean id="slcDefault.detached.castor.marshaller"
+ class="org.springframework.oxm.castor.CastorMarshaller">
+ <property name="mappingLocations">
+ <list>
+ <value>
+ classpath:org/argeo/slc/lib/detached/castor.xml
+ </value>
+ </list>
+ </property>
+ <property name="whitespacePreserve" value="true" />
+ </bean>
+
+ <bean id="slcDefault.detached.xml.xsdValidator"
+ factory-bean="slcDefault.detached.xml.xsdSchema"
+ factory-method="createValidator" />
+
+ <bean id="slcDefault.detached.xml.xsdSchema"
+ class="org.springframework.xml.xsd.SimpleXsdSchema">
+ <property name="xsd"
+ value="classpath:/org/argeo/slc/detached/slc-detached.xsd" />
+ </bean>
+
+</beans>
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.lib.detached;
+
+import java.util.Enumeration;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.detached.DetachedAnswer;
+import org.argeo.slc.detached.DetachedRequest;
+import org.argeo.slc.detached.DetachedXmlConverter;
+import org.argeo.slc.detached.DetachedXmlConverterCompat;
+import org.argeo.slc.unit.AbstractSpringTestCase;
+import org.argeo.slc.unit.UnitXmlUtils;
+import org.springframework.xml.transform.StringResult;
+import org.springframework.xml.transform.StringSource;
+import org.springframework.xml.validation.XmlValidator;
+
+public class DetachedCastorTest extends AbstractSpringTestCase {
+ private final Log log = LogFactory.getLog(getClass());
+
+ private DetachedXmlConverter converter = null;
+ private XmlValidator validator = null;
+ private DetachedXmlConverter converterCompat = null;
+
+ public void setUp() {
+ converter = getBean("slcDefault.detached.xmlConverterCastor");
+ validator = getBean("slcDefault.detached.xml.xsdValidator");
+ converterCompat = new DetachedXmlConverterCompat();
+ }
+
+ public void testRequest() throws Exception {
+ DetachedRequest request = createTestRequest();
+
+ StringResult result = new StringResult();
+ converter.marshallCommunication(request, result);
+ String xml = result.toString();
+ log.debug(xml + "\n");
+
+ UnitXmlUtils.assertXmlValidation(validator, new StringSource(xml));
+ DetachedRequest requestUnm = (DetachedRequest) converter
+ .unmarshallCommunication(new StringSource(xml));
+ assertDetachedRequest(request, requestUnm);
+ }
+
+ public void testRequestCompat() throws Exception {
+ DetachedRequest request = createTestRequest();
+
+ StringResult result = new StringResult();
+ converter.marshallCommunication(request, result);
+ String xml = result.toString();
+ log.debug(xml + "\n");
+
+ UnitXmlUtils.assertXmlValidation(validator, new StringSource(xml));
+ DetachedRequest requestUnm = (DetachedRequest) converterCompat
+ .unmarshallCommunication(new StringSource(xml));
+ assertDetachedRequest(request, requestUnm);
+ }
+
+ public void testAnswer() throws Exception {
+ DetachedAnswer answer = createTestAnswer();
+ StringResult result = new StringResult();
+ converter.marshallCommunication(answer, result);
+ String xml = result.toString();
+ log.debug(xml + "\n");
+
+ UnitXmlUtils.assertXmlValidation(validator, new StringSource(xml));
+ DetachedAnswer answerUnm = (DetachedAnswer) converter
+ .unmarshallCommunication(new StringSource(xml));
+ assertDetachedAnswer(answer, answerUnm);
+ }
+
+ public void testAnswerCompat() throws Exception {
+ DetachedAnswer answer = createTestAnswer();
+ StringResult result = new StringResult();
+ converterCompat.marshallCommunication(answer, result);
+ String xml = result.toString();
+ log.debug(xml + "\n");
+
+ UnitXmlUtils.assertXmlValidation(validator, new StringSource(xml));
+ DetachedAnswer answerUnm = (DetachedAnswer) converter
+ .unmarshallCommunication(new StringSource(xml));
+ assertDetachedAnswer(answer, answerUnm);
+ }
+
+ public static DetachedRequest createTestRequest() {
+ DetachedRequest request = new DetachedRequest();
+ request.setUuid("12345");
+ request.setRef("testRef");
+ Properties properties = new Properties();
+ properties.setProperty("key1", "value1");
+ properties.setProperty("key2", "value2");
+ request.setProperties(properties);
+ return request;
+ }
+
+ public static DetachedAnswer createTestAnswer() {
+ DetachedAnswer answer = new DetachedAnswer();
+ answer.setUuid("12345");
+ answer.setStatus(DetachedAnswer.PROCESSED);
+ answer.setLog("my log\nline break.");
+ Properties properties = new Properties();
+ properties.setProperty("key1", "value1");
+ properties.setProperty("key2", "value2");
+ answer.setProperties(properties);
+ return answer;
+ }
+
+ public static void assertDetachedRequest(DetachedRequest expected,
+ DetachedRequest reached) {
+ assertEquals(expected.getUuid(), reached.getUuid());
+ assertEquals(expected.getRef(), reached.getRef());
+ Properties expectedProps = expected.getProperties();
+ Properties reachedProps = reached.getProperties();
+ assertEquals(expectedProps.size(), reachedProps.size());
+ Enumeration<Object> keys = expectedProps.keys();
+ while (keys.hasMoreElements()) {
+ String key = (String) keys.nextElement();
+ assertTrue(reachedProps.containsKey(key));
+ assertEquals(expectedProps.getProperty(key), reachedProps
+ .getProperty(key));
+ }
+ }
+
+ public static void assertDetachedAnswer(DetachedAnswer expected,
+ DetachedAnswer reached) {
+ assertEquals(expected.getUuid(), reached.getUuid());
+ assertEquals(expected.getStatus(), reached.getStatus());
+ assertEquals(expected.getLog(), reached.getLog());
+ Properties expectedProps = expected.getProperties();
+ Properties reachedProps = reached.getProperties();
+ assertEquals(expectedProps.size(), reachedProps.size());
+ Enumeration<Object> keys = expectedProps.keys();
+ while (keys.hasMoreElements()) {
+ String key = (String) keys.nextElement();
+ assertTrue(reachedProps.containsKey(key));
+ assertEquals(expectedProps.getProperty(key), reachedProps
+ .getProperty(key));
+ }
+ }
+}
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+# Slc\r
+log4j.logger.org.argeo=DEBUG\r
+\r
+# Castor\r
+log4j.logger.org.exolab.castor=WARN\r
+\r
+# Spring\r
+log4j.logger.org.springframework=WARN\r
+\r
+## Appenders\r
+# A1 is set to be a ConsoleAppender.\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+\r
+# A1 uses PatternLayout.\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
+\r
--- /dev/null
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <import resource="classpath:/org/argeo/slc/lib/detached/spring.xml" />
+
+</beans>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.repo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
--- /dev/null
+#Sat Feb 05 12:23:06 CET 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
--- /dev/null
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.repo</artifactId>
+ <name>SLC Repo Runtime</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.repo.*
+ </Export-Package>
+ <Import-Package>
+ org.w3c.dom.*;version="0.0.0",
+ org.xml.sax.*;version="0.0.0",
+ javax.xml.transform.*;version="0.0.0",
+ javax.xml.parsers.*;version="0.0.0",
+ javax.jcr.nodetype,
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <!-- SLC Runtime -->
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.support.aether</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.support.jcr</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Commons -->
+ <dependency>
+ <groupId>org.argeo.commons.server</groupId>
+ <artifactId>org.argeo.server.jcr</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+
+ <!-- Third party -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.org.apache.commons.logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>javax.servlet</artifactId>
+ </dependency>
+
+ <!-- OSGi -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>biz.aQute.bndlib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- RPM -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.redline_rpm</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2003, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+org.osgi.framework.system.packages = \
+ javax.accessibility,\
+ javax.activation,\
+ javax.activity,\
+ javax.annotation,\
+ javax.annotation.processing,\
+ javax.crypto,\
+ javax.crypto.interfaces,\
+ javax.crypto.spec,\
+ javax.imageio,\
+ javax.imageio.event,\
+ javax.imageio.metadata,\
+ javax.imageio.plugins.bmp,\
+ javax.imageio.plugins.jpeg,\
+ javax.imageio.spi,\
+ javax.imageio.stream,\
+ javax.jws,\
+ javax.jws.soap,\
+ javax.lang.model,\
+ javax.lang.model.element,\
+ javax.lang.model.type,\
+ javax.lang.model.util,\
+ javax.management,\
+ javax.management.loading,\
+ javax.management.modelmbean,\
+ javax.management.monitor,\
+ javax.management.openmbean,\
+ javax.management.relation,\
+ javax.management.remote,\
+ javax.management.remote.rmi,\
+ javax.management.timer,\
+ javax.naming,\
+ javax.naming.directory,\
+ javax.naming.event,\
+ javax.naming.ldap,\
+ javax.naming.spi,\
+ javax.net,\
+ javax.net.ssl,\
+ javax.print,\
+ javax.print.attribute,\
+ javax.print.attribute.standard,\
+ javax.print.event,\
+ javax.rmi,\
+ javax.rmi.CORBA,\
+ javax.rmi.ssl,\
+ javax.script,\
+ javax.security.auth,\
+ javax.security.auth.callback,\
+ javax.security.auth.kerberos,\
+ javax.security.auth.login,\
+ javax.security.auth.spi,\
+ javax.security.auth.x500,\
+ javax.security.cert,\
+ javax.security.sasl,\
+ javax.sound.midi,\
+ javax.sound.midi.spi,\
+ javax.sound.sampled,\
+ javax.sound.sampled.spi,\
+ javax.sql,\
+ javax.sql.rowset,\
+ javax.sql.rowset.serial,\
+ javax.sql.rowset.spi,\
+ javax.swing,\
+ javax.swing.border,\
+ javax.swing.colorchooser,\
+ javax.swing.event,\
+ javax.swing.filechooser,\
+ javax.swing.plaf,\
+ javax.swing.plaf.basic,\
+ javax.swing.plaf.metal,\
+ javax.swing.plaf.multi,\
+ javax.swing.plaf.synth,\
+ javax.swing.table,\
+ javax.swing.text,\
+ javax.swing.text.html,\
+ javax.swing.text.html.parser,\
+ javax.swing.text.rtf,\
+ javax.swing.tree,\
+ javax.swing.undo,\
+ javax.tools,\
+ javax.transaction,\
+ javax.transaction.xa,\
+ javax.xml,\
+ javax.xml.bind,\
+ javax.xml.bind.annotation,\
+ javax.xml.bind.annotation.adapters,\
+ javax.xml.bind.attachment,\
+ javax.xml.bind.helpers,\
+ javax.xml.bind.util,\
+ javax.xml.crypto,\
+ javax.xml.crypto.dom,\
+ javax.xml.crypto.dsig,\
+ javax.xml.crypto.dsig.dom,\
+ javax.xml.crypto.dsig.keyinfo,\
+ javax.xml.crypto.dsig.spec,\
+ javax.xml.datatype,\
+ javax.xml.namespace,\
+ javax.xml.parsers,\
+ javax.xml.soap,\
+ javax.xml.stream,\
+ javax.xml.stream.events,\
+ javax.xml.stream.util,\
+ javax.xml.transform,\
+ javax.xml.transform.dom,\
+ javax.xml.transform.sax,\
+ javax.xml.transform.stax,\
+ javax.xml.transform.stream,\
+ javax.xml.validation,\
+ javax.xml.ws,\
+ javax.xml.ws.handler,\
+ javax.xml.ws.handler.soap,\
+ javax.xml.ws.http,\
+ javax.xml.ws.soap,\
+ javax.xml.ws.spi,\
+ javax.xml.ws.wsaddressing,\
+ javax.xml.xpath,\
+ org.ietf.jgss,\
+ org.omg.CORBA,\
+ org.omg.CORBA_2_3,\
+ org.omg.CORBA_2_3.portable,\
+ org.omg.CORBA.DynAnyPackage,\
+ org.omg.CORBA.ORBPackage,\
+ org.omg.CORBA.portable,\
+ org.omg.CORBA.TypeCodePackage,\
+ org.omg.CosNaming,\
+ org.omg.CosNaming.NamingContextExtPackage,\
+ org.omg.CosNaming.NamingContextPackage,\
+ org.omg.Dynamic,\
+ org.omg.DynamicAny,\
+ org.omg.DynamicAny.DynAnyFactoryPackage,\
+ org.omg.DynamicAny.DynAnyPackage,\
+ org.omg.IOP,\
+ org.omg.IOP.CodecFactoryPackage,\
+ org.omg.IOP.CodecPackage,\
+ org.omg.Messaging,\
+ org.omg.PortableInterceptor,\
+ org.omg.PortableInterceptor.ORBInitInfoPackage,\
+ org.omg.PortableServer,\
+ org.omg.PortableServer.CurrentPackage,\
+ org.omg.PortableServer.POAManagerPackage,\
+ org.omg.PortableServer.POAPackage,\
+ org.omg.PortableServer.portable,\
+ org.omg.PortableServer.ServantLocatorPackage,\
+ org.omg.SendingContext,\
+ org.omg.stub.java.rmi,\
+ org.w3c.dom,\
+ org.w3c.dom.bootstrap,\
+ org.w3c.dom.css,\
+ org.w3c.dom.events,\
+ org.w3c.dom.html,\
+ org.w3c.dom.ls,\
+ org.w3c.dom.ranges,\
+ org.w3c.dom.stylesheets,\
+ org.w3c.dom.traversal,\
+ org.w3c.dom.views,\
+ org.w3c.dom.xpath,\
+ org.xml.sax,\
+ org.xml.sax.ext,\
+ org.xml.sax.helpers
+org.osgi.framework.bootdelegation = \
+ javax.*,\
+ org.ietf.jgss,\
+ org.omg.*,\
+ org.w3c.*,\
+ org.xml.*,\
+ sun.*,\
+ com.sun.*
+org.osgi.framework.executionenvironment = \
+ OSGi/Minimum-1.0,\
+ OSGi/Minimum-1.1,\
+ OSGi/Minimum-1.2,\
+ JRE-1.1,\
+ J2SE-1.2,\
+ J2SE-1.3,\
+ J2SE-1.4,\
+ J2SE-1.5,\
+ JavaSE-1.6
+osgi.java.profile.name = JavaSE-1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
--- /dev/null
+###############################################################################
+# Copyright (c) 2009, 2010 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+org.osgi.framework.system.packages = \
+ javax.accessibility,\
+ javax.activation,\
+ javax.activity,\
+ javax.annotation,\
+ javax.annotation.processing,\
+ javax.crypto,\
+ javax.crypto.interfaces,\
+ javax.crypto.spec,\
+ javax.imageio,\
+ javax.imageio.event,\
+ javax.imageio.metadata,\
+ javax.imageio.plugins.bmp,\
+ javax.imageio.plugins.jpeg,\
+ javax.imageio.spi,\
+ javax.imageio.stream,\
+ javax.jws,\
+ javax.jws.soap,\
+ javax.lang.model,\
+ javax.lang.model.element,\
+ javax.lang.model.type,\
+ javax.lang.model.util,\
+ javax.management,\
+ javax.management.event,\
+ javax.management.loading,\
+ javax.management.modelmbean,\
+ javax.management.monitor,\
+ javax.management.namespace,\
+ javax.management.openmbean,\
+ javax.management.relation,\
+ javax.management.remote,\
+ javax.management.remote.rmi,\
+ javax.management.timer,\
+ javax.naming,\
+ javax.naming.directory,\
+ javax.naming.event,\
+ javax.naming.ldap,\
+ javax.naming.spi,\
+ javax.net,\
+ javax.net.ssl,\
+ javax.print,\
+ javax.print.attribute,\
+ javax.print.attribute.standard,\
+ javax.print.event,\
+ javax.rmi,\
+ javax.rmi.CORBA,\
+ javax.rmi.ssl,\
+ javax.script,\
+ javax.security.auth,\
+ javax.security.auth.callback,\
+ javax.security.auth.kerberos,\
+ javax.security.auth.login,\
+ javax.security.auth.spi,\
+ javax.security.auth.x500,\
+ javax.security.cert,\
+ javax.security.sasl,\
+ javax.sound.midi,\
+ javax.sound.midi.spi,\
+ javax.sound.sampled,\
+ javax.sound.sampled.spi,\
+ javax.sql,\
+ javax.sql.rowset,\
+ javax.sql.rowset.serial,\
+ javax.sql.rowset.spi,\
+ javax.swing,\
+ javax.swing.border,\
+ javax.swing.colorchooser,\
+ javax.swing.event,\
+ javax.swing.filechooser,\
+ javax.swing.plaf,\
+ javax.swing.plaf.basic,\
+ javax.swing.plaf.metal,\
+ javax.swing.plaf.multi,\
+ javax.swing.plaf.nimbus,\
+ javax.swing.plaf.synth,\
+ javax.swing.table,\
+ javax.swing.text,\
+ javax.swing.text.html,\
+ javax.swing.text.html.parser,\
+ javax.swing.text.rtf,\
+ javax.swing.tree,\
+ javax.swing.undo,\
+ javax.tools,\
+ javax.transaction,\
+ javax.transaction.xa,\
+ javax.xml,\
+ javax.xml.bind,\
+ javax.xml.bind.annotation,\
+ javax.xml.bind.annotation.adapters,\
+ javax.xml.bind.attachment,\
+ javax.xml.bind.helpers,\
+ javax.xml.bind.util,\
+ javax.xml.crypto,\
+ javax.xml.crypto.dom,\
+ javax.xml.crypto.dsig,\
+ javax.xml.crypto.dsig.dom,\
+ javax.xml.crypto.dsig.keyinfo,\
+ javax.xml.crypto.dsig.spec,\
+ javax.xml.datatype,\
+ javax.xml.namespace,\
+ javax.xml.parsers,\
+ javax.xml.soap,\
+ javax.xml.stream,\
+ javax.xml.stream.events,\
+ javax.xml.stream.util,\
+ javax.xml.transform,\
+ javax.xml.transform.dom,\
+ javax.xml.transform.sax,\
+ javax.xml.transform.stax,\
+ javax.xml.transform.stream,\
+ javax.xml.validation,\
+ javax.xml.ws,\
+ javax.xml.ws.handler,\
+ javax.xml.ws.handler.soap,\
+ javax.xml.ws.http,\
+ javax.xml.ws.soap,\
+ javax.xml.ws.spi,\
+ javax.xml.ws.wsaddressing,\
+ javax.xml.xpath,\
+ org.ietf.jgss,\
+ org.omg.CORBA,\
+ org.omg.CORBA_2_3,\
+ org.omg.CORBA_2_3.portable,\
+ org.omg.CORBA.DynAnyPackage,\
+ org.omg.CORBA.ORBPackage,\
+ org.omg.CORBA.portable,\
+ org.omg.CORBA.TypeCodePackage,\
+ org.omg.CosNaming,\
+ org.omg.CosNaming.NamingContextExtPackage,\
+ org.omg.CosNaming.NamingContextPackage,\
+ org.omg.Dynamic,\
+ org.omg.DynamicAny,\
+ org.omg.DynamicAny.DynAnyFactoryPackage,\
+ org.omg.DynamicAny.DynAnyPackage,\
+ org.omg.IOP,\
+ org.omg.IOP.CodecFactoryPackage,\
+ org.omg.IOP.CodecPackage,\
+ org.omg.Messaging,\
+ org.omg.PortableInterceptor,\
+ org.omg.PortableInterceptor.ORBInitInfoPackage,\
+ org.omg.PortableServer,\
+ org.omg.PortableServer.CurrentPackage,\
+ org.omg.PortableServer.POAManagerPackage,\
+ org.omg.PortableServer.POAPackage,\
+ org.omg.PortableServer.portable,\
+ org.omg.PortableServer.ServantLocatorPackage,\
+ org.omg.SendingContext,\
+ org.omg.stub.java.rmi,\
+ org.w3c.dom,\
+ org.w3c.dom.bootstrap,\
+ org.w3c.dom.css,\
+ org.w3c.dom.events,\
+ org.w3c.dom.html,\
+ org.w3c.dom.ls,\
+ org.w3c.dom.ranges,\
+ org.w3c.dom.stylesheets,\
+ org.w3c.dom.traversal,\
+ org.w3c.dom.views,\
+ org.w3c.dom.xpath,\
+ org.xml.sax,\
+ org.xml.sax.ext,\
+ org.xml.sax.helpers
+org.osgi.framework.bootdelegation = \
+ javax.*,\
+ org.ietf.jgss,\
+ org.omg.*,\
+ org.w3c.*,\
+ org.xml.*,\
+ sun.*,\
+ com.sun.*
+org.osgi.framework.executionenvironment = \
+ OSGi/Minimum-1.0,\
+ OSGi/Minimum-1.1,\
+ OSGi/Minimum-1.2,\
+ JRE-1.1,\
+ J2SE-1.2,\
+ J2SE-1.3,\
+ J2SE-1.4,\
+ J2SE-1.5,\
+ JavaSE-1.6,\
+ JavaSE-1.7
+osgi.java.profile.name = JavaSE-1.7
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
--- /dev/null
+<slc = 'http://www.argeo.org/ns/slc'>
+
+// AETHER
+[slc:artifact] > mix:referenceable, mix:created, mix:lastModified
+mixin
+- slc:artifactId (STRING) m
+- slc:groupId (STRING) m
+- slc:artifactVersion (STRING) m
+- slc:artifactExtension (STRING) m
+- slc:artifactClassifier (STRING) ='' m a
+
+[slc:artifactVersion] > mix:referenceable, mix:created, mix:lastModified, mix:title
+mixin
+- slc:artifactId (STRING) m
+- slc:groupId (STRING) m
+- slc:artifactVersion (STRING) m
+
+[slc:artifactBase] > mix:referenceable, mix:created, mix:lastModified
+mixin
+- slc:artifactId (STRING) m
+- slc:groupId (STRING) m
+
+[slc:groupBase] > mix:referenceable, mix:created, mix:lastModified
+mixin
+// it is possible to have groupBase being artifact base (e.g. org.argeo.commons.basic)
+// so using groupId would conflict
+- slc:groupBaseId (STRING) m
+
+// Mark a given group base as relevant to create modular distribution in the current workspace
+// [slc:category]
+// mixin
+
+[slc:distribution] > slc:artifactVersion
+mixin
++ slc:artifactVersions (argeo:references) m
+
+
+[slc:modularDistributionBase]
+mixin
+
+// Question: Extend slc:categorizedNameVersion ? (not possible without migration)
+[slc:modularDistribution]
+mixin
++ slc:modules (nt:unstructured) m
+
+[slc:moduleCoordinates] > nt:unstructured
+- slc:category (STRING)
+- slc:name (STRING)
+- slc:version (STRING)
+
+
+// ORIGINS
+[slc:knownOrigin] > nt:base
+mixin
++ slc:origin (nt:address)
+
+[slc:proxied] > nt:address
+- slc:proxy (REFERENCE)
+
+// JAVA
+[slc:jarFile] > mix:referenceable
+mixin
+- 'slc:manifest' (BINARY) m
+- 'slc:Manifest-Version' (STRING)
+- 'slc:Signature-Version' (STRING)
+- 'slc:Class-Path' (STRING)
+- 'slc:Main-Class' (STRING)
+- 'slc:Extension-Name' (STRING)
+- 'slc:Implementation-Version' (STRING)
+- 'slc:Implementation-Vendor' (STRING)
+- 'slc:Implementation-Vendor-Id' (STRING)
+- 'slc:Implementation-URL' (STRING)
+- 'slc:Specification-Title' (STRING)
+- 'slc:Specification-Version' (STRING)
+- 'slc:Specification-Vendor' (STRING)
+- 'slc:Sealed' (STRING)
+
+// OSGi
+// see http://www.osgi.org/Specifications/Reference
+
+[slc:javaPackage] > mix:referenceable
+- slc:name (STRING) primary m
+
+[slc:osgiBaseVersion] > mix:referenceable
+- slc:asString (STRING) primary m
+- slc:major (LONG) m
+- slc:minor (LONG) m
+- slc:micro (LONG) m
+
+[slc:osgiVersion] > slc:osgiBaseVersion
+- slc:qualifier (STRING)
+
+[slc:exportedPackage] > slc:javaPackage
++ slc:uses (slc:javaPackage) multiple
++ slc:version (slc:osgiVersion)
+
+[slc:importedPackage] > slc:javaPackage
+- slc:version (STRING) ='0.0.0' m a
+- slc:optional (BOOLEAN) ='false' m a
+
+[slc:dynamicImportedPackage] > slc:javaPackage
+- slc:version (STRING) ='0.0.0' m a
+- slc:optional (BOOLEAN) ='false' m a
+
+[slc:requiredBundle] > mix:referenceable
+- 'slc:symbolic-name' (STRING) primary m
+- 'slc:bundle-version' (STRING) ='0.0.0' m a
+- slc:optional (BOOLEAN) ='false' m a
+
+[slc:fragmentHost] > mix:referenceable
+- 'slc:symbolic-name' (STRING) m
+- 'slc:bundle-version' (STRING) ='0.0.0' m a
+
+[slc:bundleNativeCode] > mix:referenceable
+- slc:path (STRING) primary m
+- slc:osname (STRING)
+- slc:processor (STRING)
+
+// see http://www.osgi.org/Specifications/ReferenceHeaders
+[slc:bundle] > mix:referenceable
+mixin
+- 'slc:symbolic-name' (STRING) primary m
+- 'slc:bundle-version' (STRING) m
+- 'slc:Bundle-SymbolicName' (STRING) m
+- 'slc:Bundle-Name' (STRING)
+- 'slc:Bundle-Description' (STRING)
+- 'slc:Bundle-ManifestVersion' (STRING)
+- 'slc:Bundle-Category' (STRING)
+- 'slc:Bundle-ActivationPolicy' (STRING)
+- 'slc:Bundle-Copyright' (STRING)
+- 'slc:Bundle-Vendor' (STRING)
+- 'slc:Bundle-License' (STRING)
+- 'slc:Bundle-DocURL' (STRING)
+- 'slc:Bundle-ContactAddress' (STRING)
+- 'slc:Bundle-Activator' (STRING)
+- 'slc:Bundle-UpdateLocation' (STRING)
+- 'slc:Bundle-Localization' (STRING)
+- 'slc:Bundle-ClassPath' (STRING) *
+// see http://wiki.eclipse.org/EE < 'OSGi/Minimum-1.0','OSGi/Minimum-1.1','CDC-1.0/Foundation-1.0','CDC-1.1/Foundation-1.1','JRE-1.1','J2SE-1.2','J2SE-1.3','J2SE-1.4','J2SE-1.5','JavaSE-1.6','JavaSE-1.7'
+- 'slc:Bundle-RequiredExecutionEnvironment' (STRING) *
++ 'slc:Bundle-Version' (slc:osgiVersion) m
++ 'slc:Fragment-Host' (slc:fragmentHost)
++ 'slc:Import-Package' (slc:importedPackage) multiple
++ 'slc:Export-Package' (slc:exportedPackage) multiple
++ 'slc:Require-Bundle' (slc:requiredBundle) multiple
++ 'slc:Bundle-NativeCode' (slc:bundleNativeCode) multiple
++ 'slc:DynamicImport-Package' (slc:dynamicImportedPackage) multiple
+
+[slc:bundleArtifact] > slc:artifact,slc:jarFile,slc:bundle
+mixin
+
+// RPM
+[slc:rpm] > mix:referenceable, mix:created, mix:lastModified, mix:title
+mixin
+- slc:name (STRING)
+- slc:version (STRING)
+- slc:rpmVersion (STRING)
+- slc:rpmRelease (STRING)
+- slc:rpmArch (STRING)
+- slc:rpmArchivaeSize (STRING)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.rpmfactory</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
--- /dev/null
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
--- /dev/null
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.rpmfactory</artifactId>
+ <name>SLC RPM Factory</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.rpmfactory.*
+ </Export-Package>
+ <Import-Package>
+ javax.jcr.nodetype,
+ org.argeo.slc.repo,
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <!-- SLC Runtime -->
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.repo</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.support.jcr</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Third party -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.org.apache.commons.logging</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.specs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Fri Aug 29 11:10:18 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+source.. = src/main/java/
+jre.compilation.profile = J2SE-1.5
+
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.specs</artifactId>
+ <name>SLC Specifications</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.*
+ </Export-Package>
+ <Import-Package>*,
+ org.hibernate.proxy;resolution:="optional",
+ javassist.util.proxy;resolution:="optional"
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
--- /dev/null
+Argeo SLC Site
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.support.aether</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Sun Feb 13 11:00:00 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+#Sun Feb 13 11:00:00 CET 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
--- /dev/null
+source.. = src/main/java/,\
+ src/test/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .
+additional.bundles = junit,\
+ slf4j.api,\
+ slf4j.log4j,\
+ org.apache.log4j,\
+ slf4j.org.apache.commons.logging
+
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.support.aether</artifactId>
+ <name>SLC Support Aether</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.aether.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.core</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.sonatype.aether</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.beans</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.org.apache.commons.logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Test -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>\r
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.support.ant</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Fri Aug 29 11:31:46 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+source.. = src/main/java/,\
+ src/main/resources/,\
+ src/test/java/,\
+ src/test/resources/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.support.ant</artifactId>
+ <packaging>jar</packaging>
+ <name>SLC Support Ant</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.ant.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.core</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.tools.ant</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.tools.ant.launch</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.net</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.oro</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.bsf</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+# Slc\r
+log4j.logger.org.argeo=DEBUG\r
+\r
+# Castor\r
+log4j.logger.org.exolab.castor=WARN\r
+\r
+# Spring\r
+log4j.logger.org.springframework=WARN\r
+\r
+## Appenders\r
+# A1 is set to be a ConsoleAppender.\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+\r
+# A1 uses PatternLayout.\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.support.equinox</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org> Licensed under \r
+ the Apache License, Version 2.0 (the "License"); you may not use this file \r
+ except in compliance with the License. You may obtain a copy of the License \r
+ at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable \r
+ law or agreed to in writing, software distributed under the License is distributed \r
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either \r
+ express or implied. See the License for the specific language governing permissions \r
+ and limitations under the License. -->\r
+\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 -->\r
+<!-- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> -->\r
+<!-- <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" /> -->\r
+<!-- <property name="ignoreUnresolvablePlaceholders" value="false" /> -->\r
+<!-- <property name="locations"> -->\r
+<!-- <value>osgibundle:equinox.properties</value> -->\r
+<!-- </property> -->\r
+<!-- </bean> -->\r
+\r
+ <bean id="commandProvider" class="org.argeo.slc.equinox.ExecutionCommandProvider">\r
+ <property name="agentCli" ref="agentCli" />\r
+ </bean>\r
+\r
+<!-- <bean id="modulesManager" class="org.argeo.slc.osgi.OsgiExecutionModulesManager"> -->\r
+<!-- <property name="bundlesManager" ref="bundlesManager" /> -->\r
+<!-- </bean> -->\r
+\r
+<!-- <bean id="bundlesManager" class="org.argeo.slc.osgi.BundlesManager"> -->\r
+<!-- <property name="defaultTimeout" value="${slc.equinox.commandTimeout}" /> -->\r
+<!-- <property name="pollingPeriod" value="${slc.equinox.commandPollingPeriod}" /> -->\r
+<!-- </bean> -->\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org> Licensed under \r
+ the Apache License, Version 2.0 (the "License"); you may not use this file \r
+ except in compliance with the License. You may obtain a copy of the License \r
+ at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable \r
+ law or agreed to in writing, software distributed under the License is distributed \r
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either \r
+ express or implied. See the License for the specific language governing permissions \r
+ and limitations under the License. -->\r
+\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ http://www.springframework.org/schema/beans \r
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <!-- REFERENCES -->\r
+ <reference id="agentCli" interface="org.argeo.slc.execution.SlcAgentCli" />\r
+\r
+ <!-- SERVICES -->\r
+ <service interface="org.eclipse.osgi.framework.console.CommandProvider"\r
+ ref="commandProvider" />\r
+</beans:beans>
\ No newline at end of file
--- /dev/null
+additional.bundles = org.argeo.slc.core,\
+ org.springframework.context,\
+ org.argeo.slc.unit,\
+ junit,\
+ org.argeo.osgi.boot,\
+ org.eclipse.osgi
+source.. = src/main/java/,\
+ src/test/java/,\
+ src/test/resources/
--- /dev/null
+# Timeout for the SLC command in the OSGi console (in ms)
+slc.equinox.commandTimeout=10000
+# Polling period for synchronous OSGi commands (in ms)
+slc.equinox.commandPollingPeriod=100
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.support.equinox</artifactId>
+ <name>SLC Support Equinox</name>
+ <packaging>jar</packaging>
+ <properties />
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- FIXME class "org.osgi.service.condpermadmin.ConditionalPermissionUpdate"'s
+ signer information does not match signer information of other classes in
+ the same package -->
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.*
+ </Export-Package>
+ <Import-Package>*,
+ org.springframework.beans.factory.config,
+ org.springframework.osgi.context.event,
+ org.springframework.core.io
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.support.osgi</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ </dependency>
+
+ <!-- Unit Tests -->
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.unit</artifactId>
+ <scope>test</scope>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.equinox;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.osgi.OsgiRuntime;
+import org.eclipse.core.runtime.adaptor.EclipseStarter;
+
+/** OSGi runtime with shutdown capability implemented. */
+@SuppressWarnings("restriction")
+@Deprecated
+public class EquinoxRuntime extends OsgiRuntime {
+
+ public void shutdown() {
+ try {
+ EclipseStarter.shutdown();
+ } catch (Exception e) {
+ throw new SlcException("Cannot shutdown Equinox runtime.", e);
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.equinox;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.execution.SlcAgentCli;
+import org.eclipse.osgi.framework.console.CommandInterpreter;
+import org.eclipse.osgi.framework.console.CommandProvider;
+
+public class ExecutionCommandProvider implements CommandProvider {
+ private SlcAgentCli agentCli;
+
+ private String lastProcessUuid;
+
+ public Object _slc(CommandInterpreter ci) {
+ List<String> args = new ArrayList<String>();
+ String arg = null;
+ while ((arg = ci.nextArgument()) != null)
+ args.add(arg);
+ if (args.size() == 0) {
+ // TODO relaunch last process
+ ci.execute("help");
+ throw new SlcException("Command not properly formatted");
+ }
+
+ lastProcessUuid = agentCli
+ .process(args.toArray(new String[args.size()]));
+ return lastProcessUuid;
+ }
+
+ public String getHelp() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("---SLC Execution Commands---\n");
+ buf.append("\tslc <module> <flow> [[ --arg value | --booleanArg ]]"
+ + " - executes an execution flow\n");
+ return buf.toString();
+
+ }
+
+ public void setAgentCli(SlcAgentCli agentCli) {
+ this.agentCli = agentCli;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.equinox.cli;
+
+import org.eclipse.core.runtime.adaptor.EclipseStarter;
+
+@SuppressWarnings("restriction")
+public class Main {
+
+ public static void main(String[] args) {
+ try {
+ String confDir = "";
+ String[] equinoxArgs = { "-console", "-conf", confDir };
+ EclipseStarter.startup(equinoxArgs, null);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+}
--- /dev/null
+Bundle-SymbolicName: org.argeo.slc.support.osgi.test.hello
+Bundle-Version: 0.1.0
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+ <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />
+
+ <bean id="main" parent="slcTemplate.simpleFlow" init-method="run">
+ <property name="executables">
+ <list>
+ <bean parent="task.echo">
+ <property name="message" value="Hello world!" />
+ </bean>
+ </list>
+ </property>
+ </bean>
+</beans>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.osgi.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.argeo.slc.equinox.unit.AbstractOsgiRuntimeTestCase;
+import org.argeo.osgi.boot.OsgiBoot;
+
+public class HelloTest extends AbstractOsgiRuntimeTestCase {
+ public void testHello() throws Exception {
+ Thread.sleep(2000);
+ }
+
+ protected void installBundles() throws Exception {
+ // System.out.println("java.class.path="
+ // + System.getProperty("java.class.path"));
+
+ osgiBoot.installUrls(osgiBoot.getLocationsUrls(
+ OsgiBoot.DEFAULT_BASE_URL,
+ System.getProperty("java.class.path")));
+ osgiBoot.installUrls(osgiBoot.getBundlesUrls("src/test/bundles;in=*"));
+
+ // Map<String, String> sysProps = new TreeMap(System.getProperties());
+ // for (String key : sysProps.keySet()) {
+ // System.out.println(key + "=" + sysProps.get(key));
+ // }
+ }
+
+ protected List<String> getBundlesToStart() {
+ List<String> bundlesToStart = new ArrayList<String>();
+ // bundlesToStart.add("org.springframework.osgi.extender");
+ bundlesToStart.add("org.argeo.slc.support.osgi.test.hello");
+ return bundlesToStart;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.osgi.test;
+
+import org.argeo.slc.equinox.unit.AbstractOsgiRuntimeTestCase;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+
+public class PlatformStartStopTest extends AbstractOsgiRuntimeTestCase {
+
+ public void testStartStop() {
+ BundleContext bundleContext = osgiBoot.getBundleContext();
+ System.out.println(bundleContext
+ .getProperty(Constants.FRAMEWORK_VENDOR));
+ System.out.println(bundleContext
+ .getProperty(Constants.FRAMEWORK_VERSION));
+ System.out.println(bundleContext
+ .getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT));
+
+ }
+}
--- /dev/null
+Bundle-SymbolicName: org.argeo.slc.support.osgi.tests
+Fragment-Host: org.argeo.slc.support.osgi
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.support.jcr</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Sun Feb 21 12:26:27 CET 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+#Thu Feb 18 16:48:02 CET 2010
+eclipse.preferences.version=1
+resolve.requirebundle=false
--- /dev/null
+additional.bundles = org.springframework.core,\
+ org.argeo.server.jackrabbit,\
+ junit,\
+ org.argeo.slc.unit,\
+ org.apache.xerces,\
+ org.apache.log4j,\
+ slf4j.api,\
+ slf4j.log4j,\
+ org.eclipse.osgi,\
+ org.apache.commons.io,\
+ org.apache.jackrabbit,\
+ org.h2,\
+ org.apache.commons.dbcp,\
+ org.apache.commons.pool,\
+ edu.oswego.cs.dl.util.concurrent,\
+ org.apache.commons.collections,\
+ org.apache.lucene,\
+ org.apache.tika
+source.. = src/main/java/,\
+ src/main/resources/,\
+ src/test/java/,\
+ src/test/resources/
+
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.support.jcr</artifactId>
+ <name>SLC Support JCR</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.jcr.*
+ </Export-Package>
+ <Import-Package>
+ org.springframework.context,
+ javax.jcr.nodetype,
+ org.springframework.beans.factory,
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.core</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.commons.server</groupId>
+ <artifactId>org.argeo.server.jcr</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+
+ <!-- Unit Tests -->
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.unit</artifactId>
+ <scope>test</scope>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.commons.server</groupId>
+ <artifactId>org.argeo.server.jackrabbit</artifactId>
+ <version>${version.argeo-commons}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2007-2012 Argeo GmbH
+
+ Licensed 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.
+
+-->
+<!DOCTYPE jackrabbit-ocm PUBLIC "-//The Apache Software Foundation//DTD Repository//EN" "http://jackrabbit.apache.org/dtd/jackrabbit-ocm-1.5.dtd">
+<jackrabbit-ocm>
+ <class-descriptor className="Type" jcrType="my:type"
+ jcrSuperTypes="nt:base" jcrMixinTypes="mix:referenceable">
+ <field-descriptor fieldName="path" path="true" />
+ <field-descriptor fieldName="uuid" uuid="true" />
+ <field-descriptor fieldName="name" jcrName="my:name"
+ jcrMandatory="true" />
+ <field-descriptor fieldName="description" jcrName="my:description" />
+ </class-descriptor>
+ <class-descriptor className="Element" jcrType="my:element"
+ jcrSuperTypes="nt:base" jcrMixinTypes="mix:versionable">
+ <field-descriptor fieldName="path" path="true" />
+ <field-descriptor fieldName="uuid" uuid="true" />
+ <field-descriptor fieldName="name" jcrName="my:name"
+ jcrMandatory="true" />
+ <field-descriptor fieldName="description" jcrName="my:description" />
+ <bean-descriptor fieldName="type" jcrName="my:type"
+ proxy="false" jcrType="my:type" jcrMandatory="true"
+ jcrOnParentVersion="IGNORE"
+ converter="org.apache.jackrabbit.ocm.manager.beanconverter.impl.ReferenceBeanConverterImpl" />
+ </class-descriptor>
+</jackrabbit-ocm>
\ No newline at end of file
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+# Slc\r
+log4j.logger.org.argeo=DEBUG\r
+#log4j.logger.org.argeo.jcr=TRACE\r
+\r
+# Castor\r
+log4j.logger.org.exolab.castor=WARN\r
+\r
+# Spring\r
+#log4j.logger.org.springframework=INFO\r
+\r
+## Appenders\r
+# A1 is set to be a ConsoleAppender.\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+\r
+# A1 uses PatternLayout.\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<!-- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org> Licensed under \r
+ the Apache License, Version 2.0 (the "License"); you may not use this file \r
+ except in compliance with the License. You may obtain a copy of the License \r
+ at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable \r
+ law or agreed to in writing, software distributed under the License is distributed \r
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either \r
+ express or implied. See the License for the specific language governing permissions \r
+ and limitations under the License. -->\r
+\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <bean\r
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">\r
+ <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />\r
+ <property name="ignoreUnresolvablePlaceholders" value="true" />\r
+ </bean>\r
+\r
+ <bean id="slcAgentDescriptorDao" class="org.argeo.slc.jcr.dao.SlcAgentDescriptorDaoJcr"\r
+ init-method="init">\r
+ <property name="session" ref="argeo.jcr.session.inMemory" />\r
+ <property name="nodeMapperProvider" ref="nodeMapperProvider" />\r
+ </bean>\r
+\r
+ <bean id="slcExecutionDao" class="org.argeo.slc.jcr.dao.SlcExecutionDaoJcr"\r
+ init-method="init">\r
+ <property name="session" ref="argeo.jcr.session.inMemory" />\r
+ <property name="nodeMapperProvider" ref="nodeMapperProvider" />\r
+ </bean>\r
+\r
+ <bean id="nodeMapperProvider" class="org.argeo.slc.jcr.dao.SlcNodeMapperProvider"\r
+ init-method="init">\r
+ <property name="defaultNodeMapper" ref="nodeMapper" />\r
+ <property name="treeTestResultNodeMapper" ref="treeTestResultNodeMapper" />\r
+ </bean>\r
+\r
+ <bean id="treeTestResultDao" class="org.argeo.slc.jcr.dao.TreeTestResultDaoJcr"\r
+ init-method="init">\r
+ <property name="session" ref="argeo.jcr.session.inMemory" />\r
+ <property name="nodeMapperProvider" ref="nodeMapperProvider" />\r
+ </bean>\r
+\r
+ <bean id="treeTestResultCollectionDao" class="org.argeo.slc.jcr.dao.TreeTestResultCollectionDaoJcr"\r
+ init-method="init">\r
+ <property name="session" ref="argeo.jcr.session.inMemory" />\r
+ <property name="nodeMapperProvider" ref="nodeMapperProvider" />\r
+ </bean>\r
+\r
+ <bean id="nodeMapper" class="org.argeo.jcr.spring.BeanNodeMapper" />\r
+\r
+ <bean id="treeTestResultNodeMapper" class="org.argeo.slc.jcr.dao.TreeTestResultNodeMapper">\r
+ </bean>\r
+\r
+\r
+ <bean id="argeo.jcr.session.inMemory" factory-bean="argeo.jcr.repository.inMemory"\r
+ factory-method="login" destroy-method="logout">\r
+ <constructor-arg>\r
+ <bean class="javax.jcr.SimpleCredentials">\r
+ <constructor-arg value="demo" />\r
+ <constructor-arg value="demo" />\r
+ </bean>\r
+ </constructor-arg>\r
+ </bean>\r
+\r
+ <bean id="argeo.jcr.repository.inMemory" class="org.argeo.jackrabbit.JackrabbitContainer"\r
+ init-method="init" destroy-method="destroy">\r
+ <property name="homeDirectory"\r
+ value="${java.io.tmpdir}/jackrabbit-slc-unit-${user.name}" />\r
+ <property name="inMemory" value="true" />\r
+ <property name="configuration"\r
+ value="classpath:/org/argeo/jackrabbit/repository-inMemory.xml" />\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.support.jemmy</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Tue Jul 21 11:27:46 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
--- /dev/null
+source.. = src/main/java/,\
+ src/main/resources/,\
+ src/test/java/,\
+ src/test/resources/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.support.jemmy</artifactId>
+ <name>SLC Support Jemmy</name>
+ <description>Helper classes for the Jemmy framework</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Bundle-RequiredExecutionEnvironment>J2SE-1.4</Bundle-RequiredExecutionEnvironment>
+ <Export-Package>
+ org.argeo.slc.jemmy
+ </Export-Package>
+ <Import-Package>org.netbeans.jemmy,
+ org.netbeans.jemmy.operators,
+ org.netbeans.jemmy.util
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.argeo.dep.jemmy.nb61</artifactId>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.Set;\r
+\r
+import org.netbeans.jemmy.operators.ComponentOperator;\r
+\r
+public class AbstractComponentWrapper implements ComponentWrapper {\r
+\r
+ protected ComponentWrapper parent;\r
+\r
+ /**\r
+ * List of children ComponentWrapper\r
+ */\r
+ protected List children = new ArrayList();\r
+\r
+ protected WrapperLocator locator;\r
+\r
+ protected String prefix;\r
+\r
+ public ComponentOperator find() {\r
+ return locator.find(this);\r
+ }\r
+\r
+ protected String createNewKey(String oldKey) {\r
+ return (prefix == null) ? oldKey : (prefix + "." + oldKey);\r
+ }\r
+\r
+ protected void addToAccessorMap(Map accessors, String oldKey,\r
+ Object accessor) {\r
+ String newKey = createNewKey(oldKey);\r
+ if (accessors.containsKey(newKey)) {\r
+ throw new ConfigRuntimeException("An Accessor with key '" + newKey\r
+ + "' was already registered");\r
+ }\r
+ accessors.put(newKey, accessor);\r
+ }\r
+\r
+ public Map getAccessors(Class accessorClass) {\r
+ Map accessors = new HashMap();\r
+ if (accessorClass.isInstance(this)) {\r
+ addToAccessorMap(accessors, ((Accessor) this).getFieldName(), this);\r
+ }\r
+ for (int i = 0; i < children.size(); i++) {\r
+ Map childAccessors = ((ComponentWrapper) children.get(i))\r
+ .getAccessors(accessorClass);\r
+\r
+ Set entries = childAccessors.entrySet();\r
+ Iterator it = entries.iterator();\r
+\r
+ while (it.hasNext()) {\r
+ Map.Entry keyValue = (Map.Entry) it.next();\r
+ addToAccessorMap(accessors, keyValue.getKey().toString(),\r
+ keyValue.getValue());\r
+ }\r
+ }\r
+ return accessors;\r
+ }\r
+\r
+ public ComponentWrapper getParent() {\r
+ return parent;\r
+ }\r
+\r
+ public void setParent(ComponentWrapper parent) {\r
+ if (this.parent != null) {\r
+ throw new ConfigRuntimeException("Parent already set");\r
+ }\r
+ this.parent = parent;\r
+ }\r
+\r
+ public List getChildren() {\r
+ return children;\r
+ }\r
+\r
+ public void setChildren(List children) {\r
+ this.children = children;\r
+\r
+ // check that all elements of the list are ComponentWrapper\r
+ // and set their parent\r
+ for (int i = 0; i < this.children.size(); i++) {\r
+ ComponentWrapper wrapper = (ComponentWrapper) this.children.get(i);\r
+ if (wrapper == null) {\r
+ throw new ConfigRuntimeException(\r
+ "Children of ComponentWrappers must be ComponentWrappers");\r
+ }\r
+ wrapper.setParent(this);\r
+ }\r
+ }\r
+\r
+ public WrapperLocator getLocator() {\r
+ return locator;\r
+ }\r
+\r
+ public void setLocator(WrapperLocator locator) {\r
+ this.locator = locator;\r
+ }\r
+\r
+ public String getPrefix() {\r
+ return prefix;\r
+ }\r
+\r
+ public void setPrefix(String prefix) {\r
+ this.prefix = prefix;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+public interface Accessor {\r
+\r
+ public String getFieldName();\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+\r
+public interface Actuator extends Accessor {\r
+ \r
+ void perform();\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+import java.util.Map;\r
+\r
+import org.netbeans.jemmy.operators.ComponentOperator;\r
+\r
+public interface ComponentWrapper {\r
+\r
+ /**\r
+ * Finds the component described by the ComponentWrapper\r
+ * in the GUI\r
+ * @return a Jemmy ComponentOperator for the found component\r
+ */\r
+ public ComponentOperator find();\r
+ \r
+ public void setParent(ComponentWrapper parent);\r
+ \r
+ public ComponentWrapper getParent();\r
+ \r
+ public Map getAccessors(Class accessorClass);\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+public class ConfigRuntimeException extends UIRuntimeException{\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+ public ConfigRuntimeException(){\r
+ super();\r
+ }\r
+ public ConfigRuntimeException(String s){\r
+ super(s);\r
+ }\r
+ public ConfigRuntimeException(Throwable t){\r
+ super(t);\r
+ }\r
+ public ConfigRuntimeException(String s, Throwable t){\r
+ super(s,t);\r
+ }\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.netbeans.jemmy.operators.ComponentOperator;\r
+\r
+public class FictiveComponentWrapper implements ComponentWrapper {\r
+\r
+ protected ComponentWrapper parent; \r
+ \r
+ public ComponentOperator find() {\r
+ // just ask the parent\r
+ return parent.find();\r
+ }\r
+\r
+ /**\r
+ * Return only itself (if the class matches)\r
+ */\r
+ public Map getAccessors(Class accessorClass) {\r
+ Map accessors = new HashMap();\r
+ if (accessorClass.isInstance(this)) {\r
+ accessors.put(((Accessor) this).getFieldName(), this);\r
+ } \r
+ return accessors;\r
+ }\r
+\r
+ public ComponentWrapper getParent() {\r
+ return parent;\r
+ }\r
+\r
+ public void setParent(ComponentWrapper parent) {\r
+ this.parent = parent;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+public interface PopupMenuActuator extends Accessor {\r
+ /**\r
+ * Popup the context menu and optionally select an item.\r
+ * @param menu - A list of items to choose on each menu level, separated by '|'\r
+ */\r
+ void select(String menu);\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+\r
+public interface ReadAccessor extends Accessor {\r
+ \r
+ public String get();\r
+ \r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+public class UIRuntimeException extends RuntimeException {\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+ public UIRuntimeException(){\r
+ super();\r
+ }\r
+ public UIRuntimeException(String s){\r
+ super(s);\r
+ }\r
+ public UIRuntimeException(Throwable t){\r
+ super(t);\r
+ }\r
+ public UIRuntimeException(String s, Throwable t){\r
+ super(s,t);\r
+ }\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+import org.netbeans.jemmy.operators.ComponentOperator;\r
+\r
+public interface WrapperLocator {\r
+\r
+ public ComponentOperator find(ComponentWrapper wrapper);\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.jemmy;\r
+\r
+\r
+public interface WriteAccessor extends Accessor {\r
+ \r
+ public void set(String value);\r
+ \r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="lib" path="lib/aether-connector-wagon-1.11.jar"/>
+ <classpathentry kind="lib" path="lib/aether-impl-1.11.jar"/>
+ <classpathentry kind="lib" path="lib/google-collections-1.0.jar"/>
+ <classpathentry kind="lib" path="lib/maven-aether-provider-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-artifact-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-compat-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-core-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-embedder-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-model-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-model-builder-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-plugin-api-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-repository-metadata-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-settings-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/maven-settings-builder-3.0.3.jar"/>
+ <classpathentry kind="lib" path="lib/nekohtml-1.9.6.2.jar"/>
+ <classpathentry kind="lib" path="lib/plexus-cipher-1.4.jar"/>
+ <classpathentry kind="lib" path="lib/plexus-classworlds-2.4.jar"/>
+ <classpathentry kind="lib" path="lib/plexus-component-annotations-1.5.5.jar"/>
+ <classpathentry kind="lib" path="lib/plexus-container-default-1.5.5.jar"/>
+ <classpathentry kind="lib" path="lib/plexus-interpolation-1.14.jar"/>
+ <classpathentry kind="lib" path="lib/plexus-sec-dispatcher-1.3.jar"/>
+ <classpathentry kind="lib" path="lib/plexus-utils-2.0.6.jar"/>
+ <classpathentry kind="lib" path="lib/sisu-guice-2.9.4-no_aop.jar"/>
+ <classpathentry kind="lib" path="lib/sisu-inject-bean-2.1.1.jar"/>
+ <classpathentry kind="lib" path="lib/sisu-inject-plexus-2.1.1.jar"/>
+ <classpathentry kind="lib" path="lib/wagon-file-1.0-beta-7.jar"/>
+ <classpathentry kind="lib" path="lib/wagon-http-lightweight-1.0-beta-7.jar"/>
+ <classpathentry kind="lib" path="lib/wagon-http-shared-1.0-beta-7.jar"/>
+ <classpathentry kind="lib" path="lib/wagon-provider-api-1.0-beta-7.jar"/>
+ <classpathentry kind="lib" path="lib/wagon-webdav-jackrabbit-1.0-beta-7.jar"/>
+ <classpathentry kind="lib" path="lib/xbean-reflect-3.4.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.support.maven</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Fri Aug 29 11:31:46 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ http://www.springframework.org/schema/beans \r
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <!-- SERVICES -->\r
+ <service ref="mavenRepositorySystem" interface="org.sonatype.aether.RepositorySystem">\r
+ <service-properties>\r
+ <beans:entry key="aether.repositorySystemType" value="maven" />\r
+ </service-properties>\r
+ </service>\r
+\r
+ <service ref="defaultMavenRepositorySystemSession" interface="org.sonatype.aether.RepositorySystemSession">\r
+ <service-properties>\r
+ <beans:entry key="aether.repositorySystemType" value="maven" />\r
+ </service-properties>\r
+ </service>\r
+</beans:beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+
+ <bean id="mavenRepositorySystem" class="org.argeo.slc.maven.MavenManager"
+ factory-method="createRepositorySystem">
+ </bean>
+
+ <bean id="defaultMavenRepositorySystemSession" class="org.argeo.slc.maven.MavenManager"
+ factory-method="createRepositorySystemSession">
+ <constructor-arg ref="mavenRepositorySystem" />
+ </bean>
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.support.maven</artifactId>
+ <packaging>bundle</packaging>
+ <name>SLC Support Maven</name>
+ <properties>
+ <version.aether>1.11</version.aether>
+ <version.maven>3.0.3</version.maven>
+ <version.wagon>1.0-beta-7</version.wagon>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.maven.*
+ </Export-Package>
+ <Import-Package>
+ org.w3c.dom.*;version="0.0.0",
+ org.xml.sax.*;version="0.0.0",
+ com.google.*;resolution:=optional,
+ javax.*;resolution:=optional,
+ com.sun.*;resolution:=optional,
+ org.objectweb.asm.*;resolution:=optional,
+ *
+ </Import-Package>
+ <_exportcontents>
+ org.apache.maven.*;version=${version.maven},
+ </_exportcontents>
+ <Private-Package>org.apache.xbean.*</Private-Package>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Embed-Directory>lib</Embed-Directory>
+ <Embed-Dependency>*;scope=provided;inline=false</Embed-Dependency>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <includeScope>provided</includeScope>
+ <outputDirectory>lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.specs</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.support.aether</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <!-- <dependency> <groupId>org.argeo.dep.osgi</groupId> <artifactId>org.argeo.dep.osgi.maven.embedder</artifactId>
+ </dependency> -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.io</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.org.apache.commons.logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-embedder</artifactId>
+ <version>${version.maven}</version>
+ <optional>true</optional>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-connector-wagon</artifactId>
+ <version>${version.aether}</version>
+ <optional>true</optional>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-provider-api</artifactId>
+ <version>${version.wagon}</version>
+ <optional>true</optional>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-file</artifactId>
+ <version>${version.wagon}</version>
+ <optional>true</optional>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http-lightweight</artifactId>
+ <version>${version.wagon}</version>
+ <optional>true</optional>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>nekohtml</groupId>
+ <artifactId>xercesMinimal</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav-jackrabbit</artifactId>
+ <version>${version.wagon}</version>
+ <optional>true</optional>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-nop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-webdav</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.sonatype.aether</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.maven;
+
+import org.apache.maven.cli.MavenCli;
+import org.codehaus.plexus.PlexusContainer;
+
+/** Custom Maven CLI, giving access to the underlying Plexus container. */
+class CustomCli extends MavenCli {
+ private PlexusContainer container;
+
+ @Override
+ protected void customizeContainer(PlexusContainer container) {
+ this.container = container;
+ }
+
+ public PlexusContainer getContainer() {
+ return container;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.maven;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.core.io.Resource;
+
+public class DependencyFileLoader implements FactoryBean{
+ private final static Log log = LogFactory.getLog(DependencyFileLoader.class);
+
+ private Resource dependenciesResource;
+
+ @SuppressWarnings("unchecked")
+ public List<MavenFile> loadMavenFiles() {
+ try {
+ List<MavenFile> mavenFiles = new ArrayList<MavenFile>();
+
+ List<String> lines = IOUtils.readLines(dependenciesResource
+ .getInputStream());
+ for (String line : lines) {
+ try {
+ line = line.trim();
+ if (line.equals("")
+ || line
+ .startsWith("The following files have been resolved:"))
+ continue;// skip
+
+ mavenFiles.add(convert(line));
+ } catch (Exception e) {
+ log.warn("Could not load line " + line);
+ }
+ }
+
+ return mavenFiles;
+ } catch (IOException e) {
+ throw new SlcException("Could not read dependencies resource "
+ + dependenciesResource, e);
+ }
+ }
+
+ protected MavenFile convert(String str) {
+ StringTokenizer st = new StringTokenizer(str, ":");
+ MavenFile component = new MavenFile();
+ component.setGroupId(st.nextToken());
+ component.setArtifactId(st.nextToken());
+ component.setType(st.nextToken());
+ component.setVersion(st.nextToken());
+ component.setScope(st.nextToken());
+ return component;
+ }
+
+ public void setDependenciesResource(Resource dependenciesResource) {
+ this.dependenciesResource = dependenciesResource;
+ }
+
+ public Object getObject() throws Exception {
+ return loadMavenFiles();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class<List> getObjectType() {
+ return List.class;
+ }
+
+ public boolean isSingleton() {
+ return false;
+ }
+
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.maven;
+
+/*******************************************************************************
+ * Copyright (c) 2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.providers.file.FileWagon;
+import org.apache.maven.wagon.providers.http.LightweightHttpWagon;
+import org.apache.maven.wagon.providers.webdav.WebDavWagon;
+import org.eclipse.aether.connector.wagon.WagonProvider;
+
+public class ManualWagonProvider implements WagonProvider {
+
+ public Wagon lookup(String roleHint) throws Exception {
+ if ("file".equals(roleHint)) {
+ return new FileWagon();
+ } else if ("http".equals(roleHint)) {
+ return new LightweightHttpWagon();
+ } else if ("webdav".equals(roleHint)) {
+ return new WebDavWagon();
+ }
+ return null;
+ }
+
+ public void release(Wagon wagon) {
+
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.maven;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.codehaus.plexus.PlexusContainer;
+
+/** A Maven execution. */
+public class MavenCall implements Runnable {
+ private final static Log log = LogFactory.getLog(MavenCall.class);
+ private String basedir;
+ private String settings;
+ /** Raw command lines arguments */
+ private String cl;
+ private List<String> goals;
+ private List<String> profiles;
+ private Map<String, String> properties;
+
+ private Boolean success = null;
+
+ public void run() {
+ Thread.currentThread().setContextClassLoader(
+ getClass().getClassLoader());
+ List<String> args = new ArrayList<String>();
+ args.add("-e");
+ if (settings != null && !settings.trim().equals("")) {
+ args.add("--settings");
+ args.add(settings);
+ }
+ args.add("-f");
+ args.add(getBasedirFile().getPath() + "/pom.xml");
+ // FIXME manages \" \". Use Commons CLI?
+ if (cl != null) {
+ String[] clArgs = cl.split(" ");
+ args.addAll(Arrays.asList(clArgs));
+ }
+
+ if (goals != null)
+ args.addAll(goals);
+ if (profiles != null)
+ for (String profile : profiles)
+ args.add("-P" + profile);
+ if (properties != null)
+ for (String key : properties.keySet())
+ args.add("-D" + key + "=\"" + properties.get(key) + "\"");
+
+ // String[] goals = { "-o", "-e", "-f", basedir + "/pom.xml", "clean",
+ // "install" };
+
+ // String m2Home = "/opt/apache-maven-3.0.1";
+ // System.setProperty("classworlds.conf", m2Home + "/bin/m2.conf");
+ // System.setProperty("maven.home", m2Home);
+ //
+ // Launcher.main(goals);
+ log.info("Maven call: " + args);
+
+ CustomCli mavenCli = new CustomCli();
+ int exitCode = mavenCli.doMain(args.toArray(new String[args.size()]),
+ getBasedirFile().getPath(), System.out, System.err);
+ if (log.isDebugEnabled())
+ log.debug("Maven exit code: " + exitCode);
+ if (exitCode == 0)
+ success = true;
+ else
+ success = false;
+
+ PlexusContainer plexusContainer = mavenCli.getContainer();
+ if (log.isDebugEnabled())
+ log.debug(plexusContainer.getContext().getContextData());
+ plexusContainer.dispose();
+ }
+
+ /** Removes 'file:' prefix if present */
+ protected File getBasedirFile() {
+ if (basedir == null)
+ throw new SlcException("basedir not set");
+ File dir;
+ if (basedir.startsWith("file:"))
+ dir = new File(basedir.substring("file:".length()));
+ else
+ dir = new File(basedir);
+ return dir;
+ }
+
+ public void setBasedir(String basedir) {
+ this.basedir = basedir;
+ }
+
+ public void setSettings(String settings) {
+ this.settings = settings;
+ }
+
+ public void setGoals(List<String> goals) {
+ this.goals = goals;
+ }
+
+ public void setProfiles(List<String> profiles) {
+ this.profiles = profiles;
+ }
+
+ public void setProperties(Map<String, String> properties) {
+ this.properties = properties;
+ }
+
+ public void setCl(String cl) {
+ this.cl = cl;
+ }
+
+ public Boolean getSuccess() {
+ return success == null ? false : success;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.maven;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
+import java.util.UUID;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.deploy.DeployEnvironment;
+
+public abstract class MavenDeployEnvironment implements DeployEnvironment {
+ private static final Log log = LogFactory
+ .getLog(MavenDeployEnvironment.class);
+ private MavenManager mavenManager;
+
+ public void unpackTo(Object packg, File targetLocation,
+ Map<String, String> filter) {
+ File packageLocation=null;
+ String type = null;
+ String removeRootDir = "enabled";
+// if (packg instanceof MavenFile) {
+// packageLocation = mavenManager
+// .getPackageLocation((MavenFile) packg);
+// type = ((MavenFile) packg).getType();
+// } else
+ if (packg instanceof File) {
+ packageLocation = (File) packg;
+ // TODO: type based on extension
+ } else {
+ throw new SlcException("Unrecognized package type "
+ + packg.getClass());
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Unpack " + packageLocation + " of type " + type + " to "
+ + targetLocation);
+ }
+
+ try {
+ File tempDir = new File("/tmp/" + UUID.randomUUID().toString());
+ tempDir.mkdirs();
+ targetLocation.mkdirs();
+ Properties props = new Properties();
+ props.setProperty("dest", targetLocation.getAbsolutePath());
+ props.setProperty("src", packageLocation.getAbsolutePath());
+ props.setProperty("tempDir", tempDir.getAbsolutePath());
+ props.setProperty("removeRootDir", removeRootDir);
+
+ URL antUrl = getClass().getClassLoader().getResource(
+ "org/argeo/slc/support/deploy/ant/build.xml");
+
+ // if (type == null || type.equals("zip")) {
+ // new AntRunner(antUrl, "deployZip", props).run();
+ // } else if (type.equals("tar.gz")) {
+ // new AntRunner(antUrl, "deployTarGz", props).run();
+ // } else {
+ // throw new SlcException("Unknow package type " + type);
+ // }
+ throw new SlcException("Not implemented.");
+ } catch (SlcException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new SlcException("Cannot unpack package " + packg + " to "
+ + targetLocation, e);
+ }
+ }
+
+ public void setMavenManager(MavenManager mavenManager) {
+ this.mavenManager = mavenManager;
+ }
+
+}
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.maven;\r
+\r
+import org.argeo.slc.build.Distribution;\r
+import org.argeo.slc.deploy.DeploymentData;\r
+\r
+public class MavenFile implements Distribution, DeploymentData {\r
+ private String groupId;\r
+ private String artifactId;\r
+ private String version;\r
+ private String type;\r
+ private String classifier;\r
+ private String scope;\r
+\r
+ public String getScope() {\r
+ return scope;\r
+ }\r
+\r
+ public void setScope(String scope) {\r
+ this.scope = scope;\r
+ }\r
+\r
+ private String distributionId;\r
+\r
+ public String getDistributionId() {\r
+ return distributionId;\r
+ }\r
+\r
+ public void setDistributionId(String distributionId) {\r
+ this.distributionId = distributionId;\r
+ }\r
+\r
+ public String getGroupId() {\r
+ return groupId;\r
+ }\r
+\r
+ public void setGroupId(String groupId) {\r
+ this.groupId = groupId;\r
+ }\r
+\r
+ public String getArtifactId() {\r
+ return artifactId;\r
+ }\r
+\r
+ public void setArtifactId(String artifactId) {\r
+ this.artifactId = artifactId;\r
+ }\r
+\r
+ public String getVersion() {\r
+ return version;\r
+ }\r
+\r
+ public void setVersion(String version) {\r
+ this.version = version;\r
+ }\r
+\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ public void setType(String type) {\r
+ this.type = type;\r
+ }\r
+\r
+ public String getClassifier() {\r
+ return classifier;\r
+ }\r
+\r
+ public void setClassifier(String classifier) {\r
+ this.classifier = classifier;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.maven;\r
+\r
+import org.apache.commons.logging.Log;\r
+import org.apache.commons.logging.LogFactory;\r
+import org.apache.maven.repository.internal.DefaultServiceLocator;\r
+import org.apache.maven.repository.internal.MavenRepositorySystemSession;\r
+import org.argeo.slc.SlcException;\r
+import org.argeo.slc.aether.AetherUtils;\r
+import org.argeo.slc.aether.ConsoleRepositoryListener;\r
+import org.argeo.slc.aether.ConsoleTransferListener;\r
+import org.codehaus.plexus.PlexusContainer;\r
+import org.eclipse.aether.RepositorySystem;\r
+import org.eclipse.aether.RepositorySystemSession;\r
+import org.eclipse.aether.artifact.Artifact;\r
+import org.eclipse.aether.collection.CollectRequest;\r
+import org.eclipse.aether.connector.wagon.WagonProvider;\r
+import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;\r
+import org.eclipse.aether.graph.Dependency;\r
+import org.eclipse.aether.graph.DependencyNode;\r
+import org.eclipse.aether.repository.LocalRepository;\r
+import org.eclipse.aether.repository.RemoteRepository;\r
+import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;\r
+import org.eclipse.aether.util.artifact.DefaultArtifact;\r
+import org.eclipse.aether.util.graph.PreorderNodeListGenerator;\r
+\r
+public class MavenManager {\r
+ private final static Log log = LogFactory.getLog(MavenManager.class);\r
+\r
+ public void init() {\r
+ try {\r
+ testMaven();\r
+ testAether();\r
+ // List<ComponentDescriptor<?>> lst = plexusContainer\r
+ // .discoverComponents(plexusContainer.getContainerRealm());\r
+ // for (ComponentDescriptor<?> cd : lst) {\r
+ // log.debug(cd);\r
+ // }\r
+ // ArtifactHandler artifactHandler = plexusContainer\r
+ // .lookup(ArtifactHandler.class);\r
+ // ArtifactRepository localRepository = new\r
+ // DefaultArtifactRepositoryFactory().createArtifactRepository("local",\r
+ // , layoutId, snapshots, releases);\r
+ // Maven maven = mavenCli.getContainer().lookup(Maven.class);\r
+ // Artifact artifact = new DefaultArtifact("org.argeo.slc.dist",\r
+ // "org.argeo.slc.sdk", "0.13.1-SNAPSHOT", "compile", "pom",\r
+ // null, artifactHandler);\r
+ // ArtifactResolutionRequest req = new ArtifactResolutionRequest();\r
+ // req.setLocalRepository(localRepository);\r
+ // req.setResolveTransitively(true);\r
+ // req.setArtifact(artifact);\r
+ // ArtifactResolver artifactResolver = plexusContainer\r
+ // .lookup(ArtifactResolver.class);\r
+ // ArtifactResolutionResult res = artifactResolver.resolve(req);\r
+ // Set<Artifact> artifacts = res.getArtifacts();\r
+ // for (Artifact art : artifacts) {\r
+ // log.debug(art);\r
+ // }\r
+ } catch (Exception e) {\r
+ // TODO Auto-generated catch block\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+\r
+ public void testMaven() {\r
+ Thread.currentThread().setContextClassLoader(\r
+ getClass().getClassLoader());\r
+ String[] goals = { "-o", "-e", "-f",\r
+ "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk/pom.xml",\r
+ "dependency:tree" };\r
+\r
+ // String m2Home = "/opt/apache-maven-3.0.1";\r
+ // System.setProperty("classworlds.conf", m2Home + "/bin/m2.conf");\r
+ // System.setProperty("maven.home", m2Home);\r
+ //\r
+ // Launcher.main(goals);\r
+\r
+ CustomCli mavenCli = new CustomCli();\r
+ mavenCli.doMain(goals,\r
+ "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk",\r
+ System.out, System.err);\r
+\r
+ PlexusContainer plexusContainer = mavenCli.getContainer();\r
+ log.debug(plexusContainer.getContext().getContextData());\r
+ plexusContainer.dispose();\r
+ }\r
+\r
+ public void testAether() {\r
+ try {\r
+ RepositorySystem repoSystem = createRepositorySystem();\r
+\r
+ RepositorySystemSession session = createRepositorySystemSession(repoSystem);\r
+\r
+ Dependency dependency = new Dependency(new DefaultArtifact(\r
+ "org.argeo.slc.dep:org.argeo.slc.dep.sdk:0.13.1-SNAPSHOT"),\r
+ "compile");\r
+ RemoteRepository argeo = new RemoteRepository("argeo", "default",\r
+ "http://maven.argeo.org/argeo/");\r
+ RemoteRepository argeoSnapshots = new RemoteRepository(\r
+ "argeo-snapshots", "default",\r
+ "http://dev.argeo.org/maven/argeo-snapshots/");\r
+\r
+ CollectRequest collectRequest = new CollectRequest();\r
+ collectRequest.setRoot(dependency);\r
+ collectRequest.addRepository(argeo);\r
+ collectRequest.addRepository(argeoSnapshots);\r
+ DependencyNode node = repoSystem.collectDependencies(session,\r
+ collectRequest).getRoot();\r
+\r
+ repoSystem.resolveDependencies(session, node, null);\r
+\r
+ PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();\r
+ node.accept(nlg);\r
+\r
+ for (Artifact artifact : nlg.getArtifacts(true)) {\r
+ log.debug(artifact);\r
+ }\r
+\r
+ AetherUtils.logDependencyNode(0, node);\r
+ // System.out.println(nlg.getClassPath());\r
+\r
+ } catch (Exception e) {\r
+ throw new SlcException("Cannot resolve", e);\r
+ }\r
+\r
+ }\r
+\r
+ /** Creates a Maven {@link RepositorySystem}. */\r
+ public static RepositorySystem createRepositorySystem() {\r
+ try {\r
+ // return new\r
+ // DefaultPlexusContainer().lookup(RepositorySystem.class);\r
+\r
+ DefaultServiceLocator locator = new DefaultServiceLocator();\r
+\r
+ locator.setServices(WagonProvider.class, new ManualWagonProvider());\r
+ locator.addService(RepositoryConnectorFactory.class,\r
+ WagonRepositoryConnectorFactory.class);\r
+\r
+ return locator.getService(RepositorySystem.class);\r
+ } catch (Exception e) {\r
+ throw new SlcException("Cannot lookup repository system", e);\r
+ }\r
+ }\r
+\r
+ public static RepositorySystemSession createRepositorySystemSession(\r
+ RepositorySystem system) {\r
+ MavenRepositorySystemSession session = new MavenRepositorySystemSession();\r
+\r
+ LocalRepository localRepo = new LocalRepository(\r
+ System.getProperty("user.home") + "/.m2/repository");\r
+ session.setLocalRepositoryManager(system\r
+ .newLocalRepositoryManager(localRepo));\r
+ session.setTransferListener(new ConsoleTransferListener(System.out));\r
+ session.setRepositoryListener(new ConsoleRepositoryListener());\r
+ return session;\r
+ }\r
+\r
+ public static void main(String[] args) {\r
+ new MavenManager().init();\r
+ }\r
+\r
+}\r
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.maven;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.FactoryBean;
+
+public class MavenToUrl implements FactoryBean {
+ private List<MavenFile> mavenFiles;
+ private String baseUrl;
+
+ public List<String> asUrls() {
+ List<String> urls = new ArrayList<String>();
+ for (MavenFile mf : mavenFiles)
+ urls.add(convertToUrl(mf));
+ return urls;
+ }
+
+ public String convertToUrl(MavenFile mf) {
+ return baseUrl + mf.getGroupId().replace('.', '/') + '/'
+ + mf.getArtifactId() + '/' + mf.getVersion() + '/'
+ + mf.getArtifactId() + '-' + mf.getVersion() + '.'
+ + mf.getType();
+ }
+
+ public void setMavenFiles(List<MavenFile> mavenFiles) {
+ this.mavenFiles = mavenFiles;
+ }
+
+ public void setBaseUrl(String baseUrl) {
+ this.baseUrl = baseUrl;
+ }
+
+ public Object getObject() throws Exception {
+ return asUrls();
+ }
+
+ public Class<?> getObjectType() {
+ return List.class;
+ }
+
+ public boolean isSingleton() {
+ return false;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed 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.
+ */
+package org.argeo.slc.maven;
+
+public class RemoteRepo {
+ private String id;
+ private String url;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+}
--- /dev/null
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<project>\r
+\r
+ <target name="deployZip">
+ <unzip src="${src}" dest="${tempDir}" />
+ <copyFromTemp />
+ </target>
+
+ <target name="deployTarGz">
+ <untar src="${src}" dest="${tempDir}" compression="gzip" />
+ <copyFromTemp />
+ </target>
+
+ <macrodef name="copyFromTemp">
+ <sequential>
+ <copy todir="${dest}" includeemptydirs="true">
+ <fileset dir="${tempDir}">
+ <include name="**/*" />
+ </fileset>
+ <mapper classname="org.argeo.slc.ant.RemoveRootDirMapper" to="${removeRootDir}" />
+ </copy>
+ </sequential>
+ </macrodef>
+</project>
\ No newline at end of file
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+log4j.logger.org.argeo=DEBUG\r
+log4j.logger.org.argeo.slc.osgi.FileSystemBundleRegister=DEBUG\r
+\r
+## Appenders\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.support.osgi</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Sun Jun 28 09:05:50 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+source.. = src/main/java/,\
+ src/main/resources/,\
+ src/test/java/,\
+ src/test/resources/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.support.osgi</artifactId>
+ <name>SLC Support OSGi</name>
+ <packaging>jar</packaging>
+ <properties />
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.core</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>biz.aQute.bndlib</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.osgi.core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.osgi.extender</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>net.sf.cglib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.objectweb.asm.attrs</artifactId>
+ </dependency>
+
+ <!-- Xalan and Xerces are implicitly required since the JDK provided implementations
+ are overridden in the execution modules manager -->
+<!-- <dependency> -->
+<!-- <groupId>org.argeo.tp</groupId> -->
+<!-- <artifactId>org.apache.xalan</artifactId> -->
+<!-- </dependency> -->
+
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+log4j.logger.org.argeo=DEBUG\r
+log4j.logger.org.argeo.slc.osgi.FileSystemBundleRegister=DEBUG\r
+\r
+## Appenders\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.support.simple</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+source.. = src/main/java/,\
+ src/test/java/,\
+ src/test/resources/,\
+ src/main/resources/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.support.simple</artifactId>
+ <name>SLC Support Simple</name>
+ <description>Basic implementations of SLC Specifications</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.*,org.argeo.slc.core.test.spring
+ </Export-Package>
+ <Import-Package>*,org.apache.commons.logging;version="1.1",
+ org.dbunit;resolution:="optional",
+ org.dbunit.database;resolution:="optional",
+ org.dbunit.dataset;resolution:="optional",
+ org.dbunit.dataset.xml;resolution:="optional",
+ org.dbunit.operation;resolution:="optional",
+ junit.framework;resolution:="optional",
+ org.apache.commons.vfs.*,
+ javax.swing.plaf.metal
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.core</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.commons.server</groupId>
+ <artifactId>org.argeo.server.jcr</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+
+ <!-- SSH -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>com.jcraft.jsch</artifactId>
+ </dependency>
+
+ <!-- Scheduling -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.quartz</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.context.support</artifactId>
+ </dependency>
+
+ <!-- Mail -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>javax.mail</artifactId>
+ </dependency>
+
+ <!-- SVN -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.tmatesoft.svn</artifactId>
+ </dependency>
+
+ <!-- Commons -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.vfs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.exec</artifactId>
+ </dependency>
+
+ <!-- TODO: check if necessary here -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.transaction</artifactId>
+ </dependency>
+
+ <!-- Unit Tests -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+echo demo | passwd root --stdin
+
+#Fix root login on console
+echo "pts/0" >>/etc/securetty
+sed -i s/"session required pam_selinux.so close"/"#session required pam_selinux.so close"/g /etc/pam.d/login
+sed -i s/"session required pam_selinux.so open"/"#session required pam_selinux.so open"/g /etc/pam.d/login
+sed -i s/"session required pam_loginuid.so"/"#session required pam_loginuid.so"/g /etc/pam.d/login
+
+#Configuring basic networking
+cat > /etc/sysconfig/network << EOF
+NETWORKING=yes
+HOSTNAME=demo
+EOF
+cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
+DEVICE=eth0
+BOOTPROTO=dhcp
+ONBOOT=yes
+EOF
+
+#Enabling sshd
+chkconfig sshd on
+
+# Fixing root login for sshd
+sed -i s/"session required pam_selinux.so close"/"#session required pam_selinux.so close"/g /etc/pam.d/sshd
+sed -i s/"session required pam_loginuid.so"/"#session required pam_loginuid.so"/g /etc/pam.d/sshd
+sed -i s/"session required pam_selinux.so open env_params"/"#session required pam_selinux.so open env_params"/g /etc/pam.d/sshd
+
+# Leaving the chroot'ed filesystem
+exit
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+CHROOT=$1
+echo Init LXC container $CHROOT
+
+mkdir $CHROOT/etc/yum.repos.d/ -p
+cat /etc/yum.repos.d/CentOS-Base.repo |sed s/'$releasever'/6/g > $CHROOT/etc/yum.repos.d/CentOS-Base.repo
+yum groupinstall core --installroot=$CHROOT --nogpgcheck -y
+yum install plymouth libselinux-python --installroot=$CHROOT --nogpgcheck -y
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2007-2012 Argeo GmbH\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+<!-- Copyright (C) 2007-2012 Mathieu Baudier Licensed under the Apache License, \r
+ Version 2.0 (the "License"); you may not use this file except in compliance \r
+ with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 \r
+ Unless required by applicable law or agreed to in writing, software distributed \r
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES \r
+ OR CONDITIONS OF ANY KIND, either express or implied. See the License for \r
+ the specific language governing permissions and limitations under the License. -->\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-1.2.xsd">\r
+\r
+ <bean id="hostManager" class="org.argeo.slc.lib.linux.RedhatHostManager">\r
+ <property name="sshTarget" ref="sshTarget" />\r
+ <property name="host" ref="host" />\r
+ </bean>\r
+\r
+ <!-- Execution Flows -->\r
+ <bean flow:as-flow="deployConfig" class="org.argeo.slc.core.execution.tasks.MethodCall"\r
+ p:target-ref="hostManager" p:method="deployConfig" />\r
+\r
+ <bean flow:as-flow="system/reboot" p:command="shutdown -r now"\r
+ p:sshTarget-ref="sshTarget" class="org.argeo.slc.jsch.RemoteExec" />\r
+\r
+ <bean flow:as-flow="system/shutdown" p:command="shutdown -h now"\r
+ p:sshTarget-ref="sshTarget" class="org.argeo.slc.jsch.RemoteExec" />\r
+\r
+ <bean flow:as-flow="system/packages/install" class="org.argeo.slc.core.execution.tasks.MethodCall"\r
+ p:target-ref="hostManager" p:method="installPackages" />\r
+\r
+ <bean flow:as-flow="system/packages/update" p:sshTarget-ref="sshTarget"\r
+ class="org.argeo.slc.jsch.RemoteExec">\r
+ <property name="systemCall">\r
+ <bean class="org.argeo.slc.core.execution.tasks.SystemCall">\r
+ <property name="cmd" value="yum -y update" />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean flow:as-flow="system/security/firewall" p:script="osgibundle:/scripts/firewall.sh"\r
+ p:sshTarget-ref="sshTarget" class="org.argeo.slc.jsch.RemoteExec" />\r
+\r
+ <flow:flow name="system/security/authconfig">\r
+ <flow:spec>\r
+ <flow:primitive name="ldapserver" />\r
+ <flow:primitive name="ldapbasedn" />\r
+ </flow:spec>\r
+ <bean p:sshTarget-ref="sshTarget" class="org.argeo.slc.jsch.RemoteExec">\r
+ <flow:variable />\r
+ <property name="systemCall">\r
+ <bean class="org.argeo.slc.core.execution.tasks.SystemCall">\r
+ <property name="command">\r
+ <list>\r
+ <value>authconfig</value>\r
+ <value>--enableldap</value>\r
+ <value>--enableldapauth</value>\r
+ <value>--enablecache</value>\r
+ <value>--enablemkhomedir</value>\r
+ <value>--ldapserver=@{ldapserver}</value>\r
+ <value>--ldapbasedn=@{ldapbasedn}</value>\r
+ <value>--passalgo=sha256</value>\r
+ <value>--updateall</value>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+ </flow:flow>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+Argeo SLC Site
\ No newline at end of file
--- /dev/null
+Bundle-SymbolicName: org.argeo.slc.support.simple.tests
+Fragment-Host: org.argeo.slc.support.simple
+
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+# Slc\r
+log4j.logger.org.argeo=DEBUG\r
+\r
+# Castor\r
+log4j.logger.org.exolab.castor=WARN\r
+\r
+# Spring\r
+log4j.logger.org.springframework=WARN\r
+\r
+\r
+## Appenders\r
+# A1 is set to be a ConsoleAppender.\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+\r
+# A1 uses PatternLayout.\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>\r
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.unit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Sat Jun 27 16:59:43 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+source.. = src/main/java/,\
+ src/main/resources/,\
+ src/test/java/,\
+ src/test/resources/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.unit</artifactId>
+ <name>SLC Unit Tests Helpers</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.*,org.argeo.slc.core.test.spring
+ </Export-Package>
+ <Import-Package>org.apache.commons.logging;version="1.1",
+ org.dbunit.*;resolution:="optional",
+ org.hibernate.*;resolution:="optional",
+ org.springframework.xml.*;resolution:="optional",
+ org.springframework.orm.*;resolution:="optional",
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.core</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>org.argeo.slc.support.simple</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ <!-- DB Unit -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.dbunit</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.commons.collections</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Hibernate -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.hibernate</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.orm</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- OSGi -->
+ <dependency>
+ <groupId>org.argeo.commons.base</groupId>
+ <artifactId>org.argeo.osgi.boot</artifactId>
+ <version>${version.argeo-commons}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.osgi.core</artifactId>
+ </dependency>
+
+ <!-- OXM -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.springframework.oxm</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Logging -->
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.org.apache.commons.logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>org.apache.log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.tp</groupId>
+ <artifactId>slf4j.log4j</artifactId>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>argeo-slc</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>runtime</artifactId>
+ <packaging>pom</packaging>
+ <name>SLC Runtime</name>
+ <modules>
+ <module>org.argeo.slc.specs</module>
+ <module>org.argeo.slc.core</module>
+ <module>org.argeo.slc.unit</module>
+ <module>org.argeo.slc.support.simple</module>
+ <module>org.argeo.slc.support.osgi</module>
+ <module>org.argeo.slc.support.equinox</module>
+ <module>org.argeo.slc.support.ant</module>
+ <module>org.argeo.slc.support.aether</module>
+ <module>org.argeo.slc.support.maven</module>
+ <module>org.argeo.slc.support.jemmy</module>
+ <module>org.argeo.slc.support.jcr</module>
+ <module>org.argeo.slc.detached</module>
+ <module>org.argeo.slc.detached.launcher</module>
+ <module>org.argeo.slc.launcher</module>
+ <module>org.argeo.slc.lib.detached</module>
+ <module>org.argeo.slc.repo</module>
+ <module>org.argeo.slc.rpmfactory</module>
+ </modules>
+</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
- xmlns:util="http://www.springframework.org/schema/util"\r
- xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
- http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
- http://www.springframework.org/schema/beans \r
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
- http://www.springframework.org/schema/util\r
- http://www.springframework.org/schema/util/spring-util-2.5.xsd">\r
-\r
- <!-- REFERENCES -->\r
- <reference id="authenticationManager"\r
- interface="org.springframework.security.AuthenticationManager" />\r
-\r
- <reference id="modulesManager"\r
- interface="org.argeo.slc.execution.ExecutionModulesManager" />\r
-\r
- <!-- SERVICES -->\r
- <service ref="agent" interface="org.argeo.slc.execution.SlcAgent" />\r
- <service ref="agentCli" interface="org.argeo.slc.execution.SlcAgentCli" />\r
-\r
- <service ref="fileSystemManager" interface="org.apache.commons.vfs.FileSystemManager" />\r
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-<?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"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
- <bean id="agent" class="org.argeo.slc.core.execution.DefaultAgent"\r
- init-method="init" destroy-method="destroy">\r
- <property name="modulesManager" ref="modulesManager" />\r
- </bean>\r
-\r
- <bean id="agentCli" class="org.argeo.slc.core.execution.DefaultAgentCli">\r
- <property name="agent" ref="agent" />\r
- <property name="authenticationManager" ref="authenticationManager" />\r
- </bean>\r
-\r
- <bean\r
- class="org.argeo.security.core.AuthenticatedApplicationContextInitialization">\r
- <property name="authenticationManager" ref="authenticationManager" />\r
- </bean>\r
-\r
- <bean name="fileSystemManager" class="org.apache.commons.vfs.impl.StandardFileSystemManager"\r
- init-method="init" destroy-method="close" />\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>modules</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.agent.cli</artifactId>
- <name>SLC Agent CLI</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Import-Package>
- *,
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>modules</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.ext.castor</artifactId>
- <name>SLC Castor Extension</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Fragment-Host>org.castor</Fragment-Host>
- <Import-Package>
- org.argeo.slc.detached;resolution:=optional
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.server.repo.webapp</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
-
- <import resource="osgi.xml" />
- <import resource="security.xml" />
-
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
- ">
-
- <bean
- class="org.springframework.web.servlet.handler.SimpleServletPostProcessor" />
-
- <bean id="servletHandler"
- class="org.springframework.web.servlet.handler.SimpleServletHandlerAdapter" />
-
- <bean id="handlerMapping"
- class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
- <property name="mappings">
- <props>
- <prop key="*">mavenProxyServlet</prop>
- </props>
- </property>
- </bean>
-
- <bean id="mavenProxyServlet" class="org.argeo.jcr.mvc.ResourceProxyServlet">
- <property name="proxy" ref="mavenProxy" />
- </bean>
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
- xmlns:security="http://www.springframework.org/schema/security"\r
- xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
- http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
- http://www.springframework.org/schema/beans \r
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
- http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">\r
-\r
- <!-- REFERENCES -->\r
- <!-- Security -->\r
- <reference id="authenticationManager"\r
- interface="org.springframework.security.AuthenticationManager" />\r
-\r
- <!-- JCR -->\r
- <reference id="jcrRepository" interface="javax.jcr.Repository"\r
- filter="(argeo.jcr.repository.alias=java)" />\r
-\r
- <!-- Maven -->\r
- <reference id="mavenProxy" interface="org.argeo.slc.repo.MavenProxyService" />\r
- <reference id="rpmProxy" interface="org.argeo.slc.rpmfactory.RpmProxyService" />\r
-\r
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
- ">
-
- <bean
- class="org.springframework.web.servlet.handler.SimpleServletPostProcessor" />
-
- <bean id="servletHandler"
- class="org.springframework.web.servlet.handler.SimpleServletHandlerAdapter" />
-
- <bean id="handlerMapping"
- class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
- <property name="mappings">
- <props>
- <prop key="*">rpmProxyServlet</prop>
- </props>
- </property>
- </bean>
-
- <bean id="rpmProxyServlet" class="org.argeo.jcr.mvc.ResourceProxyServlet">
- <property name="proxy" ref="rpmProxy" />
- </bean>
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:sec="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
-
- <bean id="springSecurityFilterChain" class="org.springframework.security.util.FilterChainProxy">
- <sec:filter-chain-map path-type="ant">
- <sec:filter-chain pattern="/**"
- filters="httpSessionContextIntegrationFilter,logoutFilter,basicProcessingFilter,anonymousProcessingFilter,securityContextHolderAwareRequestFilter,exceptionTranslationFilter,filterInvocationInterceptor" />
- </sec:filter-chain-map>
- </bean>
-
- <!-- The actual authorization checks (called last, but first here for ease
- of configuration) -->
- <bean id="filterInvocationInterceptor" parent="filterInvocationInterceptorTemplate">
- <property name="objectDefinitionSource">
- <value>
- CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
- PATTERN_TYPE_APACHE_ANT
- /private/**=ROLE_USER
- /**=IS_AUTHENTICATED_ANONYMOUSLY
- </value>
- </property>
- </bean>
-
- <!-- Integrates the authentication information in the http sessions -->
- <bean id="httpSessionContextIntegrationFilter"
- class="org.springframework.security.context.HttpSessionContextIntegrationFilter">
- <property name="allowSessionCreation" value="true" />
- </bean>
-
- <!-- Processes logouts, removing both session informations and the remember-me
- cookie from the browser -->
- <bean id="logoutFilter" class="org.springframework.security.ui.logout.LogoutFilter">
- <constructor-arg value="/web/" />
- <!-- URL redirected to after logout -->
- <constructor-arg>
- <list>
- <bean
- class="org.springframework.security.ui.logout.SecurityContextLogoutHandler" />
- </list>
- </constructor-arg>
- </bean>
-
- <!-- Double check, this may not be necessary -->
- <bean id="securityContextHolderAwareRequestFilter"
- class="org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter" />
-
- <!-- Basic authentication -->
- <bean id="basicProcessingFilter"
- class="org.springframework.security.ui.basicauth.BasicProcessingFilter">
- <property name="authenticationManager">
- <ref bean="authenticationManager" />
- </property>
- <property name="authenticationEntryPoint">
- <ref local="basicProcessingFilterEntryPoint" />
- </property>
- </bean>
-
- <!-- Activate basic auth when needed -->
- <bean id="basicProcessingFilterEntryPoint"
- class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">
- <property name="realmName">
- <value>Argeo Repository</value>
- </property>
- </bean>
-
- <!-- If everything else failed, anonymous authentication -->
- <bean id="anonymousProcessingFilter"
- class="org.springframework.security.providers.anonymous.AnonymousProcessingFilter">
- <property name="key" value="${argeo.security.systemKey}" />
- <property name="userAttribute" value="anonymous,ROLE_ANONYMOUS" />
- </bean>
-
- <!-- Reacts to security related exceptions -->
- <bean id="exceptionTranslationFilter"
- class="org.springframework.security.ui.ExceptionTranslationFilter">
- <property name="authenticationEntryPoint">
- <ref bean="basicProcessingFilterEntryPoint" />
- </property>
- <property name="accessDeniedHandler">
- <bean class="org.springframework.security.ui.AccessDeniedHandlerImpl">
- <property name="errorPage" value="/accessDenied.jsp" />
- </bean>
- </property>
- </bean>
-
- <!-- Template for authorization checks -->
- <bean id="filterInvocationInterceptorTemplate" abstract="true"
- class="org.springframework.security.intercept.web.FilterSecurityInterceptor">
- <property name="authenticationManager" ref="authenticationManager" />
- <property name="accessDecisionManager">
- <bean class="org.springframework.security.vote.AffirmativeBased">
- <property name="allowIfAllAbstainDecisions" value="false" />
- <property name="decisionVoters">
- <list>
- <bean class="org.springframework.security.vote.RoleVoter" />
- <bean class="org.springframework.security.vote.AuthenticatedVoter" />
- </list>
- </property>
- </bean>
- </property>
- </bean>
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- version="2.5">
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
-
- <display-name>Argeo SLC Repo Webapp</display-name>
-
- <!-- General -->
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>/WEB-INF/applicationContext.xml</param-value>
- </context-param>
-
- <listener>
- <display-name>Spring Context</display-name>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
- <context-param>
- <param-name>contextClass</param-name>
- <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
- </context-param>
-
- <!-- RPM -->
- <servlet>
- <servlet-name>rpm</servlet-name>
- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
- <init-param>
- <param-name>contextClass</param-name>
- <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>rpm</servlet-name>
- <url-pattern>/rpm/*</url-pattern>
- </servlet-mapping>
-
- <!-- Maven -->
- <!-- <servlet> -->
- <!-- <servlet-name>maven</servlet-name> -->
- <!-- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> -->
- <!-- <init-param> -->
- <!-- <param-name>contextClass</param-name> -->
- <!-- <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value> -->
- <!-- </init-param> -->
- <!-- <load-on-startup>1</load-on-startup> -->
- <!-- </servlet> -->
- <!-- <servlet-mapping> -->
- <!-- <servlet-name>maven</servlet-name> -->
- <!-- <url-pattern>/maven/*</url-pattern> -->
- <!-- </servlet-mapping> -->
-
- <!-- Security -->
- <filter>
- <filter-name>springSecurityFilterChain</filter-name>
- <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>springSecurityFilterChain</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-</web-app>
+++ /dev/null
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<title>SLC Repository</title>
-<link href="style.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-<h1>SLC Repository</h1>
-<p>This is a repository of OSGi bundles, which is compatible with Maven conventions.
-</p>
-<p>The first level refers to <b>products</b>, the second one to <b>version branches</b> of these products.
-</p>
-<p>When clicking on a version branch, an editors opens which allows to efficiently browse the available bundles.
-</p>
-
-<h2>Usage with maven repository compatible tools</h2>
-<p>There is one maven-style repository per branch.
-</p>
-<p>It is accessible anonymously at the following URL (if public access has been explicitly given to this branch):<br>
-<pre>http://[host]/data/public/java/[org.example.product]-[major.minor.x]</pre>
-</p>
-<p>Or as an authenticated user (BASIC auth) belonging to <i>ROLE_SLC</i>, with read/write WebDav access:<br/>
-<pre>https://[host]/data/files/java/[org.example.product]-[major.minor.x]</pre>
-</p>
-
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>modules</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.server.repo.webapp</artifactId>
- <name>SLC Repo Web App</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Web-ContextPath>repo</Web-ContextPath>
- <!-- TODO optimize -->
- <Import-Package>
- *,
- javax.jcr,
- javax.servlet,
- javax.servlet.http,
- javax.servlet.resources,
- org.argeo.jcr.mvc,
- org.argeo.security.core,
- org.argeo.security.jcr,
- org.argeo.slc.aether.spring,
- org.argeo.slc.repo,
- org.argeo.slc.rpmfactory,
- org.springframework.osgi.web.context.support,
- org.springframework.security,
- org.springframework.security.context,
- org.springframework.security.intercept.web,
- org.springframework.security.providers.anonymous,
- org.springframework.security.ui,
- org.springframework.security.ui.basicauth,
- org.springframework.security.ui.logout,
- org.springframework.security.util,
- org.springframework.security.vote,
- org.springframework.security.wrapper,
- org.springframework.web.context,
- org.springframework.web.filter,
- org.springframework.web.servlet,
- org.springframework.web.servlet.handler
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
+++ /dev/null
-/* Generic Selectors */\r
-body {\r
- font-family: sans-serif;\r
- font-size: 12px;\r
- color: black;\r
- background-color: white;\r
-}\r
-\r
-li {\r
- list-style-type: none;\r
-}\r
-\r
-h1 {\r
- font-family: sans-serif;\r
- font-size: 16px;\r
- font-weight: bold;\r
- color: #000000;\r
- padding: 0px 0px 5px 0px;\r
- margin: 0px;\r
-}\r
-\r
-h2 {\r
- font-family: sans-serif;\r
- font-size: 14px;\r
- font-weight: bold;\r
- color: #000000;\r
- padding: 5px 0px 5px 0px;\r
- margin: 0px;\r
- margin-top: 5px;\r
-}\r
-\r
-table,form {\r
- margin: 0px;\r
-}\r
-\r
-img {\r
- border: none;\r
-}\r
-\r
-div {\r
- font-size: 100%;\r
-}\r
-\r
-tr.list:hover {\r
- background-color: lightgrey;\r
-}\r
-\r
-td.list {\r
- border-top: 1px solid lighgrey;\r
- padding: 2px 20px 2px 2px;\r
- padding-right: 15px;\r
-}\r
-\r
-th {\r
- font-size: 12px;\r
- padding: 2px 20px 2px 2px;\r
- vertical-align: top;\r
- text-align: left;\r
-}\r
-\r
-td {\r
- font-size: 12px;\r
- padding: 1px;\r
- vertical-align: middle;\r
- text-align: left;\r
-}\r
-\r
-/**************** Navigation ****************/\r
-td.nav1 {\r
- padding: 5px 0px 0px 0px;\r
- font-size: 12px;\r
- font-weight: bold;\r
-}\r
-\r
-td.nav2 {\r
- padding: 0px 0px 0px 5px;\r
- font-size: 12px;\r
-}\r
-\r
-/**************** Forms ****************/\r
-input.submit {\r
- border: solid 1px grey;\r
- background-color: lightgrey;\r
- align: right;\r
-}\r
-\r
-input.submit:hover {\r
- border: solid 1px #3399FF;\r
- background-color: white;\r
- color: #3399FF;\r
-}\r
-\r
-input.std {\r
- border: solid 1px lightgrey;\r
- padding: 1px;\r
- margin: 2px;\r
-}\r
-\r
-.formError {\r
- color: red;\r
- padding: 1px;\r
- margin: 2px;\r
- font-weight: bold;\r
-}\r
-\r
-/**************** Pseudo classes ****************/\r
-a:link {\r
- color: #0066CC;\r
- text-decoration: none;\r
-}\r
-\r
-a:visited {\r
- color: #0066CC;\r
- text-decoration: none;\r
-}\r
-\r
-a:hover {\r
- color: #3399FF;\r
- text-decoration: none;\r
-}\r
-\r
-/************************* ID's *************************/\r
-#main {\r
- position: absolute;\r
- margin-left: 180px;\r
- padding-top: 65px;\r
-}\r
-\r
-#navigation {\r
- position: absolute;\r
- width: 150px;\r
- height: 800px;\r
- border-right: 1px solid #0066CC;\r
- font-weight: normal;\r
- margin-top: 60px;\r
- margin-left: 10px;\r
-}\r
-\r
-#banner {\r
- position: absolute;\r
- width: 400px;\r
- height: 50px;\r
-}\r
-\r
-#upperRight {\r
- position: absolute;\r
- top: 0;\r
- right: 0;\r
- margin-top: 20px;\r
- margin-right: 10px;\r
-}
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>argeo-slc</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>modules</artifactId>
- <name>SLC Modules</name>
- <packaging>pom</packaging>
- <modules>
- <module>org.argeo.slc.ext.castor</module>
- <module>org.argeo.slc.agent</module>
- <module>org.argeo.slc.agent.jcr</module>
- <module>org.argeo.slc.agent.cli</module>
- <module>org.argeo.slc.node.jackrabbit</module>
- <module>org.argeo.slc.server.repo</module>
- <module>org.argeo.slc.server.repo.webapp</module>
- </modules>
- <build>
- <resources>
- <resource>
- <directory>.</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>.*</exclude>
- <exclude>.*/**</exclude>
- <exclude>pom.xml</exclude>
- <exclude>build.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.client.rcp</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Wed Aug 04 16:32:22 CEST 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <!-- RCP Specific open JCR file command -->
- <bean id="org.argeo.slc.client.rcp.openJcrFile" class="org.argeo.slc.client.ui.specific.OpenJcrFile"
- scope="prototype">
- <property name="repoService" ref="repoService" />
- </bean>
-
- <bean id="repoService" class="org.argeo.slc.repo.core.RepoServiceImpl">
- <property name="repositoryFactory" ref="repositoryFactory" />
- <property name="keyring" ref="keyring" />
- <property name="nodeRepository" ref="nodeRepository" />
- </bean>
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
- xmlns:osgi="http://www.springframework.org/schema/osgi"\r
- xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
- http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
- http://www.springframework.org/schema/beans \r
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
- osgi:default-timeout="30000">\r
-\r
- <beans:description>SLC UI RCP</beans:description>\r
-\r
- <reference id="nodeRepository" interface="javax.jcr.Repository"\r
- filter="(argeo.jcr.repository.alias=node)" />\r
- <reference id="repositoryFactory" interface="javax.jcr.RepositoryFactory" />\r
- <reference id="keyring" interface="org.argeo.security.crypto.CryptoKeyring" />\r
-\r
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-source.. = src/main/java
-output.. = target/classes
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/,\
- splash.bmp,\
- plugin_customization.ini
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- id="org.argeo.slc.client.rcp.product"
- point="org.eclipse.core.runtime.products">
- <product
- application="org.argeo.slc.client.rcp.application"
- name="SLC">
- <property
- name="windowImages"
- value="icons/argeo-icon-256.png">
- </property>
- <property
- name="appName"
- value="SLC">
- </property>
- <property
- name="preferenceCustomization"
- value="plugin_customization.ini">
- </property>
- </product>
- </extension>
- <extension
- id="org.argeo.slc.client.rcp.application"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- class="org.argeo.slc.client.rcp.SlcSecureClientApplication">
- </run>
- </application>
- </extension>
-
- <!-- COMMANDS -->
- <extension
- point="org.eclipse.ui.commands">
- <command
- id="org.argeo.slc.client.rcp.openJcrFile"
- defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
- name="Open Workspace Editor">
- <commandParameter
- id="param.repoNodePath"
- name="Repo node path">
- </commandParameter>
- <commandParameter
- id="param.repoUri"
- name="Repo URI">
- </commandParameter>
- <commandParameter
- id="param.workspaceName"
- name="Workspace name">
- </commandParameter>
- <commandParameter
- id="param.filePath"
- name="File Path">
- </commandParameter>
- </command>
- </extension>
-
- <!-- RCP Specific, does not work with RAP -->
- <extension
- point="org.eclipse.ui.bindings">
- <!-- <key
- commandId="org.argeo.slc.client.ui.refreshExecutionModulesView"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+R">
- </key> -->
- </extension>
-</plugin>
+++ /dev/null
-org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
-org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
-org.eclipse.ui/PERSPECTIVE_BAR_SIZE=100
-org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=true
-org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>plugins</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.client.rcp</artifactId>
- <name>SLC Client RCP</name>
- <packaging>jar</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-Activator>org.argeo.slc.client.rcp.SlcRcpPlugin</Bundle-Activator>
- <Require-Bundle>
- org.eclipse.ui,
- org.eclipse.core.runtime
- </Require-Bundle>
- <Import-Package>
- org.argeo.eclipse.spring,
- org.argeo.slc.repo.core,
- javax.jcr.nodetype,
- *,
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <!-- SLC -->
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.repo</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <!-- Bundles to start -->
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.node.jackrabbit</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.agent</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.commons.security</groupId>
- <artifactId>org.argeo.security.dao.jackrabbit</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.server</groupId>
- <artifactId>org.argeo.node.repo.jackrabbit</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
-
- <!-- Security UI -->
- <dependency>
- <groupId>org.argeo.commons.base</groupId>
- <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.security</groupId>
- <artifactId>org.argeo.security.ui.rcp</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
- </dependencies>
-</project>
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.client.rcp;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class SlcRcpPlugin extends AbstractUIPlugin {
- public static final String PLUGIN_ID = "org.argeo.slc.client.rcp";
- private static SlcRcpPlugin plugin;
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- public static SlcRcpPlugin getDefault() {
- return plugin;
- }
-
- @Override
- protected void initializeImageRegistry(ImageRegistry reg) {
- // TODO make it configurable
- reg.put("argeoTrayIcon",
- getImageDescriptor("icons/argeo-trayIcon-256.png"));
- }
-
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.client.rcp;
-
-import org.argeo.security.ui.rcp.SecureRcp;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.window.Window.IExceptionHandler;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-
-/**
- * This class controls all aspects of the application's execution
- */
-public class SlcSecureClientApplication extends SecureRcp {
-
- @Override
- protected WorkbenchAdvisor createWorkbenchAdvisor(String username) {
- Window.setExceptionHandler(new IExceptionHandler() {
-
- public void handleException(Throwable t) {
- System.err.println("Unexpected SLC UI exception: " + t);
-
- }
- });
-
- return new SlcSecureWorkbenchAdvisor(username);
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.client.rcp;
-
-import org.argeo.security.ui.rcp.SecureWorkbenchAdvisor;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-/**
- * Custom {@link SecureWorkbenchAdvisor} in order to create a
- * {@link SlcSecureWorkbenchWindowAdvisor}.
- */
-public class SlcSecureWorkbenchAdvisor extends SecureWorkbenchAdvisor {
- public SlcSecureWorkbenchAdvisor(String username) {
- super(username);
- }
-
- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
- IWorkbenchWindowConfigurer configurer) {
- return new SlcSecureWorkbenchWindowAdvisor(configurer, getUsername());
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.client.rcp;
-
-import org.argeo.security.ui.rcp.SecureWorkbenchWindowAdvisor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DropTargetAdapter;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tray;
-import org.eclipse.swt.widgets.TrayItem;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.part.EditorInputTransfer;
-
-/**
- * Custom {@link SecureWorkbenchWindowAdvisor} which can add a tray. TODO: to
- * be factorized in Argeo Commons and made more generic.
- */
-public class SlcSecureWorkbenchWindowAdvisor extends
- SecureWorkbenchWindowAdvisor {
- public final static String IN_TRAY_PROPERTY = "org.argeo.slc.ui.inTray";
-
- private TrayItem trayItem;
-
- public SlcSecureWorkbenchWindowAdvisor(
- IWorkbenchWindowConfigurer configurer, String username) {
- super(configurer, username);
- }
-
- public void postWindowOpen() {
- String inTray = System.getProperty(IN_TRAY_PROPERTY);
- if (inTray != null && inTray.equals("true")) {
- initTray();
- }
- }
-
- @Override
- public void preWindowOpen() {
- getWindowConfigurer().addEditorAreaTransfer(
- EditorInputTransfer.getInstance());
- getWindowConfigurer().configureEditorAreaDropListener(
- new DropTargetAdapter() {
-
- @Override
- public void dragEnter(DropTargetEvent event) {
- System.out.println("DROP enter!!! " + event);
- }
-
- @Override
- public void dragLeave(DropTargetEvent event) {
- System.out.println("DROP leave!!! " + event);
- }
-
- public void drop(DropTargetEvent event) {
- System.out.println("DROP drop!!! " + event);
-
- }
-
- @Override
- public void dropAccept(DropTargetEvent event) {
- System.out.println("DROP accept!!! " + event);
- super.dropAccept(event);
- }
-
- });
- super.preWindowOpen();
- }
-
- @Override
- public boolean preWindowShellClose() {
- // hide but do not dispose if tray is supported
- if (trayItem != null) {
- getWindowConfigurer().getWindow().getShell().setVisible(false);
- return false;
- } else
- return true;
- }
-
- /** Init tray support */
- protected void initTray() {
- IWorkbenchWindow window = getWindowConfigurer().getWindow();
- Shell shell = window.getShell();
- final Tray tray = shell.getDisplay().getSystemTray();
- trayItem = new TrayItem(tray, SWT.NONE);
- if (trayItem == null)
- return;
-
- // image
- Image trayImage = SlcRcpPlugin.getDefault().getImageRegistry()
- .get("argeoTrayIcon");
- trayItem.setImage(trayImage);
- trayItem.setToolTipText("Argeo SLC");
-
- // add pop-menu
- // TODO: contribute more commands
- trayItem.addListener(SWT.MenuDetect, new Listener() {
- public void handleEvent(Event event) {
- IWorkbenchWindow window = getWindowConfigurer().getWindow();
- Menu menu = new Menu(window.getShell(), SWT.POP_UP);
- MenuItem exit = new MenuItem(menu, SWT.NONE);
- exit.setText("Exit");
- exit.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- getWindowConfigurer().getWorkbenchConfigurer()
- .getWorkbench().close();
- }
- });
- menu.setVisible(true);
- }
- });
-
- // add behavior when clicked upon
- trayItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- Shell shell = getWindowConfigurer().getWindow().getShell();
- if (shell.isVisible()) {
- if (shell.getMinimized())
- shell.setMinimized(false);
- else {
- shell.setVisible(false);
- shell.setMinimized(true);
- }
- } else {
- shell.setVisible(true);
- shell.setActive();
- shell.setFocus();
- shell.setMinimized(false);
- }
- }
- });
-
- // start hidden
- // shell.setVisible(false);
- }
-
- @Override
- public void dispose() {
- if (trayItem != null)
- trayItem.dispose();
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.client.ui.specific;
-
-import java.awt.Desktop;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.nodetype.NodeType;
-
-import org.apache.commons.io.IOUtils;
-import org.argeo.jcr.JcrUtils;
-import org.argeo.slc.SlcException;
-import org.argeo.slc.repo.RepoService;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-/**
- * RCP specific command handler to open a file retrieved from a local or distant
- * JCR Repository.
- */
-public class OpenJcrFile extends AbstractHandler {
- // private final static Log log = LogFactory.getLog(OpenJcrFile.class);
-
- // Here is the trick that enable single sourcing: the ID is determined at
- // runtime so use (new OpenJcrFileCmdId()).getCmdId() instead of the usual
- // public final String ID = SlcRcpPlugin.PLUGIN_ID + ".openJcrFile";
-
- public final static String PARAM_REPO_NODE_PATH = "param.repoNodePath";
- public final static String PARAM_REPO_URI = "param.repoUri";
- public final static String PARAM_WORKSPACE_NAME = "param.workspaceName";
- public final static String PARAM_FILE_PATH = "param.filePath";
-
- /* DEPENDENCY INJECTION */
- private RepoService repoService;
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- String repoNodePath = event.getParameter(PARAM_REPO_NODE_PATH);
- String repoUri = event.getParameter(PARAM_REPO_URI);
- String wkspName = event.getParameter(PARAM_WORKSPACE_NAME);
- String filePath = event.getParameter(PARAM_FILE_PATH);
-
- // TODO sanity check
- if (filePath == null || "".equals(filePath.trim()))
- return null;
- retrieveAndOpen(repoNodePath, repoUri, wkspName, filePath);
-
- return null;
- }
-
- protected void retrieveAndOpen(String repoNodePath, String repoUri,
- String wkspName, String filePath) {
- Session businessSession = null;
- try {
- businessSession = repoService.getRemoteSession(repoNodePath,
- repoUri, wkspName);
- Node result = businessSession.getNode(filePath);
-
- boolean isValid = true;
- Node child = null;
- if (!result.isNodeType(NodeType.NT_FILE))
- isValid = false;
- else {
- child = result.getNode(Property.JCR_CONTENT);
- if (!(child.isNodeType(NodeType.NT_RESOURCE) || child
- .hasProperty(Property.JCR_DATA)))
- isValid = false;
- }
-
- if (!isValid)
- return;
-
- InputStream fis = null;
- String prefix = "", extension = "";
- String fileName = JcrUtils.lastPathElement(filePath);
- int ind = fileName.lastIndexOf('.');
- if (ind > 0) {
- prefix = fileName.substring(0, ind);
- extension = fileName.substring(ind);
- }
- try {
-
- fis = (InputStream) child.getProperty(Property.JCR_DATA)
- .getBinary().getStream();
- File file = createTmpFile(prefix, extension, fis);
- Desktop desktop = null;
- if (Desktop.isDesktopSupported()) {
- desktop = Desktop.getDesktop();
- }
- desktop.open(file);
- } catch (Exception e) {
- throw new SlcException(
- "Stream error while opening file " + filePath
- + " from repo " + repoUri == null ? repoNodePath
- : repoUri, e);
- } finally {
- IOUtils.closeQuietly(fis);
- }
- } catch (RepositoryException e) {
- throw new SlcException("Unexpected error while "
- + "getting repoNode info for repoNode at path "
- + repoNodePath, e);
- } finally {
- JcrUtils.logoutQuietly(businessSession);
- }
- }
-
- private File createTmpFile(String prefix, String suffix, InputStream is) {
- File tmpFile = null;
- OutputStream os = null;
- try {
- tmpFile = File.createTempFile(prefix, suffix);
- os = new FileOutputStream(tmpFile);
- IOUtils.copy(is, os);
- } catch (IOException e) {
- throw new SlcException("Cannot open file " + prefix + "." + suffix,
- e);
- } finally {
- IOUtils.closeQuietly(os);
- }
- return tmpFile;
- }
-
- /* DEPENDENCY INJECTION */
- public void setRepoService(RepoService repoService) {
- this.repoService = repoService;
- }
-}
\ No newline at end of file
+++ /dev/null
-package org.argeo.slc.client.ui.specific;
-
-import org.argeo.slc.client.rcp.SlcRcpPlugin;
-
-/**
- * Workaround a single sourcing problem:
- *
- * final static variable are imported at compilation time (we build against RCP)
- * and we still must have a different ID (the prefix must be the PLUGIN ID) for
- * RAP and RCP in order to be able to inject beans in the corresponding commands
- */
-public class OpenJcrFileCmdId {
-
- public String getCmdId() {
- return SlcRcpPlugin.PLUGIN_ID + ".openJcrFile";
- }
-}
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>argeo-slc</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>plugins</artifactId>
- <name>SLC Eclipse Plugins</name>
- <packaging>pom</packaging>
- <modules>
- <module>org.argeo.slc.client.rcp</module>
- <module>org.argeo.slc.client.rap</module>
- <module>org.argeo.slc.client.ui</module>
- <module>org.argeo.slc.client.ui.dist</module>
- </modules>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId};singleton:=true</Bundle-SymbolicName>
- <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <configuration>
- <!-- Prevents source jars to contain misleading data -->
- <excludes>
- <exclude>plugin.xml</exclude>
- <exclude>META-INF/MANIFEST.MF</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main/java" output="target/classes" />
- <classpathentry kind="src" path="src/main/resources"
- output="target/classes" />
- <classpathentry kind="src" output="target/test-classes"
- path="src/test/java" />
- <classpathentry kind="src" output="target/test-classes"
- path="src/test/resources" />
- <classpathentry kind="con"
- path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con"
- path="org.eclipse.pde.core.requiredPlugins" />
- <classpathentry kind="output" path="target/classes" />
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Sat Jun 27 17:07:29 CEST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-#Mon Feb 14 20:13:06 CET 2011
-eclipse.preferences.version=1
-pluginProject.equinox=false
-pluginProject.extensions=false
-resolve.requirebundle=false
-selfhosting.binExcludes=/org.argeo.slc.core/target/test-classes,/org.argeo.slc.core/target/test-classes
+++ /dev/null
-additional.bundles = slf4j.api,\
- slf4j.log4j,\
- org.apache.log4j,\
- slf4j.org.apache.commons.logging,\
- org.aopalliance,\
- org.aspectj.weaver,\
- net.sf.cglib,\
- org.springframework.context.support,\
- org.springframework.context
-source.. = src/main/java/,\
- src/main/resources/,\
- src/test/java/,\
- src/test/resources/
-bin.includes = META-INF/spring.handlers,\
- META-INF/spring.schemas
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.core</artifactId>
- <name>SLC Core</name>
- <description>Basic implementations of SLC Specifications</description>
- <build>
- <outputDirectory>bin</outputDirectory>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.*,org.argeo.slc.core.test.spring
- </Export-Package>
- <Import-Package>
- org.w3c.dom;version="0.0.0",
- org.dbunit;resolution:="optional",
- org.dbunit.database;resolution:="optional",
- org.dbunit.dataset;resolution:="optional",
- org.dbunit.dataset.xml;resolution:="optional",
- org.dbunit.operation;resolution:="optional",
- junit.framework;resolution:="optional",
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.specs</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.commons.base</groupId>
- <artifactId>org.argeo.util</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.security</groupId>
- <artifactId>org.argeo.security.core</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.aspectj.runtime</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.aspectj.weaver</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.exec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.cli</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.org.apache.commons.logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.base</groupId>
- <artifactId>org.argeo.dep.log4j</artifactId>
- <version>${version.argeo-commons}</version>
- <type>pom</type>
- </dependency>
-
- <!-- Spring -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.context</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.aop</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.security.core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>net.sf.cglib</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.codec</artifactId>
- </dependency>
-
- <!-- Test -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:slc="http://argeo.org/projects/slc/schemas"
- elementFormDefault="qualified"
- targetNamespace="http://argeo.org/projects/slc/schemas">
- <!-- TREE TEST RESULT -->
- <xs:element name="tree-test-result" type="slc:TreeTestResultType" />
- <xs:element name="tree-test-result-collection"
- type="slc:TreeTestResultCollectionType" />
-
- <xs:complexType name="TreeTestResultCollectionType">
- <xs:all>
- <xs:element name="results" minOccurs="0"
- type="slc:ResultsType" />
- </xs:all>
- <xs:attribute name="id" use="required" />
- </xs:complexType>
- <xs:complexType name="ResultsType">
- <xs:sequence>
- <xs:element name="tree-test-result"
- type="slc:TreeTestResultType" minOccurs="0"
- maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="TreeTestResultType">
- <xs:all>
- <xs:element name="close-date" type="xs:dateTime"
- minOccurs="0" />
- <xs:element name="attributes" minOccurs="0"
- type="slc:AttributesType" />
- <xs:element name="result-parts" minOccurs="0"
- type="slc:ResultPartsType" />
- <xs:element name="elements" minOccurs="0"
- type="slc:ElementsType" />
- </xs:all>
- <xs:attribute name="uuid" use="required" />
- </xs:complexType>
- <xs:complexType name="ResultPartsType">
- <xs:sequence>
- <xs:element name="result-part" type="slc:ResultPartType"
- minOccurs="0" maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="ResultPartType">
- <xs:all>
- <xs:element name="part-sub-list" type="slc:PartSubListType" />
- </xs:all>
- <xs:attribute name="path" type="xs:string" use="required" />
- </xs:complexType>
- <xs:complexType name="PartSubListType">
- <xs:all>
- <xs:element name="parts" minOccurs="0" type="slc:PartsType" />
- </xs:all>
- </xs:complexType>
- <xs:complexType name="PartsType">
- <xs:sequence>
- <xs:element name="simple-result-part"
- type="slc:SimpleResultPartType" maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="SimpleResultPartType">
- <xs:all>
- <xs:element name="status">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="PASSED" />
- <xs:enumeration value="FAILED" />
- <xs:enumeration value="ERROR" />
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element name="message" type="xs:string" />
- <xs:element name="exception-message" minOccurs="0"
- type="xs:string" />
- <xs:element name="stack-lines" minOccurs="0"
- type="slc:StackLinesType" />
- <xs:element name="test-run-uuid" type="xs:string"
- minOccurs="0" />
- </xs:all>
- </xs:complexType>
- <xs:complexType name="StackLinesType">
- <xs:sequence>
- <xs:element name="stack-line" maxOccurs="unbounded"
- type="xs:string" />
- </xs:sequence>
- <xs:attribute name="message" type="xs:string" />
- </xs:complexType>
- <xs:complexType name="ElementsType">
- <xs:sequence>
- <xs:element name="element" type="slc:ElementType"
- minOccurs="0" maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="ElementType">
- <xs:all>
- <xs:element name="simple-sElement"
- type="slc:SimpleSElementType" />
- </xs:all>
- <xs:attribute name="path" type="xs:string" use="required" />
- </xs:complexType>
- <xs:complexType name="SimpleSElementType">
- <xs:all>
- <xs:element name="label" type="xs:string" />
- <xs:element name="tags" type="slc:TagsType" minOccurs="0" />
- </xs:all>
- </xs:complexType>
- <xs:complexType name="TagsType">
- <xs:sequence>
- <xs:element name="tag" type="slc:TagType" minOccurs="0"
- maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="TagType">
- <xs:all>
- <xs:element name="tag-value" type="xs:string" />
- </xs:all>
- <xs:attribute name="name" type="xs:string" use="required" />
- </xs:complexType>
- <xs:complexType name="TreeSPathType">
- <xs:attribute name="as-unique-string" type="xs:string"
- use="required" />
- </xs:complexType>
- <xs:complexType name="TestRunDescriptorType">
- <xs:all>
- <xs:element name="test-run-uuid" type="xs:string" />
- <xs:element name="slc-execution-uuid" type="xs:string"
- minOccurs="0" />
- <xs:element name="slc-execution-step-uuid" type="xs:string"
- minOccurs="0" />
- <xs:element name="deployed-sytem-id" type="xs:string"
- minOccurs="0" />
- <xs:element name="test-result-uuid" type="xs:string"
- minOccurs="0" />
- </xs:all>
- </xs:complexType>
-
- <!-- BASIC MESSAGES -->
- <xs:element name="execution-answer">
- <xs:complexType>
- <xs:all>
- <xs:element name="status"
- type="xs:string" maxOccurs="1" minOccurs="1" />
- <xs:element name="message"
- type="xs:string" maxOccurs="1" minOccurs="1"/>
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <!-- TREE TEST RESULT REQUESTS -->
- <xs:element name="create-tree-test-result-request">
- <xs:complexType>
- <xs:all>
- <xs:element name="tree-test-result"
- type="slc:TreeTestResultType" />
- <xs:element name="test-run-descriptor"
- type="slc:TestRunDescriptorType" maxOccurs="1" minOccurs="0"/>
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="close-tree-test-result-request">
- <xs:complexType>
- <xs:all>
- <xs:element name="result-uuid" type="xs:string" />
- <xs:element name="close-date" type="xs:dateTime" />
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="result-part-request">
- <xs:complexType>
- <xs:all>
- <xs:element name="result-uuid" type="xs:string" />
- <xs:element name="simple-result-part"
- type="slc:SimpleResultPartType" />
- <xs:element name="related-elements"
- type="slc:ElementsType" />
- <xs:element name="tree-sPath" type="slc:TreeSPathType" />
- <xs:element name="test-run-descriptor"
- type="slc:TestRunDescriptorType" />
- <xs:element name="attributes" minOccurs="0"
- type="slc:AttributesType" />
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <!-- SLC EXECUTION -->
- <xs:element name="slc-execution" type="slc:SlcExecutionType" />
- <xs:complexType name="SlcExecutionType">
- <xs:all>
- <xs:element name="status" type="xs:string" />
- <xs:element name="type" type="xs:string" />
- <xs:element name="host" type="xs:string" />
- <xs:element name="user" type="xs:string" />
- <xs:element name="steps" minOccurs="0"
- type="slc:SlcExecutionStepsType" />
- <xs:element name="attributes" minOccurs="0"
- type="slc:AttributesType" />
- </xs:all>
- <xs:attribute name="uuid" type="xs:string" use="required" />
- </xs:complexType>
- <xs:complexType name="SlcExecutionStepsType">
- <xs:sequence>
- <xs:element name="slc-execution-step"
- type="slc:SlcExecutionStepType" maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="SlcExecutionStepType">
- <xs:all>
- <xs:element name="type" type="xs:string" />
- <xs:element name="thread" type="xs:string" />
- <xs:element name="timestamp" type="xs:dateTime" />
- <xs:element name="log-lines" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="log-line" type="xs:string"
- maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="uuid" type="xs:string" use="required" />
- </xs:complexType>
- <xs:complexType name="AttributesType">
- <xs:sequence>
- <xs:element name="attribute" type="slc:AttributeType"
- minOccurs="0" maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="AttributeType">
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="name" type="xs:string"
- use="required" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <!-- SLC EXECUTION REQUESTS-->
- <xs:element name="slc-execution-request">
- <xs:complexType>
- <xs:all>
- <xs:element name="slc-execution"
- type="slc:SlcExecutionType" />
- </xs:all>
- </xs:complexType>
- </xs:element>
- <xs:element name="slc-execution-steps-request">
- <xs:complexType>
- <xs:all>
- <xs:element name="slc-execution-uuid" type="xs:string" />
- <xs:element name="steps"
- type="slc:SlcExecutionStepsType" />
- </xs:all>
- </xs:complexType>
- </xs:element>
- <xs:element name="slc-execution-status-request">
- <xs:complexType>
- <xs:all>
- <xs:element name="slc-execution-uuid" type="xs:string" />
- <xs:element name="new-status" type="xs:string" />
- </xs:all>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
\ No newline at end of file
+++ /dev/null
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
- default-lazy-init="true">\r
-\r
- <bean id="slcDefault.xml.xsdValidator"\r
- factory-bean="slcDefault.xml.xsdSchema" factory-method="createValidator" />\r
-\r
- <bean id="slcDefault.xml.xsdSchema"\r
- class="org.springframework.xml.xsd.SimpleXsdSchema">\r
- <property name="xsd"\r
- value="classpath:/org/argeo/slc/xml/slc.xsd" />\r
- </bean>\r
-</beans>\r
+++ /dev/null
-# Set root logger level to DEBUG and its only appender to A1.\r
-log4j.rootLogger=WARN, console\r
-\r
-## Levels\r
-# Slc\r
-log4j.logger.org.argeo=DEBUG\r
-\r
-# Castor\r
-log4j.logger.org.exolab.castor=WARN\r
-\r
-# Spring\r
-log4j.logger.org.springframework=WARN\r
-\r
-\r
-## Appenders\r
-# A1 is set to be a ConsoleAppender.\r
-log4j.appender.console=org.apache.log4j.ConsoleAppender\r
-\r
-# A1 uses PatternLayout.\r
-log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
- <bean id="relativeResourceSet" class="org.argeo.slc.core.deploy.DefaultResourceSet">\r
- <property name="base" value="classpath:/org/argeo/slc/core/deploy/data" />\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="imports.xml" /> \r
-\r
- <bean id="executionModule_1" class="org.argeo.slc.core.execution.SimpleSpringExecutionModule" >\r
- <property name="executionContext">\r
- <ref bean="executionContext" />\r
- </property> \r
- <property name="name" value="dummyname" />\r
- <property name="version" value="dummyversion" />\r
- </bean>\r
- \r
- <bean id="main" parent="slcTemplate.simpleFlow">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testKey">\r
- <bean parent="specAttr.primitive" p:value="660" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- <property name="executables">\r
- <list>\r
- <ref local="echo1" />\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="echo1" parent="task.echo" scope="execution">\r
- <property name="message"\r
- value="From main! @{testKey}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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
- <import resource="canonic.xml" />\r
-\r
- <bean id="canonic.001" parent="canonic.flowTemplate">\r
- <constructor-arg>\r
- <map>\r
- <entry key="parameterAtInstantiation" value="1" />\r
- </map>\r
- </constructor-arg>\r
- </bean>\r
-</beans>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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
- <import resource="canonic.xml" />\r
-\r
- <bean id="canonic.002" parent="canonic.flowTemplate">\r
- <constructor-arg>\r
- <map>\r
- <entry key="parameterAtInstantiation" value="2" />\r
- <entry key="displayWithoutControl" value="102" />\r
- <entry key="displayWithControl" value="202" />\r
- <entry key="hide" value="202" />\r
- <entry key="notParameterAtInstantiation" value="202" />\r
- </map>\r
- </constructor-arg>\r
- </bean>\r
-</beans>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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
- <import resource="canonic.xml" />\r
-\r
- <bean id="canonic.003" parent="canonic.flowTemplate">\r
- <constructor-arg>\r
- <map>\r
- <!-- missing parameter -->\r
- <entry key="displayWithoutControl" value="102" />\r
- <entry key="displayWithControl" value="202" />\r
- <entry key="hide" value="202" />\r
- </map>\r
- </constructor-arg>\r
- </bean>\r
-</beans>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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
- <import resource="canonic.xml" />\r
-\r
- <bean id="canonic.004" parent="canonic.flowTemplate">\r
- <constructor-arg>\r
- <map>\r
- <entry key="parameterAtInstantiation" value="2" />\r
- <entry key="displayWithoutControl" value="102" />\r
- <entry key="displayWithControl" value="202" />\r
- <entry key="hide" value="202" />\r
- <entry key="unknownParameter" value="1" />\r
- </map>\r
- </constructor-arg>\r
- </bean>\r
-</beans>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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
- <import resource="imports.xml" />\r
-\r
- <bean id="canonic.spec" parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="parameterAtInstantiation">\r
- <bean parent="specAttr.primitive" p:isParameter="true" p:type="integer" />\r
- </entry>\r
- <entry key="displayWithoutControl">\r
- <bean parent="specAttr.primitive" p:value="100" p:isParameter="true"\r
- p:isFrozen="true" p:type="integer" />\r
- </entry>\r
- <entry key="displayWithControl">\r
- <bean parent="specAttr.primitive" p:value="200" p:isParameter="true"\r
- p:isFrozen="false" p:type="integer" />\r
- </entry>\r
- <entry key="hide">\r
- <bean parent="specAttr.primitive" p:value="300" p:isParameter="true"\r
- p:isFrozen="false" p:isHidden="true" p:type="integer" />\r
- </entry> \r
- <entry key="notParameterAtInstantiation">\r
- <bean parent="specAttr.primitive" p:value="400" p:isParameter="false"\r
- p:isFrozen="false" p:isHidden="false" p:type="integer" />\r
- </entry> \r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="canonic.flowTemplate" parent="slcTemplate.simpleFlow"\r
- abstract="true">\r
- <constructor-arg ref="canonic.spec" />\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo"\r
- p:message="Canonical: displayWithControl=@{displayWithControl}, displayWithoutControl=@{displayWithoutControl}, hide=@{hide}">\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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
- <import resource="imports.xml" />\r
-\r
- <bean id="executionResources.spec" parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="var">\r
- <bean parent="specAttr.primitive" p:isParameter="false"\r
- p:type="integer" p:value="60" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="executionResources.placeholderPass" parent="slcTemplate.simpleFlow">\r
- <constructor-arg ref="executionResources.spec" />\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo">\r
- <property name="message" value="DATA" />\r
- <property name="writeTo">\r
- <bean parent="slcTemplate.resourcesFactoryBean" scope="execution">\r
- <property name="executionResources" ref="executionResources" />\r
- <property name="relativePath" value="subdir/@{var}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property>\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="executionResources.placeholderFail" parent="slcTemplate.simpleFlow">\r
- <constructor-arg ref="executionResources.spec" />\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo">\r
- <property name="message" value="DATA" />\r
- <property name="writeTo">\r
- <bean factory-bean="executionResources" factory-method="getWritableResource"\r
- scope="execution">\r
- <constructor-arg value="subdir/@{var}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property>\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="executionResources.simple" parent="slcTemplate.simpleFlow">\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo">\r
- <property name="message" value="DATA" />\r
- <property name="writeTo">\r
- <bean factory-bean="executionResources" factory-method="getWritableResource"\r
- scope="execution">\r
- <constructor-arg value="subdir/writeTo" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property>\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="executionResources" parent="slcTemplate.fileResources">\r
- <property name="executionContext" ref="executionContext" />\r
- <property name="withExecutionSubdirectory" value="false" />\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<!-- Copyright (C) 2007-2012 Mathieu Baudier Licensed 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. -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
-
- <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />
- <import resource="classpath:/org/argeo/slc/core/test/spring.xml" />
-
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="imports.xml" /> \r
-\r
- <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="basic.testDef" />\r
- <property name="testResult" ref="myTestResult"/>\r
- </bean> \r
-\r
- <bean id="myFlow" parent="slcTemplate.simpleFlow">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testKey">\r
- <bean parent="specAttr.primitive" p:value="myValue" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- <property name="executables">\r
- <list>\r
- <ref local="echo1" />\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="simpleMap.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingMap.testData" />\r
- </bean> \r
- \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="simpleList.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingList.testData" />\r
- </bean> \r
- \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="simpleSet.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingSet.testData" />\r
- </bean> \r
- \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingListMap.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingSetMap.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingComplex.testData" />\r
- </bean> \r
- \r
- </list>\r
- </property>\r
- </bean>\r
-\r
-\r
- <bean id="simpleMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <map>\r
- <entry key="key1" value="myValue_myValue" />\r
- </map>\r
- </property>\r
- <property name="reached">\r
- <map>\r
- <entry key="key1" value="@{testKey}_@{testKey}" />\r
- </map>\r
- </property>\r
- </bean>\r
- \r
- <bean id="cascadingMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <map>\r
- <entry key="key3">\r
- <map>\r
- <entry key="key2">\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map>\r
- </entry>\r
- <entry key="key2bis" value="myValue" />\r
- </map>\r
- </entry>\r
- </map>\r
- </property>\r
- <property name="reached">\r
- <map>\r
- <entry key="key3">\r
- <map>\r
- <entry key="key2">\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map>\r
- </entry>\r
- <entry key="key2bis" value="@{testKey}" />\r
- </map>\r
- </entry>\r
- </map>\r
- </property>\r
- </bean> \r
- \r
- <bean id="simpleList.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <list>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </list>\r
- </property>\r
- <property name="reached">\r
- <list>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value> \r
- </list>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingList.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <list>\r
- <list>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </list>\r
- <value>myValue</value>\r
- </list>\r
- </property>\r
- <property name="reached">\r
- <list>\r
- <list>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value>\r
- </list>\r
- <value>@{testKey}</value>\r
- </list>\r
- </property>\r
- </bean> \r
- \r
- <bean id="simpleSet.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <set>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </set>\r
- </property>\r
- <property name="reached">\r
- <set>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value> \r
- </set>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingSet.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <set>\r
- <set>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </set>\r
- <value>myValue</value>\r
- </set>\r
- </property>\r
- <property name="reached">\r
- <set>\r
- <set>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value>\r
- </set>\r
- <value>@{testKey}</value>\r
- </set>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingListMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <list>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- </list>\r
- </property>\r
- <property name="reached">\r
- <list>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- </list>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingSetMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <set>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- </set>\r
- </property>\r
- <property name="reached">\r
- <set>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- </set>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingComplex.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <set>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- <list>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- <set>\r
- <set>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- <list>\r
- <list>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </list>\r
- <value>myValue</value>\r
- </list> \r
- </set>\r
- <value>myValue</value>\r
- </set> \r
- </list> \r
- <set>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- </set> \r
- </set>\r
- </property>\r
- <property name="reached">\r
- <set>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- <list>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- <set>\r
- <set>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value>\r
- <list>\r
- <list>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value>\r
- </list>\r
- <value>@{testKey}</value>\r
- </list> \r
- </set>\r
- <value>@{testKey}</value>\r
- </set> \r
- </list> \r
- <set>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- </set> \r
- </set>\r
- </property>\r
- </bean> \r
- \r
- <bean id="basic.testDef" class="org.argeo.slc.core.test.BasicTestDefinition">\r
- </bean> \r
-\r
-\r
- <bean id="echo1" parent="task.echo" scope="prototype">\r
- <property name="message"\r
- value="testKey=@{testKey}" />\r
- </bean>\r
- \r
- <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="imports.xml" /> \r
-\r
- <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="basic.testDef" />\r
- <property name="testResult" ref="myTestResult"/>\r
- </bean> \r
-\r
- <bean id="abstractFlow" parent="slcTemplate.simpleFlow" abstract="true">\r
- <property name="executables">\r
- <list>\r
- <ref local="echo1" />\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="simpleMap.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingMap.testData" />\r
- </bean> \r
- \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="simpleList.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingList.testData" />\r
- </bean> \r
- \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="simpleSet.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingSet.testData" />\r
- </bean> \r
- \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingListMap.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingSetMap.testData" />\r
- </bean> \r
- <bean parent="myTestRunTemplate">\r
- <property name="testData" ref="cascadingComplex.testData" />\r
- </bean> \r
- \r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flow1" parent="abstractFlow" scope="prototype">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testKey">\r
- <bean parent="specAttr.primitive" p:value="myValue" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- </bean> \r
-\r
- <bean id="flow2" parent="abstractFlow" scope="prototype">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testKey">\r
- <bean parent="specAttr.primitive" p:value="myValue2" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- </bean> \r
-\r
-\r
- <bean id="simpleMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <map>\r
- <entry key="key1" value="myValue_myValue" />\r
- </map>\r
- </property>\r
- <property name="reached">\r
- <map>\r
- <entry key="key1" value="@{testKey}_@{testKey}" />\r
- </map>\r
- </property>\r
- </bean>\r
- \r
- <bean id="cascadingMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <map>\r
- <entry key="key3">\r
- <map>\r
- <entry key="key2">\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map>\r
- </entry>\r
- <entry key="key2bis" value="myValue" />\r
- </map>\r
- </entry>\r
- </map>\r
- </property>\r
- <property name="reached">\r
- <map>\r
- <entry key="key3">\r
- <map>\r
- <entry key="key2">\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map>\r
- </entry>\r
- <entry key="key2bis" value="@{testKey}" />\r
- </map>\r
- </entry>\r
- </map>\r
- </property>\r
- </bean> \r
- \r
- <bean id="simpleList.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <list>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </list>\r
- </property>\r
- <property name="reached">\r
- <list>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value> \r
- </list>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingList.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <list>\r
- <list>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </list>\r
- <value>myValue</value>\r
- </list>\r
- </property>\r
- <property name="reached">\r
- <list>\r
- <list>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value>\r
- </list>\r
- <value>@{testKey}</value>\r
- </list>\r
- </property>\r
- </bean> \r
- \r
- <bean id="simpleSet.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <set>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </set>\r
- </property>\r
- <property name="reached">\r
- <set>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value> \r
- </set>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingSet.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <set>\r
- <set>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </set>\r
- <value>myValue</value>\r
- </set>\r
- </property>\r
- <property name="reached">\r
- <set>\r
- <set>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value>\r
- </set>\r
- <value>@{testKey}</value>\r
- </set>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingListMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <list>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- </list>\r
- </property>\r
- <property name="reached">\r
- <list>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- </list>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingSetMap.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <set>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- </set>\r
- </property>\r
- <property name="reached">\r
- <set>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- </set>\r
- </property>\r
- </bean> \r
- \r
- <bean id="cascadingComplex.testData" class="org.argeo.slc.core.test.BasicTestData" scope="prototype">\r
- <property name="expected">\r
- <set>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- <list>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- <set>\r
- <set>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- <list>\r
- <list>\r
- <value>myValue</value>\r
- <value>_myValue_</value>\r
- </list>\r
- <value>myValue</value>\r
- </list> \r
- </set>\r
- <value>myValue</value>\r
- </set> \r
- </list> \r
- <set>\r
- <map>\r
- <entry key="key1" value="myValue" />\r
- </map> \r
- </set> \r
- </set>\r
- </property>\r
- <property name="reached">\r
- <set>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- <list>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- <set>\r
- <set>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value>\r
- <list>\r
- <list>\r
- <value>@{testKey}</value>\r
- <value>_@{testKey}_</value>\r
- </list>\r
- <value>@{testKey}</value>\r
- </list> \r
- </set>\r
- <value>@{testKey}</value>\r
- </set> \r
- </list> \r
- <set>\r
- <map>\r
- <entry key="key1" value="@{testKey}" />\r
- </map> \r
- </set> \r
- </set>\r
- </property>\r
- </bean> \r
- \r
- <bean id="basic.testDef" class="org.argeo.slc.core.test.BasicTestDefinition">\r
- </bean> \r
-\r
-\r
- <bean id="echo1" parent="task.echo" scope="prototype">\r
- <property name="message"\r
- value="testKey=@{testKey}" />\r
- </bean>\r
- \r
- <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="imports.xml" /> \r
-\r
- <bean id="minimal" parent="slcTemplate.simpleFlow">\r
- <property name="executionSpec">\r
- <bean parent="slcTemplate.simpleSpec">\r
-<!-- <property name="attributes">\r
- <map>\r
- <entry key="testKey">\r
- <bean parent="specAttr.primitive" p:value="660" />\r
- </entry>\r
- </map>\r
- </property> -->\r
- </bean>\r
- </property>\r
- <property name="executables">\r
- <list>\r
- <ref local="echo1" />\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="echo1" parent="task.echo" scope="execution">\r
- <property name="message"\r
- value="From minimal" />\r
- <aop:scoped-proxy />\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="imports.xml" /> \r
-\r
- <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
- <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
-\r
- <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="myTestDef" />\r
- <property name="testResult" ref="myTestResult"/>\r
- </bean> \r
-\r
- <bean id="fileDiff.spec" parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="fileName">\r
- <bean parent="specAttr.primitive" p:isParameter="true" p:type="string"\r
- p:isFrozen="true" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
-\r
-\r
- <bean id="fileDiff.flowTemplate" parent="slcTemplate.simpleFlow"\r
- abstract="true">\r
- <property name="path" value="/fileDiff/testcases" />\r
- <constructor-arg ref="fileDiff.spec" />\r
- <property name="executables">\r
- <list> \r
- <bean parent="task.echo">\r
- <property name="message" value="fileName=@{fileName}" />\r
- </bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="file1" />\r
- <property name="reached" value="@{fileName}" />\r
- </bean>\r
- </property> \r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
- \r
- <bean id="echo" parent="task.echo" scope="prototype">\r
- <property name="message" value="fileName=@{fileName}" />\r
- </bean> \r
- \r
- <bean id="flow1" parent="fileDiff.flowTemplate">\r
- <constructor-arg>\r
- <map>\r
- <entry key="fileName" value="file1" />\r
- </map>\r
- </constructor-arg>\r
- </bean> \r
-\r
- <bean id="flow2" parent="fileDiff.flowTemplate">\r
- <constructor-arg>\r
- <map>\r
- <entry key="fileName" value="file2" />\r
- </map>\r
- </constructor-arg>\r
- </bean> \r
- \r
- \r
- <!-- \r
- <bean id="flow1" parent="slcTemplate.simpleFlow">\r
- <property name="path" value="/fileDiff/testcases" />\r
- <constructor-arg ref="fileDiff.spec" />\r
- <constructor-arg>\r
- <map>\r
- <entry key="fileName" value="file1" />\r
- </map>\r
- </constructor-arg> \r
- <property name="executables">\r
- <list> \r
- <bean parent="task.echo" scope="execution">\r
- <property name="message" value="fileName=@{fileName}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flow2" parent="slcTemplate.simpleFlow">\r
- <property name="path" value="/fileDiff/testcases" />\r
- <constructor-arg ref="fileDiff.spec" />\r
- <constructor-arg>\r
- <map>\r
- <entry key="fileName" value="file2" />\r
- </map>\r
- </constructor-arg> \r
- <property name="executables">\r
- <list> \r
- <bean parent="task.echo" scope="execution">\r
- <property name="message" value="fileName=@{fileName}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
- -->\r
-<!-- \r
- <bean id="main" parent="slcTemplate.simpleFlow">\r
- <property name="executables">\r
- <list> \r
- <ref bean="flow1"/> \r
- <ref bean="flow2"/> \r
- </list>\r
- </property>\r
- </bean>\r
- -->\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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
- <import resource="imports.xml" />\r
-\r
- <!-- DEFINITIONS -->\r
- <bean id="parameterRef.spec" parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="exceptionIfInitCalledTwice">\r
- <bean parent="specAttr.ref"\r
- p:targetClass="org.argeo.slc.core.execution.ExceptionIfInitCalledTwice"\r
- p:isParameter="true" p:isFrozen="true" />\r
- </entry>\r
- <entry key="testData1">\r
- <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
- p:isParameter="true" p:isFrozen="true" />\r
- </entry>\r
- <entry key="testData2">\r
- <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
- p:isParameter="true" p:isFrozen="true" />\r
- </entry>\r
- <entry key="testedComponentId">\r
- <bean parent="specAttr.primitive" p:value="100" p:isParameter="true"\r
- p:type="integer" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="parameterRef.flowTemplate" parent="slcTemplate.simpleFlow"\r
- abstract="true">\r
- <constructor-arg ref="parameterRef.spec" />\r
- <property name="executables">\r
- <list>\r
- <!-- Primitive -->\r
- <bean parent="task.echo" scope="execution">\r
- <property name="message" value="testedComponentId=@{testedComponentId}" />\r
- </bean>\r
-\r
- <!-- Exception if init called twice -->\r
- <bean parent="parameterRef">\r
- <constructor-arg value="exceptionIfInitCalledTwice" />\r
- </bean>\r
- <bean parent="parameterRef">\r
- <property name="name" value="exceptionIfInitCalledTwice" />\r
- </bean>\r
-\r
- <!-- Basic tests -->\r
- <bean parent="parameterRef.testRun">\r
- <property name="testData">\r
- <bean parent="parameterRef">\r
- <constructor-arg value="testData1" />\r
- </bean>\r
- </property>\r
- </bean>\r
- <bean parent="parameterRef.testRun">\r
- <property name="testData" ref="ref1" />\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <!-- TEST CASES -->\r
- <bean id="parameterRef.001" parent="parameterRef.flowTemplate">\r
- <constructor-arg>\r
- <map>\r
- <entry key="exceptionIfInitCalledTwice">\r
- <bean class="org.argeo.slc.core.execution.ExceptionIfInitCalledTwice" />\r
- </entry>\r
- <entry key="testData1">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="toto" />\r
- <property name="reached" value="toto" />\r
- </bean>\r
- </entry>\r
- <entry key="testData2">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="tata" />\r
- <property name="reached" value="toto" />\r
- </bean>\r
- </entry>\r
- </map>\r
- </constructor-arg>\r
- </bean>\r
-\r
- <!-- UTILITIES -->\r
-\r
- <bean id="ref1" parent="parameterRef">\r
- <constructor-arg value="testData2" />\r
- </bean>\r
-\r
- <bean id="parameterRef.testResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
- <bean id="parameterRef.testRun" class="org.argeo.slc.core.test.SimpleTestRun"\r
- abstract="true">\r
- <property name="testResult" ref="parameterRef.testResult" />\r
- <property name="testDefinition">\r
- <bean class="org.argeo.slc.core.test.BasicTestDefinition" />\r
- </property>\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="imports.xml" /> \r
-\r
- <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
- <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
-\r
- <bean id="echo1" parent="task.echo">\r
- <property name="message" value="From minimal" />\r
- </bean>\r
-\r
- <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="myTestDef" />\r
- <property name="testResult" ref="myTestResult"/>\r
- </bean> \r
-\r
- <!-- \r
- The Flow A contains the flow B as executable.\r
- \r
- Parameters\r
- p1: flow A: default - flow B: - \r
- p2: flow A: set - flow B: - \r
- p3: flow A: default - flow B: default \r
- p4: flow A: set - flow B: default\r
- p5: flow A: default - flow B: set \r
- p6: flow A: set - flow B: set\r
- p7: flow A: - - flow B: default\r
- p8: flow A: - - flow B: set\r
- \r
- \r
- -->\r
-\r
- <bean id="flowA" parent="slcTemplate.simpleFlow">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="p1"><bean parent="specAttr.primitive" p:value="da1" /></entry>\r
- <entry key="p2"><bean parent="specAttr.primitive" p:value="da2" /></entry> \r
- <entry key="p3"><bean parent="specAttr.primitive" p:value="da3" /></entry> \r
- <entry key="p4"><bean parent="specAttr.primitive" p:value="da4" /></entry> \r
- <entry key="p5"><bean parent="specAttr.primitive" p:value="da5" /></entry> \r
- <entry key="p6"><bean parent="specAttr.primitive" p:value="da6" /></entry> \r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- <constructor-arg> \r
- <map>\r
- <entry key="p2" value="va2"/>\r
- <entry key="p4" value="va4"/>\r
- <entry key="p6" value="va6"/>\r
- </map>\r
- </constructor-arg>\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo"><property name="message" value="p1=@{p1}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da1" />\r
- <property name="reached" value="@{p1}" />\r
- </bean>\r
- </property> \r
- </bean>\r
- <bean parent="task.echo"><property name="message" value="p2=@{p2}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va2" />\r
- <property name="reached" value="@{p2}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p3=@{p3}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da3" />\r
- <property name="reached" value="@{p3}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p4=@{p4}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va4" />\r
- <property name="reached" value="@{p4}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p5=@{p5}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da5" />\r
- <property name="reached" value="@{p5}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p6=@{p6}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va6" />\r
- <property name="reached" value="@{p6}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <ref bean="flowB"/> \r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flowB" parent="slcTemplate.simpleFlow" scope="prototype">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="p3"><bean parent="specAttr.primitive" p:value="db3" /></entry> \r
- <entry key="p4"><bean parent="specAttr.primitive" p:value="db4" /></entry>\r
- <entry key="p5"><bean parent="specAttr.primitive" p:value="db5" /></entry> \r
- <entry key="p6"><bean parent="specAttr.primitive" p:value="db6" /></entry>\r
- <entry key="p7"><bean parent="specAttr.primitive" p:value="db7" /></entry> \r
- <entry key="p8"><bean parent="specAttr.primitive" p:value="db8" /></entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- <constructor-arg> \r
- <map>\r
- <entry key="p3" value="vb3"/>\r
- <entry key="p4" value="vb4"/>\r
- <entry key="p7" value="vb7"/>\r
- </map>\r
- </constructor-arg> \r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo"><property name="message" value="p1=@{p1}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da1" />\r
- <property name="reached" value="@{p1}" />\r
- </bean>\r
- </property> \r
- </bean>\r
- <bean parent="task.echo"><property name="message" value="p2=@{p2}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va2" />\r
- <property name="reached" value="@{p2}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p3=@{p3}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da3" />\r
- <property name="reached" value="@{p3}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p4=@{p4}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va4" />\r
- <property name="reached" value="@{p4}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p5=@{p5}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da5" />\r
- <property name="reached" value="@{p5}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p6=@{p6}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va6" />\r
- <property name="reached" value="@{p6}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p7=@{p7}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="vb7" />\r
- <property name="reached" value="@{p7}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p8=@{p8}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="db8" />\r
- <property name="reached" value="@{p8}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- \r
- <!-- test in scope execution -->\r
- <bean parent="task.echo" scope="execution"><property name="message" value="p1=@{p1}" /><aop:scoped-proxy /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <property name="expected" value="e1" />\r
- <property name="reached" value="@{p1}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property> \r
- </bean>\r
- <bean parent="task.echo" scope="execution"><property name="message" value="p2=@{p2}" /><aop:scoped-proxy /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <property name="expected" value="e2" />\r
- <property name="reached" value="@{p2}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo" scope="execution"><property name="message" value="p3=@{p3}" /><aop:scoped-proxy /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <property name="expected" value="e3" />\r
- <property name="reached" value="@{p3}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo" scope="execution"><property name="message" value="p4=@{p4}" /><aop:scoped-proxy /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <property name="expected" value="e4" />\r
- <property name="reached" value="@{p4}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo" scope="execution"><property name="message" value="p5=@{p5}" /><aop:scoped-proxy /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <property name="expected" value="e5" />\r
- <property name="reached" value="@{p5}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo" scope="execution"><property name="message" value="p6=@{p6}" /><aop:scoped-proxy /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <property name="expected" value="e6" />\r
- <property name="reached" value="@{p6}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property> \r
- </bean>\r
- \r
- <!-- \r
- p7 and p8 are not in the spec of FlowA and therefore can not be overridden\r
- at the execution\r
- -->\r
- <bean parent="task.echo" scope="execution"><property name="message" value="p7=@{p7}" /><aop:scoped-proxy /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <property name="expected" value="vb7" />\r
- <property name="reached" value="@{p7}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo" scope="execution"><property name="message" value="p8=@{p8}" /><aop:scoped-proxy /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <property name="expected" value="db8" />\r
- <property name="reached" value="@{p8}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property> \r
- </bean> \r
- \r
- </list>\r
- </property>\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="imports.xml" /> \r
-\r
- <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
- <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
-\r
- <bean id="echo1" parent="task.echo">\r
- <property name="message" value="From minimal" />\r
- </bean>\r
-\r
- <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="myTestDef" />\r
- <property name="testResult" ref="myTestResult"/>\r
- </bean> \r
-\r
- <!-- \r
- The Flow A contains the flow B as executable.\r
- \r
- Parameters\r
- p1: flow A: default - flow B: - \r
- p2: flow A: set - flow B: - \r
- p3: flow A: default - flow B: default \r
- p4: flow A: set - flow B: default\r
- p5: flow A: default - flow B: set \r
- p6: flow A: set - flow B: set\r
- p7: flow A: - - flow B: default\r
- p8: flow A: - - flow B: set\r
- \r
- \r
- -->\r
-\r
- <bean id="flowA" parent="slcTemplate.simpleFlow">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="p1"><bean parent="specAttr.primitive" p:value="da1" /></entry>\r
- <entry key="p2"><bean parent="specAttr.primitive" p:value="da2" /></entry> \r
- <entry key="p3"><bean parent="specAttr.primitive" p:value="da3" /></entry> \r
- <entry key="p4"><bean parent="specAttr.primitive" p:value="da4" /></entry> \r
- <entry key="p5"><bean parent="specAttr.primitive" p:value="da5" /></entry> \r
- <entry key="p6"><bean parent="specAttr.primitive" p:value="da6" /></entry> \r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- <constructor-arg> \r
- <map>\r
- <entry key="p2" value="va2"/>\r
- <entry key="p4" value="va4"/>\r
- <entry key="p6" value="va6"/>\r
- </map>\r
- </constructor-arg>\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo"><property name="message" value="p1=@{p1}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da1" />\r
- <property name="reached" value="@{p1}" />\r
- </bean>\r
- </property> \r
- </bean>\r
- <bean parent="task.echo"><property name="message" value="p2=@{p2}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va2" />\r
- <property name="reached" value="@{p2}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p3=@{p3}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da3" />\r
- <property name="reached" value="@{p3}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p4=@{p4}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va4" />\r
- <property name="reached" value="@{p4}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p5=@{p5}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da5" />\r
- <property name="reached" value="@{p5}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p6=@{p6}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va6" />\r
- <property name="reached" value="@{p6}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <ref bean="flowB"/> \r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flowB" parent="slcTemplate.simpleFlow" scope="prototype">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="p3"><bean parent="specAttr.primitive" p:value="db3" /></entry> \r
- <entry key="p4"><bean parent="specAttr.primitive" p:value="db4" /></entry>\r
- <entry key="p5"><bean parent="specAttr.primitive" p:value="db5" /></entry> \r
- <entry key="p6"><bean parent="specAttr.primitive" p:value="db6" /></entry>\r
- <entry key="p7"><bean parent="specAttr.primitive" p:value="db7" /></entry> \r
- <entry key="p8"><bean parent="specAttr.primitive" p:value="db8" /></entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- <constructor-arg> \r
- <map>\r
- <entry key="p3" value="vb3"/>\r
- <entry key="p4" value="vb4"/>\r
- <entry key="p7" value="vb7"/>\r
- </map>\r
- </constructor-arg> \r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo"><property name="message" value="p1=@{p1}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da1" />\r
- <property name="reached" value="@{p1}" />\r
- </bean>\r
- </property> \r
- </bean>\r
- <bean parent="task.echo"><property name="message" value="p2=@{p2}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va2" />\r
- <property name="reached" value="@{p2}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p3=@{p3}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da3" />\r
- <property name="reached" value="@{p3}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p4=@{p4}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va4" />\r
- <property name="reached" value="@{p4}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p5=@{p5}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="da5" />\r
- <property name="reached" value="@{p5}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p6=@{p6}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="va6" />\r
- <property name="reached" value="@{p6}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p7=@{p7}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="vb7" />\r
- <property name="reached" value="@{p7}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- <bean parent="task.echo"><property name="message" value="p8=@{p8}" /></bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="db8" />\r
- <property name="reached" value="@{p8}" />\r
- </bean>\r
- </property> \r
- </bean> \r
- </list>\r
- </property>\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="imports.xml" /> \r
- \r
- <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
- <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
-\r
- <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="myTestDef" />\r
- <property name="testResult" ref="myTestResult"/>\r
- </bean> \r
- \r
- <bean id="spec1" parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testedComponentId">\r
- <bean parent="specAttr.primitive" p:isParameter="true"\r
- p:type="integer" />\r
- </entry>\r
- <entry key="testData1">\r
- <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
- p:isParameter="true" p:isFrozen="true" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flowTemplate1" parent="slcTemplate.simpleFlow"\r
- abstract="true">\r
- <constructor-arg ref="spec1" />\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo" scope="execution">\r
- <property name="message" value="From basic @{testedComponentId}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean parent="parameterRef">\r
- <constructor-arg value="testData1" />\r
- </bean>\r
- </property>\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flow1" parent="flowTemplate1" scope="prototype">\r
- <constructor-arg>\r
- <map>\r
- <entry key="testedComponentId" value="200" />\r
- <entry key="testData1">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <aop:scoped-proxy/>\r
- <property name="expected" value="tata101" />\r
- <property name="reached" value="tata@{testedComponentId}" />\r
- </bean>\r
- </entry>\r
- </map> \r
- </constructor-arg>\r
- </bean>\r
-\r
- <bean id="spec2" parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testData1">\r
- <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
- p:isParameter="true" p:isFrozen="true" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flowTemplate2" parent="slcTemplate.simpleFlow" abstract="true">\r
- <constructor-arg ref="spec2" />\r
- <property name="executables">\r
- <list>\r
- <ref bean="flow1"/>\r
- </list>\r
- </property>\r
- </bean>\r
- \r
- <bean id="flow2" parent="flowTemplate2">\r
- <constructor-arg>\r
- <map>\r
- <entry key="testData1">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="tata100" />\r
- <property name="reached" value="tata100" />\r
- </bean>\r
- </entry>\r
- </map> \r
- </constructor-arg>\r
- </bean> \r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="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
-\r
- <import resource="../imports.xml" />\r
-\r
- <bean id="systemCallSimple" parent="slcTemplate.simpleFlow">\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo">\r
- <property name="message" value="os.name=${os.name}" />\r
- </bean>\r
- <bean parent="task.systemCall">\r
- <property name="cmd" value="echo Hello World" />\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="systemCallList" parent="slcTemplate.simpleFlow">\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.systemCall">\r
- <property name="command">\r
- <list>\r
- <value>echo</value>\r
- <value>Hello</value>\r
- <value>World</value>\r
- </list>\r
- </property>\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="systemCallOsSpecific" parent="slcTemplate.simpleFlow">\r
- <!-- Direct call to dir under Windows isnot working -->\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.systemCall">\r
- <property name="cmd" value="dir" />\r
- <property name="execDir" value="../.." />\r
- <property name="osCmds">\r
- <map>\r
- <entry key="Linux" value="ls" />\r
- <entry key="Mac OS X" value="ls" />\r
- </map>\r
- </property>\r
- </bean>\r
- <bean parent="task.systemCall">\r
- <property name="command">\r
- <list>\r
- <value>dir</value>\r
- </list>\r
- </property>\r
- <property name="osCommands">\r
- <map>\r
- <entry key="Linux">\r
- <list>\r
- <value>ls</value>\r
- </list>\r
- </entry>\r
- <entry key="Mac OS X">\r
- <list>\r
- <value>ls</value>\r
- </list>\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="systemCallWithVar" parent="slcTemplate.simpleFlow">\r
- <constructor-arg>\r
- <bean parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="var">\r
- <bean parent="specAttr.primitive" p:value="660" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </constructor-arg>\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.systemCall" scope="execution">\r
- <property name="cmd" value="echo var=@{var}" />\r
- <aop:scoped-proxy />\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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
- <import resource="imports.xml" /> \r
-\r
- <bean id="myTestResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
- <bean id="myTestDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
-\r
- <bean id="myTestRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="myTestDef" />\r
- <property name="testResult" ref="myTestResult"/>\r
- </bean> \r
- \r
- <bean id="spec1" parent="slcTemplate.simpleSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testedComponentId">\r
- <bean parent="specAttr.primitive" p:isParameter="true"\r
- p:type="integer" />\r
- </entry>\r
- <entry key="testData1">\r
- <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
- p:isParameter="true" p:isFrozen="true" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flowTemplate1" parent="slcTemplate.simpleFlow"\r
- abstract="true">\r
- <constructor-arg ref="spec1" />\r
- <property name="executables">\r
- <list>\r
- <bean parent="task.echo">\r
- <property name="message" value="From basic @{testedComponentId}" />\r
- </bean>\r
- <bean parent="myTestRunTemplate">\r
- <property name="testData">\r
- <bean parent="parameterRef">\r
- <constructor-arg value="testData1" />\r
- </bean>\r
- </property>\r
- </bean>\r
- <bean parent="task.echo">\r
- <property name="message"><value>From basic @{testedComponentId}</value></property>\r
- </bean> \r
- <bean parent="task.echo">\r
- <property name="message"><value>testData1='@{testData1}'</value></property>\r
- </bean> \r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="flow1" parent="flowTemplate1" scope="prototype">\r
- <constructor-arg>\r
- <map>\r
- <entry key="testedComponentId" value="200" />\r
- <entry key="testData1">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <aop:scoped-proxy/>\r
- <property name="expected" value="tata101" />\r
- <property name="reached" value="tata@{testedComponentId}" />\r
- </bean>\r
- </entry>\r
- </map> \r
- </constructor-arg>\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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: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.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
-\r
- <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />\r
- <import resource="classpath:/org/argeo/slc/core/test/spring.xml" />\r
-\r
- <bean id="testResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
- <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
-\r
- <bean id="testRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="testDef" />\r
- <property name="testResult" ref="testResult"/>\r
- </bean> \r
-\r
- <flow:spec id="advanced.spec">\r
- <description>spec description</description>\r
- <flow:primitive name="param1" isParameter="true"\r
- type="integer" />\r
- <flow:primitive name="param2" isParameter="true"\r
- type="integer" /> \r
- </flow:spec>\r
-\r
-\r
- <flow:flow id="advanced.flowTemplate" abstract="true" spec="advanced.spec"\r
- path="/path">\r
- <description>flow description</description>\r
- <bean parent="task.echo">\r
- <property name="message" value="Advanced: param1=@{param1}, param2=@{param2}" />\r
- <flow:variable/>\r
- </bean> \r
- <flow:flow>\r
- <bean parent="task.echo" p:message="Flow in Flow - param1=@{param1}, param2=@{param2} [Not variable]" />\r
- </flow:flow>\r
- \r
- <bean parent="testRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <flow:variable/>\r
- <property name="expected" value="@{param1}" />\r
- <property name="reached" value="@{param2}" />\r
- </bean>\r
- </property> \r
- </bean>\r
- \r
- </flow:flow>\r
-\r
- <flow:flow id="advanced.flowTemplate2" abstract="true" spec="advanced.spec"\r
- path="/path">\r
- <bean parent="task.echo" p:message="Advanced2: param1=@{param1}, param2=@{param2}">\r
- <flow:variable/>\r
- </bean>\r
- <flow:flow parent="advanced.flowTemplate">\r
- <flow:arg name="param1" value="@{param1}"/>\r
- <flow:arg name="param2">\r
- <!-- flow:param in flow:arg -->\r
- <flow:param name="param2" />\r
- </flow:arg>\r
- </flow:flow>\r
- </flow:flow>\r
-\r
- \r
- <flow:flow id="flow1" parent="advanced.flowTemplate">\r
- <flow:arg name="param1" value="1" />\r
- <flow:arg name="param2" value="1" />\r
- </flow:flow>\r
- \r
- <flow:flow id="flow2">\r
- <flow:flow parent="advanced.flowTemplate">\r
- <flow:arg name="param1" value="2" />\r
- <flow:arg name="param2" value="2" />\r
- </flow:flow>\r
- </flow:flow>\r
-\r
- <flow:flow id="flow3" parent="advanced.flowTemplate2">\r
- <flow:arg name="param1" value="3" />\r
- <flow:arg name="param2" value="3" />\r
- </flow:flow>\r
- \r
- <flow:flow id="flow4" parent="advanced.flowTemplate">\r
- <description>Would fail if param 2 is not changed at execution</description>\r
- <flow:arg name="param1" value="4" />\r
- <flow:arg name="param2" value="3" />\r
- </flow:flow> \r
-\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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: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.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.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
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans:beans xmlns="http://www.argeo.org/schema/slc-flow"\r
- xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:p="http://www.springframework.org/schema/p"\r
- xsi:schemaLocation="\r
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
- http://www.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
-\r
- <flow id="canonic-ns.002" parent="canonic-ns.flowTemplate">\r
- <arg name="parameterAtInstantiation" value="2" />\r
- <arg name="displayWithoutControl" value="102" />\r
- <arg name="displayWithControl" value="202" />\r
- <arg name="hide" value="202" />\r
- <arg name="refWithoutValue">\r
- <beans:bean id="testDataOk" p:expected="tata" p:reached="tata"\r
- class="org.argeo.slc.core.test.BasicTestData" />\r
- </arg>\r
- </flow>\r
-</beans:beans>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans:beans xmlns="http://www.argeo.org/schema/slc-flow"\r
- xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:p="http://www.springframework.org/schema/p" 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/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
- <beans:import resource="classpath:org/argeo/slc/core/execution/spring.xml" />\r
- <beans:import resource="classpath:/org/argeo/slc/core/test/spring.xml" />\r
-\r
- <beans:import resource="canonic-ns-001.xml" />\r
- <beans:import resource="canonic-ns-002.xml" />\r
- <beans:import resource="tests.xml" />\r
-\r
- <!--\r
- Specifications definition is greatly simplified by the flow namespace\r
- -->\r
- <spec id="canonic-ns.spec">\r
- <primitive name="parameterAtInstantiation" isParameter="true"\r
- type="integer" />\r
- <primitive name="displayWithoutControl" value="100"\r
- isParameter="true" type="integer" isFrozen="true" />\r
- <primitive name="displayWithControl" value="200"\r
- isParameter="true" type="integer" />\r
- <primitive name="hide" value="300" isParameter="true" type="integer"\r
- isHidden="true" />\r
- <ref name="refWithValue" targetClass="org.argeo.slc.core.test.BasicTestData"\r
- isParameter="true" ref="testDataNok" />\r
- <ref name="refWithoutValue" targetClass="org.argeo.slc.core.test.BasicTestData" />\r
- <ref name="refWithoutValueFrozen" targetClass="org.argeo.slc.core.test.BasicTestData"\r
- isParameter="true" isFrozen="true">\r
- <value>\r
- <beans:bean class="org.argeo.slc.core.test.BasicTestData">\r
- <aop:scoped-proxy />\r
- <beans:property name="expected" value="tata" />\r
- <beans:property name="reached" value="tata" />\r
- </beans:bean>\r
- </value>\r
- </ref>\r
- </spec>\r
-\r
- <flow id="canonic-ns.flowTemplate" abstract="true" spec="canonic-ns.spec"\r
- path="/path">\r
- <beans:bean parent="task.echo"\r
- p:message="Canonical: displayWithControl=@{displayWithControl}, displayWithoutControl=@{displayWithoutControl}, hide=@{hide}"\r
- scope="execution">\r
- <aop:scoped-proxy />\r
- </beans:bean>\r
- <beans:ref bean="testRun" />\r
- </flow>\r
-\r
- <beans:bean id="testDataOk" class="org.argeo.slc.core.test.BasicTestData">\r
- <aop:scoped-proxy />\r
- <beans:property name="expected" value="tata" />\r
- <beans:property name="reached" value="tata" />\r
- </beans:bean>\r
-\r
- <beans:bean id="testDataNok" class="org.argeo.slc.core.test.BasicTestData">\r
- <aop:scoped-proxy />\r
- <beans:property name="expected" value="tata" />\r
- <beans:property name="reached" value="toto" />\r
- </beans:bean>\r
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\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:flow="http://www.argeo.org/schema/slc-flow" 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
- http://www.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
-\r
- <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />\r
- <import resource="classpath:/org/argeo/slc/core/test/spring.xml" />\r
-\r
- <bean id="testResult" class="org.argeo.slc.core.test.SimpleTestResult" />\r
-\r
- <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition" />\r
-\r
- <bean id="testRunTemplate" class="org.argeo.slc.core.test.SimpleTestRun" abstract="true">\r
- <property name="testDefinition" ref="testDef" />\r
- <property name="testResult" ref="testResult"/>\r
- </bean> \r
-\r
- <flow:spec id="test.list.spec">\r
- <flow:ref name="list1" targetClass="java.util.List">\r
- <flow:value>\r
- <!-- a list element can be used directly as default value-->\r
- <list>\r
- <value>val1</value>\r
- </list>\r
- </flow:value>\r
- </flow:ref>\r
- <flow:ref name="list2" targetClass="java.util.List" />\r
- <!-- following parameters are not used in flow -->\r
- <flow:ref name="dummyMap" targetClass="java.util.Map">\r
- <flow:value>\r
- <map></map>\r
- </flow:value>\r
- </flow:ref>\r
- <flow:ref name="dummySet" targetClass="java.util.Set">\r
- <flow:value>\r
- <set></set>\r
- </flow:value>\r
- </flow:ref>\r
- <flow:ref name="dummyProperties" targetClass="java.util.Properties">\r
- <flow:value>\r
- <props></props>\r
- </flow:value>\r
- </flow:ref>\r
- \r
- </flow:spec>\r
-\r
-\r
- <flow:flow id="test.list.flowTemplate" abstract="true" spec="test.list.spec"\r
- path="/path">\r
- <bean parent="task.echo">\r
- <property name="message" value="list1=@{list1}, list2=@{list2}" />\r
- <flow:variable/>\r
- </bean> \r
-\r
- <bean parent="testRunTemplate">\r
- <property name="testData">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected">\r
- <flow:param name="list1"/>\r
- </property>\r
- <property name="reached">\r
- <flow:param name="list2"/>\r
- </property>\r
- </bean>\r
- </property> \r
- </bean>\r
- \r
- </flow:flow>\r
-\r
- <flow:flow id="test.list.flow1" parent="test.list.flowTemplate">\r
- <flow:arg name="list1">\r
- <list>\r
- <value>val1</value>\r
- <value>val2</value> \r
- </list>\r
- </flow:arg>\r
- <flow:arg name="list2">\r
- <list>\r
- <value>val1</value>\r
- <value>val2</value> \r
- </list>\r
- </flow:arg>\r
- \r
- <!-- not used in flow (just to test that the syntax is accepted): -->\r
- <flow:arg name="dummyMap">\r
- <map></map>\r
- </flow:arg>\r
- <flow:arg name="dummySet">\r
- <set></set>\r
- </flow:arg>\r
- <flow:arg name="dummyProperties">\r
- <props></props>\r
- </flow:arg> \r
- \r
- </flow:flow>\r
- \r
- <flow:flow id="test.list.flow2" parent="test.list.flowTemplate">\r
- <description>use default value for parameter "list1"</description>\r
- <flow:arg name="list2">\r
- <list>\r
- <value>val1</value>\r
- </list>\r
- </flow:arg>\r
- </flow:flow>\r
-\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flow="http://www.argeo.org/schema/slc-flow"\r
- xmlns:p="http://www.springframework.org/schema/p" 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/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
- <bean id="testRun" class="org.argeo.slc.core.test.SimpleTestRun">\r
- <property name="testDefinition">\r
- <bean class="org.argeo.slc.core.test.BasicTestDefinition" />\r
- </property>\r
- <property name="testData">\r
- <flow:param name="refWithValue" />\r
- </property>\r
- <!-- <property name="testData">-->\r
- <!-- <bean parent="parameterRef">-->\r
- <!-- <constructor-arg value="refWithValue" />-->\r
- <!-- </bean>-->\r
- <!-- </property>-->\r
- <property name="testResult">\r
- <bean parent="slcDefault.test.basicSimpleTestResult" scope="execution">\r
- <property name="attributes">\r
- <map>\r
- <entry key="displayWithControl" value="@{displayWithControl}" />\r
- </map>\r
- </property>\r
- <aop:scoped-proxy />\r
- </bean>\r
- </property>\r
- </bean>\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
- <bean id="parentContext.pc1" parent="parentContext.template">\r
- <property name="values">\r
- <map>\r
- <entry key="rootvar" value="text" />\r
- </map>\r
- </property>\r
- <property name="expectedValues">\r
- <map>\r
- <entry key="reference" value="20" />\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="context.c1" parent="context.template">\r
- <property name="parentContext" ref="parentContext.pc1" />\r
- <property name="values">\r
- <map>\r
- <entry key="reference" value="20" />\r
- <entry key="any" value="999" />\r
- <entry key="skipped" value="999" />\r
- </map>\r
- </property>\r
- <property name="expectedValues">\r
- <map>\r
- <entry key="reference" value="21" />\r
- <entry key="any" value="*" />\r
- <entry key="skipped" value="!" />\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="context.c2" parent="context.template">\r
- <property name="parentContext" ref="parentContext.pc1" />\r
- <property name="values">\r
- <map>\r
- <entry key="var" value="37" />\r
- <entry key="bad" value="56" />\r
- </map>\r
- </property>\r
- <property name="expectedValues">\r
- <map>\r
- <entry key="var" value="37" />\r
- <entry key="bad" value="57" />\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="parentContext.pc2" parent="parentContext.template">\r
- <property name="parentContext" ref="parentContext.pc1" />\r
- <property name="expectedValues">\r
- <map>\r
- <entry key="reference" value="40" />\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean id="context.c3" parent="context.template">\r
- <property name="parentContext" ref="parentContext.pc2" />\r
- <property name="values">\r
- <map>\r
- <entry key="reference" value="41" />\r
- <entry key="rootvar" value="textX" />\r
- </map>\r
- </property>\r
- <property name="expectedValues">\r
- <map>\r
- <entry key="reference" value="40" />\r
- <entry key="rootvar" value="text" />\r
- </map>\r
- </property>\r
- </bean>\r
-\r
-\r
- <bean id="parentContext.template"\r
- class="org.argeo.slc.core.test.context.SimpleParentContextAware"\r
- abstract="true">\r
- </bean>\r
-\r
- <bean id="context.template"\r
- class="org.argeo.slc.core.test.context.SimpleContextAware"\r
- abstract="true">\r
- </bean>\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.detached.launcher</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Mon Nov 17 14:48:56 CET 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
+++ /dev/null
-#Wed Sep 24 16:04:14 CEST 2008
-activeProfiles=
-eclipse.preferences.version=1
-filterResources=false
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-useMavenFolders=false
-version=1
+++ /dev/null
-source.. = src/main/java/,\
- src/main/resources/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.detached.launcher</artifactId>
- <name>SLC Detached Launcher</name>
- <packaging>jar</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <mainClass>
- org.argeo.slc.detached.launcher.Main
- </mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Bundle-RequiredExecutionEnvironment>J2SE-1.4</Bundle-RequiredExecutionEnvironment>
- <Export-Package>
- org.argeo.slc.*
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<assembly xmlns="http://maven.apache.org/POM/4.0.0"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">\r
- <id>dist</id>\r
- <includeBaseDirectory>false</includeBaseDirectory>\r
- <formats>\r
- <format>tar.gz</format>\r
- </formats>\r
- <fileSets>\r
- <fileSet>\r
- <directory>src/main/base</directory>\r
- <outputDirectory></outputDirectory>\r
- <fileMode>0755</fileMode>\r
- </fileSet>\r
- </fileSets>\r
-</assembly>
\ No newline at end of file
+++ /dev/null
-@echo off\r
-\r
-rem Target application\r
-set JAVA_HOME=[the target JRE]\r
-set SLC_USER_CLASSPATH=[classpath of the application to test]\r
-set SLC_DETACHED_APPCLASS=[main class of the application to test]\r
-set SLC_DETACHED_APPARGS=[arguments of the application to test]\r
-set SLC_DETACHED_JVM_ARGS=[additional JVM arguments]\r
-\r
-rem Runtime\r
-set PROJECT_BASE=[base of the project to being developed]\r
-set SLC_WORK_DIR=%PROJECT_BASE%/src/main/slc/work\r
-set SLC_USER_BUNDLES=reference:file:%PROJECT_BASE%/target/classes\r
-\r
+++ /dev/null
-@echo off
-echo SLC Detached
-set SLC_HOME=%~dp0..
-echo SLC_HOME=%SLC_HOME%
-set SLC_LIB_DETACHED=%SLC_HOME%\lib\detached
-
-call slc-detached-settings.bat
-
-rem FOR %%f IN (%SLC_HOME%\lib\detached\*.jar) DO set CLASSPATH=%CLASSPATH%;%%f
-FOR %%f IN (%SLC_HOME%\lib\detached\org.argeo.slc.detached.launcher-*.jar) DO set SLC_DETACHED_LAUNCHER_JAR=%%f
-FOR %%f IN (%SLC_HOME%\lib\org.argeo.slc.detached-*.jar) DO set SLC_DETACHED_JAR=%%f
-
-set CLASSPATH=%SLC_DETACHED_LAUNCHER_JAR%;%SLC_USER_CLASSPATH%;%SLC_LIB_DETACHED%\com.springsource.org.aopalliance-1.0.0.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.commons.io-1.4.0.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.commons.logging-1.1.1.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.log4j-1.2.15.jar;%SLC_LIB_DETACHED%\org.apache.felix.main-1.2.1.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.xerces-2.8.1.jar;%SLC_LIB_DETACHED%\com.springsource.org.apache.xalan-2.7.0.jar
-
-set CMD=%JAVA_HOME%\bin\java %SLC_DETACHED_JVM_ARGS% -Dslc.detached.jar=%SLC_DETACHED_JAR% -Dslc.home=%SLC_HOME% -Dslc.workDir=%SLC_WORK_DIR% "-Dslc.detached.userBundles=%SLC_USER_BUNDLES%" -Dslc.detached.appclass=%SLC_DETACHED_APPCLASS% "-Dslc.detached.appargs=%SLC_DETACHED_APPARGS%" -classpath %CLASSPATH% org.argeo.slc.detached.launcher.Main
-rem echo CMD=%CMD%
-
-start %CMD%
-
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.launcher;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.TreeMap;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.adaptor.EclipseStarter;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-
-public class Main {
- public final static String PROP_SLC_HOME = "slc.home";
- public final static String PROP_SLC_DETACHED_PROEPRTIES = "slc.detached.properties";
- public final static String PROP_SLC_OSGI_START = "slc.osgi.start";
- public final static String PROP_SLC_OSGI_SCAN_CLASSPATH = "slc.osgi.scanClasspath";
- public final static String PROP_SLC_OSGI_EQUINOX_ARGS = "slc.osgi.equinox.args";
-
- private final static String DEV_BUNDLE_PREFIX = "slc.osgi.devbundle.";
-
- public static void main(String[] args) {
- info("Argeo SLC Detached launcher starting...");
- try {
- // Load properties
- String propertyPath = System.getProperty("slc.detached.properties",
- "slc-detached.properties");
- Properties config = prepareConfig(propertyPath);
-
- // Start app (in main class loader)
- startApp(config);
-
- // Start OSGi framework
- startEquinox(config);
- info("Argeo SLC Detached launcher started.");
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- protected static Properties prepareConfig(String propertyFilePath)
- throws Exception {
- // Load config
- Properties config = new Properties();
- InputStream in = null;
- try {
- File file = new File(propertyFilePath);
- if (file.exists()) {
- in = new FileInputStream(propertyFilePath);
- config.load(in);
- }
- } finally {
- if (in != null)
- in.close();
- }
-
- // Format slc.home
- String slcHome = System.getProperty(Main.PROP_SLC_HOME);
- if (slcHome == null) {
- slcHome = config.getProperty(Main.PROP_SLC_HOME);
- }
- if (slcHome != null) {
- slcHome = new File(slcHome).getCanonicalPath();
- System.setProperty(Main.PROP_SLC_HOME, slcHome);
- }
-
- // System properties have priority.
- config.putAll(System.getProperties());
-
- // SET ALL PROPERTIES AS SYSTEM PROPERTIES
- TreeMap ordered = new TreeMap(config);
- for (Iterator it = ordered.keySet().iterator(); it.hasNext();) {
- String key = it.next().toString();
- String value = ordered.get(key).toString();
- System.out.println(key + "=" + value);
- System.setProperty(key, value);
- }
-
- return config;
- }
-
- public static void startEquinox(Properties config) throws Exception {
- info("java.home=" + System.getProperty("java.home"));
- info("java.class.path=" + System.getProperty("java.class.path"));
-
- File baseDir = new File(System.getProperty("user.dir"))
- .getCanonicalFile();
- String equinoxConfigurationPath = baseDir.getPath() + File.separator
- + "slc-detached" + File.separator + "equinoxConfiguration";
-
- String equinoxArgsLineDefault = "-console -noExit -clean -debug -configuration "
- + equinoxConfigurationPath;
- String equinoxArgsLine = config.getProperty(PROP_SLC_OSGI_EQUINOX_ARGS,
- equinoxArgsLineDefault);
- // String[] equinoxArgs = { "-console", "-noExit", "-clean", "-debug",
- // "-configuration", equinoxConfigurationPath };
- String[] equinoxArgs = equinoxArgsLine.split(" ");
-
- BundleContext context = EclipseStarter.startup(equinoxArgs, null);
-
- List installBundleNames = new ArrayList();
-
- // Load from class path (dev environment, maven)
- if (config.getProperty(PROP_SLC_OSGI_SCAN_CLASSPATH, "false").equals(
- "true")) {
- StringTokenizer st = new StringTokenizer(System
- .getProperty("java.class.path"), File.pathSeparator);
- while (st.hasMoreTokens()) {
- try {
- String path = st.nextToken();
- String url = "reference:file:"
- + new File(path).getCanonicalPath();
- Bundle bundle = context.installBundle(url);
- if (bundle.getSymbolicName() != null)
- installBundleNames.add(bundle.getSymbolicName());
- info("Installed from classpath " + url);
- } catch (Exception e) {
- bundleInstallWarn(e.getMessage());
- }
- }
- }
-
- // Load from dev bundles
- Map devBundleUrls = getDevBundleUrls(config);
- Iterator devBundles = devBundleUrls.keySet().iterator();
- while (devBundles.hasNext()) {
- try {
- String bundleName = (String) devBundles.next();
- String url = (String) devBundleUrls.get(bundleName);
- Bundle bundle = context.installBundle(url);
- installBundleNames.add(bundle.getSymbolicName());
- info("Installed as dev bundle " + url);
- } catch (Exception e) {
- bundleInstallWarn(e.getMessage());
- }
- }
-
- // Load from distribution
- String slcHome = config.getProperty(PROP_SLC_HOME);
- if (slcHome != null) {
- File libDir = new File(slcHome + File.separator + "lib");
- File[] bundleFiles = libDir.listFiles();
- for (int i = 0; i < bundleFiles.length; i++) {
- try {
- String url = "reference:file:"
- + bundleFiles[i].getCanonicalPath();
- Bundle bundle = context.installBundle(url);
- installBundleNames.add(bundle.getSymbolicName());
- info("INFO: Installed from SLC home " + url);
- } catch (Exception e) {
- bundleInstallWarn(e.getMessage());
- }
-
- }
- }
-
- // Start bundles
- String bundleStart = config.getProperty(PROP_SLC_OSGI_START,
- "org.springframework.osgi.extender,org.argeo.slc.detached");
-
- if (bundleStart.trim().equals("*")) {
- for (int i = 0; i < installBundleNames.size(); i++) {
- Object obj = installBundleNames.get(i);
- if (obj != null) {
- String bundleSymbolicName = obj.toString();
- try {
- startBundle(context, bundleSymbolicName);
- } catch (Exception e) {
- bundleInstallWarn("Cannot start " + bundleSymbolicName
- + ": " + e.getMessage());
- }
- }
- }
- } else {
- StringTokenizer stBundleStart = new StringTokenizer(bundleStart,
- ",");
- while (stBundleStart.hasMoreTokens()) {
- String bundleSymbolicName = stBundleStart.nextToken();
- startBundle(context, bundleSymbolicName);
- }
- }
- }
-
- private static Map getDevBundleUrls(Properties config) {
- Map bundles = new Hashtable();
- Iterator keys = config.keySet().iterator();
- while (keys.hasNext()) {
- String key = (String) keys.next();
- if (key.startsWith(DEV_BUNDLE_PREFIX)) {
- String bundle = key.substring(DEV_BUNDLE_PREFIX.length());
- String path = config.getProperty(key);
- bundles.put(bundle, path);
- }
- }
- return bundles;
- }
-
- private static void startBundle(BundleContext bundleContext,
- String symbolicName) throws BundleException {
- // info("Starting bundle " + symbolicName + "...");
- Bundle bundle = findBundleBySymbolicName(bundleContext, symbolicName);
- if (bundle != null)
- bundle.start();
- else
- throw new RuntimeException("Bundle " + symbolicName + " not found");
- info("Started " + symbolicName);
- }
-
- /** WARNING: return the first one found! */
- private static Bundle findBundleBySymbolicName(BundleContext bundleContext,
- String symbolicName) {
- Bundle[] bundles = bundleContext.getBundles();
- for (int i = 0; i < bundles.length; i++) {
- Bundle bundle = bundles[i];
- String bundleSymbolicName = bundle.getSymbolicName();
- if (bundleSymbolicName != null) {
- // throw new RuntimeException("Bundle " + bundle.getBundleId()
- // + " (" + bundle.getLocation()
- // + ") has no symbolic name.");
-
- if (bundleSymbolicName.equals(symbolicName)) {
- return bundle;
- }
- }
- }
- return null;
- }
-
- public static void startApp(Properties config) throws Exception {
- String className = config.getProperty("slc.detached.appclass");
- String[] uiArgs = readArgumentsFromLine(config.getProperty(
- "slc.detached.appargs", ""));
-
- if (className == null) {
- info("No slc.detached.appclass property define: does not try to launch an app from the standard classpath.");
- } else {
- // Launch main method using reflection
- Class clss = Class.forName(className);
- Class[] mainArgsClasses = new Class[] { uiArgs.getClass() };
- Object[] mainArgs = { uiArgs };
- Method mainMethod = clss.getMethod("main", mainArgsClasses);
- mainMethod.invoke(null, mainArgs);
- }
- }
-
- /* UTILITIES */
-
- /**
- * Transform a line into an array of arguments, taking "" as single
- * arguments. (nested \" are not supported)
- */
- private static String[] readArgumentsFromLine(String lineOrig) {
-
- String line = lineOrig.trim();// remove trailing spaces
- // System.out.println("line=" + line);
- List args = new Vector();
- StringBuffer curr = new StringBuffer("");
- boolean inQuote = false;
- char[] arr = line.toCharArray();
- for (int i = 0; i < arr.length; i++) {
- char c = arr[i];
- switch (c) {
- case '\"':
- inQuote = !inQuote;
- break;
- case ' ':
- if (!inQuote) {// otherwise, no break: goes to default
- if (curr.length() > 0) {
- args.add(curr.toString());
- curr = new StringBuffer("");
- }
- break;
- }
- default:
- curr.append(c);
- break;
- }
- }
-
- // Add last arg
- if (curr.length() > 0) {
- args.add(curr.toString());
- curr = null;
- }
-
- String[] res = new String[args.size()];
- for (int i = 0; i < args.size(); i++) {
- res[i] = args.get(i).toString();
- // System.out.println("res[i]=" + res[i]);
- }
- return res;
- }
-
- private static void info(Object obj) {
- System.out.println("[INFO] " + obj);
- }
-
- private static void bundleInstallWarn(Object obj) {
- System.err.println("[WARN] " + obj);
- // Thread.dumpStack();
- }
-}
+++ /dev/null
-# Set root logger level to DEBUG and its only appender to A1.\r
-log4j.rootLogger=WARN, console\r
-\r
-## Levels\r
-# Slc\r
-log4j.logger.org.argeo.slc=DEBUG\r
-log4j.logger.org.springframework=WARN\r
-\r
-## Appenders\r
-# A1 is set to be a ConsoleAppender.\r
-log4j.appender.console=org.apache.log4j.ConsoleAppender\r
-\r
-# A1 uses PatternLayout.\r
-log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c %n\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.detached</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Sat Nov 22 15:15:12 CET 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
+++ /dev/null
-#Thu Sep 18 18:28:43 CEST 2008
-activeProfiles=
-eclipse.preferences.version=1
-filterResources=false
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-useMavenFolders=false
-version=1
+++ /dev/null
-source.. = src/main/java/,\
- src/main/resources/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.detached</artifactId>
- <name>SLC Detached</name>
- <packaging>jar</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Bundle-RequiredExecutionEnvironment>J2SE-1.4</Bundle-RequiredExecutionEnvironment>
- <Export-Package>
- org.argeo.slc.detached.*
- </Export-Package>
- <Import-Package>
- org.w3c.dom;version="0.0.0",
- javax.xml.*;version="0.0.0",
- org.springframework.core,
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.osgi.extender</artifactId>
- </dependency>
-
- <!-- Required under JDK 1.4 -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>edu.emory.mathcs.backport</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.xmlcommons</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.org.apache.commons.logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.log4j</artifactId>
- </dependency>
-
- <!-- JRE 1.4 -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.xerces</artifactId>
- </dependency>
-
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-public class AppLauncher {
- private Properties systemProperties = new Properties();
- private String mainClass = null;
- private List arguments = new ArrayList();
-
- public void launch() {
-
- Properties base = System.getProperties();
- Properties fake = new Properties(base);
-
- try {
- if (mainClass == null)
- throw new DetachedException(
- "A main class name has to be specified.");
-
- System.getProperties().putAll(systemProperties);
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- Class clss = cl.loadClass(mainClass);
-
- String[] args = new String[arguments.size()];
- for (int i = 0; i < arguments.size(); i++) {
- args[i] = arguments.get(i).toString();
- }
-
- Class[] mainArgsClasses = new Class[] { args.getClass() };
- Object[] mainArgs = { args };
- Method mainMethod = clss.getMethod("main", mainArgsClasses);
-
- System.setProperties(fake);
-
- mainMethod.invoke(null, mainArgs);
-
- } catch (Exception e) {
- throw new DetachedException("Unexpected exception while launching "
- + mainClass, e);
- } finally {
- System.setProperties(base);
- }
-
- }
-
- public void setSystemProperties(Properties systemProperties) {
- this.systemProperties = systemProperties;
- }
-
- public void setMainClass(String mainClass) {
- this.mainClass = mainClass;
- }
-
- public void setArguments(List arguments) {
- this.arguments = arguments;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-public interface DetachedAdminCommand {
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.util.Properties;
-
-/** An answer returned by the detached server. Always related to a request. */
-public class DetachedAnswer implements DetachedCommunication {
- static final long serialVersionUID = 1l;
-
- public final static int UNKOWN = -1;
- public final static int PROCESSED = 0;
- public final static int ERROR = 1;
- public final static int SKIPPED = 2;
- public final static int CLOSED_SESSION = 10;
-
- private Properties properties = new Properties();
- private int status = UNKOWN;
- private String log;
- private String uuid;
-
- public DetachedAnswer() {
-
- }
-
- public DetachedAnswer(DetachedRequest request) {
- uuid = request.getUuid();
- }
-
- public DetachedAnswer(DetachedRequest request, String message) {
- this(request);
- log = message;
- status = PROCESSED;
- }
-
- public Properties getProperties() {
- return properties;
- }
-
- public void setProperties(Properties outputParameters) {
- this.properties = outputParameters;
- }
-
- public int getStatus() {
- return status;
- }
-
- public void setStatus(int outputStatus) {
- this.status = outputStatus;
- }
-
- public String getLog() {
- return log;
- }
-
- public void setLog(String log) {
- this.log = log;
- }
-
- public void addToLog(String msg) {
- this.log = new StringBuffer(this.log).append(msg).toString();
- }
-
- /** The unique identifier of this answer. */
- public String getUuid() {
- return uuid;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public String getStatusAsString() {
- return convertStatus(getStatus());
- }
-
- public static String convertStatus(int status) {
- switch (status) {
- case UNKOWN:
- return "UNKOWN";
- case PROCESSED:
- return "PROCESSED";
- case SKIPPED:
- return "SKIPPED";
- case ERROR:
- return "ERROR";
- case CLOSED_SESSION:
- return "CLOSED_SESSION";
- default:
- throw new DetachedException("Unkown status " + status);
- }
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer("detached answer ");
- buf.append('#').append(uuid);
- buf.append(" status=").append(convertStatus(status));
- buf.append(" properties=").append(properties);
- buf.append(" log=").append(log);
- return buf.toString();
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-/**
- * Sends Request and receives answers. Meant to be used on runtime side to
- * communicate with a Detached.
- */
-public interface DetachedClient {
- public void sendRequest(DetachedRequest request) throws Exception;
-
- /** Blocks until next answer. */
- public DetachedAnswer receiveAnswer() throws Exception;
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.io.Serializable;
-
-/**
- * Common interface for all communications between the source context and the
- * detached server.
- */
-public interface DetachedCommunication extends Serializable {
- /** The unique identifier of this answer. */
- public String getUuid();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.util.List;
-import java.util.Set;
-
-public interface DetachedContext {
- public Object getDynamicRef(String ref);
-
- public void setDynamicRef(String ref, Object obj);
-
- public String getCurrentPath();
-
- public List getExecutedPaths();
-
- public Set getDynamicRefKeys();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.Vector;
-
-public class DetachedContextImpl implements DetachedContext {
- private List executedPaths = new Vector();
- private String currentPath;
- private Map dynamicRefs = new TreeMap();
-
- public String getCurrentPath() {
- return currentPath;
- }
-
- public void setDynamicRef(String ref, Object obj) {
- dynamicRefs.put(ref, obj);
- }
-
- public Object getDynamicRef(String ref) {
- if (dynamicRefs.containsKey(ref))
- return dynamicRefs.get(ref);
- else
- return null;
- }
-
- public List getExecutedPaths() {
- return new ArrayList(executedPaths);
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append(" currentPath=").append(currentPath);
- buf.append(" executedPaths=").append(executedPaths);
- return buf.toString();
- }
-
- public Set getDynamicRefKeys() {
- return dynamicRefs.keySet();
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-/**
- * Receives Request and sends answers. Meant to be used on detached side to
- * communicate with the runtime.
- */
-public interface DetachedDriver {
- /** Blocks until it receives a request. */
- public DetachedRequest receiveRequest() throws Exception;
- public void sendAnswer(DetachedAnswer answer) throws Exception;
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-public class DetachedException extends RuntimeException {
- static final long serialVersionUID = 1l;
-
- public DetachedException(String message) {
- super(message);
- }
-
- public DetachedException(String message, Exception cause) {
- super(message, cause);
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-/**
- * Interface between the detached and the source context via request and
- * answers.
- */
-public interface DetachedExecutionServer {
- /** Actually executes the request. */
- public DetachedAnswer executeRequest(DetachedRequest request);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.detached.admin.CloseSession;
-import org.argeo.slc.detached.admin.OpenSession;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.util.tracker.ServiceTracker;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.osgi.context.BundleContextAware;
-
-/** Default implementation of a detached server. */
-public class DetachedExecutionServerImpl implements DetachedExecutionServer,
- BundleContextAware, InitializingBean, DisposableBean,
- ApplicationContextAware {
- private final static Log log = LogFactory
- .getLog(DetachedExecutionServerImpl.class);
-
- private final DetachedContextImpl detachedContext;
-
- private DetachedSession currentSession;
-
- /**
- * Session being replayed, skipping the steps in the current session. If
- * null, no session is replayed
- */
- private DetachedSession replayedSession = null;
-
- private BundleContext bundleContext;
- private ApplicationContext applicationContext;
-
- private final static String ALL_APP_CONTEXTS_KEY = "__allApplicationContexts";
-
- private Map/* <String,ServiceTracker> */appContextServiceTrackers = Collections
- .synchronizedMap(new HashMap());
-
- public DetachedExecutionServerImpl() {
- detachedContext = new DetachedContextImpl();
- currentSession = new DetachedSession();
- currentSession.setUuid(Long.toString(System.currentTimeMillis()));
- }
-
- public synchronized DetachedAnswer executeRequest(DetachedRequest request) {
- if(log.isDebugEnabled())
- log.debug("Received " + request);
-
- DetachedAnswer answer = null;
- try {
- Object obj = retrieveStep(request);
-
- if (obj == null)
- throw new DetachedException("Could not find action with ref "
- + request.getRef());
-
- // Execute actions
- if (obj instanceof DetachedStep) {
- answer = processStep((DetachedStep) obj, request);
-
- } else if (obj instanceof DetachedAdminCommand) {
- answer = processAdminCommand((DetachedAdminCommand) obj,
- request);
- }
-
- if (answer == null) {
- throw new DetachedException("Unknown action type "
- + obj.getClass() + " for action with ref "
- + request.getRef());
- }
- } catch (Exception e) {
- answer = new DetachedAnswer(request);
- answer.setStatus(DetachedAnswer.ERROR);
- log.error("Error executing request " + request, e);
- }
-
- currentSession.getRequests().add(request);
- currentSession.getAnswers().add(answer);
- if(log.isDebugEnabled())
- log.debug("Sent " + answer);
- return answer;
- }
-
- protected synchronized Object retrieveStep(DetachedRequest request)
- throws Exception {
-
- // Check whether there is a cached object
- if (request.getCachedObject() != null) {
- Object cachedObj = request.getCachedObject();
- if (log.isTraceEnabled())
- log.trace("Use cached object " + cachedObj + " for request "
- + request);
- return cachedObj;
- }
-
- // Check its own app context (typically for admin steps)
- if (applicationContext.containsBean(request.getRef())) {
- try {
- Object obj = applicationContext.getBean(request.getRef());
- if (log.isTraceEnabled())
- log.trace("Retrieve from server app context " + obj
- + " for request " + request);
- return obj;
- } catch (Exception e) {
- if (log.isTraceEnabled())
- log.trace("Could not retrieve " + request.getRef()
- + " from server app context: " + e);
- }
- }
-
- // Check whether the source bundle is set
- String bundleName = request.getProperties().getProperty(
- Constants.BUNDLE_SYMBOLICNAME);
-
- ApplicationContext sourceAppContext = null;
- if (bundleName != null) {
- if (!appContextServiceTrackers.containsKey(bundleName)) {
- ServiceTracker nSt = new ServiceTracker(bundleContext,
- bundleContext.createFilter("(Bundle-SymbolicName="
- + bundleName + ")"), null);
- nSt.open();
- appContextServiceTrackers.put(bundleName, nSt);
- }
- ServiceTracker st = (ServiceTracker) appContextServiceTrackers
- .get(bundleName);
- sourceAppContext = (ApplicationContext) st.getService();
- if (log.isTraceEnabled())
- log.trace("Use source application context from bundle "
- + bundleName);
-
- Object obj = null;
- try {
- obj = sourceAppContext.getBean(request.getRef());
- } catch (Exception e) {
- if (log.isTraceEnabled())
- log.trace("Could not retrieve " + request.getRef()
- + " from app context of " + bundleName + ": " + e);
- }
- return obj;
- }
-
- // no bundle name specified or it failed
- if (!appContextServiceTrackers.containsKey(ALL_APP_CONTEXTS_KEY)) {
- ServiceTracker nSt = new ServiceTracker(bundleContext,
- ApplicationContext.class.getName(), null);
- nSt.open();
- appContextServiceTrackers.put(ALL_APP_CONTEXTS_KEY, nSt);
- }
- ServiceTracker st = (ServiceTracker) appContextServiceTrackers
- .get(ALL_APP_CONTEXTS_KEY);
- Object[] arr = st.getServices();
- for (int i = 0; i < arr.length; i++) {
- ApplicationContext appC = (ApplicationContext) arr[i];
- if (appC.containsBean(request.getRef())) {
- sourceAppContext = appC;
- if (log.isTraceEnabled())
- log
- .trace("Retrieved source application context "
- + "by scanning all published application contexts.");
- try {
- Object obj = sourceAppContext.getBean(request.getRef());
- return obj;
- } catch (Exception e) {
- if (log.isTraceEnabled())
- log.trace("Could not retrieve " + request.getRef()
- + " from app context " + appC + ": " + e);
- }
- }
- }
-
- throw new Exception(
- "Cannot find any published application context containing bean "
- + request.getRef());
- }
-
- protected synchronized DetachedAnswer processStep(DetachedStep obj,
- DetachedRequest request) {
- DetachedAnswer answer;
-
- StringBuffer skippedLog = new StringBuffer();
- boolean execute = true;
-
- if (replayedSession != null) {
- // Skip execution of already successful steps
- int stepIndex = currentSession.getExecutedStepCount();
-
- if (stepIndex < replayedSession.getExecutedStepCount()) {
- DetachedAnswer previousAnswer = (DetachedAnswer) replayedSession
- .getAnswers().get(stepIndex);
- DetachedRequest previousRequest = (DetachedRequest) replayedSession
- .getRequests().get(stepIndex);
-
- // check step names
- if (!previousRequest.getRef().equals(request.getRef())) {
- String msg = "New request is not consistent with previous ref. previousRef="
- + previousRequest.getRef()
- + ", newRef="
- + request.getRef() + "\n";
- skippedLog.append(msg);
- log.warn(msg);
- }
-
- if (previousAnswer.getStatus() != DetachedAnswer.ERROR) {
- // if no error occurred in the replayedSession,
- // skip the step
- execute = false;
- String msg = "Skipped Step " + request.getRef()
- + " (stepIndex=" + stepIndex + ")";
- skippedLog.append(msg);
- log.info(msg);
-
- } else {
- // if an error occurred, execute the step and leave
- // skipUntillError mode (even if replayedSession
- // has more steps)
- log.info("### End of SkipUntilError Mode ###");
- log.info("Step " + request.getRef()
- + " was previously in error, executing it again."
- + " (stepIndex=" + stepIndex + ").");
- replayedSession = null;
- }
- } else {
- // went further as skip count, doing nothing.
- }
- }
-
- if (execute) {
- DetachedStep step = (DetachedStep) obj;
- // Actually execute the step
- answer = step.execute(detachedContext, request);
- } else {
- answer = new DetachedAnswer(request);
- answer.setStatus(DetachedAnswer.SKIPPED);
- answer.setLog(skippedLog.toString());
- }
- return answer;
- }
-
- protected synchronized DetachedAnswer processAdminCommand(
- DetachedAdminCommand obj, DetachedRequest request) {
- DetachedAnswer answer;
- if (obj instanceof OpenSession) {
- DetachedSession newSession = ((OpenSession) obj).execute(request,
- bundleContext);
-
- log.debug("Creating new DetachedSession : " + newSession);
-
- if ((currentSession != null) && currentSession.lastActionIsError()
- && DetachedSession.SKIP_UNTIL_ERROR.equals(newSession.getDoItAgainPolicy())) {
- // switch to replay mode
- log.info("### Start SkipUntilError Mode ###");
- replayedSession = currentSession;
- }
-
- currentSession = newSession;
-
- answer = new DetachedAnswer(request, "Session #"
- + currentSession.getUuid() + " open.");
- } else if (obj instanceof CloseSession) {
- if (currentSession == null)
- throw new DetachedException("There is no open session to close");
- answer = new DetachedAnswer(request, "Session #"
- + currentSession.getUuid() + " closed.");
- answer.setStatus(DetachedAnswer.CLOSED_SESSION);
- } else {
- answer = null;
- }
- return answer;
- }
-
- protected synchronized String dumpSessionsHistory(
- DetachedRequest requestCurrent, DetachedAnswer answerCurrent) {
- StringBuffer buf = new StringBuffer(
- "##\n## SESSIONS HISTORY DUMP\n##\n");
- buf.append("# CURRENT\n");
- buf.append("Current session: ").append(currentSession)
- .append('\n');
- buf.append("Current request: ").append(requestCurrent).append('\n');
- buf.append("Current answer: ").append(answerCurrent).append('\n');
-
- buf.append("# CURRENT SESSION\n");
-
- List requests = currentSession.getRequests();
- List answers = currentSession.getAnswers();
- for (int j = 0; j < requests.size(); j++) {
- DetachedRequest request = (DetachedRequest) requests.get(j);
- buf.append('\t').append(j).append(". ").append(request)
- .append('\n');
- if (answers.size() > j) {
- DetachedAnswer answer = (DetachedAnswer) answers.get(j);
- buf.append('\t').append(j).append(". ").append(answer).append(
- '\n');
- }
- }
-
- buf.append("# DETACHED CONTEXT\n");
- buf.append(detachedContext).append('\n');
-
- buf.append("##\n## END OF SESSIONS HISTORY DUMP\n##\n");
- return buf.toString();
- }
-
- public void setBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
- public void afterPropertiesSet() throws Exception {
- log.debug("Detached execution server initialized.");
- }
-
- public synchronized void destroy() throws Exception {
- Iterator/* <String> */keys = appContextServiceTrackers.keySet()
- .iterator();
- while (keys.hasNext()) {
- ServiceTracker st = (ServiceTracker) appContextServiceTrackers
- .get(keys.next());
- st.close();
- }
- appContextServiceTrackers.clear();
-
- log.debug("Detached execution server closed.");
- }
-
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.util.Properties;
-
-/** A request sent to the detached server. */
-public class DetachedRequest implements DetachedCommunication {
- static final long serialVersionUID = 1l;
-
- private String uuid;
- private Properties properties = new Properties();
- private String ref;
-
- private Object cachedObject = null;
-
- public DetachedRequest() {
-
- }
-
- public DetachedRequest(String uuid) {
- this.uuid = uuid;
- }
-
- /** The properties configuring this request. */
- public Properties getProperties() {
- return properties;
- }
-
- public void setProperties(Properties inputParameters) {
- this.properties = inputParameters;
- }
-
- /**
- * A reference to the underlying implementation which will process the
- * request.
- */
- public String getRef() {
- return ref;
- }
-
- public void setRef(String stepRef) {
- this.ref = stepRef;
- }
-
- /** The unique identifier of this request. */
- public String getUuid() {
- return uuid;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer("detached request for ref ");
- buf.append(ref);
- buf.append(" #").append(uuid);
- buf.append(" cachedObject=").append((cachedObject != null));
- buf.append(" properties=").append(properties);
- return buf.toString();
- }
-
- /**
- * Optimization. Allows the driver to eagerly cache the object in the
- * request, in order to relieve the detached server of the task to look for
- * it. No implementation should rely on this to be set.
- */
- public Object getCachedObject() {
- return cachedObject;
- }
-
- public void setCachedObject(Object cachedObject) {
- this.cachedObject = cachedObject;
- }
-
-}
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.detached;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.osgi.framework.BundleContext;\r
-import org.osgi.framework.Constants;\r
-import org.springframework.beans.BeansException;\r
-import org.springframework.context.ApplicationContext;\r
-import org.springframework.context.ApplicationContextAware;\r
-import org.springframework.osgi.context.BundleContextAware;\r
-\r
-/**\r
- * When started, processes <code>DetachedRequest</code> through a\r
- * <code>DetachedExecutionServer</code> and sends <code>DetachedAnswer</code>\r
- * back\r
- */\r
-public class DetachedServer implements BundleContextAware, ApplicationContextAware {\r
-\r
- private final static Log log = LogFactory.getLog(DetachedServer.class); \r
- \r
- private boolean active = true;\r
- private DetachedExecutionServer executionServer = null;\r
-\r
- private boolean cacheObjects = true;\r
-\r
- /** May be null */\r
- private ApplicationContext applicationContext;\r
- /** May be null */\r
- private BundleContext bundleContext;\r
- \r
- /**\r
- * Used to receive Request and send answers\r
- */\r
- private DetachedDriver detachedDriver;\r
-\r
- public synchronized void start() {\r
-\r
- log.info("Starting DetachedServer");\r
- \r
- Thread driverThread = new Thread(new Runnable() {\r
-\r
- public void run() {\r
- while (active) {\r
- try {\r
- // no timeout to receive a request\r
- DetachedRequest request = detachedDriver.receiveRequest();\r
- if (!active)\r
- break;\r
-\r
- String driverBundleName = null;\r
- if (bundleContext != null)\r
- driverBundleName = bundleContext.getBundle()\r
- .getSymbolicName();\r
-\r
- if (applicationContext != null && cacheObjects) {\r
- try {\r
- String ref = request.getRef();\r
- if (applicationContext.containsBean(ref)) {\r
- Object obj = applicationContext\r
- .getBean(request.getRef());\r
- request.setCachedObject(obj);\r
- if (log.isTraceEnabled())\r
- log.trace("Cached bean '" + ref\r
- + "' in request " + request);\r
- } else {\r
- log\r
- .warn("Cannot cache object in request because no bean '"\r
- + ref\r
- + "' was found in application context"\r
- + (driverBundleName != null ? " (driver bundle "\r
- + driverBundleName\r
- + ")"\r
- : ""));\r
- }\r
- } catch (Exception e) {\r
- if (log.isTraceEnabled())\r
- log\r
- .trace("Could not retrieve "\r
- + request.getRef()\r
- + " from driver application context because of "\r
- + e);\r
- driverBundleName = null;// do not publish bundle\r
- // name\r
- }\r
- }\r
-\r
- if (driverBundleName != null)\r
- request.getProperties().put(\r
- Constants.BUNDLE_SYMBOLICNAME,\r
- driverBundleName);\r
-\r
- DetachedAnswer answer = executionServer\r
- .executeRequest(request);\r
- detachedDriver.sendAnswer(answer);\r
- } catch (Exception e) {\r
- // if (e instanceof RuntimeException)\r
- // throw (RuntimeException) e;\r
- // else\r
- e.printStackTrace();\r
- }\r
- }\r
-\r
- }\r
- }, "driverThread (" + getClass() + ")");\r
- driverThread.start();\r
-\r
- }\r
-\r
- public void setExecutionServer(DetachedExecutionServer executionServer) {\r
- this.executionServer = executionServer;\r
- }\r
-\r
- public synchronized void stop() {\r
- active = false;\r
- notifyAll();\r
- }\r
-\r
- public synchronized boolean isActive() {\r
- return active;\r
- }\r
-\r
- public synchronized void setActive(boolean active) {\r
- this.active = active;\r
- }\r
-\r
- public void setApplicationContext(ApplicationContext applicationContext)\r
- throws BeansException {\r
- this.applicationContext = applicationContext;\r
- }\r
-\r
- public void setBundleContext(BundleContext bundleContext) {\r
- this.bundleContext = bundleContext;\r
- }\r
-\r
- public void setCacheObjects(boolean cacheObjects) {\r
- this.cacheObjects = cacheObjects;\r
- }\r
-\r
- public void setDetachedDriver(DetachedDriver detachedDriver) {\r
- this.detachedDriver = detachedDriver;\r
- } \r
- \r
-}\r
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-/** A session within the detached context. */
-public class DetachedSession {
- public final static String PROP_DO_IT_AGAIN_POLICY = "slc.detached.doItAgainPolicy";
- public final static String SKIP_UNTIL_ERROR = "skipUntilError";
- public final static String REPLAY = "replay";
-
- private String uuid = null;
- private List requests = new Vector();
- private List answers = new Vector();
- private String doItAgainPolicy = REPLAY;
- private List refreshedBundleNames = new ArrayList();
-
- public boolean isClosed() {
- if (answers.size() > 0) {
- DetachedAnswer answer = (DetachedAnswer) answers
- .get(answers.size() - 1);
- return answer.getStatus() == DetachedAnswer.CLOSED_SESSION;
- } else {
- return false;
- }
- }
-
- public boolean lastActionIsError() {
- if (answers.size() > 0) {
- DetachedAnswer answer = (DetachedAnswer) answers
- .get(answers.size() - 1);
- return answer.getStatus() == DetachedAnswer.ERROR;
- } else {
- return false;
- }
- }
-
- public int getExecutedStepCount() {
- if(requests.size() != answers.size()) {
- throw new DetachedException("requests.size() != answers.size() in DetachedSession");
- }
- return answers.size();
- }
-
- public String getDoItAgainPolicy() {
- return doItAgainPolicy;
- }
-
- public void setDoItAgainPolicy(String doItAgainPolicy) {
- this.doItAgainPolicy = doItAgainPolicy;
- }
-
- public List getRequests() {
- return requests;
- }
-
- public String getUuid() {
- return uuid;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public List getAnswers() {
- return answers;
- }
-
- public List getRefreshedBundleNames() {
- return refreshedBundleNames;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append("#").append(uuid);
- buf.append(" doItAgainPolicy=").append(doItAgainPolicy);
- return buf.toString();
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-
-public interface DetachedStep {
- public DetachedAnswer execute(DetachedContext detachedContext,
- DetachedRequest detachedStepRequest);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-
-public interface DetachedXmlConverter {
- public void marshallCommunication(DetachedCommunication detCom,
- Result result);
-
- public DetachedCommunication unmarshallCommunication(Source source);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.Enumeration;
-import java.util.Properties;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * For compatibility with old JDKs (pre 1.5). Use Spring base one when possible.
- */
-public class DetachedXmlConverterCompat implements DetachedXmlConverter {
- public final static String SLC_DETACHED_NAMESPACE_URI = "http://argeo.org/projects/slc/schemas/detached";
- private final static Log log = LogFactory
- .getLog(DetachedXmlConverterCompat.class);
-
- private final Transformer copy;
-
- public DetachedXmlConverterCompat() {
- try {
- copy = TransformerFactory.newInstance().newTransformer();
- } catch (Exception e) {
- throw new DetachedException("Could not create transformer.", e);
- }
- }
-
- public void marshallCommunication(DetachedCommunication detCom,
- Result result) {
- if (detCom instanceof DetachedRequest) {
- marshallRequest((DetachedRequest) detCom, result);
- } else if (detCom instanceof DetachedAnswer) {
- marshallAnswer((DetachedAnswer) detCom, result);
- } else {
- throw new DetachedException("Unkown communication type "
- + detCom.getClass());
- }
- }
-
- public DetachedCommunication unmarshallCommunication(Source source) {
- // Parse
- DOMResult result = new DOMResult();
- try {
- copy.transform(source, result);
- } catch (TransformerException e) {
- throw new DetachedException("Could not copy xml source", e);
- }
-
- if (log.isTraceEnabled()) {
- try {
- DOMSource domSource = new DOMSource(result.getNode());
- StringWriter stringWriter = new StringWriter();
- StreamResult streamResult = new StreamResult(stringWriter);
- copy.transform(domSource, streamResult);
- log.trace("Unmarshall communication:\n"
- + stringWriter.toString());
- IOUtils.closeQuietly(stringWriter);
- } catch (TransformerException e) {
- log.warn("Could not log xml source", e);
- }
- }
- Element root = (Element) ((Document) result.getNode())
- .getDocumentElement();
-
- // Create objects
- String requestType = root.getLocalName();
- if (requestType.equals("detached-request")) {
- DetachedRequest request = new DetachedRequest();
- request.setUuid(root.getElementsByTagNameNS(
- SLC_DETACHED_NAMESPACE_URI, "uuid").item(0)
- .getTextContent());
- request
- .setRef(root.getElementsByTagNameNS(
- SLC_DETACHED_NAMESPACE_URI, "ref").item(0)
- .getTextContent());
- Element propertiesElement = (Element) root.getElementsByTagNameNS(
- SLC_DETACHED_NAMESPACE_URI, "properties").item(0);
- NodeList propElements = propertiesElement.getElementsByTagNameNS(
- SLC_DETACHED_NAMESPACE_URI, "prop");
- Properties properties = new Properties();
- for (int i = 0; i < propElements.getLength(); i++) {
- Element propElement = (Element) propElements.item(i);
- String key = propElement.getAttribute("key");
- String value = propElement.getTextContent();
- properties.setProperty(key, value);
- }
- request.setProperties(properties);
- return request;
- } else {
- throw new DetachedException(requestType + " not implemented.");
- }
- }
-
- public void marshallAnswer(DetachedAnswer answer, Result result) {
- StringBuffer buf = new StringBuffer("");
- buf.append("<slc-det:detached-answer xmlns:slc-det=\""
- + SLC_DETACHED_NAMESPACE_URI + "\">");
- if (answer.getUuid() != null)
- buf.append("<slc-det:uuid>").append(answer.getUuid()).append(
- "</slc-det:uuid>");
- buf.append("<slc-det:status>").append(answer.getStatus()).append(
- "</slc-det:status>");
- if (answer.getLog() != null)
- buf.append("<slc-det:log>").append(answer.getLog()).append(
- "</slc-det:log>");
- if (answer.getProperties().size() != 0) {
- buf.append("<slc-det:properties>");
- Enumeration keys = answer.getProperties().keys();
- while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
- buf.append("<slc-det:prop key=\"").append(key).append("\">");
- buf.append(answer.getProperties().getProperty(key));
- buf.append("</slc-det:prop>");
- }
- buf.append("</slc-det:properties>");
- }
- buf.append("</slc-det:detached-answer>");
- StringReader reader = new StringReader(buf.toString());
- Source source = new StreamSource(reader);
- try {
- copy.transform(source, result);
- } catch (TransformerException e) {
- throw new DetachedException("Could not copy xml to result", e);
- } finally {
- IOUtils.closeQuietly(reader);
- }
- }
-
- public void marshallRequest(DetachedRequest request, Result result) {
- throw new DetachedException(" Not implemented.");
- }
-
- public DetachedRequest unmarshallRequest(Source source) {
- DOMResult result = new DOMResult();
- try {
- copy.transform(source, result);
- } catch (TransformerException e) {
- throw new DetachedException("Could not copy xml source", e);
- }
- Element node = (Element) ((Document) result.getNode())
- .getDocumentElement();
- DetachedRequest request = new DetachedRequest();
- request.setUuid(node.getElementsByTagNameNS(SLC_DETACHED_NAMESPACE_URI,
- "uuid").item(0).getTextContent());
- request.setRef(node.getElementsByTagNameNS(SLC_DETACHED_NAMESPACE_URI,
- "ref").item(0).getTextContent());
- Element propertiesElement = (Element) node.getElementsByTagNameNS(
- SLC_DETACHED_NAMESPACE_URI, "properties").item(0);
- NodeList propElements = propertiesElement.getElementsByTagNameNS(
- SLC_DETACHED_NAMESPACE_URI, "prop");
- Properties properties = new Properties();
- for (int i = 0; i < propElements.getLength(); i++) {
- Element propElement = (Element) propElements.item(i);
- String key = propElement.getAttribute("key");
- String value = propElement.getTextContent();
- properties.setProperty(key, value);
- }
- request.setProperties(properties);
- return request;
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached;
-
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Dummy detached step which copies the request into the answer and log. Useful
- * for testing.
- */
-public class MirrorStep implements DetachedStep {
- private final static Log log = LogFactory.getLog(MirrorStep.class);
-
- public DetachedAnswer execute(DetachedContext detachedContext,
- DetachedRequest req) {
- log.debug(" uuid=" + req.getUuid());
- log.debug(" ref=" + req.getRef());
- log.debug(" properties=" + req.getProperties());
-
- DetachedAnswer answer = new DetachedAnswer(req, "Mirror");
- Properties answerProps = new Properties();
- answerProps.putAll(req.getProperties());
- answer.setProperties(answerProps);
- return answer;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.admin;
-
-import org.argeo.slc.detached.DetachedAdminCommand;
-
-public class CloseSession implements DetachedAdminCommand {
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.admin;
-
-import org.argeo.slc.detached.DetachedAdminCommand;
-import org.argeo.slc.detached.DetachedAnswer;
-import org.argeo.slc.detached.DetachedException;
-import org.argeo.slc.detached.DetachedRequest;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-public class FelixShellCommand implements DetachedAdminCommand {
- public final static String PROP_FELIX_CMDLINE = "slc.detached.felix.cmdline";
-
- public DetachedAnswer execute(DetachedRequest request,
- BundleContext bundleContext) {
- ServiceReference ref = bundleContext
- .getServiceReference("org.apache.felix.shell.ShellService");
- if (ref == null)
- throw new DetachedException("Felix shell service not found.");
-
- String cmdLine = request.getProperties()
- .getProperty(PROP_FELIX_CMDLINE);
- if (cmdLine == null)
- throw new DetachedException("Property " + PROP_FELIX_CMDLINE
- + " must be defined.");
-
- // TODO: check were to put Felix dependency
- // see http://felix.apache.org/site/apache-felix-shell-service.html
- throw new DetachedException("Not yet implemented.");
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.admin;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.FrameworkEvent;
-import org.osgi.framework.FrameworkListener;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/**
- * Wraps low-level access to a {@link BundleContext}. Hacked from the related
- * class in org.argeo.slc.support.osgi.
- */
-class MinimalBundlesManager implements FrameworkListener {
- private final static Log log = LogFactory
- .getLog(MinimalBundlesManager.class);
-
- private final BundleContext bundleContext;
-
- private long defaultTimeout = 10000l;
- private final Object refreshedPackageSem = new Object();
-
- public MinimalBundlesManager(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- bundleContext.addFrameworkListener(this);
- }
-
- protected void finalize() throws Throwable {
- bundleContext.removeFrameworkListener(this);
- }
-
- /**
- * @see #upgradeSynchronous(Bundle[])
- */
- public void upgradeSynchronous(Bundle bundle) {
- upgradeSynchronous(new Bundle[] { bundle });
- }
-
- /**
- * Stop the active bundles, update them, refresh them and restart the
- * initially active bundles. All synchronously.
- */
- public void upgradeSynchronous(Bundle[] bundles) {
- try {
- // State (ACTIVE or other) before upgrading
- int[] initialStates = new int[bundles.length];
-
- // store initial state and stop active bundles
- for (int i = 0; i < bundles.length; ++i) {
- initialStates[i] = bundles[i].getState();
- if (initialStates[i] == Bundle.ACTIVE) {
- stopSynchronous(bundles[i]);
- }
- }
-
- // update the bundles
- for (int i = 0; i < bundles.length; ++i) {
- updateSynchronous(bundles[i]);
- }
-
- // refresh the bundles
- refreshSynchronous(bundles);
-
- // restart the bundles that were ACTIVE before upgrading
- for (int i = 0; i < bundles.length; ++i) {
- if (initialStates[i] == Bundle.ACTIVE) {
- startSynchronous(bundles[i]);
-
- String filter = "(Bundle-SymbolicName="
- + bundles[i].getSymbolicName() + ")";
- // Wait for application context to be ready
- // TODO: use service tracker
- try {
- getServiceRefSynchronous(
- "org.springframework.context.ApplicationContext",
- filter);
- }
- // in case of exception, catch and go on
- catch (Exception e) {
- log.error("getServiceRefSynchronous failed", e);
- }
- }
- }
- } catch (Exception e) {
- throw new RuntimeException("Cannot update bundles", e);
- }
- }
-
- /** Updates bundle synchronously. */
- protected void updateSynchronous(Bundle bundle) throws BundleException {
- bundle.update();
- boolean waiting = true;
-
- long begin = System.currentTimeMillis();
- do {
- int state = bundle.getState();
- if (state == Bundle.INSTALLED || state == Bundle.ACTIVE
- || state == Bundle.RESOLVED)
- waiting = false;
-
- sleep(100);
- if (System.currentTimeMillis() - begin > defaultTimeout)
- throw new RuntimeException("Update of bundle "
- + bundle.getSymbolicName()
- + " timed out. Bundle state = " + bundle.getState());
- } while (waiting);
-
- if (log.isDebugEnabled())
- log.debug("Bundle " + bundle.getSymbolicName() + " updated.");
- }
-
- /** Starts bundle synchronously. Does nothing if already started. */
- protected void startSynchronous(Bundle bundle) throws BundleException {
- int originalState = bundle.getState();
- if (originalState == Bundle.ACTIVE)
- return;
-
- bundle.start();
- boolean waiting = true;
-
- long begin = System.currentTimeMillis();
- do {
- if (bundle.getState() == Bundle.ACTIVE)
- waiting = false;
-
- sleep(100);
- if (System.currentTimeMillis() - begin > defaultTimeout)
- throw new RuntimeException("Start of bundle "
- + bundle.getSymbolicName()
- + " timed out. Bundle state = " + bundle.getState());
- } while (waiting);
-
- if (log.isDebugEnabled())
- log.debug("Bundle " + bundle.getSymbolicName() + " started.");
- }
-
- /** Stops bundle synchronously. Does nothing if already started. */
- protected void stopSynchronous(Bundle bundle) throws BundleException {
- int originalState = bundle.getState();
- if (originalState != Bundle.ACTIVE)
- return;
-
- bundle.stop();
- boolean waiting = true;
-
- long begin = System.currentTimeMillis();
- do {
- if (bundle.getState() != Bundle.ACTIVE
- && bundle.getState() != Bundle.STOPPING)
- waiting = false;
-
- sleep(100);
- if (System.currentTimeMillis() - begin > defaultTimeout)
- throw new RuntimeException("Stop of bundle "
- + bundle.getSymbolicName()
- + " timed out. Bundle state = " + bundle.getState());
- } while (waiting);
-
- if (log.isDebugEnabled())
- log.debug("Bundle " + bundle.getSymbolicName() + " stopped.");
- }
-
- /** Refresh bundle synchronously. Does nothing if already started. */
- protected void refreshSynchronous(Bundle[] bundles) throws BundleException {
- ServiceReference packageAdminRef = bundleContext
- .getServiceReference(PackageAdmin.class.getName());
- PackageAdmin packageAdmin = (PackageAdmin) bundleContext
- .getService(packageAdminRef);
- packageAdmin.refreshPackages(bundles);
-
- synchronized (refreshedPackageSem) {
- try {
- refreshedPackageSem.wait(defaultTimeout);
- } catch (InterruptedException e) {
- // silent
- }
- }
-
- if (log.isDebugEnabled())
- log.debug("Bundles refreshed.");
- }
-
- public void frameworkEvent(FrameworkEvent event) {
- if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) {
- synchronized (refreshedPackageSem) {
- refreshedPackageSem.notifyAll();
- }
- }
- }
-
- public ServiceReference[] getServiceRefSynchronous(String clss,
- String filter) throws InvalidSyntaxException {
- if (log.isTraceEnabled())
- log.trace("Filter: '" + filter + "'");
- ServiceReference[] sfs = null;
- boolean waiting = true;
- long begin = System.currentTimeMillis();
- do {
- sfs = bundleContext.getServiceReferences(clss, filter);
-
- if (sfs != null)
- waiting = false;
-
- sleep(100);
- if (System.currentTimeMillis() - begin > defaultTimeout)
- throw new RuntimeException("Search of services " + clss
- + " with filter " + filter + " timed out.");
- } while (waiting);
-
- return sfs;
- }
-
- protected void sleep(long ms) {
- try {
- Thread.sleep(ms);
- } catch (InterruptedException e) {
- // silent
- }
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.admin;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.detached.DetachedAdminCommand;
-import org.argeo.slc.detached.DetachedException;
-import org.argeo.slc.detached.DetachedRequest;
-import org.argeo.slc.detached.DetachedSession;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-public class OpenSession implements DetachedAdminCommand {
- private final static Log log = LogFactory.getLog(OpenSession.class);
-
- public DetachedSession execute(DetachedRequest request,
- BundleContext bundleContext) {
-
- DetachedSession session = new DetachedSession();
- session.setUuid(Long.toString(System.currentTimeMillis()));
-
- Properties props = request.getProperties();
- if (props.containsKey(DetachedSession.PROP_DO_IT_AGAIN_POLICY))
- session.setDoItAgainPolicy(props
- .getProperty(DetachedSession.PROP_DO_IT_AGAIN_POLICY));
-
- String refreshedBundles = props
- .getProperty("slc.detached.refreshedBundles");
- if (refreshedBundles != null) {
-
- List refreshedBundleNames = new ArrayList();
- StringTokenizer st = new StringTokenizer(refreshedBundles, ",");
- while (st.hasMoreTokens()) {
- refreshedBundleNames.add(st.nextElement());
- }
-
- Bundle[] allBundles = bundleContext.getBundles();
- Bundle[] bundlesToRefresh = new Bundle[refreshedBundleNames.size()];
-
- log.debug("Bundles to refresh for DetachedSession:");
-
- for(int i = 0; i < bundlesToRefresh.length; ++i) {
- bundlesToRefresh[i] = getBundleForName((String)refreshedBundleNames.get(i), allBundles);
- if(log.isDebugEnabled())
- log.debug(" " + refreshedBundleNames.get(i));
- }
-
- (new MinimalBundlesManager(bundleContext)).upgradeSynchronous(bundlesToRefresh);
- }
-
- return session;
- }
-
- private Bundle getBundleForName(String symbolicName, Bundle[] bundles) {
- for (int i = 0; i < bundles.length; i++) {
- if (symbolicName.equals(bundles[i].getSymbolicName())) {
- return bundles[i];
- }
- }
- throw new DetachedException("No Bundle found for symbolic name " + symbolicName);
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.drivers;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.text.MessageFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.io.filefilter.NotFileFilter;
-import org.apache.commons.io.filefilter.SuffixFileFilter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.detached.DetachedAnswer;
-import org.argeo.slc.detached.DetachedClient;
-import org.argeo.slc.detached.DetachedCommunication;
-import org.argeo.slc.detached.DetachedDriver;
-import org.argeo.slc.detached.DetachedException;
-import org.argeo.slc.detached.DetachedRequest;
-import org.argeo.slc.detached.DetachedXmlConverter;
-import org.springframework.beans.factory.InitializingBean;
-
-/**
- * Implements both <code>DetachedClient</code> and <code>DetachedDriver</code>
- * using File protocol
- */
-public class FileDriver implements DetachedClient, DetachedDriver,
- InitializingBean {
- private final static Log log = LogFactory.getLog(FileDriver.class);
- private final static SimpleDateFormat sdf = new SimpleDateFormat(
- "yyMMdd_HHmmss_SSS");
- private final static MessageFormat mf = new MessageFormat("{0,number,000}");
-
- private File baseDir;
- private File requestsDir;
- private File answersDir;
- private File processedRequestsDir;
- private File processedAnswersDir;
- private File cleanedRequestsDir;
- private File cleanedAnswersDir;
-
- private String lockFileExt = "lck";
- private FileFilter notLockFileFilter = new NotFileFilter(
- new SuffixFileFilter("." + lockFileExt));
-
- // Counters to avoid naming files with same prefix
- private long lastSentTime = 0;
- private int counter = 0;
-
- private DetachedXmlConverter xmlConverter = null;
-
- private long receiveAnswerTimeout = 10000l;
-
- private boolean active = true;
-
- public synchronized DetachedRequest receiveRequest() throws Exception {
- DetachedRequest request = (DetachedRequest) receiveFile(requestsDir,
- processedRequestsDir, 0);
- if (request != null)
- if (log.isTraceEnabled())
- log.trace("Received detached request #" + request.getUuid()
- + " for ref '" + request.getRef());
- return request;
- }
-
- public synchronized void sendAnswer(DetachedAnswer answer) throws Exception {
- sendFile(answersDir, answer);
- if (log.isTraceEnabled())
- log.trace("Sent detached answer #" + answer.getUuid());
- }
-
- public synchronized DetachedAnswer receiveAnswer() throws Exception {
- DetachedAnswer answer = (DetachedAnswer) receiveFile(answersDir,
- processedAnswersDir, getReceiveAnswerTimeout());
- if (answer != null)
- if (log.isTraceEnabled())
- log.trace("Received detached answer #" + answer.getUuid());
- return answer;
- }
-
- public synchronized void sendRequest(DetachedRequest request)
- throws Exception {
- sendFile(requestsDir, request);
- if (log.isTraceEnabled())
- log.trace("Sent detached request #" + request.getUuid()
- + " for ref '" + request.getRef());
- }
-
- protected synchronized void sendFile(File dir, DetachedCommunication detCom)
- throws Exception {
- final String ext;
- if (getXmlConverter() != null)
- ext = ".xml";
- else
- ext = "";
-
- // Check counters
- Date nowDate = new Date();
- long nowMs = nowDate.getTime();
- if (nowMs == lastSentTime) {
- counter++;
- } else {
- counter = 0;
- }
-
- // Create file path
- StringBuffer filePath = new StringBuffer(dir.getPath());
- filePath.append(File.separatorChar).append(sdf.format(nowDate))
- .append('-');
- filePath.append(mf.format(new Object[] { new Long(counter) })).append(
- '-');
- filePath.append(detCom.getUuid()).append(ext);
- File file = new File(filePath.toString());
-
- File lockFile = createLockFile(file);
- if (getXmlConverter() != null) {// xml
- FileOutputStream outFile = new FileOutputStream(file);
- try {
- StreamResult result = new StreamResult(outFile);
- getXmlConverter().marshallCommunication(detCom, result);
- } finally {
- IOUtils.closeQuietly(outFile);
- }
- } else {// serialize
- ObjectOutputStream out = new ObjectOutputStream(
- new FileOutputStream(file));
- try {
- out.writeObject(detCom);
- } finally {
- IOUtils.closeQuietly(out);
- }
- }
- lockFile.delete();
- }
-
- /**
- * @param timeout
- * in ms, 0 is no timeout
- */
- protected synchronized DetachedCommunication receiveFile(File dir,
- File processedDir, long timeout) throws Exception {
- long begin = System.currentTimeMillis();
- File file = null;
- while (file == null && isActive()) {
- if (!dir.exists())
- throw new DetachedException("Dir " + dir + " does not exist.");
-
- File[] files = dir.listFiles(notLockFileFilter);
- if (files.length > 0)
- file = files[0];
- else {
- try {
- wait(100);
- } catch (InterruptedException e) {
- // silent
- }
- }
-
- long duration = System.currentTimeMillis() - begin;
- if (timeout != 0 && duration > timeout) {
- throw new DetachedException("Receive file timed out after "
- + duration + "ms.");
- }
- }
-
- if (!isActive()) {
- log.debug("DetachedDriver is not active. Leaving receiveFile");
- return null;
- }
-
- File lockFile = nameLockFile(file);
- while (lockFile.exists())
- // FIXME: implements time out
- Thread.sleep(100);
-
- // Read the file
- final DetachedCommunication detCom;
- if (FilenameUtils.getExtension(file.getName()).equals("xml")) {
- if (getXmlConverter() == null)
- throw new DetachedException("No XML converter defined.");
- FileInputStream in = new FileInputStream(file);
- try {
- StreamSource source = new StreamSource(in);
- detCom = getXmlConverter().unmarshallCommunication(source);
- } finally {
- IOUtils.closeQuietly(in);
- }
- } else {
- ObjectInputStream in = new ObjectInputStream(new FileInputStream(
- file));
- try {
- detCom = (DetachedCommunication) in.readObject();
- } finally {
- IOUtils.closeQuietly(in);
- }
- }
- // Move to processed dir
- FileUtils.moveFileToDirectory(file, processedDir, false);
- return detCom;
- }
-
- public synchronized void stop() {
- log.debug("Stopping Detached Driver");
- active = false;
- notifyAll();
- }
-
- private synchronized boolean isActive() {
- return active;
- }
-
- protected File createLockFile(File file) {
- File lockFile = nameLockFile(file);
- try {
- lockFile.createNewFile();
- } catch (IOException e) {
- throw new DetachedException("Cannot create lock file " + lockFile);
- }
- return lockFile;
- }
-
- protected File nameLockFile(File file) {
- return new File(file.getAbsolutePath() + "." + lockFileExt);
- }
-
- public void setBaseDir(File baseDir) {
- this.baseDir = baseDir;
- }
-
- private void createIfNotExist(File dir) {
- if (!dir.exists()) {
- log.warn("Dir " + dir.getAbsolutePath()
- + " does not exist. Creating it...");
- dir.mkdirs();
- }
- }
-
- public void afterPropertiesSet() throws Exception {
- this.requestsDir = new File(baseDir.getAbsolutePath() + File.separator
- + "requests");
- this.answersDir = new File(baseDir.getAbsolutePath() + File.separator
- + "answers");
- this.processedRequestsDir = new File(baseDir.getAbsolutePath()
- + File.separator + "processed" + File.separator + "requests");
- this.processedAnswersDir = new File(baseDir.getAbsolutePath()
- + File.separator + "processed" + File.separator + "answers");
- this.cleanedRequestsDir = new File(baseDir.getAbsolutePath()
- + File.separator + "cleaned" + File.separator + "requests");
- this.cleanedAnswersDir = new File(baseDir.getAbsolutePath()
- + File.separator + "cleaned" + File.separator + "answers");
-
- createIfNotExist(requestsDir);
- createIfNotExist(answersDir);
- createIfNotExist(processedRequestsDir);
- createIfNotExist(processedAnswersDir);
- createIfNotExist(cleanedRequestsDir);
- createIfNotExist(cleanedAnswersDir);
- if (log.isDebugEnabled())
- log.debug("Detached File Driver initialized on " + baseDir);
- }
-
- public void cleanPreviousRuns() throws Exception {
-
- // Clean requests and answers from previous builds
- File[] remainingRequests = requestsDir.listFiles();
- for (int i = 0; i < remainingRequests.length; i++) {
- FileUtils.moveFileToDirectory(remainingRequests[i],
- cleanedRequestsDir, false);
- }
-
- File[] remainingAnswers = answersDir.listFiles();
- for (int i = 0; i < remainingAnswers.length; i++) {
- FileUtils.moveFileToDirectory(remainingAnswers[i],
- cleanedAnswersDir, false);
- }
- log.info("Clean previous runs of File Driver on " + baseDir);
-
- }
-
- public long getReceiveAnswerTimeout() {
- return receiveAnswerTimeout;
- }
-
- public void setReceiveAnswerTimeout(long receiveAnswerTimeout) {
- this.receiveAnswerTimeout = receiveAnswerTimeout;
- }
-
- public DetachedXmlConverter getXmlConverter() {
- return xmlConverter;
- }
-
- public void setXmlConverter(DetachedXmlConverter xmlConverter) {
- this.xmlConverter = xmlConverter;
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.drivers;
-
-import org.argeo.slc.detached.DetachedAnswer;
-import org.argeo.slc.detached.DetachedClient;
-import org.argeo.slc.detached.DetachedDriver;
-import org.argeo.slc.detached.DetachedRequest;
-
-/**
- * Implements both <code>DetachedClient</code> and <code>DetachedDriver</code>
- * using memory access
- */
-public class MemoryDriver implements DetachedClient, DetachedDriver {
- private DetachedRequest currentRequest = null;
- private DetachedAnswer currentAnswer = null;
-
- // DRIVER
- public synchronized DetachedRequest receiveRequest() throws Exception {
- while (currentRequest == null)
- this.wait(500);
- return currentRequest;
- }
-
- public synchronized void sendAnswer(DetachedAnswer answer) throws Exception {
- currentAnswer = answer;
- this.notify();
- }
-
- // CLIENT
- public synchronized DetachedAnswer receiveAnswer() throws Exception {
- while (currentAnswer == null)
- this.wait(500);
- DetachedAnswer answer = currentAnswer;
- currentAnswer = null;
- currentRequest = null;
- return answer;
- }
-
- public synchronized void sendRequest(DetachedRequest request)
- throws Exception {
- currentRequest = request;
- this.notify();
- }
-
- public void stop() {
- // NOTHING
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.ui;
-
-import org.argeo.slc.detached.DetachedContext;
-import org.argeo.slc.detached.DetachedRequest;
-
-public abstract class UiPart {
- private boolean initialized = false;
-
- public synchronized final void init(DetachedContext context,
- DetachedRequest request) {
- initUi(context, request);
- initialized = true;
- }
-
- public synchronized final void reset(DetachedContext context,
- DetachedRequest request) {
- resetUi(context, request);
- initialized = false;
- }
-
- protected abstract void initUi(DetachedContext context,
- DetachedRequest request);
-
- protected void resetUi(DetachedContext context, DetachedRequest request) {
-
- }
-
- public synchronized boolean isInitialized() {
- return initialized;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.detached.ui;
-
-import org.argeo.slc.detached.DetachedAnswer;
-import org.argeo.slc.detached.DetachedContext;
-import org.argeo.slc.detached.DetachedRequest;
-import org.argeo.slc.detached.DetachedStep;
-import org.springframework.beans.factory.BeanNameAware;
-
-public abstract class UiStep implements DetachedStep, BeanNameAware {
- private String beanName;
-
- public final DetachedAnswer execute(DetachedContext detachedContext,
- DetachedRequest detachedStepRequest) {
- // uiPart.init(detachedContext, detachedStepRequest);
- return executeUiStep(detachedContext, detachedStepRequest);
- }
-
- protected abstract DetachedAnswer executeUiStep(DetachedContext context,
- DetachedRequest request);
-
- public void setBeanName(String name) {
- this.beanName = name;
- }
-
- public String getBeanName() {
- return beanName;
- }
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
- xsi:schemaLocation="http://www.springframework.org/schema/osgi
- http://www.springframework.org/schema/osgi/spring-osgi.xsd
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-<!--
- <service id="slcDetached.service.driver.fileXmlCompat" ref="slcDetached.driver.fileXmlCompat"
- interface="org.argeo.slc.detached.DetachedDriver" />
- -->
- <service id="executionServer.service" ref="executionServer"
- interface="org.argeo.slc.detached.DetachedExecutionServer" />
-
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
-
- <import resource="classpath:/org/argeo/slc/detached/spring.xml" />
-
- <bean id="executionServer" class="org.argeo.slc.detached.DetachedExecutionServerImpl">
- </bean>
-
- <!--
- <bean id="slcDetached.driver.fileXmlCompat"
- parent="slcTemplate.detached.fileDriver"> <property name="baseDir"
- value="${slc.workDir}/detached" /> <property name="xmlConverter"
- ref="slcDefault.detached.xmlConverterCompat" /> </bean>
- -->
-</beans>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema
- targetNamespace="http://argeo.org/projects/slc/schemas/detached"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- xmlns:slc-det="http://argeo.org/projects/slc/schemas/detached">
-
- <xs:element name="detached-request">
- <xs:complexType>
- <xs:all>
- <xs:element name="uuid" type="xs:string" maxOccurs="1" />
- <xs:element name="ref" type="xs:string" minOccurs="0"
- maxOccurs="1" />
- <xs:element name="path" type="xs:string" minOccurs="0"
- maxOccurs="1" />
- <xs:element name="properties" minOccurs="0"
- maxOccurs="1" type="slc-det:PropertiesType" />
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="detached-answer">
- <xs:complexType>
- <xs:all>
- <xs:element name="uuid" type="xs:string" maxOccurs="1" />
- <xs:element name="status" minOccurs="0" maxOccurs="1">
- <xs:simpleType>
- <xs:restriction base="xs:integer">
- <xs:enumeration value="-1" />
- <xs:enumeration value="0" />
- <xs:enumeration value="1" />
- <xs:enumeration value="2" />
- <xs:enumeration value="10" />
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element name="log" type="xs:string" minOccurs="0"
- maxOccurs="1" />
- <xs:element name="properties" minOccurs="0"
- maxOccurs="1" type="slc-det:PropertiesType" />
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <xs:complexType name="PropertiesType">
- <xs:sequence>
- <xs:element name="prop" type="slc-det:PropType"
- minOccurs="0" maxOccurs="unbounded">
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="PropType">
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="key" type="xs:string"
- use="required" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
-
-</xs:schema>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
- default-lazy-init="true">
-
- <bean id="slcDefault.detached.admin.openSession" class="org.argeo.slc.detached.admin.OpenSession">
- </bean>
-
- <bean id="slcDefault.detached.admin.closeSession" class="org.argeo.slc.detached.admin.CloseSession">
- </bean>
-
- <bean id="slcDefault.detached.xmlConverterCompat" class="org.argeo.slc.detached.DetachedXmlConverterCompat">
- </bean>
-
- <bean id="slcTemplate.detached.fileDriver" class="org.argeo.slc.detached.drivers.FileDriver"
- abstract="true">
- </bean>
-
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.launcher</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Fri Aug 29 11:31:46 CEST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-source.. = src/main/java/,\
- src/main/resources/
+++ /dev/null
-NIX {
- com.sun.security.auth.module.UnixLoginModule required;
-};
-
-WINDOWS {
- com.sun.security.auth.module.NTLoginModule required;
-};
+++ /dev/null
-log4j.rootLogger=WARN, console
-#log4j.rootLogger=DEBUG, development
-
-## Levels
-log4j.logger.org.argeo=INFO
-
-log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
-log4j.logger.org.apache.jackrabbit.core.config.ConfigurationErrorHandler=ERROR
-log4j.logger.org.apache.jackrabbit.core.util.db.DbUtility=FATAL
-
-## Appenders
-# default appender
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %m%n
-
-# development appender
-log4j.appender.development=org.apache.log4j.ConsoleAppender
-log4j.appender.development.layout=org.apache.log4j.PatternLayout
-#log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%16.16t] %5p %m (%F:%L) %c%n
-log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p %m [%16.16t] %c%n
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.launcher</artifactId>
- <packaging>jar</packaging>
- <name>SLC Launcher</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/base.xml</descriptor>
- </descriptors>
- </configuration>
- <executions>
- <execution>
- <id>assembly-base</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Main-Class>org.argeo.slc.cli.SlcMain</Main-Class>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/base</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/base</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.commons.base</groupId>
- <artifactId>org.argeo.osgi.boot</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
- <id>base</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- </formats>
- <fileSets>
- <fileSet>
- <directory>target/base</directory>
- <outputDirectory></outputDirectory>
- <fileMode>0755</fileMode>
- <includes>
- <include>*.sh</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>target/base</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>*.bat</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>target/base</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>work/**</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
+++ /dev/null
-@echo off\r
-set ROOT_DIR=%~dp0\r
-set LIB_DIR=%ROOT_DIR%\lib\r
-set WORK_DIR=%ROOT_DIR%\work\%1\r
-\r
-TITLE %1\r
-\r
-cd %WORK_DIR%\r
-\r
-java %JAVA_OPTS% -jar "%LIB_DIR%\org.eclipse.osgi-${version.equinox}.jar" -clean -console -configuration "%WORK_DIR%\conf" -data "%WORK_DIR%\data"
\ No newline at end of file
+++ /dev/null
-#!/bin/sh
-INSTANCE=$1
-
-ROOT_DIR=`pwd`
-LIB_DIR=$ROOT_DIR/lib
-
-# Defaults
-if [ -z "$INSTANCE" ]; then
- INSTANCE=agent
-fi
-
-echo "Using configuration: $INSTANCE"
-
-WORK_DIR=$ROOT_DIR/work/$INSTANCE
-if [ -z "$JAVA_OPTS" ]; then
- JAVA_OPTS=-Xmx256m
-fi
-
-if [ -d "$WORK_DIR" ]; then
-cd $WORK_DIR
-java $JAVA_OPTS -jar $LIB_DIR/org.eclipse.osgi-${version.equinox}.jar \
- -clean -console \
- -configuration $WORK_DIR/conf \
- -data $WORK_DIR/data
-else
- echo "$WORK_DIR does not exist. Please specify a proper configuration name."
-fi
+++ /dev/null
-osgi.bundles=org.argeo.osgi.boot-${version.argeo-commons}.jar@start
-argeo.osgi.bundles=${osgi.install.area};in=*.jar
-argeo.osgi.start=org.springframework.osgi.extender,\
- org.argeo.slc.agent,\
- org.argeo.slc.agent.jms,\
- org.argeo.slc.support.equinox
-
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.cli;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.ServiceLoader;
-import java.util.UUID;
-
-import javax.security.auth.Subject;
-import javax.security.auth.login.LoginContext;
-
-import org.argeo.osgi.boot.OsgiBoot;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/** Configures an SLC runtime and runs a process. */
-public class SlcMain implements PrivilegedAction<String> {
- public final static String NIX = "NIX";
- public final static String WINDOWS = "WINDOWS";
- public final static String SOLARIS = "SOLARIS";
-
- public final static String os;
- public final static String slcDirName = ".slc";
- final static File homeDir = new File(System.getProperty("user.home"));
-
- static {
- String osName = System.getProperty("os.name");
- if (osName.startsWith("Win"))
- os = WINDOWS;
- else if (osName.startsWith("Solaris"))
- os = SOLARIS;
- else
- os = NIX;
- }
-
- private Long timeout = 30 * 1000l;
- private final String[] args;
- private final File confDir;
- private final File dataDir;
- private final File modulesDir;
-
- private final List<String> bundlesToStart = new ArrayList<String>();
-
- public SlcMain(String[] args, File confDir, File dataDir, File modulesDir) {
- this.args = args;
- this.confDir = confDir;
- this.dataDir = dataDir;
- this.modulesDir = modulesDir;
- bundlesToStart.add("org.springframework.osgi.extender");
- bundlesToStart.add("org.argeo.node.repo.jackrabbit");
- bundlesToStart.add("org.argeo.security.dao.os");
- bundlesToStart.add("org.argeo.slc.node.jackrabbit");
- bundlesToStart.add("org.argeo.slc.agent");
- bundlesToStart.add("org.argeo.slc.agent.jcr");
- if (args.length == 0)
- bundlesToStart.add("org.argeo.slc.support.equinox");
- // bundlesToStart.add("org.argeo.slc.agent.cli");
- }
-
- public String run() {
- long begin = System.currentTimeMillis();
-
- Framework framework = null;
- try {
- info("## Date : " + new Date());
- info("## Data : " + dataDir.getCanonicalPath());
-
- // Start Equinox
- ServiceLoader<FrameworkFactory> ff = ServiceLoader
- .load(FrameworkFactory.class);
- FrameworkFactory frameworkFactory = ff.iterator().next();
- Map<String, String> configuration = new HashMap<String, String>();
- configuration.put("osgi.configuration.area",
- confDir.getCanonicalPath());
- configuration.put("osgi.instance.area", dataDir.getCanonicalPath());
- // Do clean
- configuration.put("osgi.clean", "true");
- if (args.length == 0) {
- configuration.put("osgi.console", "");
- }
-
- // Spring configs currently require System properties
- System.getProperties().putAll(configuration);
-
- framework = frameworkFactory.newFramework(configuration);
- framework.start();
- BundleContext bundleContext = framework.getBundleContext();
-
- // OSGi bootstrap
- OsgiBoot osgiBoot = new OsgiBoot(bundleContext);
-
- // working copy modules
- if (modulesDir.exists())
- osgiBoot.installUrls(osgiBoot.getBundlesUrls(modulesDir
- .getCanonicalPath() + ";in=*;ex=.gitignore"));
-
- // system modules
- if (System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BUNDLES) != null)
- osgiBoot.installUrls(osgiBoot.getBundlesUrls(System
- .getProperty(OsgiBoot.PROP_ARGEO_OSGI_BUNDLES)));
- else
- osgiBoot.installUrls(osgiBoot.getBundlesUrls(System
- .getProperty("user.home") + "/.slc/modules/;in=**"));
-
- // Start runtime
- osgiBoot.startBundles(bundlesToStart);
-
- // Find SLC Agent
- ServiceReference sr = null;
- while (sr == null) {
- sr = bundleContext
- .getServiceReference("org.argeo.slc.execution.SlcAgentCli");
- if (System.currentTimeMillis() - begin > timeout)
- throw new RuntimeException("Cannot find SLC agent CLI");
- Thread.sleep(100);
- }
- Object agentCli = bundleContext.getService(sr);
-
- // Initialization completed
- long duration = System.currentTimeMillis() - begin;
- info("[[ Initialized in " + (duration / 1000) + "s "
- + (duration % 1000) + "ms ]]");
-
- if (args.length == 0)
- return null;// console mode
-
- // Subject.doAs(Subject.getSubject(AccessController.getContext()),
- // new AgentCliCall(agentCli));
- Class<?>[] parameterTypes = { String[].class };
- Method method = agentCli.getClass().getMethod("process",
- parameterTypes);
- Object[] methodArgs = { args };
- Object ret = method.invoke(agentCli, methodArgs);
-
- // Shutdown OSGi runtime
- framework.stop();
- framework.waitForStop(60 * 1000);
-
- return ret.toString();
- } catch (Exception e) {
- // Shutdown OSGi runtime
- if (framework != null)
- try {
- framework.stop();
- framework.waitForStop(15 * 1000);
- } catch (Exception silent) {
- }
- throw new RuntimeException("Cannot run SLC command line", e);
- } finally {
-
- }
- }
-
- public static void main(String[] args) {
- try {
- // Prepare directories
- File executionDir = new File(System.getProperty("user.dir"));
- File slcDir;
- Boolean isTransient = false;
- if (isTransient) {
- File tempDir = new File(System.getProperty("java.io.tmpdir")
- + "/" + System.getProperty("user.name"));
- slcDir = new File(tempDir, "slc-"
- + UUID.randomUUID().toString());
- slcDir.mkdirs();
- System.setProperty("argeo.node.repo.configuration",
- "osgibundle:repository-memory.xml");
- } else {
- slcDir = findSlcDir(executionDir);
- if (slcDir == null) {
- slcDir = new File(executionDir, slcDirName);
- slcDir.mkdirs();
- info("## Creating an SLC node at " + slcDir + " ...");
- }
- }
-
- File dataDir = new File(slcDir, "data");
- if (!dataDir.exists())
- dataDir.mkdirs();
-
- File confDir = new File(slcDir, "conf");
- if (!confDir.exists())
- confDir.mkdirs();
-
- File modulesDir = new File(slcDir, "modules");
-
- // JAAS
- File jaasFile = new File(confDir, "jaas.config");
- if (!jaasFile.exists())
- copyResource("/org/argeo/slc/cli/jaas.config", jaasFile);
- System.setProperty("java.security.auth.login.config",
- jaasFile.getCanonicalPath());
-
- // log4j
- File log4jFile = new File(confDir, "log4j.properties");
- if (!log4jFile.exists())
- copyResource("/org/argeo/slc/cli/log4j.properties", log4jFile);
- System.setProperty("log4j.configuration",
- "file://" + log4jFile.getCanonicalPath());
- // Run as a privileged action
- LoginContext lc = new LoginContext(os);
- lc.login();
-
- Subject subject = Subject.getSubject(AccessController.getContext());
- Subject.doAs(subject, new SlcMain(args, confDir, dataDir,
- modulesDir));
-
- if (args.length != 0)
- System.exit(0);
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- /**
- * Recursively look in parent directories for a directory named
- * {@link #slcDirName}
- */
- protected static File findSlcDir(File currentDir) {
- File slcDir = new File(currentDir, slcDirName);
- // covers the use case of running from the home directory
- if (slcDir.exists() && slcDir.isDirectory())
- return slcDir;
- File parentDir = currentDir.getParentFile();
- if (parentDir == null)
- return null;
- try {
- // ~/.slc reserved for agent
- if (parentDir.getCanonicalPath().equals(homeDir.getCanonicalPath()))
- return null;
- } catch (IOException e) {
- throw new RuntimeException("Cannot check home directory", e);
- }
- return findSlcDir(parentDir);
- }
-
- protected static void copyResource(String resource, File targetFile) {
- InputStream input = null;
- FileOutputStream output = null;
- try {
- input = SlcMain.class.getResourceAsStream(resource);
- output = new FileOutputStream(targetFile);
- byte[] buf = new byte[8192];
- while (true) {
- int length = input.read(buf);
- if (length < 0)
- break;
- output.write(buf, 0, length);
- }
- } catch (Exception e) {
- throw new RuntimeException("Cannot write " + resource + " file to "
- + targetFile, e);
- } finally {
- try {
- input.close();
- } catch (Exception ignore) {
- }
- try {
- output.close();
- } catch (Exception ignore) {
- }
- }
-
- }
-
- protected static void info(Object msg) {
- System.out.println(msg);
- }
-
- protected static void err(Object msg) {
- System.err.println(msg);
- }
-
- protected static void debug(Object msg) {
- System.out.println(msg);
- }
-
-}
-
-// private String bundlesToInstall = System.getProperty("user.home")
-// +
-// "/dev/src/slc/dep/org.argeo.slc.dep.minimal/target/dependency;in=*.jar,"
-// + System.getProperty("user.home")
-// + "/dev/src/slc/demo/modules;in=*;ex=pom.xml;ex=.svn";
-
-// ServiceTracker agentTracker = new ServiceTracker(bundleContext,
-// "org.argeo.slc.execution.SlcAgentCli", null);
-// agentTracker.open();
-// final Object agentCli = agentTracker.waitForService(30 * 1000);
-// if (agentCli == null)
-// throw new RuntimeException("Cannot find SLC agent CLI");
-
-// protected class AgentCliCall implements PrivilegedAction<String> {
-// private final Object agentCli;
-//
-// public AgentCliCall(Object agentCli) {
-// super();
-// this.agentCli = agentCli;
-// }
-//
-// public String run() {
-// try {
-// Class<?>[] parameterTypes = { String[].class };
-// Method method = agentCli.getClass().getMethod("process",
-// parameterTypes);
-// Object[] methodArgs = { args };
-// Object ret = method.invoke(agentCli, methodArgs);
-// return ret.toString();
-// } catch (Exception e) {
-// throw new RuntimeException("Cannot run "
-// + Arrays.toString(args) + " on " + agentCli, e);
-// }
-// }
-//
-// }
-
+++ /dev/null
-NIX {
- com.sun.security.auth.module.UnixLoginModule required;
-};
-
-WINDOWS {
- com.sun.security.auth.module.NTLoginModule required;
-};
+++ /dev/null
-log4j.rootLogger=WARN, console
-#log4j.rootLogger=DEBUG, development
-
-## Levels
-log4j.logger.org.argeo=INFO
-
-log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
-log4j.logger.org.apache.jackrabbit.core.config.ConfigurationErrorHandler=ERROR
-log4j.logger.org.apache.jackrabbit.core.util.db.DbUtility=FATAL
-
-## Appenders
-# default appender
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %m%n
-
-# development appender
-log4j.appender.development=org.apache.log4j.ConsoleAppender
-log4j.appender.development.layout=org.apache.log4j.PatternLayout
-log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p %m [%16.16t] %c%n
+++ /dev/null
-Argeo SLC Site
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>\r
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>\r
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.lib.detached</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Fri Aug 29 11:31:46 CEST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-additional.bundles = org.springframework.xml,\
- org.argeo.slc.unit,\
- junit
-source.. = src/main/java/,\
- src/main/resources/,\
- src/test/java/,\
- src/test/resources/
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.lib.detached</artifactId>
- <name>SLC Lib Detached</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.*
- </Export-Package>
- <Import-Package>javax.xml.*;version="0.0.0",org.argeo.slc.ant.*;resolution:="optional",*</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.support.simple</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.detached</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.oxm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.castor</artifactId>
- </dependency>
-
- <!-- Unit Tests -->
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.unit</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.lib.detached;
-
-import java.util.Properties;
-import java.util.UUID;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.SlcException;
-import org.argeo.slc.detached.DetachedAnswer;
-import org.argeo.slc.detached.DetachedClient;
-import org.argeo.slc.detached.DetachedRequest;
-
-public class DetachedAdminTask implements Runnable {
- private final static Log log = LogFactory.getLog(DetachedAdminTask.class);
-
- private String action;
- private DetachedClient client;
- private Properties properties;
-
- public void run() {
- // Prepare and send request
- DetachedRequest request = new DetachedRequest(UUID.randomUUID()
- .toString());
- request.setRef(action);
-
- if (properties != null) {
- request.setProperties(properties);
- }
-
- try {
- client.sendRequest(request);
- DetachedAnswer answer = client.receiveAnswer();
- if (answer.getStatus() == DetachedAnswer.ERROR)
- throw new SlcException("Error when executing request "
- + answer.getUuid() + ": " + answer.getLog());
- else
- log.info("Admin answer: " + answer.getLog());
- } catch (Exception e) {
- throw new SlcException("Could not send request.", e);
- }
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public void setClient(DetachedClient detachedClient) {
- this.client = detachedClient;
- }
-
- public void setProperties(Properties properties) {
- this.properties = properties;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.lib.detached;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.SlcException;
-import org.argeo.slc.core.execution.tasks.JvmProcess;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.context.ResourceLoaderAware;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.ResourceLoader;
-import org.springframework.osgi.context.BundleContextAware;
-
-public class DetachedLauncher extends JvmProcess implements BundleContextAware,
- InitializingBean, ResourceLoaderAware {
- private final static Log log = LogFactory.getLog(DetachedLauncher.class);
-
- private BundleContext bundleContext = null;
- private ResourceLoader resourceLoader = null;
-
- private Resource osgiFramework = null;
- private String osgibootBundleName = "org.argeo.osgi.boot";
- private String equinoxBundleName = "org.eclipse.osgi";
- private String xmlapisBundleName = "org.apache.xmlcommons";
- private String xercesBundleName = "org.apache.xerces";
-
- private List<String> excludeBundleNames = new ArrayList<String>();
- private List<String> includeBundleUrls = new ArrayList<String>();
-
- /**
- * Required by Spring for JDK 1.4. see
- * http://forum.springsource.org/showthread.php?t=74555
- */
- private Boolean prependXmlJars = false;
-
- public DetachedLauncher() {
- // Override defaults
- setSynchronous(false);
- setMainClass("org.argeo.osgi.boot.Launcher");
- }
-
- public void afterPropertiesSet() throws Exception {
- if (bundleContext == null)
- throw new SlcException("An OSGi bundle context is required.");
-
- // Equinox jar
- if (osgiFramework == null)
- getClasspath()
- .add(asResource(System.getProperty("osgi.framework")));
- else
- getClasspath().add(osgiFramework);
-
- StringBuffer osgiBundles = new StringBuffer("");
- StringBuffer osgiLocations = new StringBuffer("");
- bundles: for (Bundle bundle : bundleContext.getBundles()) {
- String name = bundle.getSymbolicName();
-
- if (excludeBundleNames.contains(name)) {
- if (log.isDebugEnabled())
- log.debug("Exclude bundle " + name);
- continue bundles;// skip excluded
- }
-
- String originalLocation = bundle.getLocation();
- if (log.isTraceEnabled())
- log.trace("Original location of bundle " + name + ": "
- + originalLocation);
- String location = removeInitialReference(originalLocation);
-
- // Special bundles
- if (osgibootBundleName.equals(name))
- getClasspath().add(asResource(location));
- else if (equinoxBundleName.equals(name))
- continue bundles;// skip framework
- else if (xmlapisBundleName.equals(name) && prependXmlJars)
- getPBootClasspath().add(asResource(location));
- else if (xercesBundleName.equals(name) && prependXmlJars)
- getPBootClasspath().add(asResource(location));
-
- if (location.startsWith("file:")) {
- File file = new File(location.substring("file:".length()));
- if (osgiLocations.length() != 0)
- osgiLocations.append(File.pathSeparatorChar);
- location = file.getPath().replace('/', File.separatorChar);
- osgiLocations.append(location);
- if (log.isTraceEnabled())
- log.trace("Added bundle " + name
- + " to argeo.osgi.locations: " + location);
- } else {
- if (osgiBundles.length() != 0)
- osgiBundles.append(',');
- location = location.replace('/', File.separatorChar);
- osgiBundles.append(location);
- if (log.isTraceEnabled())
- log.trace("Added bundle " + name + " to osgi.bundles: "
- + location);
- }
- }
-
- for (String url : includeBundleUrls) {
- if (osgiBundles.length() != 0)
- osgiBundles.append(',');
- osgiBundles.append(url);
- if (log.isDebugEnabled())
- log.debug("Include url" + url);
- }
-
- getSystemProperties().setProperty("osgi.bundles",
- osgiBundles.toString());
- getSystemProperties().setProperty("argeo.osgi.locations",
- osgiLocations.toString());
-
- super.afterPropertiesSet();
- }
-
- protected String removeInitialReference(String location) {
- if (location.startsWith("initial@reference:file:"))
- location = System.getProperty("osgi.install.area")
- + location.substring("initial@reference:file:".length());
- if (location.charAt(location.length() - 1) == '/')
- location.substring(0, location.length() - 1);
- return location;
- }
-
- protected Resource asResource(String location) {
- // Resource res = resourceLoader.getResource(location);
-
- final Resource res;
- if (location.startsWith("file:")) {
- File file = new File(location.substring("file:".length()));
- if (!file.exists())
- throw new SlcException("File " + file + " does not exist");
-
- try {
- res = new FileSystemResource(file.getCanonicalFile());
- } catch (IOException e) {
- throw new SlcException("Cannot create resource based on "
- + file, e);
- }
- } else
- res = resourceLoader.getResource(location);
-
- if (log.isDebugEnabled())
- log.debug("Converted " + location + " to " + res);
- return res;
- }
-
- public void setBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
- public void setResourceLoader(ResourceLoader resourceLoader) {
- this.resourceLoader = resourceLoader;
- }
-
- public void setOsgibootBundleName(String osgibootBundleName) {
- this.osgibootBundleName = osgibootBundleName;
- }
-
- public void setXmlapisBundleName(String xmlapisBundleName) {
- this.xmlapisBundleName = xmlapisBundleName;
- }
-
- public void setXercesBundleName(String xercesBundleName) {
- this.xercesBundleName = xercesBundleName;
- }
-
- public void setOsgiFramework(Resource osgiFramework) {
- this.osgiFramework = osgiFramework;
- }
-
- public void setEquinoxBundleName(String equinoxBundleName) {
- this.equinoxBundleName = equinoxBundleName;
- }
-
- public void setPrependXmlJars(Boolean prependXmlJars) {
- this.prependXmlJars = prependXmlJars;
- }
-
- public void setExcludeBundleNames(List<String> excludeBundleNames) {
- this.excludeBundleNames = excludeBundleNames;
- }
-
- public void setIncludeBundleUrls(List<String> includeBundleUrls) {
- this.includeBundleUrls = includeBundleUrls;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.lib.detached;
-
-import org.argeo.slc.core.test.context.DefaultContextTestData;
-
-/**
- * @deprecated
- *
- */
-public class DetachedTestData extends DefaultContextTestData {
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.lib.detached;
-
-import java.util.Map;
-import java.util.Properties;
-import java.util.UUID;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.SlcException;
-import org.argeo.slc.core.test.SimpleResultPart;
-import org.argeo.slc.core.test.context.ContextUtils;
-import org.argeo.slc.core.test.context.DefaultContextTestData;
-import org.argeo.slc.detached.DetachedAnswer;
-import org.argeo.slc.detached.DetachedClient;
-import org.argeo.slc.detached.DetachedRequest;
-import org.argeo.slc.detached.DetachedStep;
-import org.argeo.slc.detached.ui.UiStep;
-import org.argeo.slc.test.TestDefinition;
-import org.argeo.slc.test.TestResult;
-import org.argeo.slc.test.TestRun;
-import org.argeo.slc.test.TestStatus;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.PropertyValue;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.BeanFactoryAware;
-import org.springframework.beans.factory.BeanInitializationException;
-import org.springframework.beans.factory.BeanNameAware;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.BeanReference;
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-
-public class DetachedTestDefinition implements TestDefinition, BeanNameAware,
- BeanFactoryAware, InitializingBean {
- private final static Log log = LogFactory
- .getLog(DetachedTestDefinition.class);
-
- private DetachedStep step;
- private DetachedClient client;
-
- // Spring properties
- private String testDefBeanName = null;
- private BeanDefinitionRegistry beanDefinitionRegistry = null;
- private String stepRef = null;
-
- public void execute(TestRun testRun) {
- // Look for step bean name
- String stepBeanNameT = null;
- if (this.stepRef == null && step != null) {
- if (step instanceof UiStep) {
- stepBeanNameT = ((UiStep) step).getBeanName();
- } else {
- // Introspects bean factory in order to find step bean name
- BeanDefinition thisBeanDef = beanDefinitionRegistry
- .getBeanDefinition(testDefBeanName);
- PropertyValue propValue = thisBeanDef.getPropertyValues()
- .getPropertyValue("step");
- Object stepBeanRef = propValue.getValue();
- BeanReference ref = (BeanReference) stepBeanRef;
- stepBeanNameT = ref.getBeanName();
- }
- } else if (this.stepRef != null) {
- stepBeanNameT = this.stepRef;
- }
-
- // Execute
- DetachedRequest request = new DetachedRequest();
- request.setUuid(UUID.randomUUID().toString());
- request.setRef(stepBeanNameT);
-
- DefaultContextTestData testData = testRun.getTestData();
- if (testData != null) {
- Map<String, Object> values = testData.getValues();
- Properties inputParameters = new Properties();
- inputParameters.putAll(values);// TODO: check conversions to string
- request.setProperties(inputParameters);
- }
-
- try {
- client.sendRequest(request);
- } catch (Exception e) {
- throw new SlcException("Could not send request for step "
- + stepBeanNameT, e);
- }
-
- DetachedAnswer answer;
- try {
- answer = client.receiveAnswer();
- } catch (Exception e) {
- throw new SlcException("Could not receive answer #"
- + request.getUuid() + " for step " + stepBeanNameT, e);
- }
-
- if (answer.getStatus() == DetachedAnswer.ERROR)
- throw new SlcException("Error when executing step "
- + answer.getUuid() + ": " + answer.getLog());
- else
- log.info("Received answer for '" + request.getRef() + "' ("
- + answer.getStatusAsString() + "):" + answer.getLog());
-
- if (testData != null) {
- Properties outputParameters = answer.getProperties();
- for (Object key : outputParameters.keySet())
- testData.getValues().put(key.toString(),
- outputParameters.get(key));
- }
-
- if (testData != null) {
- ContextUtils.compareReachedExpected(testData,
- testRun.getTestResult());
- } else {
- ((TestResult) testRun.getTestResult())
- .addResultPart(new SimpleResultPart(TestStatus.PASSED,
- "Step " + stepBeanNameT + " executed successfully"));
- }
- }
-
- public void setBeanName(String name) {
- this.testDefBeanName = name;
- }
-
- public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
- if (beanFactory instanceof BeanDefinitionRegistry)
- beanDefinitionRegistry = (BeanDefinitionRegistry) beanFactory;
- else
- throw new BeanInitializationException(
- "Require BeanDefinitionRegistry");
- }
-
- public void afterPropertiesSet() throws Exception {
- }
-
- public void setStep(DetachedStep step) {
- this.step = step;
- }
-
- public void setClient(DetachedClient client) {
- this.client = client;
- }
-
- public void setStepRef(String stepBeanName) {
- this.stepRef = stepBeanName;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.lib.detached;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-
-import org.argeo.slc.SlcException;
-import org.argeo.slc.detached.DetachedAnswer;
-import org.argeo.slc.detached.DetachedCommunication;
-import org.argeo.slc.detached.DetachedException;
-import org.argeo.slc.detached.DetachedRequest;
-import org.argeo.slc.detached.DetachedXmlConverter;
-import org.springframework.oxm.Marshaller;
-import org.springframework.oxm.Unmarshaller;
-
-public class DetachedXmlConverterSpring implements DetachedXmlConverter {
- private Marshaller marshaller;
- private Unmarshaller unmarshaller;
-
- public void marshallCommunication(DetachedCommunication detCom,
- Result result) {
- if (detCom instanceof DetachedRequest) {
- marshallRequest((DetachedRequest) detCom, result);
- } else if (detCom instanceof DetachedAnswer) {
- marshallAnswer((DetachedAnswer) detCom, result);
- } else {
- throw new DetachedException("Unkown communication type "
- + detCom.getClass());
- }
- }
-
- public DetachedCommunication unmarshallCommunication(Source source) {
- try {
- return (DetachedCommunication) unmarshaller.unmarshal(source);
- } catch (Exception e) {
- throw new SlcException("Could not unmarshall", e);
- }
- }
-
- public void marshallRequest(DetachedRequest request, Result result) {
- try {
- marshaller.marshal(request, result);
- } catch (Exception e) {
- throw new SlcException("Could not marshall", e);
- }
- }
-
- public void marshallAnswer(DetachedAnswer answer, Result result) {
- try {
- marshaller.marshal(answer, result);
- } catch (Exception e) {
- throw new SlcException("Could not marshall", e);
- }
- }
-
- public void setMarshaller(Marshaller marshaller) {
- this.marshaller = marshaller;
- }
-
- public void setUnmarshaller(Unmarshaller unmarshaller) {
- this.unmarshaller = unmarshaller;
- }
-
-}
+++ /dev/null
-<?xml version="1.0"?>
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<!DOCTYPE doc [
-<!ENTITY slc-detached-namespace-uri "http://argeo.org/projects/slc/schemas/detached">
-<!ENTITY slc-detached-namespace-prefix "slc-det">
-]>
-
-<mapping>
- <description>Mapping of SLC detached types</description>
-
- <class name="org.argeo.slc.detached.DetachedRequest">
- <map-to ns-uri="&slc-detached-namespace-uri;"
- ns-prefix="&slc-detached-namespace-prefix;" />
- <field name="uuid" />
- <field name="ref" />
- <field name="properties" collection="map">
- <bind-xml name="prop" location="properties">
- <class name="org.exolab.castor.mapping.MapItem">
- <map-to ns-uri="&slc-detached-namespace-uri;"
- ns-prefix="&slc-detached-namespace-prefix;" />
- <field name="key" type="string">
- <bind-xml name="key" node="attribute" />
- </field>
- <field name="value" type="string">
- <bind-xml node="text" />
- </field>
- </class>
- </bind-xml>
- </field>
- </class>
-
- <class name="org.argeo.slc.detached.DetachedAnswer">
- <map-to ns-uri="&slc-detached-namespace-uri;"
- ns-prefix="&slc-detached-namespace-prefix;" />
- <field name="uuid" />
- <field name="status" />
- <field name="log" />
- <field name="properties" collection="map">
- <bind-xml name="prop" location="properties">
- <class name="org.exolab.castor.mapping.MapItem">
- <map-to ns-uri="&slc-detached-namespace-uri;"
- ns-prefix="&slc-detached-namespace-prefix;" />
- <field name="key" type="string">
- <bind-xml name="key" node="attribute" />
- </field>
- <field name="value" type="string">
- <bind-xml node="text" />
- </field>
- </class>
- </bind-xml>
- </field>
- </class>
-</mapping>
\ No newline at end of file
+++ /dev/null
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
- default-lazy-init="true">
-
- <bean id="slcTemplate.detached.testDefinition"
- class="org.argeo.slc.lib.detached.DetachedTestDefinition"
- abstract="true">
- </bean>
-
- <bean id="slcDefault.detached.xmlConverterCastor"
- class="org.argeo.slc.lib.detached.DetachedXmlConverterSpring">
- <property name="marshaller"
- ref="slcDefault.detached.castor.marshaller" />
- <property name="unmarshaller"
- ref="slcDefault.detached.castor.marshaller" />
- </bean>
-
- <bean id="slcDefault.detached.castor.marshaller"
- class="org.springframework.oxm.castor.CastorMarshaller">
- <property name="mappingLocations">
- <list>
- <value>
- classpath:org/argeo/slc/lib/detached/castor.xml
- </value>
- </list>
- </property>
- <property name="whitespacePreserve" value="true" />
- </bean>
-
- <bean id="slcDefault.detached.xml.xsdValidator"
- factory-bean="slcDefault.detached.xml.xsdSchema"
- factory-method="createValidator" />
-
- <bean id="slcDefault.detached.xml.xsdSchema"
- class="org.springframework.xml.xsd.SimpleXsdSchema">
- <property name="xsd"
- value="classpath:/org/argeo/slc/detached/slc-detached.xsd" />
- </bean>
-
-</beans>
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.lib.detached;
-
-import java.util.Enumeration;
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.detached.DetachedAnswer;
-import org.argeo.slc.detached.DetachedRequest;
-import org.argeo.slc.detached.DetachedXmlConverter;
-import org.argeo.slc.detached.DetachedXmlConverterCompat;
-import org.argeo.slc.unit.AbstractSpringTestCase;
-import org.argeo.slc.unit.UnitXmlUtils;
-import org.springframework.xml.transform.StringResult;
-import org.springframework.xml.transform.StringSource;
-import org.springframework.xml.validation.XmlValidator;
-
-public class DetachedCastorTest extends AbstractSpringTestCase {
- private final Log log = LogFactory.getLog(getClass());
-
- private DetachedXmlConverter converter = null;
- private XmlValidator validator = null;
- private DetachedXmlConverter converterCompat = null;
-
- public void setUp() {
- converter = getBean("slcDefault.detached.xmlConverterCastor");
- validator = getBean("slcDefault.detached.xml.xsdValidator");
- converterCompat = new DetachedXmlConverterCompat();
- }
-
- public void testRequest() throws Exception {
- DetachedRequest request = createTestRequest();
-
- StringResult result = new StringResult();
- converter.marshallCommunication(request, result);
- String xml = result.toString();
- log.debug(xml + "\n");
-
- UnitXmlUtils.assertXmlValidation(validator, new StringSource(xml));
- DetachedRequest requestUnm = (DetachedRequest) converter
- .unmarshallCommunication(new StringSource(xml));
- assertDetachedRequest(request, requestUnm);
- }
-
- public void testRequestCompat() throws Exception {
- DetachedRequest request = createTestRequest();
-
- StringResult result = new StringResult();
- converter.marshallCommunication(request, result);
- String xml = result.toString();
- log.debug(xml + "\n");
-
- UnitXmlUtils.assertXmlValidation(validator, new StringSource(xml));
- DetachedRequest requestUnm = (DetachedRequest) converterCompat
- .unmarshallCommunication(new StringSource(xml));
- assertDetachedRequest(request, requestUnm);
- }
-
- public void testAnswer() throws Exception {
- DetachedAnswer answer = createTestAnswer();
- StringResult result = new StringResult();
- converter.marshallCommunication(answer, result);
- String xml = result.toString();
- log.debug(xml + "\n");
-
- UnitXmlUtils.assertXmlValidation(validator, new StringSource(xml));
- DetachedAnswer answerUnm = (DetachedAnswer) converter
- .unmarshallCommunication(new StringSource(xml));
- assertDetachedAnswer(answer, answerUnm);
- }
-
- public void testAnswerCompat() throws Exception {
- DetachedAnswer answer = createTestAnswer();
- StringResult result = new StringResult();
- converterCompat.marshallCommunication(answer, result);
- String xml = result.toString();
- log.debug(xml + "\n");
-
- UnitXmlUtils.assertXmlValidation(validator, new StringSource(xml));
- DetachedAnswer answerUnm = (DetachedAnswer) converter
- .unmarshallCommunication(new StringSource(xml));
- assertDetachedAnswer(answer, answerUnm);
- }
-
- public static DetachedRequest createTestRequest() {
- DetachedRequest request = new DetachedRequest();
- request.setUuid("12345");
- request.setRef("testRef");
- Properties properties = new Properties();
- properties.setProperty("key1", "value1");
- properties.setProperty("key2", "value2");
- request.setProperties(properties);
- return request;
- }
-
- public static DetachedAnswer createTestAnswer() {
- DetachedAnswer answer = new DetachedAnswer();
- answer.setUuid("12345");
- answer.setStatus(DetachedAnswer.PROCESSED);
- answer.setLog("my log\nline break.");
- Properties properties = new Properties();
- properties.setProperty("key1", "value1");
- properties.setProperty("key2", "value2");
- answer.setProperties(properties);
- return answer;
- }
-
- public static void assertDetachedRequest(DetachedRequest expected,
- DetachedRequest reached) {
- assertEquals(expected.getUuid(), reached.getUuid());
- assertEquals(expected.getRef(), reached.getRef());
- Properties expectedProps = expected.getProperties();
- Properties reachedProps = reached.getProperties();
- assertEquals(expectedProps.size(), reachedProps.size());
- Enumeration<Object> keys = expectedProps.keys();
- while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
- assertTrue(reachedProps.containsKey(key));
- assertEquals(expectedProps.getProperty(key), reachedProps
- .getProperty(key));
- }
- }
-
- public static void assertDetachedAnswer(DetachedAnswer expected,
- DetachedAnswer reached) {
- assertEquals(expected.getUuid(), reached.getUuid());
- assertEquals(expected.getStatus(), reached.getStatus());
- assertEquals(expected.getLog(), reached.getLog());
- Properties expectedProps = expected.getProperties();
- Properties reachedProps = reached.getProperties();
- assertEquals(expectedProps.size(), reachedProps.size());
- Enumeration<Object> keys = expectedProps.keys();
- while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
- assertTrue(reachedProps.containsKey(key));
- assertEquals(expectedProps.getProperty(key), reachedProps
- .getProperty(key));
- }
- }
-}
+++ /dev/null
-# Set root logger level to DEBUG and its only appender to A1.\r
-log4j.rootLogger=WARN, console\r
-\r
-## Levels\r
-# Slc\r
-log4j.logger.org.argeo=DEBUG\r
-\r
-# Castor\r
-log4j.logger.org.exolab.castor=WARN\r
-\r
-# Spring\r
-log4j.logger.org.springframework=WARN\r
-\r
-## Appenders\r
-# A1 is set to be a ConsoleAppender.\r
-log4j.appender.console=org.apache.log4j.ConsoleAppender\r
-\r
-# A1 uses PatternLayout.\r
-log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
-\r
+++ /dev/null
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <import resource="classpath:/org/argeo/slc/lib/detached/spring.xml" />
-
-</beans>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.repo</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+++ /dev/null
-#Sat Feb 05 12:23:06 CET 2011
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
+++ /dev/null
-source.. = src/main/java/
-output.. = target/classes/
-bin.includes = META-INF/,\
- .
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.repo</artifactId>
- <name>SLC Repo Runtime</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.repo.*
- </Export-Package>
- <Import-Package>
- org.w3c.dom.*;version="0.0.0",
- org.xml.sax.*;version="0.0.0",
- javax.xml.transform.*;version="0.0.0",
- javax.xml.parsers.*;version="0.0.0",
- javax.jcr.nodetype,
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <!-- SLC Runtime -->
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.support.aether</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.support.jcr</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <!-- Commons -->
- <dependency>
- <groupId>org.argeo.commons.server</groupId>
- <artifactId>org.argeo.server.jcr</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
-
- <!-- Third party -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.org.apache.commons.logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>javax.servlet</artifactId>
- </dependency>
-
- <!-- OSGi -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>biz.aQute.bndlib</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- RPM -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.redline_rpm</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-###############################################################################
-# Copyright (c) 2003, 2008 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-org.osgi.framework.system.packages = \
- javax.accessibility,\
- javax.activation,\
- javax.activity,\
- javax.annotation,\
- javax.annotation.processing,\
- javax.crypto,\
- javax.crypto.interfaces,\
- javax.crypto.spec,\
- javax.imageio,\
- javax.imageio.event,\
- javax.imageio.metadata,\
- javax.imageio.plugins.bmp,\
- javax.imageio.plugins.jpeg,\
- javax.imageio.spi,\
- javax.imageio.stream,\
- javax.jws,\
- javax.jws.soap,\
- javax.lang.model,\
- javax.lang.model.element,\
- javax.lang.model.type,\
- javax.lang.model.util,\
- javax.management,\
- javax.management.loading,\
- javax.management.modelmbean,\
- javax.management.monitor,\
- javax.management.openmbean,\
- javax.management.relation,\
- javax.management.remote,\
- javax.management.remote.rmi,\
- javax.management.timer,\
- javax.naming,\
- javax.naming.directory,\
- javax.naming.event,\
- javax.naming.ldap,\
- javax.naming.spi,\
- javax.net,\
- javax.net.ssl,\
- javax.print,\
- javax.print.attribute,\
- javax.print.attribute.standard,\
- javax.print.event,\
- javax.rmi,\
- javax.rmi.CORBA,\
- javax.rmi.ssl,\
- javax.script,\
- javax.security.auth,\
- javax.security.auth.callback,\
- javax.security.auth.kerberos,\
- javax.security.auth.login,\
- javax.security.auth.spi,\
- javax.security.auth.x500,\
- javax.security.cert,\
- javax.security.sasl,\
- javax.sound.midi,\
- javax.sound.midi.spi,\
- javax.sound.sampled,\
- javax.sound.sampled.spi,\
- javax.sql,\
- javax.sql.rowset,\
- javax.sql.rowset.serial,\
- javax.sql.rowset.spi,\
- javax.swing,\
- javax.swing.border,\
- javax.swing.colorchooser,\
- javax.swing.event,\
- javax.swing.filechooser,\
- javax.swing.plaf,\
- javax.swing.plaf.basic,\
- javax.swing.plaf.metal,\
- javax.swing.plaf.multi,\
- javax.swing.plaf.synth,\
- javax.swing.table,\
- javax.swing.text,\
- javax.swing.text.html,\
- javax.swing.text.html.parser,\
- javax.swing.text.rtf,\
- javax.swing.tree,\
- javax.swing.undo,\
- javax.tools,\
- javax.transaction,\
- javax.transaction.xa,\
- javax.xml,\
- javax.xml.bind,\
- javax.xml.bind.annotation,\
- javax.xml.bind.annotation.adapters,\
- javax.xml.bind.attachment,\
- javax.xml.bind.helpers,\
- javax.xml.bind.util,\
- javax.xml.crypto,\
- javax.xml.crypto.dom,\
- javax.xml.crypto.dsig,\
- javax.xml.crypto.dsig.dom,\
- javax.xml.crypto.dsig.keyinfo,\
- javax.xml.crypto.dsig.spec,\
- javax.xml.datatype,\
- javax.xml.namespace,\
- javax.xml.parsers,\
- javax.xml.soap,\
- javax.xml.stream,\
- javax.xml.stream.events,\
- javax.xml.stream.util,\
- javax.xml.transform,\
- javax.xml.transform.dom,\
- javax.xml.transform.sax,\
- javax.xml.transform.stax,\
- javax.xml.transform.stream,\
- javax.xml.validation,\
- javax.xml.ws,\
- javax.xml.ws.handler,\
- javax.xml.ws.handler.soap,\
- javax.xml.ws.http,\
- javax.xml.ws.soap,\
- javax.xml.ws.spi,\
- javax.xml.ws.wsaddressing,\
- javax.xml.xpath,\
- org.ietf.jgss,\
- org.omg.CORBA,\
- org.omg.CORBA_2_3,\
- org.omg.CORBA_2_3.portable,\
- org.omg.CORBA.DynAnyPackage,\
- org.omg.CORBA.ORBPackage,\
- org.omg.CORBA.portable,\
- org.omg.CORBA.TypeCodePackage,\
- org.omg.CosNaming,\
- org.omg.CosNaming.NamingContextExtPackage,\
- org.omg.CosNaming.NamingContextPackage,\
- org.omg.Dynamic,\
- org.omg.DynamicAny,\
- org.omg.DynamicAny.DynAnyFactoryPackage,\
- org.omg.DynamicAny.DynAnyPackage,\
- org.omg.IOP,\
- org.omg.IOP.CodecFactoryPackage,\
- org.omg.IOP.CodecPackage,\
- org.omg.Messaging,\
- org.omg.PortableInterceptor,\
- org.omg.PortableInterceptor.ORBInitInfoPackage,\
- org.omg.PortableServer,\
- org.omg.PortableServer.CurrentPackage,\
- org.omg.PortableServer.POAManagerPackage,\
- org.omg.PortableServer.POAPackage,\
- org.omg.PortableServer.portable,\
- org.omg.PortableServer.ServantLocatorPackage,\
- org.omg.SendingContext,\
- org.omg.stub.java.rmi,\
- org.w3c.dom,\
- org.w3c.dom.bootstrap,\
- org.w3c.dom.css,\
- org.w3c.dom.events,\
- org.w3c.dom.html,\
- org.w3c.dom.ls,\
- org.w3c.dom.ranges,\
- org.w3c.dom.stylesheets,\
- org.w3c.dom.traversal,\
- org.w3c.dom.views,\
- org.w3c.dom.xpath,\
- org.xml.sax,\
- org.xml.sax.ext,\
- org.xml.sax.helpers
-org.osgi.framework.bootdelegation = \
- javax.*,\
- org.ietf.jgss,\
- org.omg.*,\
- org.w3c.*,\
- org.xml.*,\
- sun.*,\
- com.sun.*
-org.osgi.framework.executionenvironment = \
- OSGi/Minimum-1.0,\
- OSGi/Minimum-1.1,\
- OSGi/Minimum-1.2,\
- JRE-1.1,\
- J2SE-1.2,\
- J2SE-1.3,\
- J2SE-1.4,\
- J2SE-1.5,\
- JavaSE-1.6
-osgi.java.profile.name = JavaSE-1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.source=1.6
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+++ /dev/null
-###############################################################################
-# Copyright (c) 2009, 2010 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-org.osgi.framework.system.packages = \
- javax.accessibility,\
- javax.activation,\
- javax.activity,\
- javax.annotation,\
- javax.annotation.processing,\
- javax.crypto,\
- javax.crypto.interfaces,\
- javax.crypto.spec,\
- javax.imageio,\
- javax.imageio.event,\
- javax.imageio.metadata,\
- javax.imageio.plugins.bmp,\
- javax.imageio.plugins.jpeg,\
- javax.imageio.spi,\
- javax.imageio.stream,\
- javax.jws,\
- javax.jws.soap,\
- javax.lang.model,\
- javax.lang.model.element,\
- javax.lang.model.type,\
- javax.lang.model.util,\
- javax.management,\
- javax.management.event,\
- javax.management.loading,\
- javax.management.modelmbean,\
- javax.management.monitor,\
- javax.management.namespace,\
- javax.management.openmbean,\
- javax.management.relation,\
- javax.management.remote,\
- javax.management.remote.rmi,\
- javax.management.timer,\
- javax.naming,\
- javax.naming.directory,\
- javax.naming.event,\
- javax.naming.ldap,\
- javax.naming.spi,\
- javax.net,\
- javax.net.ssl,\
- javax.print,\
- javax.print.attribute,\
- javax.print.attribute.standard,\
- javax.print.event,\
- javax.rmi,\
- javax.rmi.CORBA,\
- javax.rmi.ssl,\
- javax.script,\
- javax.security.auth,\
- javax.security.auth.callback,\
- javax.security.auth.kerberos,\
- javax.security.auth.login,\
- javax.security.auth.spi,\
- javax.security.auth.x500,\
- javax.security.cert,\
- javax.security.sasl,\
- javax.sound.midi,\
- javax.sound.midi.spi,\
- javax.sound.sampled,\
- javax.sound.sampled.spi,\
- javax.sql,\
- javax.sql.rowset,\
- javax.sql.rowset.serial,\
- javax.sql.rowset.spi,\
- javax.swing,\
- javax.swing.border,\
- javax.swing.colorchooser,\
- javax.swing.event,\
- javax.swing.filechooser,\
- javax.swing.plaf,\
- javax.swing.plaf.basic,\
- javax.swing.plaf.metal,\
- javax.swing.plaf.multi,\
- javax.swing.plaf.nimbus,\
- javax.swing.plaf.synth,\
- javax.swing.table,\
- javax.swing.text,\
- javax.swing.text.html,\
- javax.swing.text.html.parser,\
- javax.swing.text.rtf,\
- javax.swing.tree,\
- javax.swing.undo,\
- javax.tools,\
- javax.transaction,\
- javax.transaction.xa,\
- javax.xml,\
- javax.xml.bind,\
- javax.xml.bind.annotation,\
- javax.xml.bind.annotation.adapters,\
- javax.xml.bind.attachment,\
- javax.xml.bind.helpers,\
- javax.xml.bind.util,\
- javax.xml.crypto,\
- javax.xml.crypto.dom,\
- javax.xml.crypto.dsig,\
- javax.xml.crypto.dsig.dom,\
- javax.xml.crypto.dsig.keyinfo,\
- javax.xml.crypto.dsig.spec,\
- javax.xml.datatype,\
- javax.xml.namespace,\
- javax.xml.parsers,\
- javax.xml.soap,\
- javax.xml.stream,\
- javax.xml.stream.events,\
- javax.xml.stream.util,\
- javax.xml.transform,\
- javax.xml.transform.dom,\
- javax.xml.transform.sax,\
- javax.xml.transform.stax,\
- javax.xml.transform.stream,\
- javax.xml.validation,\
- javax.xml.ws,\
- javax.xml.ws.handler,\
- javax.xml.ws.handler.soap,\
- javax.xml.ws.http,\
- javax.xml.ws.soap,\
- javax.xml.ws.spi,\
- javax.xml.ws.wsaddressing,\
- javax.xml.xpath,\
- org.ietf.jgss,\
- org.omg.CORBA,\
- org.omg.CORBA_2_3,\
- org.omg.CORBA_2_3.portable,\
- org.omg.CORBA.DynAnyPackage,\
- org.omg.CORBA.ORBPackage,\
- org.omg.CORBA.portable,\
- org.omg.CORBA.TypeCodePackage,\
- org.omg.CosNaming,\
- org.omg.CosNaming.NamingContextExtPackage,\
- org.omg.CosNaming.NamingContextPackage,\
- org.omg.Dynamic,\
- org.omg.DynamicAny,\
- org.omg.DynamicAny.DynAnyFactoryPackage,\
- org.omg.DynamicAny.DynAnyPackage,\
- org.omg.IOP,\
- org.omg.IOP.CodecFactoryPackage,\
- org.omg.IOP.CodecPackage,\
- org.omg.Messaging,\
- org.omg.PortableInterceptor,\
- org.omg.PortableInterceptor.ORBInitInfoPackage,\
- org.omg.PortableServer,\
- org.omg.PortableServer.CurrentPackage,\
- org.omg.PortableServer.POAManagerPackage,\
- org.omg.PortableServer.POAPackage,\
- org.omg.PortableServer.portable,\
- org.omg.PortableServer.ServantLocatorPackage,\
- org.omg.SendingContext,\
- org.omg.stub.java.rmi,\
- org.w3c.dom,\
- org.w3c.dom.bootstrap,\
- org.w3c.dom.css,\
- org.w3c.dom.events,\
- org.w3c.dom.html,\
- org.w3c.dom.ls,\
- org.w3c.dom.ranges,\
- org.w3c.dom.stylesheets,\
- org.w3c.dom.traversal,\
- org.w3c.dom.views,\
- org.w3c.dom.xpath,\
- org.xml.sax,\
- org.xml.sax.ext,\
- org.xml.sax.helpers
-org.osgi.framework.bootdelegation = \
- javax.*,\
- org.ietf.jgss,\
- org.omg.*,\
- org.w3c.*,\
- org.xml.*,\
- sun.*,\
- com.sun.*
-org.osgi.framework.executionenvironment = \
- OSGi/Minimum-1.0,\
- OSGi/Minimum-1.1,\
- OSGi/Minimum-1.2,\
- JRE-1.1,\
- J2SE-1.2,\
- J2SE-1.3,\
- J2SE-1.4,\
- J2SE-1.5,\
- JavaSE-1.6,\
- JavaSE-1.7
-osgi.java.profile.name = JavaSE-1.7
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.source=1.6
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+++ /dev/null
-<slc = 'http://www.argeo.org/ns/slc'>
-
-// AETHER
-[slc:artifact] > mix:referenceable, mix:created, mix:lastModified
-mixin
-- slc:artifactId (STRING) m
-- slc:groupId (STRING) m
-- slc:artifactVersion (STRING) m
-- slc:artifactExtension (STRING) m
-- slc:artifactClassifier (STRING) ='' m a
-
-[slc:artifactVersion] > mix:referenceable, mix:created, mix:lastModified, mix:title
-mixin
-- slc:artifactId (STRING) m
-- slc:groupId (STRING) m
-- slc:artifactVersion (STRING) m
-
-[slc:artifactBase] > mix:referenceable, mix:created, mix:lastModified
-mixin
-- slc:artifactId (STRING) m
-- slc:groupId (STRING) m
-
-[slc:groupBase] > mix:referenceable, mix:created, mix:lastModified
-mixin
-// it is possible to have groupBase being artifact base (e.g. org.argeo.commons.basic)
-// so using groupId would conflict
-- slc:groupBaseId (STRING) m
-
-// Mark a given group base as relevant to create modular distribution in the current workspace
-// [slc:category]
-// mixin
-
-[slc:distribution] > slc:artifactVersion
-mixin
-+ slc:artifactVersions (argeo:references) m
-
-
-[slc:modularDistributionBase]
-mixin
-
-// Question: Extend slc:categorizedNameVersion ? (not possible without migration)
-[slc:modularDistribution]
-mixin
-+ slc:modules (nt:unstructured) m
-
-[slc:moduleCoordinates] > nt:unstructured
-- slc:category (STRING)
-- slc:name (STRING)
-- slc:version (STRING)
-
-
-// ORIGINS
-[slc:knownOrigin] > nt:base
-mixin
-+ slc:origin (nt:address)
-
-[slc:proxied] > nt:address
-- slc:proxy (REFERENCE)
-
-// JAVA
-[slc:jarFile] > mix:referenceable
-mixin
-- 'slc:manifest' (BINARY) m
-- 'slc:Manifest-Version' (STRING)
-- 'slc:Signature-Version' (STRING)
-- 'slc:Class-Path' (STRING)
-- 'slc:Main-Class' (STRING)
-- 'slc:Extension-Name' (STRING)
-- 'slc:Implementation-Version' (STRING)
-- 'slc:Implementation-Vendor' (STRING)
-- 'slc:Implementation-Vendor-Id' (STRING)
-- 'slc:Implementation-URL' (STRING)
-- 'slc:Specification-Title' (STRING)
-- 'slc:Specification-Version' (STRING)
-- 'slc:Specification-Vendor' (STRING)
-- 'slc:Sealed' (STRING)
-
-// OSGi
-// see http://www.osgi.org/Specifications/Reference
-
-[slc:javaPackage] > mix:referenceable
-- slc:name (STRING) primary m
-
-[slc:osgiBaseVersion] > mix:referenceable
-- slc:asString (STRING) primary m
-- slc:major (LONG) m
-- slc:minor (LONG) m
-- slc:micro (LONG) m
-
-[slc:osgiVersion] > slc:osgiBaseVersion
-- slc:qualifier (STRING)
-
-[slc:exportedPackage] > slc:javaPackage
-+ slc:uses (slc:javaPackage) multiple
-+ slc:version (slc:osgiVersion)
-
-[slc:importedPackage] > slc:javaPackage
-- slc:version (STRING) ='0.0.0' m a
-- slc:optional (BOOLEAN) ='false' m a
-
-[slc:dynamicImportedPackage] > slc:javaPackage
-- slc:version (STRING) ='0.0.0' m a
-- slc:optional (BOOLEAN) ='false' m a
-
-[slc:requiredBundle] > mix:referenceable
-- 'slc:symbolic-name' (STRING) primary m
-- 'slc:bundle-version' (STRING) ='0.0.0' m a
-- slc:optional (BOOLEAN) ='false' m a
-
-[slc:fragmentHost] > mix:referenceable
-- 'slc:symbolic-name' (STRING) m
-- 'slc:bundle-version' (STRING) ='0.0.0' m a
-
-[slc:bundleNativeCode] > mix:referenceable
-- slc:path (STRING) primary m
-- slc:osname (STRING)
-- slc:processor (STRING)
-
-// see http://www.osgi.org/Specifications/ReferenceHeaders
-[slc:bundle] > mix:referenceable
-mixin
-- 'slc:symbolic-name' (STRING) primary m
-- 'slc:bundle-version' (STRING) m
-- 'slc:Bundle-SymbolicName' (STRING) m
-- 'slc:Bundle-Name' (STRING)
-- 'slc:Bundle-Description' (STRING)
-- 'slc:Bundle-ManifestVersion' (STRING)
-- 'slc:Bundle-Category' (STRING)
-- 'slc:Bundle-ActivationPolicy' (STRING)
-- 'slc:Bundle-Copyright' (STRING)
-- 'slc:Bundle-Vendor' (STRING)
-- 'slc:Bundle-License' (STRING)
-- 'slc:Bundle-DocURL' (STRING)
-- 'slc:Bundle-ContactAddress' (STRING)
-- 'slc:Bundle-Activator' (STRING)
-- 'slc:Bundle-UpdateLocation' (STRING)
-- 'slc:Bundle-Localization' (STRING)
-- 'slc:Bundle-ClassPath' (STRING) *
-// see http://wiki.eclipse.org/EE < 'OSGi/Minimum-1.0','OSGi/Minimum-1.1','CDC-1.0/Foundation-1.0','CDC-1.1/Foundation-1.1','JRE-1.1','J2SE-1.2','J2SE-1.3','J2SE-1.4','J2SE-1.5','JavaSE-1.6','JavaSE-1.7'
-- 'slc:Bundle-RequiredExecutionEnvironment' (STRING) *
-+ 'slc:Bundle-Version' (slc:osgiVersion) m
-+ 'slc:Fragment-Host' (slc:fragmentHost)
-+ 'slc:Import-Package' (slc:importedPackage) multiple
-+ 'slc:Export-Package' (slc:exportedPackage) multiple
-+ 'slc:Require-Bundle' (slc:requiredBundle) multiple
-+ 'slc:Bundle-NativeCode' (slc:bundleNativeCode) multiple
-+ 'slc:DynamicImport-Package' (slc:dynamicImportedPackage) multiple
-
-[slc:bundleArtifact] > slc:artifact,slc:jarFile,slc:bundle
-mixin
-
-// RPM
-[slc:rpm] > mix:referenceable, mix:created, mix:lastModified, mix:title
-mixin
-- slc:name (STRING)
-- slc:version (STRING)
-- slc:rpmVersion (STRING)
-- slc:rpmRelease (STRING)
-- slc:rpmArch (STRING)
-- slc:rpmArchivaeSize (STRING)
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.rpmfactory</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+++ /dev/null
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
+++ /dev/null
-source.. = src/main/java/
-output.. = target/classes/
-bin.includes = META-INF/,\
- .
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.rpmfactory</artifactId>
- <name>SLC RPM Factory</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.rpmfactory.*
- </Export-Package>
- <Import-Package>
- javax.jcr.nodetype,
- org.argeo.slc.repo,
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <!-- SLC Runtime -->
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.repo</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.support.jcr</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <!-- Third party -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.org.apache.commons.logging</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.specs</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Fri Aug 29 11:10:18 CEST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-source.. = src/main/java/
-jre.compilation.profile = J2SE-1.5
-
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.specs</artifactId>
- <name>SLC Specifications</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.*
- </Export-Package>
- <Import-Package>*,
- org.hibernate.proxy;resolution:="optional",
- javassist.util.proxy;resolution:="optional"
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
+++ /dev/null
-Argeo SLC Site
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.support.aether</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Sun Feb 13 11:00:00 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-#Sun Feb 13 11:00:00 CET 2011
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
+++ /dev/null
-source.. = src/main/java/,\
- src/test/java/
-output.. = target/classes/
-bin.includes = META-INF/,\
- .
-additional.bundles = junit,\
- slf4j.api,\
- slf4j.log4j,\
- org.apache.log4j,\
- slf4j.org.apache.commons.logging
-
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.support.aether</artifactId>
- <name>SLC Support Aether</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.aether.*
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.core</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.sonatype.aether</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.beans</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.org.apache.commons.logging</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- Test -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>\r
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>\r
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.support.ant</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Fri Aug 29 11:31:46 CEST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-source.. = src/main/java/,\
- src/main/resources/,\
- src/test/java/,\
- src/test/resources/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.support.ant</artifactId>
- <packaging>jar</packaging>
- <name>SLC Support Ant</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.ant.*
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.core</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.tools.ant</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.tools.ant.launch</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.net</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.oro</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.bsf</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-# Set root logger level to DEBUG and its only appender to A1.\r
-log4j.rootLogger=WARN, console\r
-\r
-## Levels\r
-# Slc\r
-log4j.logger.org.argeo=DEBUG\r
-\r
-# Castor\r
-log4j.logger.org.exolab.castor=WARN\r
-\r
-# Spring\r
-log4j.logger.org.springframework=WARN\r
-\r
-## Appenders\r
-# A1 is set to be a ConsoleAppender.\r
-log4j.appender.console=org.apache.log4j.ConsoleAppender\r
-\r
-# A1 uses PatternLayout.\r
-log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.support.equinox</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org> Licensed under \r
- the Apache License, Version 2.0 (the "License"); you may not use this file \r
- except in compliance with the License. You may obtain a copy of the License \r
- at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable \r
- law or agreed to in writing, software distributed under the License is distributed \r
- on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either \r
- express or implied. See the License for the specific language governing permissions \r
- and limitations under the License. -->\r
-\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 -->\r
-<!-- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> -->\r
-<!-- <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" /> -->\r
-<!-- <property name="ignoreUnresolvablePlaceholders" value="false" /> -->\r
-<!-- <property name="locations"> -->\r
-<!-- <value>osgibundle:equinox.properties</value> -->\r
-<!-- </property> -->\r
-<!-- </bean> -->\r
-\r
- <bean id="commandProvider" class="org.argeo.slc.equinox.ExecutionCommandProvider">\r
- <property name="agentCli" ref="agentCli" />\r
- </bean>\r
-\r
-<!-- <bean id="modulesManager" class="org.argeo.slc.osgi.OsgiExecutionModulesManager"> -->\r
-<!-- <property name="bundlesManager" ref="bundlesManager" /> -->\r
-<!-- </bean> -->\r
-\r
-<!-- <bean id="bundlesManager" class="org.argeo.slc.osgi.BundlesManager"> -->\r
-<!-- <property name="defaultTimeout" value="${slc.equinox.commandTimeout}" /> -->\r
-<!-- <property name="pollingPeriod" value="${slc.equinox.commandPollingPeriod}" /> -->\r
-<!-- </bean> -->\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org> Licensed under \r
- the Apache License, Version 2.0 (the "License"); you may not use this file \r
- except in compliance with the License. You may obtain a copy of the License \r
- at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable \r
- law or agreed to in writing, software distributed under the License is distributed \r
- on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either \r
- express or implied. See the License for the specific language governing permissions \r
- and limitations under the License. -->\r
-\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
- xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
- http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
- http://www.springframework.org/schema/beans \r
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
- <!-- REFERENCES -->\r
- <reference id="agentCli" interface="org.argeo.slc.execution.SlcAgentCli" />\r
-\r
- <!-- SERVICES -->\r
- <service interface="org.eclipse.osgi.framework.console.CommandProvider"\r
- ref="commandProvider" />\r
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-additional.bundles = org.argeo.slc.core,\
- org.springframework.context,\
- org.argeo.slc.unit,\
- junit,\
- org.argeo.osgi.boot,\
- org.eclipse.osgi
-source.. = src/main/java/,\
- src/test/java/,\
- src/test/resources/
+++ /dev/null
-# Timeout for the SLC command in the OSGi console (in ms)
-slc.equinox.commandTimeout=10000
-# Polling period for synchronous OSGi commands (in ms)
-slc.equinox.commandPollingPeriod=100
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.support.equinox</artifactId>
- <name>SLC Support Equinox</name>
- <packaging>jar</packaging>
- <properties />
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- FIXME class "org.osgi.service.condpermadmin.ConditionalPermissionUpdate"'s
- signer information does not match signer information of other classes in
- the same package -->
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.*
- </Export-Package>
- <Import-Package>*,
- org.springframework.beans.factory.config,
- org.springframework.osgi.context.event,
- org.springframework.core.io
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.support.osgi</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- </dependency>
-
- <!-- Unit Tests -->
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.unit</artifactId>
- <scope>test</scope>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.equinox;
-
-import org.argeo.slc.SlcException;
-import org.argeo.slc.osgi.OsgiRuntime;
-import org.eclipse.core.runtime.adaptor.EclipseStarter;
-
-/** OSGi runtime with shutdown capability implemented. */
-@SuppressWarnings("restriction")
-@Deprecated
-public class EquinoxRuntime extends OsgiRuntime {
-
- public void shutdown() {
- try {
- EclipseStarter.shutdown();
- } catch (Exception e) {
- throw new SlcException("Cannot shutdown Equinox runtime.", e);
- }
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.equinox;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.argeo.slc.SlcException;
-import org.argeo.slc.execution.SlcAgentCli;
-import org.eclipse.osgi.framework.console.CommandInterpreter;
-import org.eclipse.osgi.framework.console.CommandProvider;
-
-public class ExecutionCommandProvider implements CommandProvider {
- private SlcAgentCli agentCli;
-
- private String lastProcessUuid;
-
- public Object _slc(CommandInterpreter ci) {
- List<String> args = new ArrayList<String>();
- String arg = null;
- while ((arg = ci.nextArgument()) != null)
- args.add(arg);
- if (args.size() == 0) {
- // TODO relaunch last process
- ci.execute("help");
- throw new SlcException("Command not properly formatted");
- }
-
- lastProcessUuid = agentCli
- .process(args.toArray(new String[args.size()]));
- return lastProcessUuid;
- }
-
- public String getHelp() {
- StringBuffer buf = new StringBuffer();
- buf.append("---SLC Execution Commands---\n");
- buf.append("\tslc <module> <flow> [[ --arg value | --booleanArg ]]"
- + " - executes an execution flow\n");
- return buf.toString();
-
- }
-
- public void setAgentCli(SlcAgentCli agentCli) {
- this.agentCli = agentCli;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.equinox.cli;
-
-import org.eclipse.core.runtime.adaptor.EclipseStarter;
-
-@SuppressWarnings("restriction")
-public class Main {
-
- public static void main(String[] args) {
- try {
- String confDir = "";
- String[] equinoxArgs = { "-console", "-conf", confDir };
- EclipseStarter.startup(equinoxArgs, null);
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-}
+++ /dev/null
-Bundle-SymbolicName: org.argeo.slc.support.osgi.test.hello
-Bundle-Version: 0.1.0
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
-
- <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />
-
- <bean id="main" parent="slcTemplate.simpleFlow" init-method="run">
- <property name="executables">
- <list>
- <bean parent="task.echo">
- <property name="message" value="Hello world!" />
- </bean>
- </list>
- </property>
- </bean>
-</beans>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.osgi.test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.argeo.slc.equinox.unit.AbstractOsgiRuntimeTestCase;
-import org.argeo.osgi.boot.OsgiBoot;
-
-public class HelloTest extends AbstractOsgiRuntimeTestCase {
- public void testHello() throws Exception {
- Thread.sleep(2000);
- }
-
- protected void installBundles() throws Exception {
- // System.out.println("java.class.path="
- // + System.getProperty("java.class.path"));
-
- osgiBoot.installUrls(osgiBoot.getLocationsUrls(
- OsgiBoot.DEFAULT_BASE_URL,
- System.getProperty("java.class.path")));
- osgiBoot.installUrls(osgiBoot.getBundlesUrls("src/test/bundles;in=*"));
-
- // Map<String, String> sysProps = new TreeMap(System.getProperties());
- // for (String key : sysProps.keySet()) {
- // System.out.println(key + "=" + sysProps.get(key));
- // }
- }
-
- protected List<String> getBundlesToStart() {
- List<String> bundlesToStart = new ArrayList<String>();
- // bundlesToStart.add("org.springframework.osgi.extender");
- bundlesToStart.add("org.argeo.slc.support.osgi.test.hello");
- return bundlesToStart;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.osgi.test;
-
-import org.argeo.slc.equinox.unit.AbstractOsgiRuntimeTestCase;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-
-public class PlatformStartStopTest extends AbstractOsgiRuntimeTestCase {
-
- public void testStartStop() {
- BundleContext bundleContext = osgiBoot.getBundleContext();
- System.out.println(bundleContext
- .getProperty(Constants.FRAMEWORK_VENDOR));
- System.out.println(bundleContext
- .getProperty(Constants.FRAMEWORK_VERSION));
- System.out.println(bundleContext
- .getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT));
-
- }
-}
+++ /dev/null
-Bundle-SymbolicName: org.argeo.slc.support.osgi.tests
-Fragment-Host: org.argeo.slc.support.osgi
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.support.jcr</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Sun Feb 21 12:26:27 CET 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-#Thu Feb 18 16:48:02 CET 2010
-eclipse.preferences.version=1
-resolve.requirebundle=false
+++ /dev/null
-additional.bundles = org.springframework.core,\
- org.argeo.server.jackrabbit,\
- junit,\
- org.argeo.slc.unit,\
- org.apache.xerces,\
- org.apache.log4j,\
- slf4j.api,\
- slf4j.log4j,\
- org.eclipse.osgi,\
- org.apache.commons.io,\
- org.apache.jackrabbit,\
- org.h2,\
- org.apache.commons.dbcp,\
- org.apache.commons.pool,\
- edu.oswego.cs.dl.util.concurrent,\
- org.apache.commons.collections,\
- org.apache.lucene,\
- org.apache.tika
-source.. = src/main/java/,\
- src/main/resources/,\
- src/test/java/,\
- src/test/resources/
-
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.support.jcr</artifactId>
- <name>SLC Support JCR</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.jcr.*
- </Export-Package>
- <Import-Package>
- org.springframework.context,
- javax.jcr.nodetype,
- org.springframework.beans.factory,
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.core</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.commons.server</groupId>
- <artifactId>org.argeo.server.jcr</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
-
- <!-- Unit Tests -->
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.unit</artifactId>
- <scope>test</scope>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.server</groupId>
- <artifactId>org.argeo.server.jackrabbit</artifactId>
- <version>${version.argeo-commons}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2007-2012 Argeo GmbH
-
- Licensed 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.
-
--->
-<!DOCTYPE jackrabbit-ocm PUBLIC "-//The Apache Software Foundation//DTD Repository//EN" "http://jackrabbit.apache.org/dtd/jackrabbit-ocm-1.5.dtd">
-<jackrabbit-ocm>
- <class-descriptor className="Type" jcrType="my:type"
- jcrSuperTypes="nt:base" jcrMixinTypes="mix:referenceable">
- <field-descriptor fieldName="path" path="true" />
- <field-descriptor fieldName="uuid" uuid="true" />
- <field-descriptor fieldName="name" jcrName="my:name"
- jcrMandatory="true" />
- <field-descriptor fieldName="description" jcrName="my:description" />
- </class-descriptor>
- <class-descriptor className="Element" jcrType="my:element"
- jcrSuperTypes="nt:base" jcrMixinTypes="mix:versionable">
- <field-descriptor fieldName="path" path="true" />
- <field-descriptor fieldName="uuid" uuid="true" />
- <field-descriptor fieldName="name" jcrName="my:name"
- jcrMandatory="true" />
- <field-descriptor fieldName="description" jcrName="my:description" />
- <bean-descriptor fieldName="type" jcrName="my:type"
- proxy="false" jcrType="my:type" jcrMandatory="true"
- jcrOnParentVersion="IGNORE"
- converter="org.apache.jackrabbit.ocm.manager.beanconverter.impl.ReferenceBeanConverterImpl" />
- </class-descriptor>
-</jackrabbit-ocm>
\ No newline at end of file
+++ /dev/null
-# Set root logger level to DEBUG and its only appender to A1.\r
-log4j.rootLogger=WARN, console\r
-\r
-## Levels\r
-# Slc\r
-log4j.logger.org.argeo=DEBUG\r
-#log4j.logger.org.argeo.jcr=TRACE\r
-\r
-# Castor\r
-log4j.logger.org.exolab.castor=WARN\r
-\r
-# Spring\r
-#log4j.logger.org.springframework=INFO\r
-\r
-## Appenders\r
-# A1 is set to be a ConsoleAppender.\r
-log4j.appender.console=org.apache.log4j.ConsoleAppender\r
-\r
-# A1 uses PatternLayout.\r
-log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<!-- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org> Licensed under \r
- the Apache License, Version 2.0 (the "License"); you may not use this file \r
- except in compliance with the License. You may obtain a copy of the License \r
- at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable \r
- law or agreed to in writing, software distributed under the License is distributed \r
- on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either \r
- express or implied. See the License for the specific language governing permissions \r
- and limitations under the License. -->\r
-\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
- <bean\r
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">\r
- <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />\r
- <property name="ignoreUnresolvablePlaceholders" value="true" />\r
- </bean>\r
-\r
- <bean id="slcAgentDescriptorDao" class="org.argeo.slc.jcr.dao.SlcAgentDescriptorDaoJcr"\r
- init-method="init">\r
- <property name="session" ref="argeo.jcr.session.inMemory" />\r
- <property name="nodeMapperProvider" ref="nodeMapperProvider" />\r
- </bean>\r
-\r
- <bean id="slcExecutionDao" class="org.argeo.slc.jcr.dao.SlcExecutionDaoJcr"\r
- init-method="init">\r
- <property name="session" ref="argeo.jcr.session.inMemory" />\r
- <property name="nodeMapperProvider" ref="nodeMapperProvider" />\r
- </bean>\r
-\r
- <bean id="nodeMapperProvider" class="org.argeo.slc.jcr.dao.SlcNodeMapperProvider"\r
- init-method="init">\r
- <property name="defaultNodeMapper" ref="nodeMapper" />\r
- <property name="treeTestResultNodeMapper" ref="treeTestResultNodeMapper" />\r
- </bean>\r
-\r
- <bean id="treeTestResultDao" class="org.argeo.slc.jcr.dao.TreeTestResultDaoJcr"\r
- init-method="init">\r
- <property name="session" ref="argeo.jcr.session.inMemory" />\r
- <property name="nodeMapperProvider" ref="nodeMapperProvider" />\r
- </bean>\r
-\r
- <bean id="treeTestResultCollectionDao" class="org.argeo.slc.jcr.dao.TreeTestResultCollectionDaoJcr"\r
- init-method="init">\r
- <property name="session" ref="argeo.jcr.session.inMemory" />\r
- <property name="nodeMapperProvider" ref="nodeMapperProvider" />\r
- </bean>\r
-\r
- <bean id="nodeMapper" class="org.argeo.jcr.spring.BeanNodeMapper" />\r
-\r
- <bean id="treeTestResultNodeMapper" class="org.argeo.slc.jcr.dao.TreeTestResultNodeMapper">\r
- </bean>\r
-\r
-\r
- <bean id="argeo.jcr.session.inMemory" factory-bean="argeo.jcr.repository.inMemory"\r
- factory-method="login" destroy-method="logout">\r
- <constructor-arg>\r
- <bean class="javax.jcr.SimpleCredentials">\r
- <constructor-arg value="demo" />\r
- <constructor-arg value="demo" />\r
- </bean>\r
- </constructor-arg>\r
- </bean>\r
-\r
- <bean id="argeo.jcr.repository.inMemory" class="org.argeo.jackrabbit.JackrabbitContainer"\r
- init-method="init" destroy-method="destroy">\r
- <property name="homeDirectory"\r
- value="${java.io.tmpdir}/jackrabbit-slc-unit-${user.name}" />\r
- <property name="inMemory" value="true" />\r
- <property name="configuration"\r
- value="classpath:/org/argeo/jackrabbit/repository-inMemory.xml" />\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.support.jemmy</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Tue Jul 21 11:27:46 CEST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
+++ /dev/null
-source.. = src/main/java/,\
- src/main/resources/,\
- src/test/java/,\
- src/test/resources/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.support.jemmy</artifactId>
- <name>SLC Support Jemmy</name>
- <description>Helper classes for the Jemmy framework</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Bundle-RequiredExecutionEnvironment>J2SE-1.4</Bundle-RequiredExecutionEnvironment>
- <Export-Package>
- org.argeo.slc.jemmy
- </Export-Package>
- <Import-Package>org.netbeans.jemmy,
- org.netbeans.jemmy.operators,
- org.netbeans.jemmy.util
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
- <dependencies>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.argeo.dep.jemmy.nb61</artifactId>
- </dependency>
-
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Set;\r
-\r
-import org.netbeans.jemmy.operators.ComponentOperator;\r
-\r
-public class AbstractComponentWrapper implements ComponentWrapper {\r
-\r
- protected ComponentWrapper parent;\r
-\r
- /**\r
- * List of children ComponentWrapper\r
- */\r
- protected List children = new ArrayList();\r
-\r
- protected WrapperLocator locator;\r
-\r
- protected String prefix;\r
-\r
- public ComponentOperator find() {\r
- return locator.find(this);\r
- }\r
-\r
- protected String createNewKey(String oldKey) {\r
- return (prefix == null) ? oldKey : (prefix + "." + oldKey);\r
- }\r
-\r
- protected void addToAccessorMap(Map accessors, String oldKey,\r
- Object accessor) {\r
- String newKey = createNewKey(oldKey);\r
- if (accessors.containsKey(newKey)) {\r
- throw new ConfigRuntimeException("An Accessor with key '" + newKey\r
- + "' was already registered");\r
- }\r
- accessors.put(newKey, accessor);\r
- }\r
-\r
- public Map getAccessors(Class accessorClass) {\r
- Map accessors = new HashMap();\r
- if (accessorClass.isInstance(this)) {\r
- addToAccessorMap(accessors, ((Accessor) this).getFieldName(), this);\r
- }\r
- for (int i = 0; i < children.size(); i++) {\r
- Map childAccessors = ((ComponentWrapper) children.get(i))\r
- .getAccessors(accessorClass);\r
-\r
- Set entries = childAccessors.entrySet();\r
- Iterator it = entries.iterator();\r
-\r
- while (it.hasNext()) {\r
- Map.Entry keyValue = (Map.Entry) it.next();\r
- addToAccessorMap(accessors, keyValue.getKey().toString(),\r
- keyValue.getValue());\r
- }\r
- }\r
- return accessors;\r
- }\r
-\r
- public ComponentWrapper getParent() {\r
- return parent;\r
- }\r
-\r
- public void setParent(ComponentWrapper parent) {\r
- if (this.parent != null) {\r
- throw new ConfigRuntimeException("Parent already set");\r
- }\r
- this.parent = parent;\r
- }\r
-\r
- public List getChildren() {\r
- return children;\r
- }\r
-\r
- public void setChildren(List children) {\r
- this.children = children;\r
-\r
- // check that all elements of the list are ComponentWrapper\r
- // and set their parent\r
- for (int i = 0; i < this.children.size(); i++) {\r
- ComponentWrapper wrapper = (ComponentWrapper) this.children.get(i);\r
- if (wrapper == null) {\r
- throw new ConfigRuntimeException(\r
- "Children of ComponentWrappers must be ComponentWrappers");\r
- }\r
- wrapper.setParent(this);\r
- }\r
- }\r
-\r
- public WrapperLocator getLocator() {\r
- return locator;\r
- }\r
-\r
- public void setLocator(WrapperLocator locator) {\r
- this.locator = locator;\r
- }\r
-\r
- public String getPrefix() {\r
- return prefix;\r
- }\r
-\r
- public void setPrefix(String prefix) {\r
- this.prefix = prefix;\r
- }\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-public interface Accessor {\r
-\r
- public String getFieldName();\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-\r
-public interface Actuator extends Accessor {\r
- \r
- void perform();\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-import java.util.Map;\r
-\r
-import org.netbeans.jemmy.operators.ComponentOperator;\r
-\r
-public interface ComponentWrapper {\r
-\r
- /**\r
- * Finds the component described by the ComponentWrapper\r
- * in the GUI\r
- * @return a Jemmy ComponentOperator for the found component\r
- */\r
- public ComponentOperator find();\r
- \r
- public void setParent(ComponentWrapper parent);\r
- \r
- public ComponentWrapper getParent();\r
- \r
- public Map getAccessors(Class accessorClass);\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-public class ConfigRuntimeException extends UIRuntimeException{\r
- /**\r
- * \r
- */\r
- private static final long serialVersionUID = 1L;\r
- public ConfigRuntimeException(){\r
- super();\r
- }\r
- public ConfigRuntimeException(String s){\r
- super(s);\r
- }\r
- public ConfigRuntimeException(Throwable t){\r
- super(t);\r
- }\r
- public ConfigRuntimeException(String s, Throwable t){\r
- super(s,t);\r
- }\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
-import org.netbeans.jemmy.operators.ComponentOperator;\r
-\r
-public class FictiveComponentWrapper implements ComponentWrapper {\r
-\r
- protected ComponentWrapper parent; \r
- \r
- public ComponentOperator find() {\r
- // just ask the parent\r
- return parent.find();\r
- }\r
-\r
- /**\r
- * Return only itself (if the class matches)\r
- */\r
- public Map getAccessors(Class accessorClass) {\r
- Map accessors = new HashMap();\r
- if (accessorClass.isInstance(this)) {\r
- accessors.put(((Accessor) this).getFieldName(), this);\r
- } \r
- return accessors;\r
- }\r
-\r
- public ComponentWrapper getParent() {\r
- return parent;\r
- }\r
-\r
- public void setParent(ComponentWrapper parent) {\r
- this.parent = parent;\r
- }\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-public interface PopupMenuActuator extends Accessor {\r
- /**\r
- * Popup the context menu and optionally select an item.\r
- * @param menu - A list of items to choose on each menu level, separated by '|'\r
- */\r
- void select(String menu);\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-\r
-public interface ReadAccessor extends Accessor {\r
- \r
- public String get();\r
- \r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-public class UIRuntimeException extends RuntimeException {\r
- /**\r
- * \r
- */\r
- private static final long serialVersionUID = 1L;\r
- public UIRuntimeException(){\r
- super();\r
- }\r
- public UIRuntimeException(String s){\r
- super(s);\r
- }\r
- public UIRuntimeException(Throwable t){\r
- super(t);\r
- }\r
- public UIRuntimeException(String s, Throwable t){\r
- super(s,t);\r
- }\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-import org.netbeans.jemmy.operators.ComponentOperator;\r
-\r
-public interface WrapperLocator {\r
-\r
- public ComponentOperator find(ComponentWrapper wrapper);\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.jemmy;\r
-\r
-\r
-public interface WriteAccessor extends Accessor {\r
- \r
- public void set(String value);\r
- \r
-}\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="lib" path="lib/aether-connector-wagon-1.11.jar"/>
- <classpathentry kind="lib" path="lib/aether-impl-1.11.jar"/>
- <classpathentry kind="lib" path="lib/google-collections-1.0.jar"/>
- <classpathentry kind="lib" path="lib/maven-aether-provider-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-artifact-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-compat-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-core-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-embedder-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-model-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-model-builder-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-plugin-api-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-repository-metadata-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-settings-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/maven-settings-builder-3.0.3.jar"/>
- <classpathentry kind="lib" path="lib/nekohtml-1.9.6.2.jar"/>
- <classpathentry kind="lib" path="lib/plexus-cipher-1.4.jar"/>
- <classpathentry kind="lib" path="lib/plexus-classworlds-2.4.jar"/>
- <classpathentry kind="lib" path="lib/plexus-component-annotations-1.5.5.jar"/>
- <classpathentry kind="lib" path="lib/plexus-container-default-1.5.5.jar"/>
- <classpathentry kind="lib" path="lib/plexus-interpolation-1.14.jar"/>
- <classpathentry kind="lib" path="lib/plexus-sec-dispatcher-1.3.jar"/>
- <classpathentry kind="lib" path="lib/plexus-utils-2.0.6.jar"/>
- <classpathentry kind="lib" path="lib/sisu-guice-2.9.4-no_aop.jar"/>
- <classpathentry kind="lib" path="lib/sisu-inject-bean-2.1.1.jar"/>
- <classpathentry kind="lib" path="lib/sisu-inject-plexus-2.1.1.jar"/>
- <classpathentry kind="lib" path="lib/wagon-file-1.0-beta-7.jar"/>
- <classpathentry kind="lib" path="lib/wagon-http-lightweight-1.0-beta-7.jar"/>
- <classpathentry kind="lib" path="lib/wagon-http-shared-1.0-beta-7.jar"/>
- <classpathentry kind="lib" path="lib/wagon-provider-api-1.0-beta-7.jar"/>
- <classpathentry kind="lib" path="lib/wagon-webdav-jackrabbit-1.0-beta-7.jar"/>
- <classpathentry kind="lib" path="lib/xbean-reflect-3.4.jar"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.support.maven</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Fri Aug 29 11:31:46 CEST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
- xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
- http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
- http://www.springframework.org/schema/beans \r
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
- <!-- SERVICES -->\r
- <service ref="mavenRepositorySystem" interface="org.sonatype.aether.RepositorySystem">\r
- <service-properties>\r
- <beans:entry key="aether.repositorySystemType" value="maven" />\r
- </service-properties>\r
- </service>\r
-\r
- <service ref="defaultMavenRepositorySystemSession" interface="org.sonatype.aether.RepositorySystemSession">\r
- <service-properties>\r
- <beans:entry key="aether.repositorySystemType" value="maven" />\r
- </service-properties>\r
- </service>\r
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
-
- <bean id="mavenRepositorySystem" class="org.argeo.slc.maven.MavenManager"
- factory-method="createRepositorySystem">
- </bean>
-
- <bean id="defaultMavenRepositorySystemSession" class="org.argeo.slc.maven.MavenManager"
- factory-method="createRepositorySystemSession">
- <constructor-arg ref="mavenRepositorySystem" />
- </bean>
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.support.maven</artifactId>
- <packaging>bundle</packaging>
- <name>SLC Support Maven</name>
- <properties>
- <version.aether>1.11</version.aether>
- <version.maven>3.0.3</version.maven>
- <version.wagon>1.0-beta-7</version.wagon>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.maven.*
- </Export-Package>
- <Import-Package>
- org.w3c.dom.*;version="0.0.0",
- org.xml.sax.*;version="0.0.0",
- com.google.*;resolution:=optional,
- javax.*;resolution:=optional,
- com.sun.*;resolution:=optional,
- org.objectweb.asm.*;resolution:=optional,
- *
- </Import-Package>
- <_exportcontents>
- org.apache.maven.*;version=${version.maven},
- </_exportcontents>
- <Private-Package>org.apache.xbean.*</Private-Package>
- <Embed-Transitive>true</Embed-Transitive>
- <Embed-Directory>lib</Embed-Directory>
- <Embed-Dependency>*;scope=provided;inline=false</Embed-Dependency>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <includeScope>provided</includeScope>
- <outputDirectory>lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.specs</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.support.aether</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <!-- <dependency> <groupId>org.argeo.dep.osgi</groupId> <artifactId>org.argeo.dep.osgi.maven.embedder</artifactId>
- </dependency> -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.beans</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.io</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.org.apache.commons.logging</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-embedder</artifactId>
- <version>${version.maven}</version>
- <optional>true</optional>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-util</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-connector-wagon</artifactId>
- <version>${version.aether}</version>
- <optional>true</optional>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-util</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-provider-api</artifactId>
- <version>${version.wagon}</version>
- <optional>true</optional>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-file</artifactId>
- <version>${version.wagon}</version>
- <optional>true</optional>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-http-lightweight</artifactId>
- <version>${version.wagon}</version>
- <optional>true</optional>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>nekohtml</groupId>
- <artifactId>xercesMinimal</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav-jackrabbit</artifactId>
- <version>${version.wagon}</version>
- <optional>true</optional>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-nop</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-webdav</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.sonatype.aether</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.maven;
-
-import org.apache.maven.cli.MavenCli;
-import org.codehaus.plexus.PlexusContainer;
-
-/** Custom Maven CLI, giving access to the underlying Plexus container. */
-class CustomCli extends MavenCli {
- private PlexusContainer container;
-
- @Override
- protected void customizeContainer(PlexusContainer container) {
- this.container = container;
- }
-
- public PlexusContainer getContainer() {
- return container;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.maven;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.SlcException;
-import org.springframework.beans.factory.FactoryBean;
-import org.springframework.core.io.Resource;
-
-public class DependencyFileLoader implements FactoryBean{
- private final static Log log = LogFactory.getLog(DependencyFileLoader.class);
-
- private Resource dependenciesResource;
-
- @SuppressWarnings("unchecked")
- public List<MavenFile> loadMavenFiles() {
- try {
- List<MavenFile> mavenFiles = new ArrayList<MavenFile>();
-
- List<String> lines = IOUtils.readLines(dependenciesResource
- .getInputStream());
- for (String line : lines) {
- try {
- line = line.trim();
- if (line.equals("")
- || line
- .startsWith("The following files have been resolved:"))
- continue;// skip
-
- mavenFiles.add(convert(line));
- } catch (Exception e) {
- log.warn("Could not load line " + line);
- }
- }
-
- return mavenFiles;
- } catch (IOException e) {
- throw new SlcException("Could not read dependencies resource "
- + dependenciesResource, e);
- }
- }
-
- protected MavenFile convert(String str) {
- StringTokenizer st = new StringTokenizer(str, ":");
- MavenFile component = new MavenFile();
- component.setGroupId(st.nextToken());
- component.setArtifactId(st.nextToken());
- component.setType(st.nextToken());
- component.setVersion(st.nextToken());
- component.setScope(st.nextToken());
- return component;
- }
-
- public void setDependenciesResource(Resource dependenciesResource) {
- this.dependenciesResource = dependenciesResource;
- }
-
- public Object getObject() throws Exception {
- return loadMavenFiles();
- }
-
- @SuppressWarnings("unchecked")
- public Class<List> getObjectType() {
- return List.class;
- }
-
- public boolean isSingleton() {
- return false;
- }
-
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.maven;
-
-/*******************************************************************************
- * Copyright (c) 2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-
-import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.providers.file.FileWagon;
-import org.apache.maven.wagon.providers.http.LightweightHttpWagon;
-import org.apache.maven.wagon.providers.webdav.WebDavWagon;
-import org.eclipse.aether.connector.wagon.WagonProvider;
-
-public class ManualWagonProvider implements WagonProvider {
-
- public Wagon lookup(String roleHint) throws Exception {
- if ("file".equals(roleHint)) {
- return new FileWagon();
- } else if ("http".equals(roleHint)) {
- return new LightweightHttpWagon();
- } else if ("webdav".equals(roleHint)) {
- return new WebDavWagon();
- }
- return null;
- }
-
- public void release(Wagon wagon) {
-
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.maven;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.SlcException;
-import org.codehaus.plexus.PlexusContainer;
-
-/** A Maven execution. */
-public class MavenCall implements Runnable {
- private final static Log log = LogFactory.getLog(MavenCall.class);
- private String basedir;
- private String settings;
- /** Raw command lines arguments */
- private String cl;
- private List<String> goals;
- private List<String> profiles;
- private Map<String, String> properties;
-
- private Boolean success = null;
-
- public void run() {
- Thread.currentThread().setContextClassLoader(
- getClass().getClassLoader());
- List<String> args = new ArrayList<String>();
- args.add("-e");
- if (settings != null && !settings.trim().equals("")) {
- args.add("--settings");
- args.add(settings);
- }
- args.add("-f");
- args.add(getBasedirFile().getPath() + "/pom.xml");
- // FIXME manages \" \". Use Commons CLI?
- if (cl != null) {
- String[] clArgs = cl.split(" ");
- args.addAll(Arrays.asList(clArgs));
- }
-
- if (goals != null)
- args.addAll(goals);
- if (profiles != null)
- for (String profile : profiles)
- args.add("-P" + profile);
- if (properties != null)
- for (String key : properties.keySet())
- args.add("-D" + key + "=\"" + properties.get(key) + "\"");
-
- // String[] goals = { "-o", "-e", "-f", basedir + "/pom.xml", "clean",
- // "install" };
-
- // String m2Home = "/opt/apache-maven-3.0.1";
- // System.setProperty("classworlds.conf", m2Home + "/bin/m2.conf");
- // System.setProperty("maven.home", m2Home);
- //
- // Launcher.main(goals);
- log.info("Maven call: " + args);
-
- CustomCli mavenCli = new CustomCli();
- int exitCode = mavenCli.doMain(args.toArray(new String[args.size()]),
- getBasedirFile().getPath(), System.out, System.err);
- if (log.isDebugEnabled())
- log.debug("Maven exit code: " + exitCode);
- if (exitCode == 0)
- success = true;
- else
- success = false;
-
- PlexusContainer plexusContainer = mavenCli.getContainer();
- if (log.isDebugEnabled())
- log.debug(plexusContainer.getContext().getContextData());
- plexusContainer.dispose();
- }
-
- /** Removes 'file:' prefix if present */
- protected File getBasedirFile() {
- if (basedir == null)
- throw new SlcException("basedir not set");
- File dir;
- if (basedir.startsWith("file:"))
- dir = new File(basedir.substring("file:".length()));
- else
- dir = new File(basedir);
- return dir;
- }
-
- public void setBasedir(String basedir) {
- this.basedir = basedir;
- }
-
- public void setSettings(String settings) {
- this.settings = settings;
- }
-
- public void setGoals(List<String> goals) {
- this.goals = goals;
- }
-
- public void setProfiles(List<String> profiles) {
- this.profiles = profiles;
- }
-
- public void setProperties(Map<String, String> properties) {
- this.properties = properties;
- }
-
- public void setCl(String cl) {
- this.cl = cl;
- }
-
- public Boolean getSuccess() {
- return success == null ? false : success;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.maven;
-
-import java.io.File;
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
-import java.util.UUID;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.SlcException;
-import org.argeo.slc.deploy.DeployEnvironment;
-
-public abstract class MavenDeployEnvironment implements DeployEnvironment {
- private static final Log log = LogFactory
- .getLog(MavenDeployEnvironment.class);
- private MavenManager mavenManager;
-
- public void unpackTo(Object packg, File targetLocation,
- Map<String, String> filter) {
- File packageLocation=null;
- String type = null;
- String removeRootDir = "enabled";
-// if (packg instanceof MavenFile) {
-// packageLocation = mavenManager
-// .getPackageLocation((MavenFile) packg);
-// type = ((MavenFile) packg).getType();
-// } else
- if (packg instanceof File) {
- packageLocation = (File) packg;
- // TODO: type based on extension
- } else {
- throw new SlcException("Unrecognized package type "
- + packg.getClass());
- }
- if (log.isDebugEnabled()) {
- log.debug("Unpack " + packageLocation + " of type " + type + " to "
- + targetLocation);
- }
-
- try {
- File tempDir = new File("/tmp/" + UUID.randomUUID().toString());
- tempDir.mkdirs();
- targetLocation.mkdirs();
- Properties props = new Properties();
- props.setProperty("dest", targetLocation.getAbsolutePath());
- props.setProperty("src", packageLocation.getAbsolutePath());
- props.setProperty("tempDir", tempDir.getAbsolutePath());
- props.setProperty("removeRootDir", removeRootDir);
-
- URL antUrl = getClass().getClassLoader().getResource(
- "org/argeo/slc/support/deploy/ant/build.xml");
-
- // if (type == null || type.equals("zip")) {
- // new AntRunner(antUrl, "deployZip", props).run();
- // } else if (type.equals("tar.gz")) {
- // new AntRunner(antUrl, "deployTarGz", props).run();
- // } else {
- // throw new SlcException("Unknow package type " + type);
- // }
- throw new SlcException("Not implemented.");
- } catch (SlcException e) {
- throw e;
- } catch (Exception e) {
- throw new SlcException("Cannot unpack package " + packg + " to "
- + targetLocation, e);
- }
- }
-
- public void setMavenManager(MavenManager mavenManager) {
- this.mavenManager = mavenManager;
- }
-
-}
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.maven;\r
-\r
-import org.argeo.slc.build.Distribution;\r
-import org.argeo.slc.deploy.DeploymentData;\r
-\r
-public class MavenFile implements Distribution, DeploymentData {\r
- private String groupId;\r
- private String artifactId;\r
- private String version;\r
- private String type;\r
- private String classifier;\r
- private String scope;\r
-\r
- public String getScope() {\r
- return scope;\r
- }\r
-\r
- public void setScope(String scope) {\r
- this.scope = scope;\r
- }\r
-\r
- private String distributionId;\r
-\r
- public String getDistributionId() {\r
- return distributionId;\r
- }\r
-\r
- public void setDistributionId(String distributionId) {\r
- this.distributionId = distributionId;\r
- }\r
-\r
- public String getGroupId() {\r
- return groupId;\r
- }\r
-\r
- public void setGroupId(String groupId) {\r
- this.groupId = groupId;\r
- }\r
-\r
- public String getArtifactId() {\r
- return artifactId;\r
- }\r
-\r
- public void setArtifactId(String artifactId) {\r
- this.artifactId = artifactId;\r
- }\r
-\r
- public String getVersion() {\r
- return version;\r
- }\r
-\r
- public void setVersion(String version) {\r
- this.version = version;\r
- }\r
-\r
- public String getType() {\r
- return type;\r
- }\r
-\r
- public void setType(String type) {\r
- this.type = type;\r
- }\r
-\r
- public String getClassifier() {\r
- return classifier;\r
- }\r
-\r
- public void setClassifier(String classifier) {\r
- this.classifier = classifier;\r
- }\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.maven;\r
-\r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-import org.apache.maven.repository.internal.DefaultServiceLocator;\r
-import org.apache.maven.repository.internal.MavenRepositorySystemSession;\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.aether.AetherUtils;\r
-import org.argeo.slc.aether.ConsoleRepositoryListener;\r
-import org.argeo.slc.aether.ConsoleTransferListener;\r
-import org.codehaus.plexus.PlexusContainer;\r
-import org.eclipse.aether.RepositorySystem;\r
-import org.eclipse.aether.RepositorySystemSession;\r
-import org.eclipse.aether.artifact.Artifact;\r
-import org.eclipse.aether.collection.CollectRequest;\r
-import org.eclipse.aether.connector.wagon.WagonProvider;\r
-import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;\r
-import org.eclipse.aether.graph.Dependency;\r
-import org.eclipse.aether.graph.DependencyNode;\r
-import org.eclipse.aether.repository.LocalRepository;\r
-import org.eclipse.aether.repository.RemoteRepository;\r
-import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;\r
-import org.eclipse.aether.util.artifact.DefaultArtifact;\r
-import org.eclipse.aether.util.graph.PreorderNodeListGenerator;\r
-\r
-public class MavenManager {\r
- private final static Log log = LogFactory.getLog(MavenManager.class);\r
-\r
- public void init() {\r
- try {\r
- testMaven();\r
- testAether();\r
- // List<ComponentDescriptor<?>> lst = plexusContainer\r
- // .discoverComponents(plexusContainer.getContainerRealm());\r
- // for (ComponentDescriptor<?> cd : lst) {\r
- // log.debug(cd);\r
- // }\r
- // ArtifactHandler artifactHandler = plexusContainer\r
- // .lookup(ArtifactHandler.class);\r
- // ArtifactRepository localRepository = new\r
- // DefaultArtifactRepositoryFactory().createArtifactRepository("local",\r
- // , layoutId, snapshots, releases);\r
- // Maven maven = mavenCli.getContainer().lookup(Maven.class);\r
- // Artifact artifact = new DefaultArtifact("org.argeo.slc.dist",\r
- // "org.argeo.slc.sdk", "0.13.1-SNAPSHOT", "compile", "pom",\r
- // null, artifactHandler);\r
- // ArtifactResolutionRequest req = new ArtifactResolutionRequest();\r
- // req.setLocalRepository(localRepository);\r
- // req.setResolveTransitively(true);\r
- // req.setArtifact(artifact);\r
- // ArtifactResolver artifactResolver = plexusContainer\r
- // .lookup(ArtifactResolver.class);\r
- // ArtifactResolutionResult res = artifactResolver.resolve(req);\r
- // Set<Artifact> artifacts = res.getArtifacts();\r
- // for (Artifact art : artifacts) {\r
- // log.debug(art);\r
- // }\r
- } catch (Exception e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- }\r
- }\r
-\r
- public void testMaven() {\r
- Thread.currentThread().setContextClassLoader(\r
- getClass().getClassLoader());\r
- String[] goals = { "-o", "-e", "-f",\r
- "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk/pom.xml",\r
- "dependency:tree" };\r
-\r
- // String m2Home = "/opt/apache-maven-3.0.1";\r
- // System.setProperty("classworlds.conf", m2Home + "/bin/m2.conf");\r
- // System.setProperty("maven.home", m2Home);\r
- //\r
- // Launcher.main(goals);\r
-\r
- CustomCli mavenCli = new CustomCli();\r
- mavenCli.doMain(goals,\r
- "/home/mbaudier/dev/src/slc/dist/org.argeo.slc.sdk",\r
- System.out, System.err);\r
-\r
- PlexusContainer plexusContainer = mavenCli.getContainer();\r
- log.debug(plexusContainer.getContext().getContextData());\r
- plexusContainer.dispose();\r
- }\r
-\r
- public void testAether() {\r
- try {\r
- RepositorySystem repoSystem = createRepositorySystem();\r
-\r
- RepositorySystemSession session = createRepositorySystemSession(repoSystem);\r
-\r
- Dependency dependency = new Dependency(new DefaultArtifact(\r
- "org.argeo.slc.dep:org.argeo.slc.dep.sdk:0.13.1-SNAPSHOT"),\r
- "compile");\r
- RemoteRepository argeo = new RemoteRepository("argeo", "default",\r
- "http://maven.argeo.org/argeo/");\r
- RemoteRepository argeoSnapshots = new RemoteRepository(\r
- "argeo-snapshots", "default",\r
- "http://dev.argeo.org/maven/argeo-snapshots/");\r
-\r
- CollectRequest collectRequest = new CollectRequest();\r
- collectRequest.setRoot(dependency);\r
- collectRequest.addRepository(argeo);\r
- collectRequest.addRepository(argeoSnapshots);\r
- DependencyNode node = repoSystem.collectDependencies(session,\r
- collectRequest).getRoot();\r
-\r
- repoSystem.resolveDependencies(session, node, null);\r
-\r
- PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();\r
- node.accept(nlg);\r
-\r
- for (Artifact artifact : nlg.getArtifacts(true)) {\r
- log.debug(artifact);\r
- }\r
-\r
- AetherUtils.logDependencyNode(0, node);\r
- // System.out.println(nlg.getClassPath());\r
-\r
- } catch (Exception e) {\r
- throw new SlcException("Cannot resolve", e);\r
- }\r
-\r
- }\r
-\r
- /** Creates a Maven {@link RepositorySystem}. */\r
- public static RepositorySystem createRepositorySystem() {\r
- try {\r
- // return new\r
- // DefaultPlexusContainer().lookup(RepositorySystem.class);\r
-\r
- DefaultServiceLocator locator = new DefaultServiceLocator();\r
-\r
- locator.setServices(WagonProvider.class, new ManualWagonProvider());\r
- locator.addService(RepositoryConnectorFactory.class,\r
- WagonRepositoryConnectorFactory.class);\r
-\r
- return locator.getService(RepositorySystem.class);\r
- } catch (Exception e) {\r
- throw new SlcException("Cannot lookup repository system", e);\r
- }\r
- }\r
-\r
- public static RepositorySystemSession createRepositorySystemSession(\r
- RepositorySystem system) {\r
- MavenRepositorySystemSession session = new MavenRepositorySystemSession();\r
-\r
- LocalRepository localRepo = new LocalRepository(\r
- System.getProperty("user.home") + "/.m2/repository");\r
- session.setLocalRepositoryManager(system\r
- .newLocalRepositoryManager(localRepo));\r
- session.setTransferListener(new ConsoleTransferListener(System.out));\r
- session.setRepositoryListener(new ConsoleRepositoryListener());\r
- return session;\r
- }\r
-\r
- public static void main(String[] args) {\r
- new MavenManager().init();\r
- }\r
-\r
-}\r
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.maven;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.beans.factory.FactoryBean;
-
-public class MavenToUrl implements FactoryBean {
- private List<MavenFile> mavenFiles;
- private String baseUrl;
-
- public List<String> asUrls() {
- List<String> urls = new ArrayList<String>();
- for (MavenFile mf : mavenFiles)
- urls.add(convertToUrl(mf));
- return urls;
- }
-
- public String convertToUrl(MavenFile mf) {
- return baseUrl + mf.getGroupId().replace('.', '/') + '/'
- + mf.getArtifactId() + '/' + mf.getVersion() + '/'
- + mf.getArtifactId() + '-' + mf.getVersion() + '.'
- + mf.getType();
- }
-
- public void setMavenFiles(List<MavenFile> mavenFiles) {
- this.mavenFiles = mavenFiles;
- }
-
- public void setBaseUrl(String baseUrl) {
- this.baseUrl = baseUrl;
- }
-
- public Object getObject() throws Exception {
- return asUrls();
- }
-
- public Class<?> getObjectType() {
- return List.class;
- }
-
- public boolean isSingleton() {
- return false;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed 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.
- */
-package org.argeo.slc.maven;
-
-public class RemoteRepo {
- private String id;
- private String url;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
-}
+++ /dev/null
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<project>\r
-\r
- <target name="deployZip">
- <unzip src="${src}" dest="${tempDir}" />
- <copyFromTemp />
- </target>
-
- <target name="deployTarGz">
- <untar src="${src}" dest="${tempDir}" compression="gzip" />
- <copyFromTemp />
- </target>
-
- <macrodef name="copyFromTemp">
- <sequential>
- <copy todir="${dest}" includeemptydirs="true">
- <fileset dir="${tempDir}">
- <include name="**/*" />
- </fileset>
- <mapper classname="org.argeo.slc.ant.RemoveRootDirMapper" to="${removeRootDir}" />
- </copy>
- </sequential>
- </macrodef>
-</project>
\ No newline at end of file
+++ /dev/null
-# Set root logger level to DEBUG and its only appender to A1.\r
-log4j.rootLogger=WARN, console\r
-\r
-## Levels\r
-log4j.logger.org.argeo=DEBUG\r
-log4j.logger.org.argeo.slc.osgi.FileSystemBundleRegister=DEBUG\r
-\r
-## Appenders\r
-log4j.appender.console=org.apache.log4j.ConsoleAppender\r
-log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.support.osgi</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Sun Jun 28 09:05:50 CEST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-source.. = src/main/java/,\
- src/main/resources/,\
- src/test/java/,\
- src/test/resources/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.support.osgi</artifactId>
- <name>SLC Support OSGi</name>
- <packaging>jar</packaging>
- <properties />
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.*
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.core</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>biz.aQute.bndlib</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.osgi.core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.osgi.extender</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>net.sf.cglib</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.objectweb.asm.attrs</artifactId>
- </dependency>
-
- <!-- Xalan and Xerces are implicitly required since the JDK provided implementations
- are overridden in the execution modules manager -->
-<!-- <dependency> -->
-<!-- <groupId>org.argeo.tp</groupId> -->
-<!-- <artifactId>org.apache.xalan</artifactId> -->
-<!-- </dependency> -->
-
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-# Set root logger level to DEBUG and its only appender to A1.\r
-log4j.rootLogger=WARN, console\r
-\r
-## Levels\r
-log4j.logger.org.argeo=DEBUG\r
-log4j.logger.org.argeo.slc.osgi.FileSystemBundleRegister=DEBUG\r
-\r
-## Appenders\r
-log4j.appender.console=org.apache.log4j.ConsoleAppender\r
-log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.support.simple</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-source.. = src/main/java/,\
- src/test/java/,\
- src/test/resources/,\
- src/main/resources/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.support.simple</artifactId>
- <name>SLC Support Simple</name>
- <description>Basic implementations of SLC Specifications</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.*,org.argeo.slc.core.test.spring
- </Export-Package>
- <Import-Package>*,org.apache.commons.logging;version="1.1",
- org.dbunit;resolution:="optional",
- org.dbunit.database;resolution:="optional",
- org.dbunit.dataset;resolution:="optional",
- org.dbunit.dataset.xml;resolution:="optional",
- org.dbunit.operation;resolution:="optional",
- junit.framework;resolution:="optional",
- org.apache.commons.vfs.*,
- javax.swing.plaf.metal
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.core</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.server</groupId>
- <artifactId>org.argeo.server.jcr</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
-
- <!-- SSH -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>com.jcraft.jsch</artifactId>
- </dependency>
-
- <!-- Scheduling -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.quartz</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.context.support</artifactId>
- </dependency>
-
- <!-- Mail -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>javax.mail</artifactId>
- </dependency>
-
- <!-- SVN -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.tmatesoft.svn</artifactId>
- </dependency>
-
- <!-- Commons -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.vfs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.exec</artifactId>
- </dependency>
-
- <!-- TODO: check if necessary here -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.transaction</artifactId>
- </dependency>
-
- <!-- Unit Tests -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-echo demo | passwd root --stdin
-
-#Fix root login on console
-echo "pts/0" >>/etc/securetty
-sed -i s/"session required pam_selinux.so close"/"#session required pam_selinux.so close"/g /etc/pam.d/login
-sed -i s/"session required pam_selinux.so open"/"#session required pam_selinux.so open"/g /etc/pam.d/login
-sed -i s/"session required pam_loginuid.so"/"#session required pam_loginuid.so"/g /etc/pam.d/login
-
-#Configuring basic networking
-cat > /etc/sysconfig/network << EOF
-NETWORKING=yes
-HOSTNAME=demo
-EOF
-cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
-DEVICE=eth0
-BOOTPROTO=dhcp
-ONBOOT=yes
-EOF
-
-#Enabling sshd
-chkconfig sshd on
-
-# Fixing root login for sshd
-sed -i s/"session required pam_selinux.so close"/"#session required pam_selinux.so close"/g /etc/pam.d/sshd
-sed -i s/"session required pam_loginuid.so"/"#session required pam_loginuid.so"/g /etc/pam.d/sshd
-sed -i s/"session required pam_selinux.so open env_params"/"#session required pam_selinux.so open env_params"/g /etc/pam.d/sshd
-
-# Leaving the chroot'ed filesystem
-exit
\ No newline at end of file
+++ /dev/null
-#!/bin/sh
-CHROOT=$1
-echo Init LXC container $CHROOT
-
-mkdir $CHROOT/etc/yum.repos.d/ -p
-cat /etc/yum.repos.d/CentOS-Base.repo |sed s/'$releasever'/6/g > $CHROOT/etc/yum.repos.d/CentOS-Base.repo
-yum groupinstall core --installroot=$CHROOT --nogpgcheck -y
-yum install plymouth libselinux-python --installroot=$CHROOT --nogpgcheck -y
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2007-2012 Argeo GmbH\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-<!-- Copyright (C) 2007-2012 Mathieu Baudier Licensed under the Apache License, \r
- Version 2.0 (the "License"); you may not use this file except in compliance \r
- with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 \r
- Unless required by applicable law or agreed to in writing, software distributed \r
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES \r
- OR CONDITIONS OF ANY KIND, either express or implied. See the License for \r
- the specific language governing permissions and limitations under the License. -->\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-1.2.xsd">\r
-\r
- <bean id="hostManager" class="org.argeo.slc.lib.linux.RedhatHostManager">\r
- <property name="sshTarget" ref="sshTarget" />\r
- <property name="host" ref="host" />\r
- </bean>\r
-\r
- <!-- Execution Flows -->\r
- <bean flow:as-flow="deployConfig" class="org.argeo.slc.core.execution.tasks.MethodCall"\r
- p:target-ref="hostManager" p:method="deployConfig" />\r
-\r
- <bean flow:as-flow="system/reboot" p:command="shutdown -r now"\r
- p:sshTarget-ref="sshTarget" class="org.argeo.slc.jsch.RemoteExec" />\r
-\r
- <bean flow:as-flow="system/shutdown" p:command="shutdown -h now"\r
- p:sshTarget-ref="sshTarget" class="org.argeo.slc.jsch.RemoteExec" />\r
-\r
- <bean flow:as-flow="system/packages/install" class="org.argeo.slc.core.execution.tasks.MethodCall"\r
- p:target-ref="hostManager" p:method="installPackages" />\r
-\r
- <bean flow:as-flow="system/packages/update" p:sshTarget-ref="sshTarget"\r
- class="org.argeo.slc.jsch.RemoteExec">\r
- <property name="systemCall">\r
- <bean class="org.argeo.slc.core.execution.tasks.SystemCall">\r
- <property name="cmd" value="yum -y update" />\r
- </bean>\r
- </property>\r
- </bean>\r
-\r
- <bean flow:as-flow="system/security/firewall" p:script="osgibundle:/scripts/firewall.sh"\r
- p:sshTarget-ref="sshTarget" class="org.argeo.slc.jsch.RemoteExec" />\r
-\r
- <flow:flow name="system/security/authconfig">\r
- <flow:spec>\r
- <flow:primitive name="ldapserver" />\r
- <flow:primitive name="ldapbasedn" />\r
- </flow:spec>\r
- <bean p:sshTarget-ref="sshTarget" class="org.argeo.slc.jsch.RemoteExec">\r
- <flow:variable />\r
- <property name="systemCall">\r
- <bean class="org.argeo.slc.core.execution.tasks.SystemCall">\r
- <property name="command">\r
- <list>\r
- <value>authconfig</value>\r
- <value>--enableldap</value>\r
- <value>--enableldapauth</value>\r
- <value>--enablecache</value>\r
- <value>--enablemkhomedir</value>\r
- <value>--ldapserver=@{ldapserver}</value>\r
- <value>--ldapbasedn=@{ldapbasedn}</value>\r
- <value>--passalgo=sha256</value>\r
- <value>--updateall</value>\r
- </list>\r
- </property>\r
- </bean>\r
- </property>\r
- </bean>\r
- </flow:flow>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-Argeo SLC Site
\ No newline at end of file
+++ /dev/null
-Bundle-SymbolicName: org.argeo.slc.support.simple.tests
-Fragment-Host: org.argeo.slc.support.simple
-
+++ /dev/null
-# Set root logger level to DEBUG and its only appender to A1.\r
-log4j.rootLogger=WARN, console\r
-\r
-## Levels\r
-# Slc\r
-log4j.logger.org.argeo=DEBUG\r
-\r
-# Castor\r
-log4j.logger.org.exolab.castor=WARN\r
-\r
-# Spring\r
-log4j.logger.org.springframework=WARN\r
-\r
-\r
-## Appenders\r
-# A1 is set to be a ConsoleAppender.\r
-log4j.appender.console=org.apache.log4j.ConsoleAppender\r
-\r
-# A1 uses PatternLayout.\r
-log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>\r
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.unit</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-#Sat Jun 27 16:59:43 CEST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+++ /dev/null
-source.. = src/main/java/,\
- src/main/resources/,\
- src/test/java/,\
- src/test/resources/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.slc.unit</artifactId>
- <name>SLC Unit Tests Helpers</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.*,org.argeo.slc.core.test.spring
- </Export-Package>
- <Import-Package>org.apache.commons.logging;version="1.1",
- org.dbunit.*;resolution:="optional",
- org.hibernate.*;resolution:="optional",
- org.springframework.xml.*;resolution:="optional",
- org.springframework.orm.*;resolution:="optional",
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.core</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.support.simple</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>junit</artifactId>
- </dependency>
-
- <!-- DB Unit -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.dbunit</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.commons.collections</artifactId>
- <optional>true</optional>
- </dependency>
-
- <!-- Hibernate -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.hibernate</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.orm</artifactId>
- <optional>true</optional>
- </dependency>
-
- <!-- OSGi -->
- <dependency>
- <groupId>org.argeo.commons.base</groupId>
- <artifactId>org.argeo.osgi.boot</artifactId>
- <version>${version.argeo-commons}</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.osgi.core</artifactId>
- </dependency>
-
- <!-- OXM -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.springframework.oxm</artifactId>
- <optional>true</optional>
- </dependency>
-
- <!-- Logging -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.org.apache.commons.logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.apache.log4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>slf4j.log4j</artifactId>
- </dependency>
-
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>argeo-slc</artifactId>
- <version>2.1.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>runtime</artifactId>
- <packaging>pom</packaging>
- <name>SLC Runtime</name>
- <modules>
- <module>org.argeo.slc.specs</module>
- <module>org.argeo.slc.core</module>
- <module>org.argeo.slc.unit</module>
- <module>org.argeo.slc.support.simple</module>
- <module>org.argeo.slc.support.osgi</module>
- <module>org.argeo.slc.support.equinox</module>
- <module>org.argeo.slc.support.ant</module>
- <module>org.argeo.slc.support.aether</module>
- <module>org.argeo.slc.support.maven</module>
- <module>org.argeo.slc.support.jemmy</module>
- <module>org.argeo.slc.support.jcr</module>
- <module>org.argeo.slc.detached</module>
- <module>org.argeo.slc.detached.launcher</module>
- <module>org.argeo.slc.launcher</module>
- <module>org.argeo.slc.lib.detached</module>
- <module>org.argeo.slc.repo</module>
- <module>org.argeo.slc.rpmfactory</module>
- </modules>
-</project>