From: Mathieu Baudier Date: Tue, 26 Feb 2013 15:38:17 +0000 (+0000) Subject: Remove legacy code X-Git-Tag: argeo-slc-2.1.7~451 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=0e75bed97c103d94640dd4c8e36cdce24b11390a;p=gpl%2Fargeo-slc.git Remove legacy code git-svn-id: https://svn.argeo.org/slc/trunk@6088 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/legacy/buildSite.sh b/legacy/buildSite.sh deleted file mode 100755 index 7992e7448..000000000 --- a/legacy/buildSite.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -# -# To be overridden -# -TO=mathieu.baudier@gmail.com -PROFILES=$1 - -# -# Code -# -BUILD_DIR=`pwd` -HOSTNAME=`hostname -f` -DATE=`date -u` -EXIT_STATUS=0 - -export MAVEN_OPTS=-Xmx256m -export PATH=$PATH:/usr/local/bin - -# BUILD -/usr/local/bin/mvn -up --fail-at-end deploy $PROFILES 2>&1 | tee deploy.log -EXIT_STATUS=$PIPESTATUS -if [ $EXIT_STATUS -eq 0 ] -then - mail -s "Build@$HOSTNAME SUCCESS - $DATE - $BUILD_DIR" $TO < pom.xml -else - mail -s "Build@$HOSTNAME FAILURE - $DATE - $BUILD_DIR" $TO < deploy.log -fi - -# SDK -#cd dist/org.argeo.slc.sdk -#/usr/local/bin/mvn deploy -#cd ../.. - -# SITE -/usr/local/bin/mvn -up --fail-at-end site-deploy $PROFILES 2>&1 | tee siteGeneration.log -if [ $PIPESTATUS -eq 0 ] -then - echo No need to send email for successful site generation -else - mail -s "SiteGeneration@$HOSTNAME FAILURE - $DATE - $BUILD_DIR" $TO < siteGeneration.log -fi - - -exit $EXIT_STATUS diff --git a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.classpath b/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.classpath deleted file mode 100644 index c5931a083..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - >> - - - - diff --git a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.project b/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.project deleted file mode 100644 index aeb02fc0f..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.slc.it.jackrabbit - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.settings/org.eclipse.jdt.core.prefs b/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5890d6b62..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Sat Feb 11 18:14:08 CET 2012 -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 diff --git a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.settings/org.eclipse.pde.core.prefs b/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index 07670bc0e..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Sat Feb 11 18:14:08 CET 2012 -eclipse.preferences.version=1 -pluginProject.extensions=false -resolve.requirebundle=false diff --git a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/META-INF/MANIFEST.MF b/legacy/integration-tests/org.argeo.slc.it.jackrabbit/META-INF/MANIFEST.MF deleted file mode 100644 index 1af4fb491..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/META-INF/MANIFEST.MF +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Jackrabbit -Bundle-SymbolicName: org.argeo.slc.it.jackrabbit -Bundle-Version: 1.0.0.qualifier -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/build.properties b/legacy/integration-tests/org.argeo.slc.it.jackrabbit/build.properties deleted file mode 100644 index 5fc538bc8..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.jackrabbit/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/main/java/ -output.. = target/classes/ -bin.includes = META-INF/,\ - . diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/.classpath b/legacy/integration-tests/org.argeo.slc.it.webapp/.classpath deleted file mode 100644 index b8c975378..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/.project b/legacy/integration-tests/org.argeo.slc.it.webapp/.project deleted file mode 100644 index 5d251937a..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.slc.it.webapp - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/.settings/org.eclipse.jdt.core.prefs b/legacy/integration-tests/org.argeo.slc.it.webapp/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index a1fe8157e..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Tue Jun 02 18:41:08 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 diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/META-INF/MANIFEST.MF b/legacy/integration-tests/org.argeo.slc.it.webapp/META-INF/MANIFEST.MF deleted file mode 100644 index bf8093932..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: SLC Integration Tests -Bundle-SymbolicName: org.argeo.slc.it.webapp -Bundle-Version: 0.13.1.SNAPSHOT -Import-Package: junit.framework;version="3.8.2", - org.argeo.slc, - org.argeo.slc.msg, - org.argeo.slc.runtime, - org.argeo.slc.server, - org.argeo.slc.server.client, - org.argeo.slc.server.unit -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/pom.xml b/legacy/integration-tests/org.argeo.slc.it.webapp/pom.xml deleted file mode 100644 index 1c86dba39..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/pom.xml +++ /dev/null @@ -1,128 +0,0 @@ - - 4.0.0 - - org.argeo.slc - integration-tests - 0.13.1-SNAPSHOT - - org.argeo.slc.it - org.argeo.slc.it.webapp - jar - SLC Integration Tests Web Application - - - - org.argeo.maven.plugins - maven-argeo-osgi-plugin - ${version.maven-argeo-osgi} - - false - - -clean - - - - ${basedir}/../../demo/site;in=*;ex=target;ex=pom.xml;ex=.*, - ${project.build.directory}/lib;in=*.jar, - - - - - org.springframework.osgi.extender, - org.argeo.slc.server.main, - org.argeo.slc.server.h2, - org.argeo.slc.server.hibernate, - org.argeo.slc.ria, - org.argeo.slc.agent, - org.argeo.slc.agent.jms, - org.argeo.slc.demo.minimal, - org.argeo.slc.demo.basic, - org.argeo.slc.demo.ant - - 7080 - - - - - equinox-start - pre-integration-test - - equinox - - - false - - - - equinox-shutdown - post-integration-test - - equinox-shutdown - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - surefire-it - integration-test - - test - - - false - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - process-resources - - copy-dependencies - - - jar - ${project.build.directory}/lib - - - - - - maven-jar-plugin - - - META-INF/MANIFEST.MF - - - - - - - - org.argeo.slc.dep - org.argeo.slc.dep.sdk.rcp - ${version.slc} - - - - org.argeo.slc.runtime - org.argeo.slc.unit - test - ${version.slc} - - - \ No newline at end of file diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/ScenarioWsIntegrationTest.java b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/ScenarioWsIntegrationTest.java deleted file mode 100644 index 460edd0a3..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/ScenarioWsIntegrationTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -package org.argeo.slc.ws; - -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createMinimalConsistentTreeTestResult; -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createSimpleResultPartError; -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createSimpleResultPartFailed; -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createSimpleResultPartPassed; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.core.test.SimpleResultPart; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.msg.process.SlcExecutionRequest; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.unit.AbstractSpringTestCase; -import org.argeo.slc.unit.process.SlcExecutionTestUtils; -import org.springframework.ws.client.core.WebServiceTemplate; - -public class ScenarioWsIntegrationTest extends AbstractSpringTestCase { - private Log log = LogFactory.getLog(getClass()); - - private WebServiceTemplate template; - - public void setUp() { - template = getBean(WebServiceTemplate.class); - } - - public void testSinglePathScenario() { - // Create SLC execution - SlcExecution slcExec = SlcExecutionTestUtils.createSimpleSlcExecution(); - log.info("Send create SlcExecutionRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionRequest(slcExec)); - - // Add SLC execution step - SlcExecutionStep step = new SlcExecutionStep("JUnit step"); - slcExec.getSteps().add(step); - log.info("Send SlcExecutionStepsRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionStepsRequest(slcExec - .getUuid(), step)); - - // Create test result - TreeTestResult ttr = createMinimalConsistentTreeTestResult(slcExec); - ttr.addResultPart(createSimpleResultPartPassed()); - log.info("Send CreateTreeTestResultRequest for result #" - + ttr.getUuid()); - template.marshalSendAndReceive(new CreateTreeTestResultRequest(ttr)); - - // Add failed part - SimpleResultPart failedPart = createSimpleResultPartFailed(); - ttr.addResultPart(failedPart); - log.info("Send ResultPartRequest for result #" + ttr.getUuid()); - template.marshalSendAndReceive(new ResultPartRequest(ttr, null, - failedPart)); - - // Add error part - SimpleResultPart errorPart = createSimpleResultPartError(); - ttr.addResultPart(errorPart); - log.info("Send ResultPartRequest for result #" + ttr.getUuid()); - template.marshalSendAndReceive(new ResultPartRequest(ttr, null, - errorPart)); - - // Close result - ttr.close(); - log - .info("Send CloseTreeTestResultRequest for result #" - + ttr.getUuid()); - template.marshalSendAndReceive(new CloseTreeTestResultRequest(ttr - .getUuid(), ttr.getCloseDate())); - - // Notify SLC execution FINISHED - slcExec.setStatus(SlcExecution.STATUS_FINISHED); - log.info("Send SlcExecutionStatusRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionStatusRequest(slcExec - .getUuid(), slcExec.getStatus())); - } - -} diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcAntWsIntegrationTest.java b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcAntWsIntegrationTest.java deleted file mode 100644 index 136c2d831..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcAntWsIntegrationTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -package org.argeo.slc.ws; - -import org.argeo.slc.ant.unit.MinimalAntClasspathTestCase; - -public class SlcAntWsIntegrationTest extends MinimalAntClasspathTestCase { - public void testSimpleRun() { - execute("/org/argeo/slc/ant/build.xml"); - } - -} diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcExecutionWsIntegrationTest.java b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcExecutionWsIntegrationTest.java deleted file mode 100644 index 2f5d05b23..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcExecutionWsIntegrationTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -package org.argeo.slc.ws; - -import java.util.List; -import java.util.Vector; - -import org.springframework.ws.client.core.WebServiceTemplate; -import org.springframework.ws.soap.client.SoapFaultClientException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.argeo.slc.msg.process.SlcExecutionRequest; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.unit.AbstractSpringTestCase; -import org.argeo.slc.unit.process.SlcExecutionTestUtils; -import org.argeo.slc.ws.client.WebServiceUtils; - -public class SlcExecutionWsIntegrationTest extends AbstractSpringTestCase { - private Log log = LogFactory.getLog(getClass()); - - private WebServiceTemplate template; - - public void setUp() { - template = getBean(WebServiceTemplate.class); - } - - public void testSlcExecutionRequests() { - SlcExecution slcExec = createAndSendSlcExecution(); - - slcExec.setUser("otherUser"); - log.info("Send update SlcExecutionRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionRequest(slcExec)); - } - - public void testSlcExecutionStatusRequest() { - SlcExecution slcExec = createAndSendSlcExecution(); - - slcExec.setStatus(SlcExecution.STATUS_FINISHED); - log.info("Send SlcExecutionStatusRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionStatusRequest(slcExec - .getUuid(), slcExec.getStatus())); - } - - public void testSendSlcExecutionStepRequest() { - SlcExecution slcExec = createAndSendSlcExecution(); - - SlcExecutionStep step1 = new SlcExecutionStep( - "Logline\nAnother log line."); - SlcExecutionStep step2 = new SlcExecutionStep( - "Logline2\nAnother log line2."); - List steps = new Vector(); - steps.add(step1); - steps.add(step2); - - log.info("Send SlcExecutionStepsRequest for SlcExecution #" - + slcExec.getUuid()); - try { - template.marshalSendAndReceive(new SlcExecutionStepsRequest(slcExec - .getUuid(), steps)); - } catch (SoapFaultClientException e) { - WebServiceUtils.manageSoapException(e); - throw e; - } - } - - protected SlcExecution createAndSendSlcExecution() { - SlcExecution slcExec = SlcExecutionTestUtils.createSimpleSlcExecution(); - - log.info("Send create SlcExecutionRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionRequest(slcExec)); - return slcExec; - } -} diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/TreeTestResultWsIntegrationTest.java b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/TreeTestResultWsIntegrationTest.java deleted file mode 100644 index 4b846acd7..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/TreeTestResultWsIntegrationTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -package org.argeo.slc.ws; - -import org.springframework.ws.client.core.WebServiceTemplate; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createCompleteTreeTestResult; -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createSimpleResultPartRequest; - -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.unit.AbstractSpringTestCase; - -public class TreeTestResultWsIntegrationTest extends AbstractSpringTestCase { - private Log log = LogFactory.getLog(getClass()); - - private WebServiceTemplate template; - - public void setUp() { - template = getBean(WebServiceTemplate.class); - } - - public void testCreateTreeTestResultRequest() { - createAndSendTreeTestResult(true); - } - - public void testResultPartRequest() { - TreeTestResult ttr = createAndSendTreeTestResult(true); - - ResultPartRequest req = createSimpleResultPartRequest(ttr); - - log.info("Send ResultPartRequest for result " + req.getResultUuid()); - template.marshalSendAndReceive(req); - } - - public void testCloseTreeTestResultRequest() { - TreeTestResult ttr = createAndSendTreeTestResult(false); - - ttr.close(); - CloseTreeTestResultRequest req = new CloseTreeTestResultRequest(ttr - .getUuid(), ttr.getCloseDate()); - log.info("Send CloseTreeTestResultRequest for result " - + req.getResultUuid()); - template.marshalSendAndReceive(req); - } - - protected TreeTestResult createAndSendTreeTestResult(boolean close) { - TreeTestResult ttr = createCompleteTreeTestResult(); - log.info("Send CreateTreeTestResultRequest for result #" - + ttr.getUuid()); - template.marshalSendAndReceive(new CreateTreeTestResultRequest(ttr)); - - if (close) - ttr.close(); - return ttr; - } -} diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/AgentTest.java b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/AgentTest.java deleted file mode 100644 index f5f0201cf..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/AgentTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -package org.argeo.slc.it.webapp; - -import java.net.InetAddress; - -import org.argeo.slc.runtime.SlcAgentDescriptor; -import org.argeo.slc.server.unit.AbstractHttpClientTestCase; - -public class AgentTest extends AbstractHttpClientTestCase { - public void testListAgents() throws Exception { - SlcAgentDescriptor slcAgentDescriptor = getHttpClient() - .waitForOneAgent(); - assertEquals(InetAddress.getLocalHost().getHostName(), - slcAgentDescriptor.getHost()); - } - -} diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/SimpleScenarioTest.java b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/SimpleScenarioTest.java deleted file mode 100644 index e6d5caba9..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java/org/argeo/slc/it/webapp/SimpleScenarioTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -package org.argeo.slc.it.webapp; - -import org.argeo.slc.Condition; -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.server.client.SlcServerHttpClient; -import org.argeo.slc.server.unit.AbstractHttpClientTestCase; - -public class SimpleScenarioTest extends AbstractHttpClientTestCase { - public void testSimpleScenario() throws Exception { - String moduleName = "org.argeo.slc.demo.basic"; - getHttpClient().startFlowDefault(moduleName, "main", null); - - getHttpClient().callServiceSafe(SlcServerHttpClient.LIST_RESULTS, null, - new Condition() { - - public Boolean check(ObjectList obj) { - return obj.getObjects().size() == 3; - } - }, null); - - getHttpClient().callServiceSafe(SlcServerHttpClient.LIST_RESULTS, null, - new Condition() { - - public Boolean check(ObjectList obj) { - return obj.getObjects().size() == 3; - } - }, null); - } -} diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ant/build.xml b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ant/build.xml deleted file mode 100644 index a90fbde92..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ant/build.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ant/nonDepContext.xml b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ant/nonDepContext.xml deleted file mode 100644 index 07f09b00c..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ant/nonDepContext.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - toto - - - toto - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ws/applicationContext.xml b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ws/applicationContext.xml deleted file mode 100644 index bd70b4b30..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources-old/org/argeo/slc/ws/applicationContext.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources/log4j.properties b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources/log4j.properties deleted file mode 100644 index bd20b8e12..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources/log4j.properties +++ /dev/null @@ -1,14 +0,0 @@ -log4j.rootLogger=WARN, console - -## Levels -# SLC -log4j.logger.org.argeo=DEBUG - -## Appenders -# A1 is set to be a ConsoleAppender. -log4j.appender.console=org.apache.log4j.ConsoleAppender - -# A1 uses PatternLayout. -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n - diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources/org/argeo/slc/it/webapp/applicationContext.xml b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources/org/argeo/slc/it/webapp/applicationContext.xml deleted file mode 100644 index 0e01c02c6..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/resources/org/argeo/slc/it/webapp/applicationContext.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/integration-tests/pom.xml b/legacy/integration-tests/pom.xml deleted file mode 100644 index 51d5311a8..000000000 --- a/legacy/integration-tests/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - 4.0.0 - - org.argeo.slc - argeo-slc - 0.13.1-SNAPSHOT - .. - - org.argeo.slc - integration-tests - pom - SLC Integration Tests - - - withIT - - true - - - org.argeo.slc.it.webapp - - - - withoutIT - - - diff --git a/legacy/modules/org.argeo.slc.agent.ext.jdbc/pom.xml b/legacy/modules/org.argeo.slc.agent.ext.jdbc/pom.xml deleted file mode 100644 index 1288c1d53..000000000 --- a/legacy/modules/org.argeo.slc.agent.ext.jdbc/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - 4.0.0 - - org.argeo.slc - modules - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.agent.ext.jdbc - SLC Agent JDBC Extension - - - - org.apache.felix - maven-bundle-plugin - - - org.springframework.jdbc - - *, - com.mysql.jdbc;resolution:=optional, - net.sourceforge.jtds.jdbc;resolution:=optional, - org.hsqldb;resolution:=optional - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.agent.ext.xalan/pom.xml b/legacy/modules/org.argeo.slc.agent.ext.xalan/pom.xml deleted file mode 100644 index a74e35482..000000000 --- a/legacy/modules/org.argeo.slc.agent.ext.xalan/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - 4.0.0 - - org.argeo.slc - modules - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.agent.ext.xalan - SLC Agent Xalan Extension - - - - org.apache.felix - maven-bundle-plugin - - - org.argeo.slc.agent.ext.xalan - - *, - com.sun.org.apache.xml.internal.dtm;resolution:=optional, - org.w3c.dom.traversal;resolution:=optional - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.agent.jms/.project b/legacy/modules/org.argeo.slc.agent.jms/.project deleted file mode 100644 index f9cc4f057..000000000 --- a/legacy/modules/org.argeo.slc.agent.jms/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.agent.jms - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/common.xml b/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/common.xml deleted file mode 100644 index c0ce5e076..000000000 --- a/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/common.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - osgibundle:agent.properties - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/jms.xml b/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/jms.xml deleted file mode 100644 index 7924dfe2d..000000000 --- a/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/jms.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${slc.server.jms.url} - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/osgi.xml b/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/osgi.xml deleted file mode 100644 index 6020ed85b..000000000 --- a/legacy/modules/org.argeo.slc.agent.jms/META-INF/spring/osgi.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.agent.jms/agent.properties b/legacy/modules/org.argeo.slc.agent.jms/agent.properties deleted file mode 100644 index d688a7450..000000000 --- a/legacy/modules/org.argeo.slc.agent.jms/agent.properties +++ /dev/null @@ -1,5 +0,0 @@ -slc.server.jms.url=tcp://localhost:61616 - -# Customization -slc.agent.jms.disableMarshalling=false -slc.agent.jms.resultListener.onlyOnClose=false diff --git a/legacy/modules/org.argeo.slc.agent.jms/build.properties b/legacy/modules/org.argeo.slc.agent.jms/build.properties deleted file mode 100644 index 7594fab8d..000000000 --- a/legacy/modules/org.argeo.slc.agent.jms/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -bin.includes = META-INF/,\ - . diff --git a/legacy/modules/org.argeo.slc.agent.jms/pom.xml b/legacy/modules/org.argeo.slc.agent.jms/pom.xml deleted file mode 100644 index fb3fd85b7..000000000 --- a/legacy/modules/org.argeo.slc.agent.jms/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - - org.argeo.slc - modules - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.agent.jms - SLC Agent JMS - - - - org.apache.felix - maven-bundle-plugin - - - - *, - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.ext.activemq/.project b/legacy/modules/org.argeo.slc.ext.activemq/.project deleted file mode 100644 index c8e5c7da6..000000000 --- a/legacy/modules/org.argeo.slc.ext.activemq/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.ext.activemq - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.ext.activemq/pom.xml b/legacy/modules/org.argeo.slc.ext.activemq/pom.xml deleted file mode 100644 index 185dba271..000000000 --- a/legacy/modules/org.argeo.slc.ext.activemq/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - 4.0.0 - - org.argeo.slc - modules - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.ext.activemq - SLC ActiveMQ Extension - - - - org.apache.felix - maven-bundle-plugin - - - org.apache.activemq - - *, - org.argeo.slc.runtime, - org.argeo.slc.execution, - org.argeo.slc.msg, - org.argeo.slc.build, - org.argeo.slc.core.execution, - org.argeo.slc.core.attachment, - org.argeo.slc.core.structure, - org.argeo.slc.core.structure.tree, - org.argeo.slc.core.test, - org.argeo.slc.core.test.tree, - org.argeo.slc.deploy, - org.argeo.slc.detached;resolution:=optional, - org.argeo.slc.execution, - org.argeo.slc.msg, - org.argeo.slc.msg.build, - org.argeo.slc.msg.event, - org.argeo.slc.msg.process, - org.argeo.slc.msg.test.tree, - org.argeo.slc.process, - org.argeo.slc.runtime, - org.argeo.slc.test, - org.argeo.slc.xml.process;resolution:=optional, - org.argeo.slc.xml.test.tree;resolution:=optional, - org.hibernate.collection;resolution:=optional - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.activemq/.project b/legacy/modules/org.argeo.slc.server.activemq/.project deleted file mode 100644 index 872d152ec..000000000 --- a/legacy/modules/org.argeo.slc.server.activemq/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.activemq - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.activemq/.settings/org.eclipse.pde.core.prefs b/legacy/modules/org.argeo.slc.server.activemq/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index f0ef2f954..000000000 --- a/legacy/modules/org.argeo.slc.server.activemq/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Sun Feb 14 20:09:09 CET 2010 -eclipse.preferences.version=1 -pluginProject.extensions=false -resolve.requirebundle=false diff --git a/legacy/modules/org.argeo.slc.server.activemq/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.activemq/META-INF/MANIFEST.MF deleted file mode 100644 index 4f2283fcc..000000000 --- a/legacy/modules/org.argeo.slc.server.activemq/META-INF/MANIFEST.MF +++ /dev/null @@ -1,11 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-SymbolicName: org.argeo.slc.server.activemq -Import-Package: javax.jms, - org.apache.activemq, - org.argeo.slc.jms, - org.springframework.beans.factory.config, - org.springframework.jms.connection, - org.springframework.jms.support.converter, - org.springframework.oxm -Bundle-Name: Active MQ Server diff --git a/legacy/modules/org.argeo.slc.server.activemq/META-INF/spring/activemq-osgi.xml b/legacy/modules/org.argeo.slc.server.activemq/META-INF/spring/activemq-osgi.xml deleted file mode 100644 index 1c63302d2..000000000 --- a/legacy/modules/org.argeo.slc.server.activemq/META-INF/spring/activemq-osgi.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.activemq/META-INF/spring/activemq.xml b/legacy/modules/org.argeo.slc.server.activemq/META-INF/spring/activemq.xml deleted file mode 100644 index ef5f43ceb..000000000 --- a/legacy/modules/org.argeo.slc.server.activemq/META-INF/spring/activemq.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - osgibundle:activemq.properties - - - - - - - - - ${slc.server.jms.url} - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.activemq/activemq.properties b/legacy/modules/org.argeo.slc.server.activemq/activemq.properties deleted file mode 100644 index 0e524d438..000000000 --- a/legacy/modules/org.argeo.slc.server.activemq/activemq.properties +++ /dev/null @@ -1,3 +0,0 @@ -slc.server.jms.url=tcp://localhost:61616 - -slc.server.jms.disableMarshalling=false \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.activemq/build.properties b/legacy/modules/org.argeo.slc.server.activemq/build.properties deleted file mode 100644 index 5f22cdd44..000000000 --- a/legacy/modules/org.argeo.slc.server.activemq/build.properties +++ /dev/null @@ -1 +0,0 @@ -bin.includes = META-INF/ diff --git a/legacy/modules/org.argeo.slc.server.agentproxy/.project b/legacy/modules/org.argeo.slc.server.agentproxy/.project deleted file mode 100644 index b2a0bb1dc..000000000 --- a/legacy/modules/org.argeo.slc.server.agentproxy/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.agentproxy - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/MANIFEST.MF deleted file mode 100644 index 599022d9d..000000000 --- a/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/MANIFEST.MF +++ /dev/null @@ -1,12 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-SymbolicName: org.argeo.slc.server.agentproxy -Import-Package: javax.jms, - org.apache.activemq.command, - org.argeo.slc.activemq, - org.argeo.slc.jms, - org.argeo.slc.runtime, - org.springframework.beans.factory.config, - org.springframework.jms.core, - org.springframework.jms.support.converter -Bundle-Name: Agent Proxy diff --git a/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/spring/agentProxy-osgi.xml b/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/spring/agentProxy-osgi.xml deleted file mode 100644 index 874a92a80..000000000 --- a/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/spring/agentProxy-osgi.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/spring/agentProxy.xml b/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/spring/agentProxy.xml deleted file mode 100644 index e67283c5f..000000000 --- a/legacy/modules/org.argeo.slc.server.agentproxy/META-INF/spring/agentProxy.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - osgibundle:agentproxy.properties - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.agentproxy/agentproxy.properties b/legacy/modules/org.argeo.slc.server.agentproxy/agentproxy.properties deleted file mode 100644 index b003c434a..000000000 --- a/legacy/modules/org.argeo.slc.server.agentproxy/agentproxy.properties +++ /dev/null @@ -1 +0,0 @@ -slc.server.jms.agentProxy.timeout=20000 \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.agentproxy/build.properties b/legacy/modules/org.argeo.slc.server.agentproxy/build.properties deleted file mode 100644 index 7594fab8d..000000000 --- a/legacy/modules/org.argeo.slc.server.agentproxy/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -bin.includes = META-INF/,\ - . diff --git a/legacy/modules/org.argeo.slc.server.castor/.project b/legacy/modules/org.argeo.slc.server.castor/.project deleted file mode 100644 index f40b28645..000000000 --- a/legacy/modules/org.argeo.slc.server.castor/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.castor - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.castor/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.castor/META-INF/MANIFEST.MF deleted file mode 100644 index b11b44993..000000000 --- a/legacy/modules/org.argeo.slc.server.castor/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-SymbolicName: org.argeo.slc.server.castor -Import-Package: org.springframework.oxm, - org.argeo.slc.castor, - org.springframework.oxm.castor -Bundle-Name: Server Castor diff --git a/legacy/modules/org.argeo.slc.server.castor/META-INF/spring/castor-osgi.xml b/legacy/modules/org.argeo.slc.server.castor/META-INF/spring/castor-osgi.xml deleted file mode 100644 index aaacff8cc..000000000 --- a/legacy/modules/org.argeo.slc.server.castor/META-INF/spring/castor-osgi.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - org.springframework.oxm.Marshaller - - org.springframework.oxm.Unmarshaller - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.h2/.project b/legacy/modules/org.argeo.slc.server.h2/.project deleted file mode 100644 index 431324bb0..000000000 --- a/legacy/modules/org.argeo.slc.server.h2/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.h2 - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.h2/.settings/org.eclipse.pde.core.prefs b/legacy/modules/org.argeo.slc.server.h2/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index eb0a4dc66..000000000 --- a/legacy/modules/org.argeo.slc.server.h2/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Tue Jul 13 15:43:47 CEST 2010 -eclipse.preferences.version=1 -pluginProject.extensions=false -resolve.requirebundle=false diff --git a/legacy/modules/org.argeo.slc.server.h2/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.h2/META-INF/MANIFEST.MF deleted file mode 100644 index a84864a9d..000000000 --- a/legacy/modules/org.argeo.slc.server.h2/META-INF/MANIFEST.MF +++ /dev/null @@ -1,31 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Server H2 -Bundle-SymbolicName: org.argeo.slc.server.h2 -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-Vendor: Argeo -Import-Package: net.sf.ehcache.hibernate, - org.aopalliance.aop, - org.argeo.slc.core.attachment, - org.argeo.slc.core.structure, - org.argeo.slc.core.structure.tree, - org.argeo.slc.core.test, - org.argeo.slc.core.test.tree, - org.argeo.slc.hibernate, - org.argeo.slc.hibernate.attachment, - org.argeo.slc.hibernate.process, - org.argeo.slc.hibernate.runtime, - org.argeo.slc.hibernate.structure, - org.argeo.slc.hibernate.test, - org.argeo.slc.hibernate.test.tree, - org.argeo.slc.process, - org.argeo.slc.runtime, - org.argeo.slc.test, - org.h2, - org.h2.jdbcx, - org.hibernate, - org.hibernate.hql.ast, - org.springframework.beans.factory.config, - org.springframework.cache.ehcache, - org.springframework.jdbc.datasource, - org.springframework.orm.hibernate3 diff --git a/legacy/modules/org.argeo.slc.server.h2/META-INF/spring/h2-osgi.xml b/legacy/modules/org.argeo.slc.server.h2/META-INF/spring/h2-osgi.xml deleted file mode 100644 index 6d7b0e6f1..000000000 --- a/legacy/modules/org.argeo.slc.server.h2/META-INF/spring/h2-osgi.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.h2/META-INF/spring/h2.xml b/legacy/modules/org.argeo.slc.server.h2/META-INF/spring/h2.xml deleted file mode 100644 index fa26f335e..000000000 --- a/legacy/modules/org.argeo.slc.server.h2/META-INF/spring/h2.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - osgibundle:h2.properties - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.h2/build.properties b/legacy/modules/org.argeo.slc.server.h2/build.properties deleted file mode 100644 index 5f22cdd44..000000000 --- a/legacy/modules/org.argeo.slc.server.h2/build.properties +++ /dev/null @@ -1 +0,0 @@ -bin.includes = META-INF/ diff --git a/legacy/modules/org.argeo.slc.server.h2/h2.properties b/legacy/modules/org.argeo.slc.server.h2/h2.properties deleted file mode 100644 index 0877043d7..000000000 --- a/legacy/modules/org.argeo.slc.server.h2/h2.properties +++ /dev/null @@ -1 +0,0 @@ -slc.server.h2.url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.hibernate/.project b/legacy/modules/org.argeo.slc.server.hibernate/.project deleted file mode 100644 index cade579ca..000000000 --- a/legacy/modules/org.argeo.slc.server.hibernate/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.hibernate - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.hibernate/META-INF/MANIFEST.MF deleted file mode 100644 index f9dc2f0b5..000000000 --- a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/MANIFEST.MF +++ /dev/null @@ -1,31 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-SymbolicName: org.argeo.slc.server.hibernate -Import-Package: org.aopalliance.aop, - org.argeo.slc.core.attachment, - org.argeo.slc.core.structure, - org.argeo.slc.core.structure.tree, - org.argeo.slc.core.test, - org.argeo.slc.core.test.tree, - org.argeo.slc.dao.process, - org.argeo.slc.dao.runtime, - org.argeo.slc.dao.test, - org.argeo.slc.dao.test.tree, - org.argeo.slc.hibernate, - org.argeo.slc.hibernate.process, - org.argeo.slc.hibernate.runtime, - org.argeo.slc.hibernate.test, - org.argeo.slc.hibernate.test.tree, - org.argeo.slc.process, - org.argeo.slc.runtime, - org.argeo.slc.test, - org.hibernate, - org.hibernate.hql.ast, - org.hibernate.jdbc, - org.springframework.aop, - org.springframework.aop.framework, - org.springframework.orm.hibernate3, - org.springframework.orm.hibernate3.support, - org.springframework.transaction, - org.springframework.web.context.request -Bundle-Name: Server Hibernate diff --git a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/db-osgi.xml b/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/db-osgi.xml deleted file mode 100644 index c85ccd5a2..000000000 --- a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/db-osgi.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/db.xml b/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/db.xml deleted file mode 100644 index a5d4329dd..000000000 --- a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/db.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/transaction-osgi.xml b/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/transaction-osgi.xml deleted file mode 100644 index f9513808c..000000000 --- a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/transaction-osgi.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/transaction.xml b/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/transaction.xml deleted file mode 100644 index 7d03b64e1..000000000 --- a/legacy/modules/org.argeo.slc.server.hibernate/META-INF/spring/transaction.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.jcr/.project b/legacy/modules/org.argeo.slc.server.jcr/.project deleted file mode 100644 index f2310ab21..000000000 --- a/legacy/modules/org.argeo.slc.server.jcr/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.jcr - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.jcr/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.jcr/META-INF/MANIFEST.MF deleted file mode 100644 index a3de4b26e..000000000 --- a/legacy/modules/org.argeo.slc.server.jcr/META-INF/MANIFEST.MF +++ /dev/null @@ -1,32 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-SymbolicName: org.argeo.slc.server.jcr -Bundle-Name: Server JCR -Import-Package: javax.jcr, - org.argeo.jcr, - org.argeo.jcr.mvc, - org.argeo.jcr.spring, - org.argeo.security, - org.argeo.security.core, - org.argeo.security.jcr, - org.argeo.slc.core.attachment, - org.argeo.slc.core.execution, - org.argeo.slc.core.structure, - org.argeo.slc.core.structure.tree, - org.argeo.slc.core.test, - org.argeo.slc.core.test.tree, - org.argeo.slc.dao.process, - org.argeo.slc.dao.runtime, - org.argeo.slc.dao.test, - org.argeo.slc.dao.test.tree, - org.argeo.slc.execution, - org.argeo.slc.jcr, - org.argeo.slc.jcr.dao, - org.argeo.slc.jcr.execution, - org.argeo.slc.process, - org.argeo.slc.runtime, - org.argeo.slc.test, - org.springframework.beans.factory.config, - org.springframework.osgi.util, - org.springframework.security;specification-version="2.0.6.RELEASE", - org.springframework.web.context.request diff --git a/legacy/modules/org.argeo.slc.server.jcr/META-INF/spring/jcr-osgi.xml b/legacy/modules/org.argeo.slc.server.jcr/META-INF/spring/jcr-osgi.xml deleted file mode 100644 index 1bf180908..000000000 --- a/legacy/modules/org.argeo.slc.server.jcr/META-INF/spring/jcr-osgi.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.jcr/META-INF/spring/jcr.xml b/legacy/modules/org.argeo.slc.server.jcr/META-INF/spring/jcr.xml deleted file mode 100644 index ba5e1e161..000000000 --- a/legacy/modules/org.argeo.slc.server.jcr/META-INF/spring/jcr.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.jcr/build.properties b/legacy/modules/org.argeo.slc.server.jcr/build.properties deleted file mode 100644 index 7594fab8d..000000000 --- a/legacy/modules/org.argeo.slc.server.jcr/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -bin.includes = META-INF/,\ - . diff --git a/legacy/modules/org.argeo.slc.server.jms/.project b/legacy/modules/org.argeo.slc.server.jms/.project deleted file mode 100644 index 34ade0272..000000000 --- a/legacy/modules/org.argeo.slc.server.jms/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.jms - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.jms/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.jms/META-INF/MANIFEST.MF deleted file mode 100644 index a7a76c126..000000000 --- a/legacy/modules/org.argeo.slc.server.jms/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-SymbolicName: org.argeo.slc.server.jms -Import-Package: javax.jms, - javax.management.j2ee.statistics, - org.apache.activemq, - org.apache.activemq.command, - org.apache.commons.logging, - org.argeo.security, - org.argeo.security.core, - org.argeo.slc.activemq, - org.argeo.slc.core.attachment, - org.argeo.slc.jms, - org.argeo.slc.msg.event, - org.argeo.slc.services, - org.springframework.beans.factory.config, - org.springframework.jms.core, - org.springframework.jms.listener, - org.springframework.jms.listener.adapter, - org.springframework.jms.support.converter, - org.springframework.transaction -Bundle-Name: Server JMS diff --git a/legacy/modules/org.argeo.slc.server.jms/META-INF/spring/jms-osgi.xml b/legacy/modules/org.argeo.slc.server.jms/META-INF/spring/jms-osgi.xml deleted file mode 100644 index 0f900ba78..000000000 --- a/legacy/modules/org.argeo.slc.server.jms/META-INF/spring/jms-osgi.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.jms/META-INF/spring/jms.xml b/legacy/modules/org.argeo.slc.server.jms/META-INF/spring/jms.xml deleted file mode 100644 index b7e379129..000000000 --- a/legacy/modules/org.argeo.slc.server.jms/META-INF/spring/jms.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - osgibundle:jms.properties - - - - - - - - - - - - - - - - - - - - ${slc.server.jms.url} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.jms/build.properties b/legacy/modules/org.argeo.slc.server.jms/build.properties deleted file mode 100644 index 7594fab8d..000000000 --- a/legacy/modules/org.argeo.slc.server.jms/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -bin.includes = META-INF/,\ - . diff --git a/legacy/modules/org.argeo.slc.server.jms/jms.properties b/legacy/modules/org.argeo.slc.server.jms/jms.properties deleted file mode 100644 index 8244f4bcb..000000000 --- a/legacy/modules/org.argeo.slc.server.jms/jms.properties +++ /dev/null @@ -1,2 +0,0 @@ -# TODO: duplicated with activemq bundle! -slc.server.jms.url=tcp://localhost:61616 diff --git a/legacy/modules/org.argeo.slc.server.main/.project b/legacy/modules/org.argeo.slc.server.main/.project deleted file mode 100644 index 9b86d4427..000000000 --- a/legacy/modules/org.argeo.slc.server.main/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.main - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.main/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.main/META-INF/MANIFEST.MF deleted file mode 100644 index 4dc489ff5..000000000 --- a/legacy/modules/org.argeo.slc.server.main/META-INF/MANIFEST.MF +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.argeo.slc.specs,org.argeo.slc.support.equinox -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-Name: SLC Server Main -Bundle-SymbolicName: org.argeo.slc.server.main -Import-Package: org.argeo.slc.build,org.argeo.slc.osgi.build diff --git a/legacy/modules/org.argeo.slc.server.main/META-INF/spring/eclipseUpdateSite.xml b/legacy/modules/org.argeo.slc.server.main/META-INF/spring/eclipseUpdateSite.xml deleted file mode 100644 index 6e8775c18..000000000 --- a/legacy/modules/org.argeo.slc.server.main/META-INF/spring/eclipseUpdateSite.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.main/META-INF/spring/main.xml b/legacy/modules/org.argeo.slc.server.main/META-INF/spring/main.xml deleted file mode 100644 index 5a763ad7e..000000000 --- a/legacy/modules/org.argeo.slc.server.main/META-INF/spring/main.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.main/META-INF/spring/manager.xml b/legacy/modules/org.argeo.slc.server.main/META-INF/spring/manager.xml deleted file mode 100644 index bf342bb6c..000000000 --- a/legacy/modules/org.argeo.slc.server.main/META-INF/spring/manager.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.main/META-INF/spring/osgi.xml b/legacy/modules/org.argeo.slc.server.main/META-INF/spring/osgi.xml deleted file mode 100644 index 50237f47d..000000000 --- a/legacy/modules/org.argeo.slc.server.main/META-INF/spring/osgi.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.main/build.properties b/legacy/modules/org.argeo.slc.server.main/build.properties deleted file mode 100644 index 7594fab8d..000000000 --- a/legacy/modules/org.argeo.slc.server.main/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -bin.includes = META-INF/,\ - . diff --git a/legacy/modules/org.argeo.slc.server.mysql/.project b/legacy/modules/org.argeo.slc.server.mysql/.project deleted file mode 100644 index a45bb024e..000000000 --- a/legacy/modules/org.argeo.slc.server.mysql/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.mysql - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.mysql/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.mysql/META-INF/MANIFEST.MF deleted file mode 100644 index 29ddc6009..000000000 --- a/legacy/modules/org.argeo.slc.server.mysql/META-INF/MANIFEST.MF +++ /dev/null @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.argeo.slc.specs,org.argeo.slc.core -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-Name: Argeo SLC MySQL -Bundle-SymbolicName: org.argeo.slc.server.mysql -Import-Package: com.mysql.jdbc, - net.sf.ehcache.hibernate, - org.apache.commons.dbcp, - org.hibernate, - org.hibernate.hql.ast, - org.springframework.beans.factory.config, - org.springframework.cache.ehcache, - org.springframework.jdbc.datasource, - org.springframework.orm.hibernate3 diff --git a/legacy/modules/org.argeo.slc.server.mysql/META-INF/spring/mysql.xml b/legacy/modules/org.argeo.slc.server.mysql/META-INF/spring/mysql.xml deleted file mode 100644 index 4f85f569e..000000000 --- a/legacy/modules/org.argeo.slc.server.mysql/META-INF/spring/mysql.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - osgibundle:mysql.properties - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.mysql/META-INF/spring/osgi.xml b/legacy/modules/org.argeo.slc.server.mysql/META-INF/spring/osgi.xml deleted file mode 100644 index 6d7b0e6f1..000000000 --- a/legacy/modules/org.argeo.slc.server.mysql/META-INF/spring/osgi.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.mysql/mysql.properties b/legacy/modules/org.argeo.slc.server.mysql/mysql.properties deleted file mode 100644 index 11a0d5544..000000000 --- a/legacy/modules/org.argeo.slc.server.mysql/mysql.properties +++ /dev/null @@ -1,3 +0,0 @@ -jdbc.url=jdbc:mysql://localhost/slc -jdbc.username=root -jdbc.password= diff --git a/legacy/modules/org.argeo.slc.server.services/.project b/legacy/modules/org.argeo.slc.server.services/.project deleted file mode 100644 index 21e00d813..000000000 --- a/legacy/modules/org.argeo.slc.server.services/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.server.services - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.server.services/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.server.services/META-INF/MANIFEST.MF deleted file mode 100644 index 54cab2c93..000000000 --- a/legacy/modules/org.argeo.slc.server.services/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-Name: SLC Server Services -Bundle-SymbolicName: org.argeo.slc.server.services -Import-Package: org.aopalliance.aop, - org.argeo.security, - org.argeo.slc.core.attachment, - org.argeo.slc.dao.process, - org.argeo.slc.dao.runtime, - org.argeo.slc.dao.test, - org.argeo.slc.dao.test.tree, - org.argeo.slc.msg.event, - org.argeo.slc.msg.process, - org.argeo.slc.process, - org.argeo.slc.runtime, - org.argeo.slc.services, - org.argeo.slc.services.impl, - org.hibernate.jdbc, - org.springframework.aop, - org.springframework.aop.framework, - org.springframework.beans.factory.config diff --git a/legacy/modules/org.argeo.slc.server.services/META-INF/spring/services-osgi.xml b/legacy/modules/org.argeo.slc.server.services/META-INF/spring/services-osgi.xml deleted file mode 100644 index 0b80c6e96..000000000 --- a/legacy/modules/org.argeo.slc.server.services/META-INF/spring/services-osgi.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - org.argeo.slc.core.attachment.AttachmentsStorage - - org.argeo.slc.core.attachment.AttachmentUploader - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.services/META-INF/spring/services.xml b/legacy/modules/org.argeo.slc.server.services/META-INF/spring/services.xml deleted file mode 100644 index 39f318f72..000000000 --- a/legacy/modules/org.argeo.slc.server.services/META-INF/spring/services.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - osgibundle:services.properties - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.server.services/build.properties b/legacy/modules/org.argeo.slc.server.services/build.properties deleted file mode 100644 index 7594fab8d..000000000 --- a/legacy/modules/org.argeo.slc.server.services/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -bin.includes = META-INF/,\ - . diff --git a/legacy/modules/org.argeo.slc.server.services/services.properties b/legacy/modules/org.argeo.slc.server.services/services.properties deleted file mode 100644 index 2814c6d17..000000000 --- a/legacy/modules/org.argeo.slc.server.services/services.properties +++ /dev/null @@ -1 +0,0 @@ -slc.server.services.pingCycle=60000 \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/.project b/legacy/modules/org.argeo.slc.webapp/.project deleted file mode 100644 index edfa86a11..000000000 --- a/legacy/modules/org.argeo.slc.webapp/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.argeo.slc.webapp.war - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/legacy/modules/org.argeo.slc.webapp/META-INF/MANIFEST.MF b/legacy/modules/org.argeo.slc.webapp/META-INF/MANIFEST.MF deleted file mode 100644 index ce1a34d90..000000000 --- a/legacy/modules/org.argeo.slc.webapp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,59 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ClassPath: WEB-INF/classes -Bundle-Version: 1.1.3.SNAPSHOT -Bundle-Name: SLC Webapp -Web-ContextPath: org.argeo.slc.webapp -Bundle-SymbolicName: org.argeo.slc.webapp -Import-Package: javax.jcr, - net.sf.cglib.core, - net.sf.cglib.proxy, - net.sf.cglib.reflect, - org.aopalliance.aop, - org.argeo.jackrabbit.remote, - org.argeo.security.mvc, - org.argeo.server, - org.argeo.jcr.mvc, - org.argeo.server.json, - org.argeo.server.mvc, - org.argeo.slc.build, - org.argeo.slc.core.attachment, - org.argeo.slc.core.test.tree, - org.argeo.slc.dao.process, - org.argeo.slc.dao.runtime, - org.argeo.slc.dao.test, - org.argeo.slc.dao.test.tree, - org.argeo.slc.deploy, - org.argeo.slc.msg.event, - org.argeo.slc.runtime, - org.argeo.slc.services, - org.argeo.slc.web.ajaxplorer.file, - org.argeo.slc.web.ajaxplorer.mvc, - org.argeo.slc.web.mvc, - org.argeo.slc.web.mvc.controllers, - org.argeo.slc.web.mvc.provisioning, - org.hibernate.hql.ast;resolution:=optional, - org.hibernate.jdbc;resolution:=optional, - org.springframework.aop, - org.springframework.aop.framework, - org.springframework.aop.scope, - org.springframework.beans.factory.support, - org.springframework.osgi.web.context.support, - org.springframework.oxm, - org.springframework.security, - org.springframework.security.config, - org.springframework.security.context, - org.springframework.security.providers, - org.springframework.security.ui, - org.springframework.security.ui.webapp, - org.springframework.security.userdetails, - org.springframework.security.userdetails.memory, - org.springframework.transaction, - org.springframework.web.context, - org.springframework.web.context.request, - org.springframework.web.context.support, - org.springframework.web.filter, - org.springframework.web.servlet, - org.springframework.web.servlet.handler, - org.springframework.web.servlet.mvc, - org.springframework.web.servlet.mvc.annotation, - org.springframework.web.servlet.view diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/ajaxplorer-servlet.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/ajaxplorer-servlet.xml deleted file mode 100644 index a706606b2..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/ajaxplorer-servlet.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - ajxpDriverHandler - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/applicationContext.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/applicationContext.xml deleted file mode 100644 index 1b9c09502..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/applicationContext.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/doc-servlet.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/doc-servlet.xml deleted file mode 100644 index 0576d0ccf..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/doc-servlet.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - org.argeo.slc.web.mvc.XsltMarshallerView - - - - WEB-INF/xslt/ - - - .xsl - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/jcr-manager-servlet.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/jcr-manager-servlet.xml deleted file mode 100644 index 78670a61a..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/jcr-manager-servlet.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/jcr-servlet.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/jcr-servlet.xml deleted file mode 100644 index 61c886765..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/jcr-servlet.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/osgi.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/osgi.xml deleted file mode 100644 index 25dee67fd..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/osgi.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/provisioning-servlet.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/provisioning-servlet.xml deleted file mode 100644 index bc2df745c..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/provisioning-servlet.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - /*/*/modules.html=availableModulesHtml - /*/*/modules=availableModulesPlain - /*/*/modularDistribution=availableModulesOsgiBoot - /*/*/site.xml=updateSiteHandler - - - - - - - - - - - - - - /*/*/plugins/*=getBundleHandler - /*/*/features/*=getBundleHandler - - - - - - - - - - - - - - /*/*/*.jar=getBundleHandler - - - - - - - - - - - - /distributions=availableDistributions - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/security.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/security.xml deleted file mode 100644 index 9ae3de4a8..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/security.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/slc-service-servlet.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/slc-service-servlet.xml deleted file mode 100644 index 73d854d7c..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/slc-service-servlet.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/web.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/web.xml deleted file mode 100644 index a8a404215..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/web.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - SLC Web Application - - - - slc-service - org.springframework.web.servlet.DispatcherServlet - - contextClass - org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext - - 1 - - - slc-service - *.service - - - - - doc - org.springframework.web.servlet.DispatcherServlet - - contextClass - org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext - - - - - doc - *.xls - - - doc - *.pdf - - - doc - *.xslt - - - doc - *.xml - - - - - provisioning - org.springframework.web.servlet.DispatcherServlet - - contextClass - org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext - - 1 - - - provisioning - /dist/* - - - - - jcr - org.springframework.web.servlet.DispatcherServlet - - contextClass - org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext - - 1 - - - jcr - *.jcr - - - - - jcr-manager - org.springframework.web.servlet.DispatcherServlet - - contextClass - org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext - - 1 - - - - jcr-manager - /jcr-manager/* - - - - - ajaxplorer - org.springframework.web.servlet.DispatcherServlet - - contextClass - org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext - - 1 - - - - ajaxplorer - /ajaxplorer/* - - - - - contextConfigLocation - /WEB-INF/applicationContext.xml - - - - Spring Context - org.springframework.web.context.ContextLoaderListener - - - contextClass - org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext - - - - diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/webdav-config.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/webdav-config.xml deleted file mode 100644 index f562d766e..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/webdav-config.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - nt:file - nt:resource - - - - - - - - - - - - - rep - jcr - - - - - - - diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/webdav-servlet.xml b/legacy/modules/org.argeo.slc.webapp/WEB-INF/webdav-servlet.xml deleted file mode 100644 index 4aa318128..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/webdav-servlet.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - webdavServlet - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultView.xsl b/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultView.xsl deleted file mode 100644 index e9989bdbe..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultView.xsl +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - Result - - -

- Result - -

- -

- -

- - - - - - - - - - - - - -
- - - -
-
- - -
-
\ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultXmlView.xsl b/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultXmlView.xsl deleted file mode 100644 index 87d63716f..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultXmlView.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultXsltView.xsl b/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultXsltView.xsl deleted file mode 100644 index e9989bdbe..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/resultXsltView.xsl +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - Result - - -

- Result - -

- -

- -

- - - - - - - - - - - - - -
- - - -
-
- - -
-
\ No newline at end of file diff --git a/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/viewXml.xsl b/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/viewXml.xsl deleted file mode 100644 index 87d63716f..000000000 --- a/legacy/modules/org.argeo.slc.webapp/WEB-INF/xslt/viewXml.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.server/.classpath b/legacy/runtime/org.argeo.slc.server/.classpath deleted file mode 100644 index 174751585..000000000 --- a/legacy/runtime/org.argeo.slc.server/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/legacy/runtime/org.argeo.slc.server/.project b/legacy/runtime/org.argeo.slc.server/.project deleted file mode 100644 index 278b92daa..000000000 --- a/legacy/runtime/org.argeo.slc.server/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.slc.server - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/legacy/runtime/org.argeo.slc.server/.settings/org.eclipse.jdt.core.prefs b/legacy/runtime/org.argeo.slc.server/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index e71a107e6..000000000 --- a/legacy/runtime/org.argeo.slc.server/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Fri Aug 29 11:25:17 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 diff --git a/legacy/runtime/org.argeo.slc.server/.settings/org.eclipse.ltk.core.refactoring.prefs b/legacy/runtime/org.argeo.slc.server/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index 4b61c7716..000000000 --- a/legacy/runtime/org.argeo.slc.server/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Mon Jul 12 16:05:07 CEST 2010 -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/legacy/runtime/org.argeo.slc.server/.settings/org.springframework.ide.eclipse.core.prefs b/legacy/runtime/org.argeo.slc.server/.settings/org.springframework.ide.eclipse.core.prefs deleted file mode 100644 index b93b9bd51..000000000 --- a/legacy/runtime/org.argeo.slc.server/.settings/org.springframework.ide.eclipse.core.prefs +++ /dev/null @@ -1,19 +0,0 @@ -#Sun Jan 11 18:26:20 CET 2009 -eclipse.preferences.version=1 -org.springframework.ide.eclipse.core.builders.enable.beanmetadatabuilder=false -org.springframework.ide.eclipse.core.enable.project.preferences=false -org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.core.springvalidator=false -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanAlias-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanClass-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanConstructorArgument-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinition-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinitionHolder-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanFactory-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanInitDestroyMethod-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanReference-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.methodOverride-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.parsingProblems-org.springframework.ide.eclipse.beans.core.beansvalidator=true -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.requiredProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=false -org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.core.springClasspath-org.springframework.ide.eclipse.core.springvalidator=false diff --git a/legacy/runtime/org.argeo.slc.server/.springBeans b/legacy/runtime/org.argeo.slc.server/.springBeans deleted file mode 100644 index c11d81486..000000000 --- a/legacy/runtime/org.argeo.slc.server/.springBeans +++ /dev/null @@ -1,13 +0,0 @@ - - - 1 - - - - - - - - - - diff --git a/legacy/runtime/org.argeo.slc.server/pom.xml b/legacy/runtime/org.argeo.slc.server/pom.xml deleted file mode 100644 index f43d284f7..000000000 --- a/legacy/runtime/org.argeo.slc.server/pom.xml +++ /dev/null @@ -1,123 +0,0 @@ - - 4.0.0 - - org.argeo.slc - runtime - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.runtime - org.argeo.slc.server - SLC Server - SLC Server - - - - org.apache.felix - maven-bundle-plugin - - - - org.argeo.slc.*,org.argeo.slc.server,org.argeo.slc.server.spring - - org.w3c.dom;version="0.0.0", - javax.xml.*;version="0.0.0", - org.argeo.slc.activemq;resolution:=optional, - org.argeo.slc.execution, - org.springframework.context.support, - org.tmatesoft.svn.*;resolution:=optional, - com.lowagie.*;resolution:=optional, - com.springsource.json.*;resolution:=optional, - org.springframework.oxm.*;resolution:=optional, - * - - - - - - - - - - org.argeo.commons.security - org.argeo.security.core - ${version.argeo-commons} - - - - - org.argeo.slc.runtime - org.argeo.slc.core - 1.1.3-SNAPSHOT - - - - - org.argeo.tp - org.springframework.web - - - org.argeo.tp - org.springframework.web.servlet - - - org.argeo.tp - org.springframework.aop - - - org.argeo.tp - org.springframework.oxm - true - - - - - org.argeo.tp - org.apache.commons.fileupload - - - - - org.argeo.tp - javax.servlet - - - - - org.argeo.tp - org.aspectj.weaver - - - - - org.argeo.tp - jxl - - - org.argeo.tp - com.lowagie.text - - - - - org.argeo.tp - com.springsource.json - true - - - org.argeo.tp - org.antlr - true - - - - - org.argeo.tp - org.tmatesoft.svn - true - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/AgentService.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/AgentService.java deleted file mode 100644 index 0c74e8ec6..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/AgentService.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services; - -import org.argeo.slc.runtime.SlcAgentDescriptor; - -public interface AgentService { - public void register(SlcAgentDescriptor slcAgentDescriptor); - - public void unregister(SlcAgentDescriptor slcAgentDescriptor); -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/EventPublisherAspect.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/EventPublisherAspect.java deleted file mode 100644 index a2fb8b4e0..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/EventPublisherAspect.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services; - -import java.util.Iterator; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.msg.MsgConstants; -import org.argeo.slc.msg.event.SlcEvent; -import org.argeo.slc.msg.event.SlcEventPublisher; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.runtime.SlcAgentDescriptor; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.After; -import org.aspectj.lang.annotation.Aspect; - -@Aspect -public class EventPublisherAspect { - public final static String EVT_AGENT_REGISTERED = "agentRegistered"; - public final static String EVT_AGENT_UNREGISTERED = "agentUnregistered"; - public final static String EVT_NEW_SLC_EXECUTION = "newSlcExecution"; - public final static String EVT_UPDATE_SLC_EXECUTION_STATUS = "updateSlcExecutionStatus"; - - private final static Log log = LogFactory - .getLog(EventPublisherAspect.class); - - private List eventPublishers; - - @After("execution(void org.argeo.slc.services.AgentService.register(..))") - public void registerAgent(JoinPoint jp) throws Throwable { - SlcAgentDescriptor agentDescriptor = (SlcAgentDescriptor) jp.getArgs()[0]; - SlcEvent event = new SlcEvent(EVT_AGENT_REGISTERED); - event.getHeaders().put(MsgConstants.PROPERTY_SLC_AGENT_ID, - agentDescriptor.getUuid()); - publishEvent(event); - } - - @After("execution(void org.argeo.slc.services.AgentService.unregister(..))") - public void unregisterAgent(JoinPoint jp) throws Throwable { - SlcAgentDescriptor agentDescriptor = (SlcAgentDescriptor) jp.getArgs()[0]; - SlcEvent event = new SlcEvent(EVT_AGENT_UNREGISTERED); - event.getHeaders().put(MsgConstants.PROPERTY_SLC_AGENT_ID, - agentDescriptor.getUuid()); - publishEvent(event); - } - - @After("execution(void org.argeo.slc.services.SlcExecutionService.newExecution(..))") - public void newSlcExecution(JoinPoint jp) throws Throwable { - SlcExecution slcExecution = (SlcExecution) jp.getArgs()[0]; - SlcEvent event = new SlcEvent(EVT_NEW_SLC_EXECUTION); - event.getHeaders().put(MsgConstants.PROPERTY_SLC_EXECUTION_ID, - slcExecution.getUuid()); - publishEvent(event); - } - - @After("execution(void org.argeo.slc.services.SlcExecutionService.updateStatus(..))") - public void updateSlcExecutionStatus(JoinPoint jp) throws Throwable { - SlcExecutionStatusRequest msg = (SlcExecutionStatusRequest) jp - .getArgs()[0]; - SlcEvent event = new SlcEvent(EVT_UPDATE_SLC_EXECUTION_STATUS); - event.getHeaders().put(MsgConstants.PROPERTY_SLC_EXECUTION_ID, - msg.getSlcExecutionUuid()); - event.getHeaders().put(MsgConstants.PROPERTY_SLC_EXECUTION_STATUS, - msg.getNewStatus()); - publishEvent(event); - } - - public void setEventPublishers(List eventPublishers) { - this.eventPublishers = eventPublishers; - } - - protected void publishEvent(SlcEvent event) { - - for (Iterator it = eventPublishers.iterator(); it - .hasNext();) { - SlcEventPublisher eventPublisher = it.next(); - if (log.isTraceEnabled()) - log.debug("Publish event: " - + event.getHeaders().get(SlcEvent.EVENT_TYPE) + " to " - + eventPublisher); - eventPublisher.publish(event); - } - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/ServiceMsgHandler.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/ServiceMsgHandler.java deleted file mode 100644 index 405741e4f..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/ServiceMsgHandler.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services; - -import org.argeo.slc.SlcException; -import org.argeo.slc.msg.MsgHandler; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.msg.test.tree.AddTreeTestResultAttachmentRequest; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.process.SlcExecution; - -public class ServiceMsgHandler implements MsgHandler { - private TestManagerService testManagerService; - private SlcExecutionService slcExecutionService; - - public Object handleMsg(Object msg) { - if (msg instanceof SlcExecution) - slcExecutionService.newExecution((SlcExecution) msg); - else if (msg instanceof SlcExecutionStepsRequest) - slcExecutionService.addSteps((SlcExecutionStepsRequest) msg); - else if (msg instanceof SlcExecutionStatusRequest) - slcExecutionService.updateStatus((SlcExecutionStatusRequest) msg); - else if (msg instanceof CreateTreeTestResultRequest) - testManagerService - .createTreeTestResult((CreateTreeTestResultRequest) msg); - else if (msg instanceof ResultPartRequest) - testManagerService.addResultPart((ResultPartRequest) msg); - else if (msg instanceof CloseTreeTestResultRequest) - testManagerService - .closeTreeTestResult((CloseTreeTestResultRequest) msg); - else if (msg instanceof AddTreeTestResultAttachmentRequest) - testManagerService - .addAttachment((AddTreeTestResultAttachmentRequest) msg); - else - throw new SlcException("Unrecognized message type " + msg); - return null; - } - - public void setTestManagerService(TestManagerService testManagerService) { - this.testManagerService = testManagerService; - } - - public void setSlcExecutionService(SlcExecutionService slcExecutionService) { - this.slcExecutionService = slcExecutionService; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/SlcExecutionService.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/SlcExecutionService.java deleted file mode 100644 index 79663b25f..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/SlcExecutionService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services; - -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.process.SlcExecution; - -public interface SlcExecutionService { - public void newExecution(SlcExecution slcExecutionMsg); - - public void updateStatus(SlcExecutionStatusRequest msg); - - public void addSteps(SlcExecutionStepsRequest msg); -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/TestManagerService.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/TestManagerService.java deleted file mode 100644 index 306994c6b..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/TestManagerService.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services; - -import org.argeo.slc.msg.test.tree.AddTreeTestResultAttachmentRequest; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.test.TestRunDescriptor; - -/** Performs complex business operations. */ -public interface TestManagerService { - /** Performs operations related to the addition of a new test run. */ - public void registerTestRunDescriptor(TestRunDescriptor testRunDescriptor); - - /** Adds a result in a collection based on their ids. */ - public void addResultToCollection(String collectionId, String resultUuid); - - /** Removes a result from a collection based on their ids. */ - public void removeResultFromCollection(String collectionId, - String resultUuid); - - public void createTreeTestResult(CreateTreeTestResultRequest msg); - - public void addResultPart(ResultPartRequest msg); - - public void addAttachment(AddTreeTestResultAttachmentRequest msg); - - public void closeTreeTestResult(CloseTreeTestResultRequest msg); -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/AgentServiceImpl.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/AgentServiceImpl.java deleted file mode 100644 index 7f525c2a9..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/AgentServiceImpl.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Executor; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.dao.runtime.SlcAgentDescriptorDao; -import org.argeo.slc.runtime.SlcAgent; -import org.argeo.slc.runtime.SlcAgentDescriptor; -import org.argeo.slc.runtime.SlcAgentFactory; -import org.argeo.slc.services.AgentService; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.InitializingBean; - -public class AgentServiceImpl implements AgentService, InitializingBean, - DisposableBean { - private final static Log log = LogFactory.getLog(AgentServiceImpl.class); - - private final SlcAgentDescriptorDao slcAgentDescriptorDao; - private final SlcAgentFactory agentFactory; - - private Executor systemExecutor; - - private Long pingCycle = 20000l; - - private Boolean pingThreadActive = true; - - public AgentServiceImpl(SlcAgentDescriptorDao slcAgentDescriptorDao, - SlcAgentFactory agentFactory) { - this.slcAgentDescriptorDao = slcAgentDescriptorDao; - this.agentFactory = agentFactory; - } - - public void register(SlcAgentDescriptor slcAgentDescriptor) { - if (slcAgentDescriptorDao.getAgentDescriptor(slcAgentDescriptor - .getUuid()) == null) - slcAgentDescriptorDao.create(slcAgentDescriptor); - log.info("Registered agent #" + slcAgentDescriptor.getUuid()); - } - - public void unregister(SlcAgentDescriptor slcAgentDescriptor) { - slcAgentDescriptorDao.delete(slcAgentDescriptor); - log.info("Unregistered agent #" + slcAgentDescriptor.getUuid()); - } - - public void afterPropertiesSet() throws Exception { - // if (pingCycle > 0) - // new PingThread().start(); - if (pingCycle > 0) { - Thread authenticatedThread = new Thread("SLC Agents Ping") { - public void run() { - systemExecutor.execute(new AgentsPing()); - } - }; - authenticatedThread.start(); - - } - } - - public synchronized void destroy() throws Exception { - pingThreadActive = false; - notifyAll(); - } - - public void setPingCycle(Long pingCycle) { - this.pingCycle = pingCycle; - } - - public void setSystemExecutor(Executor securityService) { - this.systemExecutor = securityService; - } - - protected class AgentsPing implements Runnable { - public void run() { - - // FIXME: temporary hack so that the ping starts after the server - // has been properly started. - try { - Thread.sleep(10 * 1000); - } catch (InterruptedException e1) { - // silent - } - - log.info("Start pinging agents."); - while (pingThreadActive) { - List lst = slcAgentDescriptorDao - .listSlcAgentDescriptors(); - List agentIds = new ArrayList(); - for (SlcAgentDescriptor ad : lst) - agentIds.add(ad.getUuid()); - - if (log.isTraceEnabled()) - log.trace("Ping " + agentIds.size() + " agent(s)."); - for (String agentId : agentIds) { - SlcAgent agent = agentFactory.getAgent(agentId); - if (!agent.ping()) { - log.info("Agent " + agentId + " did not reply to ping," - + " removing its descriptor..."); - slcAgentDescriptorDao.delete(agentId); - } - } - - lst = slcAgentDescriptorDao.listSlcAgentDescriptors(); - agentIds = new ArrayList(); - for (SlcAgentDescriptor ad : lst) - agentIds.add(ad.getUuid()); - agentFactory.pingAll(agentIds); - - synchronized (AgentServiceImpl.this) { - try { - AgentServiceImpl.this.wait(pingCycle); - } catch (InterruptedException e) { - // silent - } - } - } - log.info("Stopped pinging agents."); - } - - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/SlcExecutionServiceAdapter.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/SlcExecutionServiceAdapter.java deleted file mode 100644 index 0b68375cf..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/SlcExecutionServiceAdapter.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services.impl; - -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.execution.ExecutionProcess; -import org.argeo.slc.execution.ExecutionStep; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.process.SlcExecutionNotifier; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.services.SlcExecutionService; - -/** In memory bridge between SLC execution notifier and service. */ -@SuppressWarnings("deprecation") -public class SlcExecutionServiceAdapter implements SlcExecutionNotifier { - private final static Log log = LogFactory - .getLog(SlcExecutionServiceAdapter.class); - - private SlcExecutionService slcExecutionService; - - public void updateStatus(ExecutionProcess slcExecution, String oldStatus, - String newStatus) { - SlcExecutionStatusRequest req = new SlcExecutionStatusRequest( - slcExecution.getUuid(), newStatus); - try { - slcExecutionService.updateStatus(req); - } catch (Exception e) { - log.trace("Cannot update process status " + e); - } - } - - public void addSteps(ExecutionProcess slcExecution, - List additionalSteps) { - SlcExecutionStepsRequest req = new SlcExecutionStepsRequest( - slcExecution.getUuid(), additionalSteps); - try { - slcExecutionService.addSteps(req); - } catch (Exception e) { - log.trace("Cannot add steps " + e); - } - } - - public void setSlcExecutionService(SlcExecutionService slcExecutionService) { - this.slcExecutionService = slcExecutionService; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/SlcExecutionServiceImpl.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/SlcExecutionServiceImpl.java deleted file mode 100644 index d8f35620d..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/SlcExecutionServiceImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services.impl; - -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.dao.process.SlcExecutionDao; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.services.SlcExecutionService; - -public class SlcExecutionServiceImpl implements SlcExecutionService { - private final Log log = LogFactory.getLog(getClass()); - - private final SlcExecutionDao slcExecutionDao; - - public SlcExecutionServiceImpl(SlcExecutionDao slcExecutionDao) { - this.slcExecutionDao = slcExecutionDao; - } - - public void newExecution(SlcExecution slcExecutionMsg) { - SlcExecution slcExecutionPersisted = slcExecutionDao - .getSlcExecution(slcExecutionMsg.getUuid()); - if (slcExecutionPersisted == null) { - if (log.isTraceEnabled()) - log.trace("Creating SLC execution #" - + slcExecutionMsg.getUuid()); - - slcExecutionDao.create(slcExecutionMsg); - } else { - throw new SlcException( - "There is already an SlcExecution registered with id " - + slcExecutionMsg.getUuid()); - // if (log.isTraceEnabled()) - // log.trace("Updating SLC execution #" - // + slcExecutionMsg.getUuid()); - // - // slcExecutionDao.merge(slcExecutionMsg); - } - } - - public void updateStatus(SlcExecutionStatusRequest msg) { - SlcExecution slcExecution = slcExecutionDao.getSlcExecution(msg - .getSlcExecutionUuid()); - if (slcExecution == null) - throw new SlcException("Could not find SLC execution #" - + msg.getSlcExecutionUuid()); - - slcExecution.setStatus(msg.getNewStatus()); - - if (msg.getNewStatus().equals(SlcExecution.COMPLETED)) { - List steps = new ArrayList(); - steps.add(new SlcExecutionStep(SlcExecutionStep.END, - "Process finished.")); - slcExecutionDao.addSteps(slcExecution.getUuid(), steps); - } - - if (log.isTraceEnabled()) - log.trace("Updating status for SLC execution #" - + slcExecution.getUuid() + " to status " - + msg.getNewStatus()); - - slcExecutionDao.update(slcExecution); - } - - public void addSteps(SlcExecutionStepsRequest msg) { - slcExecutionDao.addSteps(msg.getSlcExecutionUuid(), msg.getSteps()); - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/TestManagerServiceAdapter.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/TestManagerServiceAdapter.java deleted file mode 100644 index 8f9985c45..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/TestManagerServiceAdapter.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services.impl; - -import org.argeo.slc.core.attachment.Attachment; -import org.argeo.slc.core.attachment.SimpleAttachment; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.core.test.tree.TreeTestResultListener; -import org.argeo.slc.msg.test.tree.AddTreeTestResultAttachmentRequest; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.services.TestManagerService; -import org.argeo.slc.test.TestResultPart; - -/** In memory access to a test manager service */ -public class TestManagerServiceAdapter implements TreeTestResultListener { - private Boolean onlyOnClose = false; - - private TestManagerService testManagerService; - - public void resultPartAdded(TreeTestResult testResult, - TestResultPart testResultPart) { - if (onlyOnClose) - return; - - if (testResult.getResultParts().size() == 1 - && testResult.getResultParts().values().iterator().next() - .getParts().size() == 1) { - CreateTreeTestResultRequest req = new CreateTreeTestResultRequest( - testResult); - testManagerService.createTreeTestResult(req); - } else { - ResultPartRequest req = new ResultPartRequest(testResult); - testManagerService.addResultPart(req); - } - } - - public void close(TreeTestResult testResult) { - if (onlyOnClose) { - CreateTreeTestResultRequest req = new CreateTreeTestResultRequest( - testResult); - testManagerService.createTreeTestResult(req); - } else { - CloseTreeTestResultRequest req = new CloseTreeTestResultRequest( - testResult); - testManagerService.closeTreeTestResult(req); - } - } - - public void addAttachment(TreeTestResult testResult, Attachment attachment) { - if (onlyOnClose) - return; - AddTreeTestResultAttachmentRequest req = new AddTreeTestResultAttachmentRequest(); - req.setResultUuid(testResult.getUuid()); - req.setAttachment((SimpleAttachment) attachment); - testManagerService.addAttachment(req); - - } - - /** Publishes the test result only when it gets closed. */ - public void setOnlyOnClose(Boolean onlyOnClose) { - this.onlyOnClose = onlyOnClose; - } - - public void setTestManagerService(TestManagerService testManagerService) { - this.testManagerService = testManagerService; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/TestManagerServiceImpl.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/TestManagerServiceImpl.java deleted file mode 100644 index 1e0297979..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/TestManagerServiceImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.services.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.core.test.tree.TreeTestResultCollection; -import org.argeo.slc.dao.process.SlcExecutionDao; -import org.argeo.slc.dao.test.TestRunDescriptorDao; -import org.argeo.slc.dao.test.tree.TreeTestResultCollectionDao; -import org.argeo.slc.dao.test.tree.TreeTestResultDao; -import org.argeo.slc.msg.test.tree.AddTreeTestResultAttachmentRequest; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.services.TestManagerService; -import org.argeo.slc.test.TestRunDescriptor; - -/** - * Implementation of complex operations impacting the underlying data. - */ -public class TestManagerServiceImpl implements TestManagerService { - private Log log = LogFactory.getLog(getClass()); - - private final TreeTestResultDao treeTestResultDao; - private final TestRunDescriptorDao testRunDescriptorDao; - private final SlcExecutionDao slcExecutionDao; - private final TreeTestResultCollectionDao treeTestResultCollectionDao; - - private String defaultCollectionId = "default"; - - public TestManagerServiceImpl(TreeTestResultDao treeTestResultDao, - TestRunDescriptorDao testRunDescriptorDao, - SlcExecutionDao slcExecutionDao, - TreeTestResultCollectionDao treeTestResultCollectionDao) { - this.treeTestResultDao = treeTestResultDao; - this.testRunDescriptorDao = testRunDescriptorDao; - this.slcExecutionDao = slcExecutionDao; - this.treeTestResultCollectionDao = treeTestResultCollectionDao; - } - - public void registerTestRunDescriptor(TestRunDescriptor testRunDescriptor) { - if (testRunDescriptor != null) { - if (log.isTraceEnabled()) - log.trace("Registering test run descriptor #" - + testRunDescriptor.getTestRunUuid()); - testRunDescriptorDao.saveOrUpdate(testRunDescriptor); - - // Update tree test result collection - // TODO: optimize - - if (testRunDescriptor.getSlcExecutionUuid() != null) { - SlcExecution slcExecution = slcExecutionDao - .getSlcExecution(testRunDescriptor - .getSlcExecutionUuid()); - if (slcExecution != null) { - // Use Host as collection ID if host is available - String collectionId = slcExecution.getHost() != null ? slcExecution - .getHost() - : defaultCollectionId; - addResultToCollection(collectionId, testRunDescriptor - .getTestResultUuid()); - } - } else { - if (log.isTraceEnabled()) - log.trace("ResultUUID=" - + testRunDescriptor.getTestResultUuid()); - addResultToCollection(defaultCollectionId, testRunDescriptor - .getTestResultUuid()); - } - } - } - - public void addResultToCollection(String collectionId, String resultUuid) { - // TODO: improve collections - TreeTestResultCollection ttrc = treeTestResultCollectionDao - .getTestResultCollection(collectionId); - if (ttrc == null) { - ttrc = new TreeTestResultCollection(collectionId); - treeTestResultCollectionDao.create(ttrc); - } - treeTestResultCollectionDao.addResultToCollection(ttrc, resultUuid); - } - - public void removeResultFromCollection(String collectionId, - String resultUuid) { - TreeTestResultCollection ttrc = treeTestResultCollectionDao - .getTestResultCollection(collectionId); - if (ttrc != null) { - treeTestResultCollectionDao.removeResultFromCollection(ttrc, - resultUuid); - } - - // Delete collection if empty - // see https://www.argeo.org/bugzilla/show_bug.cgi?id=74 - if (ttrc.getResults().size() == 0) { - treeTestResultCollectionDao.delete(ttrc); - } - } - - public void createTreeTestResult(CreateTreeTestResultRequest msg) { - TreeTestResult treeTestResult = msg.getTreeTestResult(); - - if (log.isTraceEnabled()) - log.trace("Creating result #" + treeTestResult.getUuid()); - treeTestResultDao.create(treeTestResult); - - registerTestRunDescriptor(msg.getTestRunDescriptor()); - - // FIXME: temporary hack before better collection management is found - if (msg.getTestRunDescriptor() == null) { - addResultToCollection("default", treeTestResult.getUuid()); - } - } - - public void addResultPart(ResultPartRequest msg) { - // registerTestRunDescriptor(msg.getTestRunDescriptor()); - - if (log.isTraceEnabled()) - log.trace("Adding result part to test result #" - + msg.getResultUuid()); - - treeTestResultDao.addResultPart(msg.getResultUuid(), msg.getPath(), msg - .getResultPart(), msg.getRelatedElements()); - // treeTestResultDao.updateAttributes(msg.getResultUuid(), msg - // .getAttributes()); - } - - public void closeTreeTestResult(CloseTreeTestResultRequest msg) { - if (log.isTraceEnabled()) - log.trace("Closing result #" + msg.getResultUuid() + " at date " - + msg.getCloseDate()); - - treeTestResultDao.close(msg.getResultUuid(), msg.getCloseDate()); - } - - public void addAttachment(AddTreeTestResultAttachmentRequest msg) { - if (log.isTraceEnabled()) - log.trace("Adding attachment " + msg.getAttachment() - + " to result #" + msg.getResultUuid()); - treeTestResultDao.addAttachment(msg.getResultUuid(), msg - .getAttachment()); - - } - - public void setDefaultCollectionId(String defaultCollectionId) { - this.defaultCollectionId = defaultCollectionId; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpAction.java deleted file mode 100644 index 400b0cc9d..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpAction.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer; - -import javax.servlet.http.HttpServletRequest; - -public interface AjxpAction{ - public AjxpAnswer execute(T driver, HttpServletRequest request); -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpAnswer.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpAnswer.java deleted file mode 100644 index 308fd0a0a..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpAnswer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer; - -import javax.servlet.http.HttpServletResponse; - -public interface AjxpAnswer { - public static AjxpAnswer DO_NOTHING = new AjxpAnswer(){ - public void updateResponse(HttpServletResponse response) { - } - }; - - public void updateResponse(HttpServletResponse response); -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpDriver.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpDriver.java deleted file mode 100644 index 5df7a080a..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpDriver.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer; - -import javax.servlet.http.HttpServletRequest; - -public interface AjxpDriver { - public AjxpAnswer executeAction(HttpServletRequest request); -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpDriverException.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpDriverException.java deleted file mode 100644 index 25c1fadca..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/AjxpDriverException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer; - -public class AjxpDriverException extends RuntimeException { - static final long serialVersionUID = 1l; - - public AjxpDriverException(String arg0) { - super(arg0); - } - - public AjxpDriverException(String arg0, Throwable arg1) { - super(arg0, arg1); - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/SimpleAjxpDriver.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/SimpleAjxpDriver.java deleted file mode 100644 index 754a9c980..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/SimpleAjxpDriver.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer; - -import java.util.Map; -import java.util.TreeMap; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -public class SimpleAjxpDriver implements AjxpDriver { - protected final Log log = LogFactory.getLog(getClass()); - private Map> actions = new TreeMap>(); - - public AjxpAnswer executeAction(HttpServletRequest request) { - String actionStr = request.getParameter("get_action"); - if (actionStr == null) { - actionStr = request.getParameter("action"); - } - if (!actions.containsKey(actionStr)) { - throw new AjxpDriverException("Action " + actionStr - + " not defined."); - } - AjxpAction action = actions.get(actionStr); - return action.execute(this,request); - } - - public void setActions(Map> actions) { - this.actions = actions; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/AbstractFileDownloadAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/AbstractFileDownloadAction.java deleted file mode 100644 index fca3243eb..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/AbstractFileDownloadAction.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; - -public abstract class AbstractFileDownloadAction extends FileAction { - public AjxpAnswer execute(FileDriver driver, HttpServletRequest request) { - String fileStr = request.getParameter(getFileParameter()); - if (fileStr == null) { - throw new AjxpDriverException( - "A file to download needs to be provided."); - } - File file = new File(driver.getBasePath() + fileStr); - return new AxpBasicDownloadAnswer(file); - } - - /** Return 'file' by default. */ - protected String getFileParameter() { - return "file"; - } - - /** To be overridden. Do nothing by default. */ - protected void setHeaders(HttpServletResponse response, File file) { - // do nothing - } - - protected class AxpBasicDownloadAnswer implements AjxpAnswer { - private final File file; - - public AxpBasicDownloadAnswer(File file) { - this.file = file; - } - - public void updateResponse(HttpServletResponse response) { - InputStream in = null; - OutputStream out = null; - try { - setHeaders(response, file); - - if (log.isDebugEnabled()) - log.debug("Download file " + file); - in = FileUtils.openInputStream(file); - out = response.getOutputStream(); - - copyFile(in, out); - out.flush(); - - } catch (Exception e) { - e.printStackTrace(); - throw new AjxpDriverException("Cannot download file " + file, e); - } finally { - IOUtils.closeQuietly(in); - IOUtils.closeQuietly(out); - } - - } - - protected void copyFile(InputStream in, OutputStream out) - throws Exception { - IOUtils.copy(in, out); - } - - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/AjxpFile.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/AjxpFile.java deleted file mode 100644 index 2a589a4bd..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/AjxpFile.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; - -public class AjxpFile { - private final static Log log = LogFactory.getLog(AjxpFile.class); - - // FIXME: more generic modif time format? - private final static SimpleDateFormat sdf = new SimpleDateFormat( - "dd/MM/yyyy hh:mm"); - - private final File file; - private final String parentPath; - private final String filePath; - - private final String ext; - private final FileType type; - - public AjxpFile(File file, String parentPath) { - this.file = file; - this.parentPath = parentPath; - if (parentPath.equals("/")) { - this.filePath = "/" + file.getName(); - } else { - this.filePath = parentPath + "/" + file.getName(); - } - this.ext = file.isDirectory() ? null : file.getName().substring( - file.getName().indexOf('.') + 1); - this.type = FileType.findType(ext); - } - - public String toXml(final LsMode mode, final String encoding) { - try { - StringBuffer buf = new StringBuffer(); - buf.append(""); - - if (log.isTraceEnabled()) - log.trace(buf.toString()); - - return buf.toString(); - } catch (Exception e) { - throw new AjxpDriverException("Could not serialize file " + file, e); - } - } - - private String formatModifTime() { - return sdf.format(new Date(file.lastModified())); - } - - private String formatFileSize() { - return (file.length() / 1024) + " Kb"; - } - - protected void addAttr(String attrName, String attrValue, StringBuffer buf) { - buf.append(" ").append(attrName).append("=\"").append(attrValue) - .append("\""); - } - - /** To be overridden, do nothing by default. */ - protected void addAdditionalAttrs(final StringBuffer buf, - final LsMode mode, final String encoding) { - - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileAction.java deleted file mode 100644 index ff0aee5d1..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileAction.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.web.ajaxplorer.AjxpAction; - -public abstract class FileAction implements AjxpAction { - protected final Log log = LogFactory.getLog(getClass()); -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDeleteAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDeleteAction.java deleted file mode 100644 index 563bd01ef..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDeleteAction.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; - -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; - -public class FileDeleteAction extends FileAction { - - public AjxpAnswer execute(FileDriver driver, HttpServletRequest request) { - Map params = request.getParameterMap(); - for (Object paramKey : params.keySet()) { - String param = paramKey.toString(); - log.debug("param=" + param + " (" + params.get(paramKey)); - if (param.length() < 4) - continue; - else { - - if (param.substring(0, 4).equals("file")) { - String[] values = (String[]) params.get(paramKey); - for (String path : values) { - File file = driver.getFile(path); - executeDelete((T) driver, file); - } - } - } - } - - return AjxpAnswer.DO_NOTHING; - } - - protected void executeDelete(T driver, File file) { - log.debug("Delete file " + file); - file.delete(); - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDownloadAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDownloadAction.java deleted file mode 100644 index ea863a311..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDownloadAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; - -import javax.servlet.http.HttpServletResponse; - -public class FileDownloadAction extends AbstractFileDownloadAction { - - @Override - protected void setHeaders(HttpServletResponse response, File file) { - setDefaultDownloadHeaders(response, file.getName(), file.length()); - } - - public static void setDefaultDownloadHeaders(HttpServletResponse response, - String fileName, Long fileLength) { - response.setContentType("application/force-download; name=\"" - + fileName + "\""); - response.setHeader("Content-Transfer-Encoding", "binary"); - if (fileLength != null) - response.setContentLength(fileLength.intValue()); - response.setHeader("Content-Disposition", "attachement; filename=\"" - + fileName + "\""); - response.setHeader("Expires", "0"); - response.setHeader("Cache-Control", "no-cache, must-revalidate"); - response.setHeader("Pragma", "no-cache"); - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDriver.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDriver.java deleted file mode 100644 index 2e5acb0c0..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileDriver.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; - -import org.argeo.slc.web.ajaxplorer.SimpleAjxpDriver; - -public class FileDriver extends SimpleAjxpDriver{ - private String basePath; - private String encoding = "UTF-8"; - - public String getBasePath() { - return basePath; - } - - public File getBaseDir(){ - return new File(getBasePath()); - } - - public void setBasePath(String basePath) { - if (basePath.charAt(basePath.length() - 1) != File.separatorChar) - basePath = basePath + File.separatorChar; - this.basePath = basePath; - } - - public String getEncoding() { - return encoding; - } - - public void setEncoding(String encoding) { - this.encoding = encoding; - } - - public File getFile(String relpath) { - return new File(getBasePath() + relpath).getAbsoluteFile(); - } - - public File getFile(String dir, String fileName) { - return getFile(dir + File.separator + fileName); - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileImageProxyAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileImageProxyAction.java deleted file mode 100644 index a74498cc3..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileImageProxyAction.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; - -import javax.servlet.http.HttpServletResponse; - -public class FileImageProxyAction extends AbstractFileDownloadAction { - - @Override - protected void setHeaders(HttpServletResponse response, File file) { - FileType fileType = FileType.findType(file); - response.setContentType(fileType.getImageType()); - response.setContentLength((int) file.length()); - response.setHeader("Cache-Control", "public"); - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileLsAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileLsAction.java deleted file mode 100644 index 94240f0f0..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileLsAction.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; -import java.io.FileFilter; -import java.io.OutputStreamWriter; -import java.util.List; -import java.util.Vector; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.IOUtils; -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; - -public class FileLsAction extends - FileAction { - - public AjxpAnswer execute(FileDriver driver, HttpServletRequest request) { - String modeStr = request.getParameter("mode"); - LsMode mode; - if (modeStr == null) - mode = LsMode.NULL; - else if (modeStr.equals("complete")) - mode = LsMode.COMPLETE; - else if (modeStr.equals("file_list")) - mode = LsMode.FILE_LIST; - else if (modeStr.equals("search")) - mode = LsMode.SEARCH; - else - throw new AjxpDriverException("Unkown mode " + modeStr); - - String options = request.getParameter("options"); - if (options != null) { - if ("al".equals(options)) - mode = LsMode.FILE_LIST; - } - - String path = request.getParameter("dir"); - if (path == null) { - path = "/"; - } - - boolean dirOnly = false; - if (mode == LsMode.NULL || mode == LsMode.COMPLETE) { - dirOnly = true; - } - - List ajxpFiles = listFiles((T) driver, path, dirOnly); - /* - * File[] files = dir.listFiles(createFileFilter(request, dir)); - * List ajxpFiles = new Vector(); for (File file : - * files) { if (file.isDirectory()) { ajxpFiles.add(new AjxpFile(file, - * path)); } else { if (!dirOnly) ajxpFiles.add(new AjxpFile(file, - * path)); } } - */ - return new AxpLsAnswer(driver, ajxpFiles, mode); - } - - protected List listFiles(T driver, String path, boolean dirOnly) { - File dir = driver.getFile(path); - - if (!dir.exists()) - throw new AjxpDriverException("Dir " + dir + " does not exist."); - - FileFilter filter = createFileFilter(dir); - File[] files = dir.listFiles(filter); - List ajxpFiles = new Vector(); - for (File file : files) { - if (file.isDirectory()) { - ajxpFiles.add((F) new AjxpFile(file, path)); - } else { - if (!dirOnly) - ajxpFiles.add((F) new AjxpFile(file, path)); - } - } - return ajxpFiles; - } - - /** To be overridden. Accept all by default. */ - protected FileFilter createFileFilter(File dir) { - return new FileFilter() { - public boolean accept(File pathname) { - return true; - } - - }; - } - - protected class AxpLsAnswer implements AjxpAnswer { - private final List files; - private final LsMode mode; - private final FileDriver driver; - - public AxpLsAnswer(FileDriver driver, List files, LsMode mode) { - this.files = files; - this.mode = mode; - this.driver = driver; - } - - public void updateResponse(HttpServletResponse response) { - final String encoding = driver.getEncoding(); - response.setCharacterEncoding(encoding); - response.setContentType("text/xml"); - - ServletOutputStream out = null; - OutputStreamWriter writer = null; - try { - out = response.getOutputStream(); - writer = new OutputStreamWriter(out, encoding); - writer.write(""); - // TODO add current path - writer.write(""); - for (AjxpFile file : files) { - writer.write(file.toXml(mode, encoding)); - } - writer.write(""); - writer.flush(); - - } catch (Exception e) { - throw new AjxpDriverException("Could not write response.", e); - } finally { - IOUtils.closeQuietly(writer); - IOUtils.closeQuietly(out); - } - } - - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileMkdirAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileMkdirAction.java deleted file mode 100644 index a60f3a392..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileMkdirAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; - -import javax.servlet.http.HttpServletRequest; - -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; - -public class FileMkdirAction extends FileAction { - - public AjxpAnswer execute(FileDriver driver, - HttpServletRequest request) { - String dir = request.getParameter("dir"); - String dirName = request.getParameter("dirname"); - - File newDir = driver.getFile(dir, dirName); - newDir.mkdirs(); - - postProcess((T)driver,newDir); - - return AjxpAnswer.DO_NOTHING; - } - - protected void postProcess(T driver,File newDir) { - - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileType.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileType.java deleted file mode 100644 index 48d45a277..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileType.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; - -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; - -public enum FileType { - FOLDER("folder.png", "Directory"), UNKNOWN("mime_empty.png", "Unkown"), GIF( - "image.png", "GIF Picture"), JPEG("image.png", "JPEG Picture"), PNG( - "image.png", "PNG Picture"); - - private final String icon; - private final String mimeString; - - FileType(String icon, String mimeString) { - this.icon = icon; - this.mimeString = mimeString; - } - - public String getIcon() { - return icon; - } - - public String getMimeString() { - return mimeString; - } - - public boolean isImage() { - return this == GIF || this == JPEG || this == PNG; - } - - public String getImageType() { - switch (this) { - case GIF: - return "image/gif"; - case JPEG: - return "image/jpeg"; - case PNG: - return "image/png"; - } - throw new AjxpDriverException("Image type undefined for " + this); - } - - public static FileType findType(File file) { - String ext = file.isDirectory() ? null : file.getName().substring( - file.getName().indexOf('.') + 1); - return findType(ext); - } - - /** - * Find the type based on the extension. - * - * @param ext - * the extension, null for a directory - */ - public static FileType findType(String extArg) { - if (extArg == null) - return FOLDER; - - String ext = extArg.toLowerCase(); - if (ext.equals("jpg") || ext.equals("jpeg")) - return JPEG; - else if (ext.equals("gif")) - return GIF; - else if (ext.equals("png")) - return PNG; - else - return UNKNOWN; - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileUploadAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileUploadAction.java deleted file mode 100644 index 1620d9305..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/FileUploadAction.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.io.IOUtils; -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; - -public class FileUploadAction extends FileAction { - - public AjxpAnswer execute(FileDriver driver, HttpServletRequest request) { - if (!(request instanceof MultipartHttpServletRequest)) { - throw new AjxpDriverException( - "Cann only deal with MultipartHttpServletRequest"); - } - MultipartHttpServletRequest mpr = (MultipartHttpServletRequest) request; - String dir = mpr.getParameter("dir"); - String fileName = mpr.getParameter("Filename"); - - InputStream in = null; - OutputStream out = null; - File file = null; - try { - MultipartFile mpfile = mpr.getFile("Filedata"); - in = mpfile.getInputStream(); - file = driver.getFile(dir, fileName); - out = new FileOutputStream(file); - IOUtils.copy(in, out); - } catch (IOException e) { - throw new AjxpDriverException("Cannot upload file.", e); - } finally { - IOUtils.closeQuietly(in); - IOUtils.closeQuietly(out); - } - postProcess((T)driver, file); - - return AjxpAnswer.DO_NOTHING; - } - - protected void postProcess(T driver,File file) { - - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/LsMode.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/LsMode.java deleted file mode 100644 index e976a2d11..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/file/LsMode.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.file; - -public enum LsMode { - NULL, COMPLETE, FILE_LIST, SEARCH -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/mvc/AjxpDriverRequestHandler.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/mvc/AjxpDriverRequestHandler.java deleted file mode 100644 index 9b929ed0d..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/mvc/AjxpDriverRequestHandler.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.mvc; - -import java.io.IOException; -import java.util.Map; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; -import org.argeo.slc.web.ajaxplorer.AjxpDriver; -import org.springframework.web.HttpRequestHandler; - -public class AjxpDriverRequestHandler implements HttpRequestHandler { - - protected final Log log = LogFactory.getLog(getClass()); - private AjxpDriver driver; - - public void handleRequest(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - long id = System.currentTimeMillis(); - try { - if (log.isDebugEnabled()) - logRequest(id, req.getMethod(), req); - - AjxpAnswer answer = driver.executeAction(req); - answer.updateResponse(resp); - - if (log.isTraceEnabled()) - log.trace(id + " " + req.getMethod() + " completed"); - } catch (Exception e) { - log.error(id + " Cannot process request.", e); - throw new ServletException("Cannot process request " + id, e); - } - - } - - protected void logRequest(long id, String method, HttpServletRequest req) { - if (log.isDebugEnabled()) { - StringBuffer buf = new StringBuffer(id + " Received " + method - + ": "); - buf.append('{'); - @SuppressWarnings("unchecked") - Map params = req.getParameterMap(); - int count1 = 0; - for (Map.Entry entry : params.entrySet()) { - if (count1 != 0) - buf.append(", "); - buf.append(entry.getKey()).append("={"); - int count2 = 0; - for (String value : entry.getValue()) { - if (count2 != 0) - buf.append(','); - buf.append(value); - count2++; - } - buf.append('}'); - count1++; - } - buf.append('}'); - log.debug(buf.toString()); - } - } - - public void setDriver(AjxpDriver driver) { - this.driver = driver; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/mvc/AjxpDriverServlet.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/mvc/AjxpDriverServlet.java deleted file mode 100644 index d4e579e8b..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/mvc/AjxpDriverServlet.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.mvc; - -import java.io.IOException; -import java.util.Enumeration; -import java.util.Map; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; -import org.argeo.slc.web.ajaxplorer.AjxpDriver; -import org.springframework.beans.BeanWrapper; -import org.springframework.beans.BeanWrapperImpl; -import org.springframework.beans.BeansException; -import org.springframework.web.context.WebApplicationContext; -import org.springframework.web.context.support.WebApplicationContextUtils; -import org.springframework.web.servlet.HttpServletBean; - -public class AjxpDriverServlet extends HttpServletBean { - static final long serialVersionUID = 1l; - - protected final Log log = LogFactory.getLog(getClass()); - private String driverBean; - private AjxpDriver driver; - - @Override - public void init(ServletConfig sc) throws ServletException { - super.init(sc); - WebApplicationContext context = WebApplicationContextUtils - .getRequiredWebApplicationContext(sc.getServletContext()); - driverBean = sc.getInitParameter("driverBean"); - if (driverBean == null) { - throw new ServletException( - "No driver found, please set the driverBean property"); - } - - logger.info("Loading driver " + driverBean); - driver = (AjxpDriver) context.getBean(driverBean); - - // overrideBeanProperties(sc); - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - processRequest("GET", req, resp); - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - processRequest("POST", req, resp); - } - - protected void processRequest(String method, HttpServletRequest req, - HttpServletResponse resp) throws ServletException, IOException { - long id = System.currentTimeMillis(); - try { - if (log.isDebugEnabled()) - logRequest(id, method, req); - - AjxpAnswer answer = driver.executeAction(req); - answer.updateResponse(resp); - - if (log.isDebugEnabled()) - log.debug(id + " " + method + " completed"); - } catch (Exception e) { - log.error(id + " Cannot process request.", e); - throw new ServletException("Cannot process request " + id, e); - } - - } - - public void setDriverBean(String driverName) { - this.driverBean = driverName; - } - - protected void logRequest(long id, String method, HttpServletRequest req) { - if (log.isDebugEnabled()) { - StringBuffer buf = new StringBuffer(id + " Received " + method - + ": "); - buf.append('{'); - Map params = req.getParameterMap(); - int count1 = 0; - for (Map.Entry entry : params.entrySet()) { - if (count1 != 0) - buf.append(", "); - buf.append(entry.getKey()).append("={"); - int count2 = 0; - for (String value : entry.getValue()) { - if (count2 != 0) - buf.append(','); - buf.append(value); - count2++; - } - buf.append('}'); - count1++; - } - buf.append('}'); - log.debug(buf.toString()); - } - } - - protected void overrideBeanProperties(ServletConfig sc) - throws ServletException { - BeanWrapper wrapper = new BeanWrapperImpl(driver); - Enumeration en = sc.getInitParameterNames(); - while (en.hasMoreElements()) { - String name = en.nextElement(); - if (name.indexOf(driverBean + '.') == 0 - && name.length() > (driverBean.length() + 1)) { - String propertyName = name.substring(driverBean.length() + 1); - String value = sc.getInitParameter(name); - if (value != null) { - try { - wrapper.setPropertyValue(propertyName, value); - } catch (BeansException e) { - throw new ServletException("Cannot set property " - + propertyName + " of bean " + driverBean, e); - } - } - } - } - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnAjxpFile.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnAjxpFile.java deleted file mode 100644 index 5eedfc794..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnAjxpFile.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.svn; - -import org.argeo.slc.web.ajaxplorer.file.AjxpFile; -import org.argeo.slc.web.ajaxplorer.file.LsMode; -import org.tmatesoft.svn.core.wc.SVNInfo; - -public class SvnAjxpFile extends AjxpFile { - - protected final SVNInfo info; - - public SvnAjxpFile(SVNInfo info, String parentPath) { - super(info.getFile(), parentPath); - this.info = info; - } - - @Override - protected void addAdditionalAttrs(StringBuffer buf, LsMode mode, - String encoding) { - addAttr("author", info.getAuthor(), buf); - addAttr("revision", Long.toString(info.getRevision().getNumber()), buf); - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDeleteAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDeleteAction.java deleted file mode 100644 index 91753773d..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDeleteAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.svn; - -import java.io.File; - -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; -import org.argeo.slc.web.ajaxplorer.file.FileDeleteAction; -import org.tmatesoft.svn.core.SVNException; - -public class SvnDeleteAction extends FileDeleteAction { - @Override - protected void executeDelete(SvnDriver driver, File file) { - try { - driver.beginWriteAction(file.getParentFile()); - - log.debug("SVN Delete: " + file); - driver.getManager().getWCClient().doDelete(file, true, false); - - driver.commitAll("Commit delete of " + file.getName()); - driver.completeWriteAction(file.getParentFile()); - } catch (SVNException e) { - throw new AjxpDriverException("Cannot delete file " + file, e); - } finally { - driver.rollbackWriteAction(file.getParentFile()); - } - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDownloadAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDownloadAction.java deleted file mode 100644 index 9ef372279..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDownloadAction.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.svn; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.IOUtils; -import org.argeo.slc.web.ajaxplorer.AjxpAction; -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; -import org.argeo.slc.web.ajaxplorer.file.FileDownloadAction; -import org.tmatesoft.svn.core.io.SVNRepository; - -public class SvnDownloadAction implements AjxpAction { - - public AjxpAnswer execute(SvnDriver driver, HttpServletRequest request) { - String path = request.getParameter("file"); - if (path.charAt(path.length() - 1) == '/') { - // probably a directory - return AjxpAnswer.DO_NOTHING; - } - - String revStr = request.getParameter("rev"); - Long rev = Long.parseLong(revStr); - return new SvnDownloadAnswer(driver, path, rev); - } - - public class SvnDownloadAnswer implements AjxpAnswer { - private final SvnDriver driver; - private final String path; - private final Long rev; - - public SvnDownloadAnswer(SvnDriver driver, String path, Long rev) { - this.driver = driver; - this.path = path; - this.rev = rev; - } - - public void updateResponse(HttpServletResponse response) { - ServletOutputStream out = null; - try { - FileDownloadAction.setDefaultDownloadHeaders(response, - getFileName(), null); - response.setHeader("AjaXplorer-SvnFileName", getFileName()); - - SVNRepository repository = driver.getRepository(); - out = response.getOutputStream(); - repository.getFile(path, rev, null, out); - } catch (Exception e) { - throw new AjxpDriverException("Cannot download revision " + rev - + " of path " + path, e); - } finally { - IOUtils.closeQuietly(out); - } - } - - protected String getFileName() { - int lastIndexSlash = path.lastIndexOf('/'); - final String origFileName; - if (lastIndexSlash != -1) { - origFileName = path.substring(lastIndexSlash + 1); - } else { - origFileName = path; - } - - int lastIndexPoint = origFileName.lastIndexOf('.'); - String prefix = origFileName.substring(0, lastIndexPoint); - String ext = origFileName.substring(lastIndexPoint); - return prefix + "-" + rev + ext; - } - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDriver.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDriver.java deleted file mode 100644 index 1d3e95f64..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnDriver.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.svn; - -import java.io.File; - -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; -import org.argeo.slc.web.ajaxplorer.file.FileDriver; -import org.springframework.beans.factory.BeanNameAware; -import org.tmatesoft.svn.core.SVNException; -import org.tmatesoft.svn.core.SVNURL; -import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory; -import org.tmatesoft.svn.core.io.SVNRepository; -import org.tmatesoft.svn.core.wc.SVNClientManager; -import org.tmatesoft.svn.core.wc.SVNInfo; -import org.tmatesoft.svn.core.wc.SVNRevision; -import org.tmatesoft.svn.core.wc.admin.SVNAdminClient; - -public class SvnDriver extends FileDriver implements BeanNameAware { - private final static String DEFAULT_DATA_PATH = System - .getProperty("user.home") - + File.separator + "AjaXplorerArchiver" + File.separator + "data"; - - private final static long WRITE_ACTION_TIMEOUT = 10 * 60 * 1000; - - private SVNURL baseUrl; - private SVNClientManager manager; - - private String beanName; - - private boolean isInWriteAction = false; - - public void init() { - FSRepositoryFactory.setup(); - manager = SVNClientManager.newInstance(); - - String basePath = getBasePath(); - if (basePath != null) { - File baseDir = new File(basePath); - if (baseDir.exists()) {// base dir exists - boolean shouldCheckOut = baseDirChecks(baseDir); - if (shouldCheckOut) { - checkOut(baseDir); - } - } else { - checkOut(baseDir); - } - } else { - String defaultBasePath = DEFAULT_DATA_PATH + File.separator - + "svnwc" + File.separator + beanName; - log.warn("No base path provided, use " + defaultBasePath); - setBasePath(defaultBasePath); - - File baseDir = new File(getBasePath()); - if (!baseDir.exists()) { - baseDir.mkdirs(); - } - - if (baseDirChecks(baseDir)) { - if (getBaseUrl() == null) { - String defaultRepoPath = DEFAULT_DATA_PATH + File.separator - + "svnrepos" + File.separator + beanName; - log.warn("No base URL found, create repository at " - + defaultRepoPath); - baseUrl = createRepository(new File(defaultRepoPath)); - } - checkOut(new File(getBasePath())); - } - } - log.info("SVN driver initialized with base url " + getBaseUrl() - + " and base path " + getBasePath()); - } - - /** Builds a SVN URL. */ - public SVNURL getSVNURL(String relativePath) { - try { - return baseUrl.appendPath(relativePath, false); - } catch (SVNException e) { - throw new AjxpDriverException( - "Cannot build URL from relative path " + relativePath - + " and base url " + baseUrl); - } - } - - public SVNRepository getRepository() { - try { - return manager.createRepository(baseUrl, true); - } catch (SVNException e) { - throw new AjxpDriverException("Cannot create repository for " - + baseUrl, e); - } - } - - /** - * Verifies that the provided existing base dir is ok and whether one should - * check out. Set the base url from the working copy. - * - * @return whether one should check out. - */ - protected boolean baseDirChecks(File baseDir) { - if (!baseDir.isDirectory()) { - throw new AjxpDriverException("Base path " + baseDir - + " is not a directory."); - } - - try {// retrieves SVN infos - SVNInfo info = manager.getWCClient().doInfo(baseDir, - SVNRevision.WORKING); - SVNURL baseUrlTemp = info.getURL(); - if (baseUrl != null) { - if (!baseUrl.equals(baseUrlTemp)) { - throw new AjxpDriverException( - "SVN URL of the working copy " - + baseUrlTemp - + " is not compatible with provided baseUrl " - + baseUrl); - } - } else { - this.baseUrl = baseUrlTemp; - } - return false; - } catch (SVNException e) {// no info retrieved - log - .warn("Could not retrieve SVN info from " - + baseDir - + "(" - + e.getMessage() - + "). Guess that it is and empty dir and try to check out from provided URL."); - if (baseDir.listFiles().length != 0) { - throw new AjxpDriverException("Base dir " + baseDir - + " is not a working copy and not an empty dir."); - } - return true; - } - } - - protected void checkOut(File baseDir) { - if (getBaseUrl() == null) { - throw new AjxpDriverException( - "No SVN URL provided, cannot check out."); - } - - // Make sure directory exists - baseDir.mkdirs(); - - try { - long revision = manager.getUpdateClient().doCheckout(getBaseUrl(), - baseDir, SVNRevision.UNDEFINED, SVNRevision.HEAD, true); - log.info("Checked out from " + baseUrl + " to " + baseDir - + " at revision " + revision); - } catch (SVNException e) { - throw new AjxpDriverException("Cannot check out from " + baseUrl - + " to " + baseDir, e); - } - } - - protected SVNURL createRepository(File repoDir) { - try { - SVNAdminClient adminClient = manager.getAdminClient(); - return adminClient.doCreateRepository(repoDir, null, true, false); - } catch (SVNException e) { - throw new AjxpDriverException("Cannot create repository at " - + repoDir, e); - } - } - - private void updateIfRequired(File dir) { - try { - SVNInfo wcInfo = manager.getWCClient().doInfo(getBaseDir(), - SVNRevision.WORKING); - SVNRevision wcRev = wcInfo.getRevision(); - SVNInfo repoInfo = manager.getWCClient().doInfo(getBaseUrl(), - null, SVNRevision.HEAD); - SVNRevision repoRev = repoInfo.getRevision(); - - if (log.isTraceEnabled()) - log - .trace("WC Revision=" + wcRev + ", Repo Revision=" - + repoRev); - - if (!wcRev.equals(repoRev)) { - log.debug("Update working copy from revision " + wcRev - + " to revision " + repoRev); - manager.getUpdateClient().doUpdate(getBaseDir(), - SVNRevision.HEAD, true); - } - } catch (SVNException e) { - throw new AjxpDriverException("Cannot update working copy " - + getBaseDir(),e); - } - } - - public synchronized void beginWriteAction(File dir) { - if (isInWriteAction) { - try { - wait(WRITE_ACTION_TIMEOUT); - } catch (InterruptedException e) { - // silent - } - if (isInWriteAction) { - throw new AjxpDriverException( - "Still in write action after timeout " - + WRITE_ACTION_TIMEOUT + " ms."); - } - } - - isInWriteAction = true; - updateIfRequired(dir); - } - - public synchronized void completeWriteAction(File dir) { - isInWriteAction = false; - notifyAll(); - } - - public synchronized void rollbackWriteAction(File dir) { - // TODO: revert? - isInWriteAction = false; - notifyAll(); - } - - public void commitAll(String message) throws SVNException{ - if(log.isTraceEnabled()) - log.trace("SVN Commit: " + getBaseDir()); - manager.getCommitClient().doCommit(new File[] { getBaseDir() }, true, - message, true, true); - - } - - /** Spring bean name, set at initialization. */ - public void setBeanName(String beanName) { - this.beanName = beanName; - } - - public void setBaseUrl(String baseUrl) { - try { - this.baseUrl = SVNURL.parseURIDecoded(baseUrl); - } catch (SVNException e) { - throw new AjxpDriverException("Cannot parse SVN URL " + baseUrl, e); - } - } - - public SVNURL getBaseUrl() { - return baseUrl; - } - - public SVNClientManager getManager() { - return manager; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnLogAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnLogAction.java deleted file mode 100644 index 24c12bc06..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnLogAction.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.svn; - -import java.io.File; -import java.io.PrintWriter; -import java.text.SimpleDateFormat; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.web.ajaxplorer.AjxpAction; -import org.argeo.slc.web.ajaxplorer.AjxpAnswer; -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; -import org.tmatesoft.svn.core.ISVNLogEntryHandler; -import org.tmatesoft.svn.core.SVNException; -import org.tmatesoft.svn.core.SVNLogEntry; -import org.tmatesoft.svn.core.SVNLogEntryPath; -import org.tmatesoft.svn.core.wc.SVNRevision; - -public class SvnLogAction implements AjxpAction { - private final SimpleDateFormat sdfIso = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss"); - private final Log log = LogFactory.getLog(getClass()); - - public AjxpAnswer execute(SvnDriver driver, HttpServletRequest request) { - String fileStr = request.getParameter("file"); - log.debug("Log file " + fileStr); - if (fileStr == null) { - throw new AjxpDriverException("A file needs to be provided."); - } - File file = new File(driver.getBasePath() + fileStr); - return new SvnLogAnswer(driver, file); - } - - protected class SvnLogAnswer implements AjxpAnswer { - private final SvnDriver driver; - private final File file; - - public SvnLogAnswer(SvnDriver driver, File file) { - this.driver = driver; - this.file = file; - } - - public void updateResponse(HttpServletResponse response) { - PrintWriter writer = null; - try { - writer = response.getWriter(); - writer.append(""); - writer.append(""); - - final List logEntries = new Vector(); - ISVNLogEntryHandler logHandler = new ISVNLogEntryHandler() { - public void handleLogEntry(SVNLogEntry logEntry) - throws SVNException { - logEntries.add(logEntry); - } - }; - - driver.getManager().getLogClient().doLog(new File[] { file }, - SVNRevision.create(0), SVNRevision.HEAD, true, true, - 100, logHandler); - - for (int i = logEntries.size() - 1; i >= 0; i--) { - String xml = logEntryAsXml(logEntries.get(i), file); - if(log.isTraceEnabled()) - log.trace(xml); - writer.append(xml); - } - - writer.append(""); - writer.append(""); - } catch (Exception e) { - throw new AjxpDriverException( - "Cannot retrieve log for " + file, e); - } finally { - IOUtils.closeQuietly(writer); - } - } - - } - - protected String logEntryAsXml(SVNLogEntry entry, File file) { - StringBuffer buf = new StringBuffer(); - buf.append(""); - - buf.append("").append(entry.getAuthor()).append(""); - buf.append("").append(sdfIso.format(entry.getDate())).append( - ""); - - buf.append(""); - Map paths = entry.getChangedPaths(); - for (SVNLogEntryPath path : paths.values()) { - buf.append("").append(path.getPath()).append(""); - } - buf.append(""); - - buf.append("").append(entry.getMessage()).append(""); - - buf.append(""); - return buf.toString(); - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnLsAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnLsAction.java deleted file mode 100644 index 4a3fc411f..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnLsAction.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.svn; - -import java.io.File; -import java.io.FileFilter; -import java.util.List; -import java.util.Vector; - -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; -import org.argeo.slc.web.ajaxplorer.file.FileLsAction; -import org.tmatesoft.svn.core.SVNException; -import org.tmatesoft.svn.core.wc.SVNInfo; -import org.tmatesoft.svn.core.wc.SVNRevision; -import org.tmatesoft.svn.core.wc.SVNWCClient; - -public class SvnLsAction extends FileLsAction { - - @Override - protected List listFiles(SvnDriver driver, final String path, - final boolean dirOnly) { - try { - File dir = driver.getFile(path); - SVNWCClient client = driver.getManager().getWCClient(); - - final List res = new Vector(); - FileFilter filter = createFileFilter(dir); - File[] files = dir.listFiles(filter); - for (File file : files) { - //SVNStatus status = driver.getManager().getStatusClient().doStatus(file, false); - - SVNInfo info = client.doInfo(file, SVNRevision.WORKING); - if (dirOnly) { - if (file.isDirectory()) - res.add(new SvnAjxpFile(info, path)); - } else { - res.add(new SvnAjxpFile(info, path)); - } - } - return res; - } catch (SVNException e) { - throw new AjxpDriverException("Cannot list svn dir " + path, e); - } - } - - @Override - protected FileFilter createFileFilter(File dir) { - return new FileFilter() { - - public boolean accept(File pathname) { - if (pathname.getName().equals(".svn")) { - return false; - } else { - return true; - } - } - - }; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnMkdirAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnMkdirAction.java deleted file mode 100644 index 21cbaaa5b..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnMkdirAction.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.svn; - -import java.io.File; - -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; -import org.argeo.slc.web.ajaxplorer.file.FileMkdirAction; -import org.tmatesoft.svn.core.SVNException; - -public class SvnMkdirAction extends FileMkdirAction { - @Override - protected void postProcess(SvnDriver driver, File newDir) { - try { - driver.beginWriteAction(newDir.getParentFile()); - - log.debug("SVN Add: " + newDir); - driver.getManager().getWCClient().doAdd(newDir, true, - newDir.isDirectory(), true, true); - - driver.commitAll("Commit new dir " + newDir.getName()); - driver.completeWriteAction(newDir.getParentFile()); - } catch (SVNException e) { - throw new AjxpDriverException("Cannot commit new dir" + newDir, e); - } finally { - driver.rollbackWriteAction(newDir.getParentFile()); - } - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnUploadAction.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnUploadAction.java deleted file mode 100644 index bcc9f6a0c..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/ajaxplorer/svn/SvnUploadAction.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.ajaxplorer.svn; - -import java.io.File; - -import org.argeo.slc.web.ajaxplorer.AjxpDriverException; -import org.argeo.slc.web.ajaxplorer.file.FileUploadAction; -import org.tmatesoft.svn.core.SVNException; - -public class SvnUploadAction extends FileUploadAction { - @Override - protected void postProcess(SvnDriver driver, File file) { - try { - driver.beginWriteAction(file.getParentFile()); - - log.debug("SVN Add: " + file); - driver.getManager().getWCClient().doAdd(file, true, - file.isDirectory(), true, true); - - driver.commitAll("Commit file " + file.getName()); - driver.completeWriteAction(file.getParentFile()); - } catch (SVNException e) { - throw new AjxpDriverException("Cannot commit file " + file, e); - } finally { - driver.rollbackWriteAction(file.getParentFile()); - } - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/AbstractServiceController.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/AbstractServiceController.java deleted file mode 100644 index e4ebd5040..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/AbstractServiceController.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc; - -import java.io.PrintWriter; -import java.io.StringWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.msg.ExecutionAnswer; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.AbstractController; - -public abstract class AbstractServiceController extends AbstractController { - public final static String KEY_ANSWER = "__answer"; - - private String viewName = null; - - @Override - protected final ModelAndView handleRequestInternal( - HttpServletRequest request, HttpServletResponse response) - throws Exception { - ModelAndView mv = new ModelAndView(); - mv.setViewName(getViewName()); - try { - handleServiceRequest(request, response, mv); - } catch (Exception e) { - e.printStackTrace(); - StringWriter writer = new StringWriter(); - e.printStackTrace(new PrintWriter(writer)); - ExecutionAnswer answer = ExecutionAnswer.error(writer.toString()); - ModelAndView errorMv = new ModelAndView(); - errorMv.addObject(KEY_ANSWER, answer); - errorMv.setViewName(KEY_ANSWER); - return errorMv; - } - - if (mv.getModel().size() == 0) { - mv.addObject(KEY_ANSWER, ExecutionAnswer - .ok("Execution completed properly")); - } - - if (mv.getViewName() == null && mv.getModel().size() == 1) - mv.setViewName(mv.getModel().keySet().iterator().next().toString()); - - return mv; - } - - protected abstract void handleServiceRequest(HttpServletRequest request, - HttpServletResponse response, ModelAndView modelAndView) - throws Exception; - - public void setViewName(String viewName) { - this.viewName = viewName; - } - - public String getViewName() { - return viewName; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/FileUploadBean.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/FileUploadBean.java deleted file mode 100644 index b7113004a..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/FileUploadBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc; - - -public class FileUploadBean { - private byte[] file; - - public void setFile(byte[] file) { - this.file = file; - } - - public byte[] getFile() { - return file; - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/JsonView.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/JsonView.java deleted file mode 100644 index 25f96cf87..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/JsonView.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc; - -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.SlcException; -import org.springframework.web.servlet.view.AbstractView; - -import com.springsource.json.writer.JSONObject; - -/** Marshal one of the object of the map to the output. */ -public class JsonView extends AbstractView { - private String modelKey = null; - - public JsonView() { - } - - @Override - @SuppressWarnings(value = { "unchecked" }) - protected void renderMergedOutputModel(Map model, - HttpServletRequest request, HttpServletResponse response) - throws Exception { - final Object answer; - if (modelKey != null) { - if (!model.containsKey(modelKey)) - throw new SlcException("Key " + modelKey - + " not found in model."); - answer = model.get(modelKey); - } else { - if (model.size() != 1) - throw new SlcException( - "Model has a size different from 1. Specify a modelKey."); - answer = model.values().iterator().next(); - } - - if (answer instanceof JSONObject) { - ((JSONObject) answer).write(response.getWriter()); - } else { - JSONObject jsonObject = new JSONObject(answer); - jsonObject.write(response.getWriter()); - } - } - - public void setModelKey(String modelKey) { - this.modelKey = modelKey; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/ResultExcelView.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/ResultExcelView.java deleted file mode 100644 index 91ef9af0c..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/ResultExcelView.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc; - -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import jxl.write.Label; -import jxl.write.WritableSheet; -import jxl.write.WritableWorkbook; - -import org.argeo.slc.SlcException; -import org.argeo.slc.core.structure.tree.TreeSPath; -import org.argeo.slc.core.test.SlcTestUtils; -import org.argeo.slc.core.test.tree.PartSubList; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.test.TestResultPart; -import org.springframework.web.servlet.view.document.AbstractJExcelView; - -public class ResultExcelView extends AbstractJExcelView { - public final static String MODELKEY_RESULT = "result"; - - - @SuppressWarnings(value = { "unchecked" }) - protected void buildExcelDocument(Map model, WritableWorkbook workbook, - HttpServletRequest request, HttpServletResponse response) { - try { - if (workbook.getNumberOfSheets() == 0) { - workbook.createSheet("SLC", 0); - } - WritableSheet sheet = workbook.getSheet("SLC"); - - TreeTestResult ttr = (TreeTestResult) model - .get(MODELKEY_RESULT); - - sheet.addCell(new Label(0, 0, "Result " + ttr.getUuid())); - - int currentRow = 1; - for (TreeSPath path : ttr.getResultParts().keySet()) { - PartSubList lst = ttr.getResultParts().get(path); - sheet.addCell(new Label(0, currentRow, "Path " + path)); - currentRow++; - for (TestResultPart part : lst.getParts()) { - sheet.addCell(new Label(0, currentRow, SlcTestUtils - .statusToString(part.getStatus()))); - sheet.addCell(new Label(1, currentRow, part.getMessage())); - currentRow++; - } - currentRow++;// add an empty line between paths - } - } catch (Exception e) { - throw new SlcException("Could not write spreadsheet.", e); - } - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/ResultPdfView.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/ResultPdfView.java deleted file mode 100644 index 7891e1847..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/ResultPdfView.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc; - -import java.awt.Color; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.core.structure.tree.TreeSPath; -import org.argeo.slc.core.test.SlcTestUtils; -import org.argeo.slc.core.test.tree.PartSubList; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.test.TestResultPart; -import org.argeo.slc.test.TestStatus; -import org.springframework.web.servlet.view.document.AbstractPdfView; - -import com.lowagie.text.Cell; -import com.lowagie.text.Document; -import com.lowagie.text.Paragraph; -import com.lowagie.text.Table; -import com.lowagie.text.pdf.PdfWriter; - -public class ResultPdfView extends AbstractPdfView { - // private static final Log log = LogFactory.getLog(ResultPdfView.class); - - public final static String MODELKEY_RESULT = "result"; - - @Override - @SuppressWarnings(value = { "unchecked" }) - protected void buildPdfDocument(Map model, Document document, - PdfWriter writer, HttpServletRequest request, - HttpServletResponse response) throws Exception { - TreeTestResult ttr = (TreeTestResult) model.get(MODELKEY_RESULT); - - document.addTitle("Result " + ttr.getUuid()); - document.add(new Paragraph("Result " + ttr.getUuid())); - - for (TreeSPath path : ttr.getResultParts().keySet()) { - PartSubList lst = ttr.getResultParts().get(path); - document.add(new Paragraph("Path " + path)); - Table table = new Table(2, lst.getParts().size()); - for (TestResultPart part : lst.getParts()) { - Integer status = part.getStatus(); - Cell statusCell = new Cell(SlcTestUtils.statusToString(status)); - final Color color; - if (status.equals(TestStatus.PASSED)) - color = Color.GREEN; - else if (status.equals(TestStatus.FAILED)) - color = Color.RED; - else - color = Color.MAGENTA; - - statusCell.setBackgroundColor(color); - table.addCell(statusCell); - table.addCell(part.getMessage()); - } - document.add(table); - } - - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/WebSlcEventListenerRegister.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/WebSlcEventListenerRegister.java deleted file mode 100644 index a671a72d1..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/WebSlcEventListenerRegister.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Vector; - -import org.argeo.slc.msg.event.SlcEventListenerDescriptor; -import org.argeo.slc.msg.event.SlcEventListenerRegister; -import org.springframework.web.context.request.RequestContextHolder; - -public class WebSlcEventListenerRegister implements SlcEventListenerRegister, - Serializable { - public final static String ATTR_EVENT_LISTENER = "slcEventListener"; - - static final long serialVersionUID = 1l; - - // private String clientId = UUID.randomUUID().toString(); - - /** Synchronized */ - private List descriptors = new Vector(); - - public synchronized void addEventListenerDescriptor( - SlcEventListenerDescriptor eventListenerDescriptor) { - if (descriptors.contains(eventListenerDescriptor)) - descriptors.remove(eventListenerDescriptor); - descriptors.add(eventListenerDescriptor); - } - - public synchronized void removeEventListenerDescriptor( - SlcEventListenerDescriptor eventListenerDescriptor) { - descriptors.remove(eventListenerDescriptor); - } - - public synchronized List getDescriptorsCopy() { - return new ArrayList(descriptors); - } - - public String getId() { - return RequestContextHolder.currentRequestAttributes().getSessionId(); - } - - // public SlcEvent listen(SlcEventListener eventListener, Long timeout) { - // return eventListener.listen(clientId, getDescriptorsCopy(), timeout); - // } - - // public void init() { - // clientId = getSessionId(); - // checkClientId(); - // - // if (log.isDebugEnabled()) - // log.debug("Initialized web event listener " + clientId); - // } - // - // public void close() { - // checkClientId(); - // if (log.isDebugEnabled()) - // log.debug("Closed web event listener " + clientId); - // } - - // protected void checkClientId() { - // String sessionId = getSessionId(); - // if (clientId == null || !clientId.equals(sessionId)) - // throw new SlcException("Client id " + clientId - // + " not consistent with web session id " + sessionId); - // } - // - // protected String getSessionId() { - // return RequestContextHolder.currentRequestAttributes().getSessionId(); - // } - // -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/XsltMarshallerView.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/XsltMarshallerView.java deleted file mode 100644 index 4d1d50e0e..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/XsltMarshallerView.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc; - -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.dom.DOMSource; - -import org.argeo.slc.SlcException; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.core.test.tree.TreeTestResultCollection; -import org.argeo.slc.process.SlcExecution; -import org.springframework.oxm.Marshaller; -import org.springframework.web.servlet.view.xslt.XsltView; -import org.w3c.dom.Document; - -public class XsltMarshallerView extends XsltView { - - private Marshaller marshaller; - - @Override - protected Class[] getSourceTypes() { - return new Class[] { TreeTestResult.class, - TreeTestResultCollection.class, SlcExecution.class }; - } - - @Override - protected Source convertSource(Object source) throws Exception { - Document document = DocumentBuilderFactory.newInstance() - .newDocumentBuilder().newDocument(); - DOMResult result = new DOMResult(document); - if (!marshaller.supports(source.getClass())) - throw new SlcException("Object of type " + source.getClass() - + " not supported."); - marshaller.marshal(source, result); - return new DOMSource(result.getNode()); - } - - public void setMarshaller(Marshaller marshaller) { - this.marshaller = marshaller; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/XsltMarshallerViewResolver.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/XsltMarshallerViewResolver.java deleted file mode 100644 index 55e44de70..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/XsltMarshallerViewResolver.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc; - -import java.io.IOException; -import java.util.Map; -import java.util.TreeMap; - -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.URIResolver; -import javax.xml.transform.stream.StreamSource; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.springframework.core.io.Resource; -import org.springframework.oxm.Marshaller; -import org.springframework.web.servlet.view.AbstractUrlBasedView; -import org.springframework.web.servlet.view.xslt.XsltViewResolver; - -/** - * Xslt View resolver implementing URI resolver as well. - * - * @see URIResolver - * @see XsltViewResolver - */ -public class XsltMarshallerViewResolver extends XsltViewResolver implements - URIResolver { - private final static Log log = LogFactory - .getLog(XsltMarshallerViewResolver.class); - - private Marshaller marshaller; - private Map cacheUriResolver = new TreeMap(); - - public XsltMarshallerViewResolver() { - setUriResolver(this); - } - - @Override - protected AbstractUrlBasedView buildView(String viewName) throws Exception { - AbstractUrlBasedView viewT = super.buildView(viewName); - XsltMarshallerView view = (XsltMarshallerView) viewT; - view.setMarshaller(marshaller); - return view; - } - - public void setMarshaller(Marshaller marshaller) { - this.marshaller = marshaller; - } - - public Source resolve(String href, String base) throws TransformerException { - if (log.isTraceEnabled()) - log.trace("Resolve URI for href=" + href + " base=" + base); - - Source res = null; - if (isCache()) - res = cacheUriResolver.get(href); - - if (res == null) - res = getStylesheetSource(href); - - if (res == null) - res = getStylesheetSource(getPrefix() + href); - - if (res == null) - throw new SlcException("Can't resolve URI for href=" + href - + " base=" + base); - - if (isCache() && !cacheUriResolver.containsKey(href)) - cacheUriResolver.put(href, res); - - return res; - } - - protected Source getStylesheetSource(String url) { - if (log.isDebugEnabled()) { - log.debug("Loading XSLT stylesheet from '" + url + "'"); - } - try { - final Resource stylesheetResource = getApplicationContext() - .getResource(url); - String systemId = url.substring(0, url.lastIndexOf('/') + 1); - return new StreamSource(stylesheetResource.getInputStream(), - systemId); - } catch (IOException e) { - if (log.isTraceEnabled()) - log.trace("Cannot load stylesheet " + url, e); - return null; - } - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/AgentController.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/AgentController.java deleted file mode 100644 index 79f8c240c..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/AgentController.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.controllers; - -import java.util.List; -import java.util.Vector; - -import org.argeo.slc.dao.runtime.SlcAgentDescriptorDao; -import org.argeo.slc.msg.ExecutionAnswer; -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.runtime.SlcAgentDescriptor; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * Controle and information about the agents. - */ - -@Controller -public class AgentController { - - // IoC - private SlcAgentDescriptorDao slcAgentDescriptorDao; - - @RequestMapping("/listAgents.service") - protected ObjectList listAgents() { - List list = slcAgentDescriptorDao - .listSlcAgentDescriptors(); - return new ObjectList(list); - } - - @RequestMapping("/cleanAgents.service") - protected ExecutionAnswer cleanAgents() { - - List list = slcAgentDescriptorDao - .listSlcAgentDescriptors(); - for (SlcAgentDescriptor t : new Vector(list)) { - slcAgentDescriptorDao.delete(t); - } - return ExecutionAnswer.ok("Execution completed properly"); - } - - // IoC - public void setSlcAgentDescriptorDao( - SlcAgentDescriptorDao slcAgentDescriptorDao) { - this.slcAgentDescriptorDao = slcAgentDescriptorDao; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/EventController.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/EventController.java deleted file mode 100644 index 60218b96d..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/EventController.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.controllers; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.msg.ExecutionAnswer; -import org.argeo.slc.msg.event.SlcEvent; -import org.argeo.slc.msg.event.SlcEventListener; -import org.argeo.slc.msg.event.SlcEventListenerDescriptor; -import org.argeo.slc.msg.event.SlcEventListenerRegister; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -@Controller -public class EventController { - - private final static Log log = LogFactory.getLog(EventController.class); - - private Long defaultTimeout = 10000l; - - // IoC - private SlcEventListener eventListener = null; - // the following bean as a Session scope. - private SlcEventListenerRegister eventListenerRegister; - - // Business Methods - @RequestMapping("/addEventListener.service") - public ExecutionAnswer addEventListener( - @RequestParam(SlcEvent.EVENT_TYPE) String eventType, - @RequestParam(value = SlcEvent.EVENT_FILTER, required = false) String eventFilter) { - - eventListenerRegister - .addEventListenerDescriptor(new SlcEventListenerDescriptor( - eventType, eventFilter)); - if (log.isTraceEnabled()) { - log.trace("Registered listener on register " - + eventListenerRegister.getId() + " for type " + eventType - + ", filter=" + eventFilter); - log.trace("Nb of registered descriptors : " - + eventListenerRegister.getDescriptorsCopy().size()); - } - return ExecutionAnswer.ok("Execution completed properly"); - - } - - @RequestMapping("/removeEventListener.service") - public ExecutionAnswer removeEventListener( - @RequestParam(SlcEvent.EVENT_TYPE) String eventType, - @RequestParam(value = SlcEvent.EVENT_FILTER, required = false) String eventFilter) { - - eventListenerRegister - .removeEventListenerDescriptor(new SlcEventListenerDescriptor( - eventType, eventFilter)); - if (log.isTraceEnabled()) { - log.trace("Removed listener from register " - + eventListenerRegister.getId() + " for type " + eventType - + ", filter=" + eventFilter); - log.trace("Nb of registered descriptors : " - + eventListenerRegister.getDescriptorsCopy().size()); - } - return ExecutionAnswer.ok("Execution completed properly"); - } - - @RequestMapping("/pollEvent.service") - public Object pollEvent( - @RequestParam(value = "timeout", required = false) String timeoutStr) { - final Long timeout; - if (timeoutStr != null) - timeout = Long.parseLong(timeoutStr); - else - timeout = defaultTimeout; - if (log.isTraceEnabled()) { - log.trace("Begin poolEvent.service :" - + " Nb of registered descriptors : " - + eventListenerRegister.getDescriptorsCopy().size()); - } - SlcEvent event = eventListener.listen(eventListenerRegister.getId(), - eventListenerRegister.getDescriptorsCopy(), timeout); - if (event != null) { - if (log.isTraceEnabled()) - log.trace("Event heard : " + event.toString()); - return event; - } else { - if (log.isTraceEnabled()) - log.trace("No Event heard - Time out: "); - return ExecutionAnswer.ok("Execution completed properly"); - } - - } - - public void setEventListenerRegister( - SlcEventListenerRegister eventListenerRegister) { - this.eventListenerRegister = eventListenerRegister; - } - - public void setDefaultTimeout(Long defaultTimeout) { - this.defaultTimeout = defaultTimeout; - } - - public void setEventListener(SlcEventListener eventListener) { - this.eventListener = eventListener; - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ProcessController.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ProcessController.java deleted file mode 100644 index 579b5bf74..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ProcessController.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.controllers; - -import java.io.BufferedReader; -import java.text.SimpleDateFormat; -import java.util.Comparator; -import java.util.List; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.UUID; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.argeo.slc.core.attachment.AttachmentsStorage; -import org.argeo.slc.dao.process.SlcExecutionDao; -import org.argeo.slc.execution.ExecutionModuleDescriptor; -import org.argeo.slc.msg.ExecutionAnswer; -import org.argeo.slc.msg.MsgConstants; -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.runtime.SlcAgent; -import org.argeo.slc.runtime.SlcAgentFactory; -import org.argeo.slc.services.SlcExecutionService; -import org.springframework.oxm.Marshaller; -import org.springframework.oxm.Unmarshaller; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.util.Assert; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.xml.transform.StringSource; - -@Controller -public class ProcessController { - - private final static Log log = LogFactory.getLog(ProcessController.class); - - private SlcExecutionDao slcExecutionDao; - private SlcAgentFactory agentFactory; - private Unmarshaller unmarshaller; - private Marshaller marshaller; - private SlcExecutionService slcExecutionService; - private AttachmentsStorage attachmentsStorage; - - private SlcExecutionManager slcExecutionManager; - - @RequestMapping("/listSlcExecutions.service") - protected ObjectList listSlcExecutions() { - List list = slcExecutionDao.listSlcExecutions(); - return new ObjectList(list); - } - - @RequestMapping("/getExecutionDescriptor.service") - protected ExecutionModuleDescriptor getExecutionDescriptor( - @RequestParam String agentId, @RequestParam String moduleName, - @RequestParam String version) { - - SlcAgent slcAgent = agentFactory.getAgent(agentId); - - ExecutionModuleDescriptor md = slcAgent.getExecutionModuleDescriptor( - moduleName, version); - return md; - } - - @RequestMapping("/listModulesDescriptors.service") - protected ObjectList listModulesDescriptors(@RequestParam String agentId) { - // TODO: use centralized agentId property (from MsgConstants)? - SlcAgent slcAgent = agentFactory.getAgent(agentId); - - List descriptors = slcAgent - .listExecutionModuleDescriptors(); - SortedSet set = new TreeSet( - new Comparator() { - - public int compare(ExecutionModuleDescriptor md1, - ExecutionModuleDescriptor md2) { - String str1 = md1.getLabel() != null ? md1.getLabel() - : md1.getName(); - String str2 = md2.getLabel() != null ? md2.getLabel() - : md2.getName(); - return str1.compareTo(str2); - } - }); - set.addAll(descriptors); - return new ObjectList(set); - } - - @RequestMapping("/getSlcExecution.service") - protected SlcExecution getSlcExecution(@RequestParam String uuid) { - SlcExecution slcExecution = slcExecutionDao.getSlcExecution(uuid); - initializeSEM(); - slcExecutionManager.retrieveRealizedFlows(slcExecution); - return slcExecution; - } - - @RequestMapping("/newSlcExecution.service") - protected ExecutionAnswer newSlcExecution(HttpServletRequest request, - Model model) throws Exception { - - String agentId = request - .getParameter(MsgConstants.PROPERTY_SLC_AGENT_ID); - Assert.notNull(agentId, "agent id"); - - String answer = request.getParameter("body"); - if (answer == null) { - // lets read the message body instead - BufferedReader reader = request.getReader(); - StringBuffer buffer = new StringBuffer(); - String line = null; - while (((line = reader.readLine()) != null)) { - buffer.append(line); - } - answer = buffer.toString(); - } - - if (log.isTraceEnabled()) - log.debug("Received message:\n" + answer); - - StringSource source = new StringSource(answer); - SlcExecution slcExecution = (SlcExecution) unmarshaller - .unmarshal(source); - - // Workaround for https://www.argeo.org/bugzilla/show_bug.cgi?id=86 - if (slcExecution.getUuid() == null - || slcExecution.getUuid().length() < 8) - slcExecution.setUuid(UUID.randomUUID().toString()); - - slcExecution.setStatus(SlcExecution.SCHEDULED); - slcExecution.getSteps().add( - new SlcExecutionStep(SlcExecutionStep.START, - "Process started from the Web UI")); - - initializeSEM(); - slcExecutionManager.storeRealizedFlows(slcExecution); - slcExecutionService.newExecution(slcExecution); - SlcAgent agent = agentFactory.getAgent(agentId); - //agent.runSlcExecution(slcExecution); - - return ExecutionAnswer.ok("Execution completed properly"); - } - - @RequestMapping("/tailSlcExecutionStepsCount.service") - protected ObjectList tailSlcExecutionSteps(@RequestParam String uuid, - @RequestParam Integer stepCount) { - List list = slcExecutionDao - .tailSteps(uuid, stepCount); - return new ObjectList(list); - } - - @RequestMapping("/tailSlcExecutionStepsOffset.service") - protected ObjectList tailSlcExecutionSteps(@RequestParam String uuid, - @RequestParam String stepOffsetUuid) { - List list = slcExecutionDao.tailSteps(uuid, - stepOffsetUuid); - return new ObjectList(list); - } - - @RequestMapping("/downloadSlcExecution.service") - protected void downloadSlcExecution(@RequestParam String uuid, - @RequestParam String ext, HttpServletResponse response) - throws Exception { - String contentType; - // cf. http://en.wikipedia.org/wikServicei/Internet_media_type - if ("csv".equals(ext)) - contentType = "text/csv"; - else if ("pdf".equals(ext)) - contentType = "application/pdf"; - else if ("zip".equals(ext)) - contentType = "application/zip"; - else if ("html".equals(ext)) - contentType = "application/html"; - else if ("txt".equals(ext) || "log".equals(ext)) - contentType = "text/plain"; - else if ("doc".equals(ext) || "docx".equals(ext)) - contentType = "application/msword"; - else if ("xls".equals(ext) || "xlsx".equals(ext)) - contentType = "application/vnd.ms-excel"; - else if ("xml".equals(ext)) - contentType = "text/xml"; - else - contentType = "Content-Type: application/force-download"; - - String name = "Process-" + uuid + "." + ext; - - SlcExecution process = slcExecutionDao.getSlcExecution(uuid); - - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - - // TODO: put it in a separate view - if ("log".equals(ext)) { - StringBuffer buf = new StringBuffer(""); - buf.append("#\n# PROCESS " + process.getUuid() + "\n#\n\n"); - buf - .append("Started at " + df.format(process.getStartDate()) - + "\n"); - buf.append("Ended at " + df.format(process.getEndDate()) + "\n"); - buf.append("On host " + process.getHost() + "\n"); - buf.append("\n# LOG\n\n"); - for (SlcExecutionStep step : process.getSteps()) { - buf.append(df.format(step.getTimestamp())); - buf.append(" "); - for (int i = 0; i < step.getLogLines().size(); i++) { - if (i > 0) - buf.append('\n'); - buf.append(step.getLogLines().get(i)); - } - buf.append(" - "); - buf.append(step.getType()); - buf.append(" - "); - buf.append('[').append(step.getThread()).append(']'); - buf.append('\n'); - } - prepareDownloadResponse(name, contentType, response); - response.getWriter().print(buf); - } else { - throw new SlcException("Unsupported content type " + contentType); - } - } - - protected void prepareDownloadResponse(String name, String contentType, - HttpServletResponse response) { - response.setHeader("Content-Disposition", "attachment; filename=\"" - + name + "\""); - response.setContentType(contentType + ";name=\"" + name + "\""); - response.setHeader("Expires", "0"); - response.setHeader("Cache-Control", "no-cache, must-revalidate"); - response.setHeader("Pragma", "no-cache"); - } - - private void initializeSEM() { - slcExecutionManager = new SlcExecutionManager(unmarshaller, marshaller, - attachmentsStorage); - } - - public void setSlcExecutionDao(SlcExecutionDao slcExecutionDao) { - this.slcExecutionDao = slcExecutionDao; - } - - public void setSlcExecutionService(SlcExecutionService slcExecutionService) { - this.slcExecutionService = slcExecutionService; - } - - public void setUnmarshaller(Unmarshaller unmarshaller) { - this.unmarshaller = unmarshaller; - } - - public void setMarshaller(Marshaller marshaller) { - this.marshaller = marshaller; - } - - public void setAttachmentsStorage(AttachmentsStorage attachmentsStorage) { - this.attachmentsStorage = attachmentsStorage; - } - - public void setAgentFactory(SlcAgentFactory agentFactory) { - this.agentFactory = agentFactory; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/RenderingResultController.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/RenderingResultController.java deleted file mode 100644 index 58d423ab7..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/RenderingResultController.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.controllers; - -import javax.servlet.http.HttpServletRequest; - -import org.argeo.slc.SlcException; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.dao.test.tree.TreeTestResultDao; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -/** - * Sends back the results, rendered or as collection. - */ - -@Controller -public class RenderingResultController { - // private static final Log log = - // LogFactory.getLog(RenderingResultController.class); - - public final static String MODELKEY_RESULT = "result"; - - // IoC - private TreeTestResultDao treeTestResultDao; - - @RequestMapping("/resultView.*") - public String getPdfResultView(@RequestParam("uuid") String uuid, - ModelMap model, HttpServletRequest request) { - - TreeTestResult result = treeTestResultDao.getTestResult(uuid); - if (result == null) - throw new SlcException("No result found for uuid " + uuid); - model.addAttribute(MODELKEY_RESULT, result); - - String docType = request.getRequestURI().substring( - request.getRequestURI().lastIndexOf(".") + 1); - - if ("pdf".equals(docType)) - return "resultPdfView"; - if ("xls".equals(docType)) - return "resultExcelView"; - if ("xslt".equals(docType)) - return "resultXsltView"; - if ("xml".equals(docType)) - return "resultXmlView"; - - throw new SlcException("No renderer found for files of extension " - + docType); - } - - // IoC - - public void setTreeTestResultDao(TreeTestResultDao treeTestResultDao) { - this.treeTestResultDao = treeTestResultDao; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ResultController.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ResultController.java deleted file mode 100644 index 0cf8fedef..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ResultController.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.controllers; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.SortedSet; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.FilenameUtils; -import org.argeo.slc.SlcException; -import org.argeo.slc.core.attachment.AttachmentsStorage; -import org.argeo.slc.core.attachment.SimpleAttachment; -import org.argeo.slc.core.test.tree.ResultAttributes; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.core.test.tree.TreeTestResultCollection; -import org.argeo.slc.dao.test.tree.TreeTestResultCollectionDao; -import org.argeo.slc.dao.test.tree.TreeTestResultDao; -import org.argeo.slc.msg.ExecutionAnswer; -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.msg.ReferenceList; -import org.argeo.slc.services.TestManagerService; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.util.PatternMatchUtils; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -@Controller -public class ResultController { - - // private final static Log log = - // LogFactory.getLog(ServiceController.class); - - // Constants - protected final String FORCE_DOWNLOAD = "Content-Type: application/force-download"; - - // IoC - private TreeTestResultDao treeTestResultDao; - private TreeTestResultCollectionDao treeTestResultCollectionDao; - private TestManagerService testManagerService; - private AttachmentsStorage attachmentsStorage; - - // Business Methods - @RequestMapping("/getResult.service") - protected TreeTestResult getResult( - @RequestParam(value = "uuid", required = false) String uuid) { - - TreeTestResult result = treeTestResultDao.getTestResult(uuid); - if (result == null) - throw new SlcException("No result found for uuid " + uuid); - return result; - } - - @RequestMapping("/addResultToCollection.service") - protected ExecutionAnswer addResultToCollection( - @RequestParam String collectionId, @RequestParam String resultUuid) { - testManagerService.addResultToCollection(collectionId, resultUuid); - return ExecutionAnswer.ok("Execution completed properly"); - } - - @RequestMapping("/removeResultFromCollection.service") - protected ExecutionAnswer removeResultFromCollection( - HttpServletRequest request) { - String collectionId = request.getParameter("collectionId"); - String[] resultUuids = request.getParameterValues("resultUuid"); - String[] attrNames = request.getParameterValues("attrName"); - String[] attrPatterns = request.getParameterValues("attrPattern"); - - // Checks - if (collectionId == null) - throw new SlcException("A collection id must be specified"); - if (attrNames != null - && (attrPatterns == null || attrNames.length != attrPatterns.length)) - throw new SlcException( - "There must be as many attrName as attrPatterns"); - - // Remove specified results - if (resultUuids != null) - for (String resultUuid : resultUuids) - testManagerService.removeResultFromCollection(collectionId, - resultUuid); - - if (attrNames != null) { - TreeTestResultCollection sourceCollection = treeTestResultCollectionDao - .getTestResultCollection(collectionId); - - int index = 0; - for (String attrName : attrNames) { - String attrPattern = attrPatterns[index];// safe: checked above - - List results = new ArrayList( - sourceCollection.getResults()); - for (TreeTestResult treeTestResult : results) { - if (PatternMatchUtils.simpleMatch(attrPattern, - treeTestResult.getAttributes().get(attrName))) { - testManagerService.removeResultFromCollection( - collectionId, treeTestResult.getUuid()); - } - } - index++; - } - } else { - if (resultUuids == null) {// no specs - // remove all - // TODO: optimize - TreeTestResultCollection sourceCollection = treeTestResultCollectionDao - .getTestResultCollection(collectionId); - List results = new ArrayList( - sourceCollection.getResults()); - for (TreeTestResult treeTestResult : results) { - testManagerService.removeResultFromCollection(collectionId, - treeTestResult.getUuid()); - } - - } - } - return ExecutionAnswer.ok("Execution completed properly"); - } - - @RequestMapping("/listCollectionRefs.service") - protected ReferenceList listCollectionRefs(HttpServletRequest request, - HttpServletResponse response) { - - SortedSet results = treeTestResultCollectionDao - .listCollections(); - - ReferenceList referenceList = new ReferenceList(); - for (TreeTestResultCollection collection : results) { - referenceList.getReferences().add(collection.getId()); - } - return referenceList; - } - - @RequestMapping("/listResultAttributes.service") - protected ObjectList listResultAttributes(@RequestParam String id, - Model model) { - - List resultAttributes = treeTestResultCollectionDao - .listResultAttributes(id); - return new ObjectList(resultAttributes); - } - - @RequestMapping("/listResults.service") - @SuppressWarnings(value = { "unchecked" }) - protected ObjectList listResults( - @RequestParam(value = "collectionId", required = false) String collectionId, - HttpServletRequest request) { - Map parameterMap = request.getParameterMap(); - Map attributes = new HashMap(); - for (String parameter : parameterMap.keySet()) { - if (parameter.startsWith("attr.")) { - String key = parameter.substring("attr.".length()); - attributes.put(key, parameterMap.get(parameter)[0]); - } - } - - List resultAttributes = treeTestResultCollectionDao - .listResults(collectionId, attributes); - return new ObjectList(resultAttributes); - } - - @RequestMapping("/copyCollectionToCollection.service") - protected ExecutionAnswer copyCollectionToCollection( - @RequestParam String sourceCollectionId, - @RequestParam String targetCollectionId, HttpServletRequest request) { - - String[] attrNames = request.getParameterValues("attrName"); - String[] attrPatterns = request.getParameterValues("attrPattern"); - - // Checks - if (sourceCollectionId == null || targetCollectionId == null) - throw new SlcException( - "Source and target collection ids must be specified"); - if (attrNames != null - && (attrPatterns == null || attrNames.length != attrPatterns.length)) - throw new SlcException( - "There must be as many attrName as attrPatterns"); - - TreeTestResultCollection sourceCollection = treeTestResultCollectionDao - .getTestResultCollection(sourceCollectionId); - if (attrNames != null) { - int index = 0; - for (String attrName : attrNames) { - String attrPattern = attrPatterns[index];// safe: checked above - - for (TreeTestResult treeTestResult : sourceCollection - .getResults()) { - if (PatternMatchUtils.simpleMatch(attrPattern, - treeTestResult.getAttributes().get(attrName))) { - testManagerService.addResultToCollection( - targetCollectionId, treeTestResult.getUuid()); - } - } - index++; - } - } else { - // remove all - // TODO: optimize - for (TreeTestResult treeTestResult : sourceCollection.getResults()) { - testManagerService.addResultToCollection(targetCollectionId, - treeTestResult.getUuid()); - } - } - return ExecutionAnswer.ok("Execution completed properly"); - } - - @RequestMapping("/getAttachment.service") - protected void getAttachment(@RequestParam String uuid, - @RequestParam String contentType, @RequestParam String name, - HttpServletResponse response) throws Exception { - if (contentType == null || "".equals(contentType.trim())) { - if (name != null) { - contentType = FORCE_DOWNLOAD; - String ext = FilenameUtils.getExtension(name); - // cf. http://en.wikipedia.org/wikServicei/Internet_media_type - if ("csv".equals(ext)) - contentType = "text/csv"; - else if ("pdf".equals(ext)) - contentType = "application/pdf"; - else if ("zip".equals(ext)) - contentType = "application/zip"; - else if ("html".equals(ext)) - contentType = "application/html"; - else if ("txt".equals(ext)) - contentType = "text/plain"; - else if ("doc".equals(ext) || "docx".equals(ext)) - contentType = "application/msword"; - else if ("xls".equals(ext) || "xlsx".equals(ext)) - contentType = "application/vnd.ms-excel"; - else if ("xml".equals(ext)) - contentType = "text/xml"; - } - } - - if (name != null) { - contentType = contentType + ";name=\"" + name + "\""; - response.setHeader("Content-Disposition", "attachment; filename=\"" - + name + "\""); - } - response.setHeader("Expires", "0"); - response.setHeader("Cache-Control", "no-cache, must-revalidate"); - response.setHeader("Pragma", "no-cache"); - - SimpleAttachment resourceDescriptor = new SimpleAttachment(); - resourceDescriptor.setUuid(uuid); - resourceDescriptor.setContentType(contentType); - - response.setContentType(contentType); - ServletOutputStream outputStream = response.getOutputStream(); - attachmentsStorage.retrieveAttachment(resourceDescriptor, outputStream); - } - - // IoC - - public void setTreeTestResultDao(TreeTestResultDao treeTestResultDao) { - this.treeTestResultDao = treeTestResultDao; - } - - public void setTestManagerService(TestManagerService testManagerService) { - this.testManagerService = testManagerService; - } - - public void setTreeTestResultCollectionDao( - TreeTestResultCollectionDao treeTestResultCollectionDao) { - this.treeTestResultCollectionDao = treeTestResultCollectionDao; - } - - public void setAttachmentsStorage(AttachmentsStorage attachmentsStorage) { - this.attachmentsStorage = attachmentsStorage; - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ServerController.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ServerController.java deleted file mode 100644 index aabb7ebe4..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/ServerController.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.controllers; - -import java.util.List; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.FileItemFactory; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.argeo.slc.BasicNameVersion; -import org.argeo.slc.NameVersion; -import org.argeo.slc.core.build.ResourceDistribution; -import org.argeo.slc.deploy.DynamicRuntime; -import org.argeo.slc.deploy.Module; -import org.argeo.slc.msg.ExecutionAnswer; -import org.springframework.core.io.ByteArrayResource; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; - -/** - * Sends back the results, rendered or as collection. - */ - -@Controller -public class ServerController { - - // IoC - private DynamicRuntime dynamicRuntime; - - // Create a factory for disk-based file items - private FileItemFactory factory = new DiskFileItemFactory(); - // Create a new file upload handler - private ServletFileUpload upload = new ServletFileUpload(factory); - - // SERVER HANDLING - - @RequestMapping("/isServerReady.service") - protected ExecutionAnswer isServerReady(Model model) { - // Does nothing for now, it will return an OK answer. - return ExecutionAnswer.ok("Execution completed properly"); - } - - @RequestMapping("/shutdownRuntime.service") - protected ExecutionAnswer shutdownRuntime(Model model) { - new Thread() { - public void run() { - // wait in order to let call return - try { - Thread.sleep(3000); - } catch (InterruptedException e) { - // silent - } - dynamicRuntime.shutdown(); - } - }.start(); - return ExecutionAnswer.ok("Server shutting down..."); - } - - // MODULE HANDLING - - @SuppressWarnings("unchecked") - @RequestMapping("/installModule.service") - public void installModule(HttpServletRequest request) throws Exception { - - // TODO : handle the exception better - - // Parse the request - List items = upload.parseRequest(request); - - byte[] arr = null; - for (FileItem item : items) { - if (!item.isFormField()) { - arr = item.get(); - break; - } - } - - ByteArrayResource res = new ByteArrayResource(arr); - Module module = dynamicRuntime.installModule(new ResourceDistribution( - res)); - // TODO: customize whether the module is started or not - dynamicRuntime.startModule(module); - } - - @RequestMapping("/uninstallModule.service") - public void uninstallModule(@RequestParam(value = "name") String name, - @RequestParam(value = "version") String version) { - NameVersion nameVersion = new BasicNameVersion(name, version); - dynamicRuntime.uninstallModule(nameVersion); - } - - // IoC - public void setDynamicRuntime(DynamicRuntime dynamicRuntime) { - this.dynamicRuntime = dynamicRuntime; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/SlcExecutionManager.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/SlcExecutionManager.java deleted file mode 100644 index 3a07b7996..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/controllers/SlcExecutionManager.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.controllers; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.util.UUID; - -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.argeo.slc.core.attachment.Attachment; -import org.argeo.slc.core.attachment.AttachmentsStorage; -import org.argeo.slc.core.attachment.SimpleAttachment; -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.process.SlcExecution; -import org.springframework.oxm.Marshaller; -import org.springframework.oxm.Unmarshaller; -import org.springframework.xml.transform.StringResult; - -public class SlcExecutionManager { - private final static Log log = LogFactory.getLog(SlcExecutionManager.class); - - private Unmarshaller unmarshaller; - private Marshaller marshaller; - private AttachmentsStorage attachmentsStorage; - - public SlcExecutionManager(Unmarshaller unmarshaller, - Marshaller marshaller, AttachmentsStorage attachmentsStorage) { - - this.unmarshaller = unmarshaller; - this.marshaller = marshaller; - this.attachmentsStorage = attachmentsStorage; - } - - void storeRealizedFlows(SlcExecution slcExecution) { - - Attachment attachment = realizedFlowsAttachment(UUID.randomUUID() - .toString(), slcExecution); - InputStream in = null; - try { - ObjectList ol = new ObjectList(slcExecution.getRealizedFlows()); - StringResult result = new StringResult(); - marshaller.marshal(ol, result); - in = new ByteArrayInputStream(result.toString().getBytes()); - attachmentsStorage.storeAttachment(attachment, in); - - slcExecution.setRealizedFlowsXml(attachment.getUuid()); - } catch (Exception e) { - log.error("Could not store realized flows as attachment #" - + attachment.getUuid(), e); - } finally { - IOUtils.closeQuietly(in); - } - } - - void retrieveRealizedFlows(SlcExecution slcExecution) { - Attachment attachment = realizedFlowsAttachment(slcExecution - .getRealizedFlowsXml(), slcExecution); - - ByteArrayOutputStream out = null; - ByteArrayInputStream in = null; - try { - // TODO: optimize with piped streams - out = new ByteArrayOutputStream(); - attachmentsStorage.retrieveAttachment(attachment, out); - - byte[] arr = out.toByteArray(); - in = new ByteArrayInputStream(arr); - StreamSource source = new StreamSource(in); - ObjectList ol = (ObjectList) unmarshaller.unmarshal(source); - ol.fill(slcExecution.getRealizedFlows()); - } catch (Exception e) { - log.error("Could not retrieve realized flows from attachment #" - + attachment.getUuid(), e); - } finally { - IOUtils.closeQuietly(in); - IOUtils.closeQuietly(out); - } - } - - /** Unify labeling in the package */ - static Attachment realizedFlowsAttachment(String attachmentUuid, - SlcExecution slcExecution) { - return new SimpleAttachment(attachmentUuid, - "RealizedFlows of SlcExecution #" + slcExecution.getUuid(), - "text/xml"); - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AbstractAvailableModules.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AbstractAvailableModules.java deleted file mode 100644 index 90c822049..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AbstractAvailableModules.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.io.IOException; -import java.io.Writer; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.NameVersion; -import org.argeo.slc.build.ModularDistribution; -import org.springframework.web.HttpRequestHandler; - -/** List of modules for a distribution. */ -public abstract class AbstractAvailableModules implements HttpRequestHandler { - protected abstract void print(Writer out, String baseUrl, - ModularDistribution md) throws IOException; - - public final void handleRequest(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - response.setContentType(getContentType()); - - ModularDistribution md = (ModularDistribution) request - .getAttribute("modularDistribution"); - - String baseUrl = "http://" + request.getServerName() + ":" - + request.getServerPort() + request.getContextPath() - + request.getServletPath() + "/" + md.getName() + "/" - + md.getVersion() + "/"; - - print(response.getWriter(), baseUrl, md); - } - - public String getContentType() { - return "text/plain"; - } - - protected String jarUrl(String baseUrl, NameVersion nameVersion) { - return baseUrl + jarFileName(nameVersion); - } - - protected String jarFileName(NameVersion nameVersion) { - return nameVersion.getName() + "-" + nameVersion.getVersion() + ".jar"; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AbstractProvisioningInterceptor.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AbstractProvisioningInterceptor.java deleted file mode 100644 index 99f55f4c6..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AbstractProvisioningInterceptor.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; - -public abstract class AbstractProvisioningInterceptor extends - HandlerInterceptorAdapter { - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableDistributions.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableDistributions.java deleted file mode 100644 index b4aa3ed83..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableDistributions.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.io.IOException; -import java.io.Writer; -import java.util.Iterator; -import java.util.Set; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.build.ModularDistribution; -import org.springframework.web.HttpRequestHandler; - -/** List of distributions. */ -public class AvailableDistributions implements HttpRequestHandler { - private Set modularDistributions; - - public void handleRequest(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - response.setContentType("text/html"); - - String baseUrl = "http://" + request.getServerName() + ":" - + request.getServerPort() + request.getContextPath() - + request.getServletPath() + "/"; - - Writer out = response.getWriter(); - - out.write("

Distributions

"); - for (Iterator it = modularDistributions.iterator(); it - .hasNext();) { - ModularDistribution md = it.next(); - out.write("

" + md + "

"); - out.write("Modules: "); - String moduleBase = baseUrl + md.getName() + "/" + md.getVersion() - + "/"; - - String modulesListHtml = moduleBase + "modules.html"; - out.write(" html"); - - String modulesListPlain = moduleBase + "modules"; - out.write(" plain"); - - String modulesListOsgiBoot = moduleBase + "osgiBoot"; - out.write(" osgiBoot"); - - out.write("
"); - - out.write("Eclipse update site: "); - String updateSiteUrl = baseUrl + md.getName() + "/" - + md.getVersion() + "/site.xml"; - out.write("" + updateSiteUrl - + ""); - } - } - - public void setModularDistributions( - Set modularDistributions) { - this.modularDistributions = modularDistributions; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesHtml.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesHtml.java deleted file mode 100644 index 7fd83a0b4..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesHtml.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.io.IOException; -import java.io.Writer; - -import org.argeo.slc.NameVersion; -import org.argeo.slc.build.Distribution; -import org.argeo.slc.build.ModularDistribution; -import org.argeo.slc.core.build.ResourceDistribution; - -/** List of modules for a distribution. */ -public class AvailableModulesHtml extends AbstractAvailableModules { - @Override - protected void print(Writer out, String baseUrl, ModularDistribution md) - throws IOException { - out.write("

Distribution " + md + "

"); - - for (NameVersion nameVersion : md.listModulesNameVersions()) { - Distribution distribution = md.getModuleDistribution(nameVersion - .getName(), nameVersion.getVersion()); - - String moduleUrl = null; - if (distribution instanceof ResourceDistribution) { - String url = ((ResourceDistribution) distribution) - .getResource().getURL().toString(); - if (url.startsWith("reference:")) - moduleUrl = url; - } - - if (moduleUrl == null) - moduleUrl = jarUrl(baseUrl, nameVersion); - - out.write("" - + jarFileName(nameVersion) + "
"); - } - } - - @Override - public String getContentType() { - return "text/html"; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesOsgiBoot.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesOsgiBoot.java deleted file mode 100644 index 8c0a18037..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesOsgiBoot.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.io.IOException; -import java.io.Writer; - -import org.argeo.slc.NameVersion; -import org.argeo.slc.build.ModularDistribution; - -/** List of modules for a distribution. */ -public class AvailableModulesOsgiBoot extends AbstractAvailableModules { - private String separator = ","; - - @Override - protected void print(Writer out, String baseUrl, ModularDistribution md) - throws IOException { - for (NameVersion nameVersion : md.listModulesNameVersions()) { - String fileName = nameVersion.getName() + "-" - + nameVersion.getVersion() + ".jar"; - String moduleUrl = baseUrl + fileName; - out.write(nameVersion.getName() + separator - + nameVersion.getVersion() + separator + moduleUrl); - out.write("\n"); - } - } - - public void setSeparator(String separator) { - this.separator = separator; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesPlain.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesPlain.java deleted file mode 100644 index 10cb52b33..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/AvailableModulesPlain.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.io.IOException; -import java.io.Writer; - -import org.argeo.slc.NameVersion; -import org.argeo.slc.build.ModularDistribution; - -/** List of modules for a distribution. */ -public class AvailableModulesPlain extends AbstractAvailableModules { - @Override - protected void print(Writer out, String baseUrl, ModularDistribution md) - throws IOException { - for (NameVersion nameVersion : md.listModulesNameVersions()) { - String fileName = nameVersion.getName() + "-" - + nameVersion.getVersion() + ".jar"; - String moduleUrl = baseUrl + fileName; - out.write(moduleUrl); - out.write("\n"); - } - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/BundleHandler.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/BundleHandler.java deleted file mode 100644 index 94a48feb6..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/BundleHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.StreamReadable; -import org.argeo.slc.UnsupportedException; -import org.argeo.slc.build.Distribution; -import org.argeo.slc.build.ModularDistribution; -import org.springframework.web.HttpRequestHandler; - -public class BundleHandler implements HttpRequestHandler { - private final static Log log = LogFactory.getLog(BundleHandler.class); - - public void handleRequest(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - String path = request.getPathInfo(); - - if (log.isDebugEnabled()) - log.debug("Bundle jar Requested: " + path); - response.setContentType("application/java-archive"); - - String moduleName = request.getParameter("moduleName"); - if (moduleName == null) - moduleName = request.getAttribute("moduleName").toString(); - String moduleVersion = request.getParameter("moduleVersion"); - if (moduleVersion == null) - moduleVersion = request.getAttribute("moduleVersion").toString(); - - ModularDistribution modularDistribution = (ModularDistribution) request - .getAttribute("modularDistribution"); - Distribution distribution = modularDistribution.getModuleDistribution( - moduleName, moduleVersion); - if (distribution instanceof StreamReadable) - IOUtils.copy(((StreamReadable) distribution).getInputStream(), - response.getOutputStream()); - else - throw new UnsupportedException("distribution", distribution); - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/BundleJarInterceptor.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/BundleJarInterceptor.java deleted file mode 100644 index 4821c0976..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/BundleJarInterceptor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.util.StringTokenizer; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.SlcException; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; - -public class BundleJarInterceptor extends HandlerInterceptorAdapter { - - @Override - public boolean preHandle(HttpServletRequest request, - HttpServletResponse response, Object handler) throws Exception { - String path = request.getPathInfo(); - StringTokenizer stS = new StringTokenizer(path, "/"); - String fileName = null; - while (stS.hasMoreTokens()) { - String token = stS.nextToken(); - if (!stS.hasMoreTokens()) { - fileName = token; - } - } - - int ind_ = fileName.indexOf('-'); - String moduleName; - if (ind_ > -1) - moduleName = fileName.substring(0, ind_); - else - throw new SlcException("Cannot determine version for " + fileName); - - String versionAndExtension = fileName.substring(ind_ + 1); - int indExt = versionAndExtension.lastIndexOf('.'); - String moduleVersion = versionAndExtension.substring(0, indExt); - - request.setAttribute("moduleName", moduleName); - request.setAttribute("moduleVersion", moduleVersion); - - return true; - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/EclipseUpdateSiteHandler.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/EclipseUpdateSiteHandler.java deleted file mode 100644 index 870c88415..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/EclipseUpdateSiteHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.build.ModularDistribution; -import org.springframework.web.HttpRequestHandler; - -/** An Eclipse update site, serving site.xml features/* and plugins/*. */ -public class EclipseUpdateSiteHandler implements HttpRequestHandler { - public void handleRequest(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - - ModularDistribution modularDistribution = (ModularDistribution) request - .getAttribute("modularDistribution"); - response.getWriter().write( - modularDistribution.getModulesDescriptor("eclipse").toString()); - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/EclipseUpdateSiteInterceptor.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/EclipseUpdateSiteInterceptor.java deleted file mode 100644 index d529fab42..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/EclipseUpdateSiteInterceptor.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.util.StringTokenizer; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.SlcException; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; - -public class EclipseUpdateSiteInterceptor extends HandlerInterceptorAdapter { - public final static String RELEASE = "RELEASE"; - public final static String LATEST = "LATEST"; - - @Override - public boolean preHandle(HttpServletRequest request, - HttpServletResponse response, Object handler) throws Exception { - String path = request.getPathInfo(); - StringTokenizer stS = new StringTokenizer(path, "/"); - String type = null; - pathTokenizer: while (stS.hasMoreTokens()) { - String token = stS.nextToken(); - if (token.equals("plugins") || token.equals("features")) { - type = token; - break pathTokenizer; - } - } - - if (type == null || !stS.hasMoreTokens()) - throw new SlcException("Cannot determine file name from path " - + path); - - String fileName = stS.nextToken(); - - int ind_ = fileName.indexOf('_'); - String moduleName; - if (ind_ > -1) - moduleName = fileName.substring(0, ind_); - else - throw new SlcException("Cannot determine version for " + fileName); - - String versionAndExtension = fileName.substring(ind_ + 1); - int indExt = versionAndExtension.lastIndexOf('.'); - String moduleVersion = versionAndExtension.substring(0, indExt); - - request.setAttribute("moduleName", moduleName); - request.setAttribute("moduleVersion", moduleVersion); - - return true; - } -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/ListModularDistributions.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/ListModularDistributions.java deleted file mode 100644 index f0523dda4..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/ListModularDistributions.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.BasicNameVersion; -import org.argeo.slc.NameVersion; -import org.argeo.slc.build.BuildConstants; -import org.argeo.slc.build.ModularDistribution; -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.msg.build.ModularDistributionDescriptor; -import org.argeo.slc.web.mvc.AbstractServiceController; -import org.springframework.web.servlet.ModelAndView; - -/** List of distributions. */ -public class ListModularDistributions extends AbstractServiceController - implements Comparator { - private Set modularDistributions; - - private String provisioningServletPath = "/dist"; - - @Override - protected void handleServiceRequest(HttpServletRequest request, - HttpServletResponse response, ModelAndView modelAndView) - throws Exception { - - String baseUrl = "http://" + request.getServerName() + ":" - + request.getServerPort() + request.getContextPath() - + provisioningServletPath + "/"; - - SortedSet descriptors = new TreeSet( - this); - - Set names = new HashSet(); - Set namesRelease = new HashSet(); - - // Scan distributions - for (Iterator it = modularDistributions.iterator(); it - .hasNext();) { - ModularDistribution md = it.next(); - ModularDistributionDescriptor mdd = fromNameVersion(baseUrl, md); - - descriptors.add(mdd); - names.add(mdd.getName()); - if (!md.getVersion().contains(BuildConstants.SNAPSHOT)) - namesRelease.add(mdd.getName()); - } - - // Add LATESTs and RELEASEs - for (String name : names) - descriptors.add(fromNameVersion(baseUrl, new BasicNameVersion(name, - BuildConstants.LATEST))); - for (String name : namesRelease) - descriptors.add(fromNameVersion(baseUrl, new BasicNameVersion(name, - BuildConstants.RELEASE))); - - modelAndView.addObject(new ObjectList(descriptors)); - } - - public void setModularDistributions( - Set modularDistributions) { - this.modularDistributions = modularDistributions; - } - - public void setProvisioningServletPath(String provisioningServletPath) { - this.provisioningServletPath = provisioningServletPath; - } - - protected ModularDistributionDescriptor fromNameVersion(String baseUrl, - NameVersion md) { - String moduleBase = baseUrl + md.getName() + "/" + md.getVersion() - + "/"; - ModularDistributionDescriptor mdd = new ModularDistributionDescriptor(); - mdd.setName(md.getName()); - mdd.setVersion(md.getVersion()); - - mdd.getModulesDescriptors().put("modularDistribution", - moduleBase + "modularDistribution"); - mdd.getModulesDescriptors().put("eclipse", moduleBase + "site.xml"); - return mdd; - - } - - /** RELEASEs first, then LATESTs, then version */ - public int compare(ModularDistributionDescriptor mdd1, - ModularDistributionDescriptor mdd2) { - final int BEFORE = -1; - final int AFTER = 1; - - String n1 = mdd1.getName(); - String v1 = mdd1.getVersion(); - String n2 = mdd2.getName(); - String v2 = mdd2.getVersion(); - - if (v1.equals(BuildConstants.RELEASE)) - if (v2.equals(BuildConstants.RELEASE)) - return n1.compareTo(n2); - else - return BEFORE; - else if (v2.equals(BuildConstants.RELEASE)) - return AFTER;// we know 1 not RELEASE - else if (v1.equals(BuildConstants.LATEST)) - if (v2.equals(BuildConstants.LATEST)) - return n1.compareTo(n2); - else - return BEFORE; - else if (v2.equals(BuildConstants.LATEST)) - return AFTER;// we know 1 not LATEST or RELEASE - else if (n1.equals(n2)) - return v1.compareTo(v2); - else - return n1.compareTo(n2); - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/ModularDistributionInterceptor.java b/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/ModularDistributionInterceptor.java deleted file mode 100644 index 85d4dbd71..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/provisioning/ModularDistributionInterceptor.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.web.mvc.provisioning; - -import java.util.Iterator; -import java.util.Set; -import java.util.SortedMap; -import java.util.StringTokenizer; -import java.util.TreeMap; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.argeo.slc.BasicNameVersion; -import org.argeo.slc.SlcException; -import org.argeo.slc.build.BuildConstants; -import org.argeo.slc.build.ModularDistribution; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; - -public class ModularDistributionInterceptor extends HandlerInterceptorAdapter { - private Set modularDistributions; - - @Override - public boolean preHandle(HttpServletRequest request, - HttpServletResponse response, Object handler) throws Exception { - String path = request.getPathInfo(); - StringTokenizer stS = new StringTokenizer(path, "/"); - String distributionName = stS.nextToken(); - String distributionVersion = stS.nextToken(); - - SortedMap choices = new TreeMap(); - distribs: for (Iterator it = modularDistributions - .iterator(); it.hasNext();) { - ModularDistribution md = it.next(); - if (md.getName().equals(distributionName)) { - if (distributionVersion.equals(BuildConstants.RELEASE) - && md.getVersion().contains(BuildConstants.SNAPSHOT)) - continue distribs; - - else if (distributionVersion.equals(BuildConstants.LATEST)) - choices.put(md.getVersion(), md); - else if (distributionVersion.equals(md.getVersion())) { - choices.put(md.getVersion(), md); - break distribs; - } - } - } - - if (choices.size() == 0) - throw new SlcException("Cannot find distribution for " - + new BasicNameVersion(distributionName, - distributionVersion)); - - ModularDistribution modularDistribution = choices.get(choices - .firstKey()); - - request.setAttribute("modularDistribution", modularDistribution); - - return true; - } - - public void setModularDistributions( - Set modularDistributions) { - this.modularDistributions = modularDistributions; - } - -} diff --git a/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/server/jmx/spring.xml b/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/server/jmx/spring.xml deleted file mode 100644 index b969cb5f1..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/server/jmx/spring.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/web/ajaxplorer/file/spring.xml b/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/web/ajaxplorer/file/spring.xml deleted file mode 100644 index 6c12a5dc9..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/web/ajaxplorer/file/spring.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/web/ajaxplorer/svn/spring.xml b/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/web/ajaxplorer/svn/spring.xml deleted file mode 100644 index 5ea651f7a..000000000 --- a/legacy/runtime/org.argeo.slc.server/src/main/resources/org/argeo/slc/web/ajaxplorer/svn/spring.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.server/tmp/MANIFEST.MF b/legacy/runtime/org.argeo.slc.server/tmp/MANIFEST.MF deleted file mode 100644 index 3ccfd191f..000000000 --- a/legacy/runtime/org.argeo.slc.server/tmp/MANIFEST.MF +++ /dev/null @@ -1,312 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.hibernate;version="3.3.1.GA";uses:="javax.naming,j - avax.transaction,org.hibernate.classic,org.hibernate.criterion,org.hi - bernate.engine,org.hibernate.exception,org.hibernate.jdbc,org.hiberna - te.metadata,org.hibernate.stat,org.hibernate.transform,org.hibernate. - type",org.hibernate.action;version="3.3.1.GA";uses:="org.hibernate,or - g.hibernate.cache,org.hibernate.collection,org.hibernate.engine,org.h - ibernate.persister.collection,org.hibernate.persister.entity",org.hib - ernate.bytecode;version="3.3.1.GA";uses:="org.hibernate.bytecode.util - ,org.hibernate.proxy",org.hibernate.bytecode.cglib;version="3.3.1.GA" - ;uses:="org.hibernate.bytecode,org.hibernate.bytecode.util,org.hibern - ate.proxy,org.hibernate.repackage.cglib.asm,org.hibernate.repackage.c - glib.beans,org.hibernate.repackage.cglib.proxy,org.hibernate.repackag - e.cglib.reflect,org.hibernate.repackage.cglib.transform.impl",org.hib - ernate.bytecode.javassist;version="3.3.1.GA";uses:="javassist.bytecod - e,javassist.util.proxy,org.hibernate.bytecode,org.hibernate.bytecode. - util,org.hibernate.proxy",org.hibernate.bytecode.util;version="3.3.1. - GA",org.hibernate.cache;version="3.3.1.GA";uses:="javax.transaction,n - et.sf.ehcache,net.sf.swarmcache,org.hibernate,org.hibernate.cache.acc - ess,org.hibernate.cfg,org.hibernate.engine,org.hibernate.transaction, - org.hibernate.type,org.jboss.cache,org.jboss.cache.optimistic,org.slf - 4j",org.hibernate.cache.access;version="3.3.1.GA";uses:="org.hibernat - e.cache",org.hibernate.cache.entry;version="3.3.1.GA";uses:="org.hibe - rnate,org.hibernate.collection,org.hibernate.engine,org.hibernate.eve - nt,org.hibernate.persister.collection,org.hibernate.persister.entity" - ,org.hibernate.cache.impl;version="3.3.1.GA";uses:="org.hibernate.cac - he,org.hibernate.cfg,org.hibernate.mapping",org.hibernate.cache.impl. - bridge;version="3.3.1.GA";uses:="org.hibernate.cache,org.hibernate.ca - che.access,org.hibernate.cfg",org.hibernate.cache.jbc2;version="3.3.1 - .GA";uses:="javax.transaction,org.hibernate.cache,org.hibernate.cfg,o - rg.jboss.cache,org.jboss.cache.config,org.jboss.cache.notifications.a - nnotation",org.hibernate.cache.jbc2.access;version="3.3.1.GA";uses:=" - org.hibernate.cache,org.hibernate.cache.access,org.hibernate.cache.jb - c2",org.hibernate.cache.jbc2.builder;version="3.3.1.GA";uses:="org.hi - bernate.cache,org.hibernate.cache.jbc2,org.hibernate.cfg,org.jboss.ca - che,org.jgroups",org.hibernate.cache.jbc2.collection;version="3.3.1.G - A";uses:="org.hibernate.cache,org.hibernate.cache.access,org.hibernat - e.cache.jbc2,org.hibernate.cache.jbc2.access,org.jboss.cache",org.hib - ernate.cache.jbc2.entity;version="3.3.1.GA";uses:="org.hibernate.cach - e,org.hibernate.cache.access,org.hibernate.cache.jbc2,org.hibernate.c - ache.jbc2.access,org.jboss.cache",org.hibernate.cache.jbc2.query;vers - ion="3.3.1.GA";uses:="org.hibernate.cache,org.hibernate.cache.jbc2,or - g.jboss.cache",org.hibernate.cache.jbc2.timestamp;version="3.3.1.GA"; - uses:="org.hibernate.cache,org.hibernate.cache.jbc2,org.jboss.cache,o - rg.jboss.cache.notifications.annotation,org.jboss.cache.notifications - .event",org.hibernate.cache.jbc2.util;version="3.3.1.GA";uses:="org.h - ibernate.cache,org.jboss.cache,org.jboss.cache.config,org.jboss.cache - .optimistic",org.hibernate.cfg;version="3.3.1.GA";uses:="org.dom4j,or - g.hibernate,org.hibernate.bytecode,org.hibernate.cache,org.hibernate. - connection,org.hibernate.dialect,org.hibernate.dialect.function,org.h - ibernate.engine,org.hibernate.engine.query.sql,org.hibernate.event,or - g.hibernate.exception,org.hibernate.hql,org.hibernate.jdbc,org.hibern - ate.jdbc.util,org.hibernate.mapping,org.hibernate.proxy,org.hibernate - .tool.hbm2ddl,org.hibernate.transaction,org.hibernate.type,org.w3c.do - m,org.xml.sax",org.hibernate.classic;version="3.3.1.GA";uses:="org.hi - bernate,org.hibernate.type",org.hibernate.collection;version="3.3.1.G - A";uses:="org.dom4j,org.hibernate,org.hibernate.engine,org.hibernate. - loader,org.hibernate.persister.collection,org.hibernate.type",org.hib - ernate.connection;version="3.3.1.GA";uses:="javax.sql,org.hibernate", - org.hibernate.context;version="3.3.1.GA";uses:="javax.transaction,org - .hibernate,org.hibernate.classic,org.hibernate.engine,org.slf4j",org. - hibernate.criterion;version="3.3.1.GA";uses:="org.hibernate,org.hiber - nate.engine,org.hibernate.impl,org.hibernate.persister.collection,org - .hibernate.transform,org.hibernate.type",org.hibernate.dialect;versio - n="3.3.1.GA";uses:="org.hibernate,org.hibernate.dialect.function,org. - hibernate.dialect.lock,org.hibernate.engine,org.hibernate.exception,o - rg.hibernate.persister.entity,org.hibernate.sql,org.hibernate.type,or - g.slf4j",org.hibernate.dialect.function;version="3.3.1.GA";uses:="org - .hibernate,org.hibernate.dialect,org.hibernate.engine,org.hibernate.t - ype",org.hibernate.dialect.lock;version="3.3.1.GA";uses:="org.hiberna - te,org.hibernate.engine,org.hibernate.persister.entity",org.hibernate - .engine;version="3.3.1.GA";uses:="javax.transaction,org.hibernate,org - .hibernate.action,org.hibernate.cache,org.hibernate.cfg,org.hibernate - .classic,org.hibernate.collection,org.hibernate.connection,org.hibern - ate.dialect,org.hibernate.dialect.function,org.hibernate.engine.loadi - ng,org.hibernate.engine.query,org.hibernate.engine.query.sql,org.hibe - rnate.engine.transaction,org.hibernate.event,org.hibernate.exception, - org.hibernate.id,org.hibernate.impl,org.hibernate.jdbc,org.hibernate. - loader.custom,org.hibernate.persister.collection,org.hibernate.persis - ter.entity,org.hibernate.property,org.hibernate.proxy,org.hibernate.s - ql,org.hibernate.stat,org.hibernate.transform,org.hibernate.type,org. - slf4j",org.hibernate.engine.loading;version="3.3.1.GA";uses:="org.hib - ernate.collection,org.hibernate.engine,org.hibernate.persister.collec - tion",org.hibernate.engine.query;version="3.3.1.GA";uses:="org.hibern - ate,org.hibernate.engine,org.hibernate.engine.query.sql,org.hibernate - .event,org.hibernate.hql,org.hibernate.loader.custom.sql,org.hibernat - e.type",org.hibernate.engine.query.sql;version="3.3.1.GA";uses:="org. - hibernate,org.hibernate.type",org.hibernate.engine.transaction;versio - n="3.3.1.GA";uses:="org.hibernate,org.hibernate.engine,org.slf4j",org - .hibernate.event;version="3.3.1.GA";uses:="org.hibernate,org.hibernat - e.cfg,org.hibernate.collection,org.hibernate.engine,org.hibernate.per - sister.collection,org.hibernate.persister.entity,org.hibernate.util", - org.hibernate.event.def;version="3.3.1.GA";uses:="org.hibernate,org.h - ibernate.collection,org.hibernate.engine,org.hibernate.event,org.hibe - rnate.persister.collection,org.hibernate.persister.entity,org.hiberna - te.type",org.hibernate.exception;version="3.3.1.GA";uses:="org.hibern - ate,org.hibernate.dialect",org.hibernate.hql;version="3.3.1.GA";uses: - ="org.hibernate,org.hibernate.engine,org.hibernate.event,org.hibernat - e.transform,org.hibernate.type",org.hibernate.hql.antlr;version="3.3. - 1.GA";uses:="antlr,antlr.collections",org.hibernate.hql.ast;version=" - 3.3.1.GA";uses:="antlr,antlr.collections,org.hibernate,org.hibernate. - engine,org.hibernate.event,org.hibernate.hql,org.hibernate.hql.antlr, - org.hibernate.hql.ast.tree,org.hibernate.hql.ast.util,org.hibernate.i - d,org.hibernate.type",org.hibernate.hql.ast.exec;version="3.3.1.GA";u - ses:="antlr.collections,org.hibernate,org.hibernate.engine,org.hibern - ate.engine.transaction,org.hibernate.hql.ast,org.hibernate.persister. - entity,org.slf4j",org.hibernate.hql.ast.tree;version="3.3.1.GA";uses: - ="antlr,antlr.collections,org.hibernate,org.hibernate.dialect.functio - n,org.hibernate.engine,org.hibernate.hql.antlr,org.hibernate.hql.ast, - org.hibernate.hql.ast.util,org.hibernate.param,org.hibernate.persiste - r.collection,org.hibernate.persister.entity,org.hibernate.sql,org.hib - ernate.type,org.slf4j",org.hibernate.hql.ast.util;version="3.3.1.GA"; - uses:="antlr,antlr.collections,antlr.collections.impl,org.hibernate,o - rg.hibernate.dialect.function,org.hibernate.engine,org.hibernate.hql. - antlr,org.hibernate.hql.ast,org.hibernate.hql.ast.tree,org.hibernate. - persister.collection,org.hibernate.persister.entity,org.hibernate.sql - ,org.hibernate.type,org.slf4j",org.hibernate.hql.classic;version="3.3 - .1.GA";uses:="org.hibernate,org.hibernate.dialect,org.hibernate.engin - e,org.hibernate.event,org.hibernate.hql,org.hibernate.loader,org.hibe - rnate.persister.collection,org.hibernate.persister.entity,org.hiberna - te.transform,org.hibernate.type",org.hibernate.id;version="3.3.1.GA"; - uses:="org.hibernate,org.hibernate.dialect,org.hibernate.engine,org.h - ibernate.id.insert,org.hibernate.persister.entity,org.hibernate.sql,o - rg.hibernate.type,org.slf4j",org.hibernate.id.enhanced;version="3.3.1 - .GA";uses:="org.hibernate,org.hibernate.dialect,org.hibernate.engine, - org.hibernate.id,org.hibernate.type,org.slf4j",org.hibernate.id.inser - t;version="3.3.1.GA";uses:="org.hibernate.dialect,org.hibernate.engin - e,org.hibernate.id,org.hibernate.sql",org.hibernate.impl;version="3.3 - .1.GA";uses:="javax.naming,javax.naming.event,javax.naming.spi,javax. - transaction,org.hibernate,org.hibernate.cache,org.hibernate.cfg,org.h - ibernate.classic,org.hibernate.collection,org.hibernate.connection,or - g.hibernate.criterion,org.hibernate.dialect,org.hibernate.dialect.fun - ction,org.hibernate.engine,org.hibernate.engine.query,org.hibernate.e - ngine.query.sql,org.hibernate.event,org.hibernate.exception,org.hiber - nate.hql,org.hibernate.id,org.hibernate.jdbc,org.hibernate.loader,org - .hibernate.loader.custom,org.hibernate.metadata,org.hibernate.persist - er.collection,org.hibernate.persister.entity,org.hibernate.proxy,org. - hibernate.stat,org.hibernate.transaction,org.hibernate.transform,org. - hibernate.type,org.hibernate.util,org.slf4j",org.hibernate.intercept; - version="3.3.1.GA";uses:="org.hibernate,org.hibernate.engine",org.hib - ernate.intercept.cglib;version="3.3.1.GA";uses:="org.hibernate.engine - ,org.hibernate.intercept,org.hibernate.repackage.cglib.transform.impl - ",org.hibernate.intercept.javassist;version="3.3.1.GA";uses:="org.hib - ernate.bytecode.javassist,org.hibernate.engine,org.hibernate.intercep - t",org.hibernate.jdbc;version="3.3.1.GA";uses:="org.hibernate,org.hib - ernate.dialect,org.hibernate.engine,org.hibernate.transaction,org.slf - 4j",org.hibernate.jdbc.util;version="3.3.1.GA",org.hibernate.jmx;vers - ion="3.3.1.GA";uses:="javax.naming,org.hibernate,org.hibernate.classi - c,org.hibernate.engine,org.hibernate.metadata,org.hibernate.stat,org. - hibernate.util",org.hibernate.loader;version="3.3.1.GA";uses:="org.hi - bernate,org.hibernate.dialect,org.hibernate.engine,org.hibernate.hql, - org.hibernate.persister.collection,org.hibernate.persister.entity,org - .hibernate.sql,org.hibernate.transform,org.hibernate.type",org.hibern - ate.loader.collection;version="3.3.1.GA";uses:="org.hibernate,org.hib - ernate.engine,org.hibernate.loader,org.hibernate.persister.collection - ,org.hibernate.type",org.hibernate.loader.criteria;version="3.3.1.GA" - ;uses:="org.hibernate,org.hibernate.criterion,org.hibernate.dialect,o - rg.hibernate.engine,org.hibernate.impl,org.hibernate.loader,org.hiber - nate.persister.entity,org.hibernate.transform,org.hibernate.type",org - .hibernate.loader.custom;version="3.3.1.GA";uses:="org.hibernate,org. - hibernate.engine,org.hibernate.hql,org.hibernate.loader,org.hibernate - .persister.collection,org.hibernate.persister.entity,org.hibernate.tr - ansform,org.hibernate.type",org.hibernate.loader.custom.sql;version=" - 3.3.1.GA";uses:="org.hibernate,org.hibernate.engine,org.hibernate.eng - ine.query,org.hibernate.engine.query.sql,org.hibernate.loader.custom, - org.hibernate.persister.collection,org.hibernate.persister.entity",or - g.hibernate.loader.entity;version="3.3.1.GA";uses:="org.hibernate,org - .hibernate.engine,org.hibernate.loader,org.hibernate.persister.collec - tion,org.hibernate.persister.entity,org.hibernate.transform,org.hiber - nate.type",org.hibernate.loader.hql;version="3.3.1.GA";uses:="org.hib - ernate,org.hibernate.dialect,org.hibernate.engine,org.hibernate.event - ,org.hibernate.hql.ast,org.hibernate.hql.ast.tree,org.hibernate.loade - r,org.hibernate.persister.collection,org.hibernate.persister.entity,o - rg.hibernate.transform,org.hibernate.type",org.hibernate.lob;version= - "3.3.1.GA",org.hibernate.mapping;version="3.3.1.GA";uses:="org.hibern - ate,org.hibernate.dialect,org.hibernate.dialect.function,org.hibernat - e.engine,org.hibernate.id,org.hibernate.property,org.hibernate.tool.h - bm2ddl,org.hibernate.type",org.hibernate.metadata;version="3.3.1.GA"; - uses:="org.hibernate,org.hibernate.engine,org.hibernate.type",org.hib - ernate.param;version="3.3.1.GA";uses:="org.hibernate.engine,org.hiber - nate.type",org.hibernate.persister;version="3.3.1.GA";uses:="org.hibe - rnate,org.hibernate.cache.access,org.hibernate.cfg,org.hibernate.engi - ne,org.hibernate.mapping,org.hibernate.persister.collection,org.hiber - nate.persister.entity",org.hibernate.persister.collection;version="3. - 3.1.GA";uses:="org.hibernate,org.hibernate.cache,org.hibernate.cache. - access,org.hibernate.cache.entry,org.hibernate.cfg,org.hibernate.coll - ection,org.hibernate.dialect,org.hibernate.engine,org.hibernate.excep - tion,org.hibernate.id,org.hibernate.loader.collection,org.hibernate.m - apping,org.hibernate.metadata,org.hibernate.persister.entity,org.hibe - rnate.sql,org.hibernate.type",org.hibernate.persister.entity;version= - "3.3.1.GA";uses:="org.hibernate,org.hibernate.cache,org.hibernate.cac - he.access,org.hibernate.cache.entry,org.hibernate.dialect.lock,org.hi - bernate.engine,org.hibernate.id,org.hibernate.id.insert,org.hibernate - .intercept,org.hibernate.jdbc,org.hibernate.loader.entity,org.hiberna - te.mapping,org.hibernate.metadata,org.hibernate.sql,org.hibernate.tup - le.entity,org.hibernate.type",org.hibernate.pretty;version="3.3.1.GA" - ;uses:="org.hibernate,org.hibernate.engine,org.hibernate.persister.co - llection,org.hibernate.persister.entity,org.hibernate.type",org.hiber - nate.property;version="3.3.1.GA";uses:="org.hibernate,org.hibernate.e - ngine,org.hibernate.mapping,org.hibernate.type,org.slf4j",org.hiberna - te.proxy;version="3.3.1.GA";uses:="org.hibernate,org.hibernate.engine - ,org.hibernate.type",org.hibernate.proxy.dom4j;version="3.3.1.GA";use - s:="org.dom4j,org.hibernate,org.hibernate.engine,org.hibernate.proxy, - org.hibernate.type",org.hibernate.proxy.map;version="3.3.1.GA";uses:= - "org.hibernate,org.hibernate.engine,org.hibernate.proxy,org.hibernate - .type",org.hibernate.proxy.pojo;version="3.3.1.GA";uses:="org.hiberna - te.engine,org.hibernate.proxy,org.hibernate.type",org.hibernate.proxy - .pojo.cglib;version="3.3.1.GA";uses:="org.hibernate,org.hibernate.eng - ine,org.hibernate.proxy,org.hibernate.proxy.pojo,org.hibernate.repack - age.cglib.proxy,org.hibernate.type",org.hibernate.proxy.pojo.javassis - t;version="3.3.1.GA";uses:="javassist.util.proxy,org.hibernate,org.hi - bernate.engine,org.hibernate.proxy,org.hibernate.proxy.pojo,org.hiber - nate.type",org.hibernate.repackage.cglib.asm;version="3.3.1.GA",org.h - ibernate.repackage.cglib.asm.attrs;version="3.3.1.GA";uses:="org.hibe - rnate.repackage.cglib.asm",org.hibernate.repackage.cglib.beans;versio - n="3.3.1.GA";uses:="org.hibernate.repackage.cglib.asm,org.hibernate.r - epackage.cglib.core",org.hibernate.repackage.cglib.core;version="3.3. - 1.GA";uses:="org.hibernate.repackage.cglib.asm",org.hibernate.repacka - ge.cglib.proxy;version="3.3.1.GA";uses:="org.hibernate.repackage.cgli - b.asm,org.hibernate.repackage.cglib.core,org.hibernate.repackage.cgli - b.reflect",org.hibernate.repackage.cglib.reflect;version="3.3.1.GA";u - ses:="org.hibernate.repackage.cglib.asm,org.hibernate.repackage.cglib - .core",org.hibernate.repackage.cglib.transform;version="3.3.1.GA";use - s:="org.apache.tools.ant,org.apache.tools.ant.types,org.hibernate.rep - ackage.cglib.asm,org.hibernate.repackage.cglib.core",org.hibernate.re - package.cglib.transform.hook;version="3.3.1.GA";uses:="org.codehaus.a - spectwerkz.hook,org.hibernate.repackage.cglib.asm,org.hibernate.repac - kage.cglib.core,org.hibernate.repackage.cglib.transform",org.hibernat - e.repackage.cglib.transform.impl;version="3.3.1.GA";uses:="org.hibern - ate.repackage.cglib.asm,org.hibernate.repackage.cglib.core,org.hibern - ate.repackage.cglib.transform",org.hibernate.repackage.cglib.util;ver - sion="3.3.1.GA";uses:="org.hibernate.repackage.cglib.asm,org.hibernat - e.repackage.cglib.core",org.hibernate.secure;version="3.3.1.GA";uses: - ="javax.security.auth,javax.security.jacc,org.hibernate,org.hibernate - .cfg,org.hibernate.event",org.hibernate.sql;version="3.3.1.GA";uses:= - "org.hibernate,org.hibernate.dialect,org.hibernate.dialect.function,o - rg.hibernate.type",org.hibernate.stat;version="3.3.1.GA";uses:="org.h - ibernate.cache,org.hibernate.engine",org.hibernate.tool.hbm2ddl;versi - on="3.3.1.GA";uses:="org.apache.tools.ant,org.apache.tools.ant.taskde - fs,org.apache.tools.ant.types,org.hibernate,org.hibernate.cfg,org.hib - ernate.connection,org.hibernate.dialect",org.hibernate.tool.instrumen - t;version="3.3.1.GA";uses:="org.apache.tools.ant,org.apache.tools.ant - .types,org.hibernate.bytecode,org.hibernate.bytecode.util",org.hibern - ate.tool.instrument.cglib;version="3.3.1.GA";uses:="org.hibernate.byt - ecode,org.hibernate.bytecode.util,org.hibernate.tool.instrument",org. - hibernate.tool.instrument.javassist;version="3.3.1.GA";uses:="org.hib - ernate.bytecode,org.hibernate.bytecode.util,org.hibernate.tool.instru - ment",org.hibernate.transaction;version="3.3.1.GA";uses:="javax.namin - g,javax.transaction,javax.transaction.xa,org.hibernate,org.hibernate. - engine,org.hibernate.jdbc",org.hibernate.transform;version="3.3.1.GA" - ,org.hibernate.tuple;version="3.3.1.GA";uses:="org.dom4j,org.hibernat - e,org.hibernate.bytecode,org.hibernate.engine,org.hibernate.id,org.hi - bernate.mapping,org.hibernate.property,org.hibernate.type",org.hibern - ate.tuple.component;version="3.3.1.GA";uses:="org.hibernate,org.hiber - nate.engine,org.hibernate.mapping,org.hibernate.property,org.hibernat - e.tuple",org.hibernate.tuple.entity;version="3.3.1.GA";uses:="org.hib - ernate,org.hibernate.engine,org.hibernate.mapping,org.hibernate.prope - rty,org.hibernate.proxy,org.hibernate.tuple,org.hibernate.type",org.h - ibernate.type;version="3.3.1.GA";uses:="org.dom4j,org.hibernate,org.h - ibernate.collection,org.hibernate.dialect,org.hibernate.engine,org.hi - bernate.persister.collection,org.hibernate.persister.entity,org.hiber - nate.tuple,org.hibernate.tuple.component,org.hibernate.usertype",org. - hibernate.usertype;version="3.3.1.GA";uses:="org.hibernate,org.hibern - ate.collection,org.hibernate.engine,org.hibernate.persister.collectio - n,org.hibernate.type",org.hibernate.util;version="3.3.1.GA";uses:="ja - vax.naming,javax.transaction,org.dom4j,org.dom4j.io,org.hibernate,org - .hibernate.cfg,org.hibernate.dialect,org.hibernate.dialect.function,o - rg.hibernate.engine,org.hibernate.property,org.hibernate.type,org.slf - 4j,org.xml.sax" -Bundle-Vendor: SpringSource -Bundle-Version: 3.3.1.GA -Tool: Bundlor 1.0.0.CI-B166 -Bundle-Name: JBoss Hibernate Object-Relational Mapper -Bundle-ManifestVersion: 2 -Created-By: 1.5.0_15-b04 (Sun Microsystems Inc.) -Bundle-SymbolicName: com.springsource.org.hibernate -Import-Package: antlr;version="[2.7.6, 3.0.0)",antlr.collections;versi - on="[2.7.6, 3.0.0)",antlr.collections.impl;version="[2.7.6, 3.0.0)",c - om.mchange.v2.c3p0;version="[0.9.1, 0.9.2)";resolution:="optional",co - m.opensymphony.oscache.base;version="[2.1.0, 3.0.0)";resolution:="opt - ional",com.opensymphony.oscache.general;version="[2.1.0, 3.0.0)";reso - lution:="optional",javassist;version="[3.3.0.ga,3.4.0)",javassist.byt - ecode;version="[3.3.0.ga,3.4.0)",javassist.util.proxy;version="[3.3.0 - .ga,3.4.0)",javax.naming;version="0",javax.naming.event;version="0",j - avax.naming.spi;version="0",javax.security.auth;version="0",javax.sec - urity.jacc;version="0";resolution:="optional",javax.sql;version="0",j - avax.transaction;version="[1.0.1, 2.0.0)";resolution:="optional",java - x.transaction.xa;version="[1.0.1, 2.0.0)";resolution:="optional",net. - sf.cglib.beans;version="[2.1.3, 2.2.0)",net.sf.cglib.core;version="[2 - .1.3, 2.2.0)",net.sf.cglib.proxy;version="[2.1.3, 2.2.0)",net.sf.cgli - b.reflect;version="[2.1.3, 2.2.0)",net.sf.cglib.transform;version="[2 - .1.3, 2.2.0)",net.sf.cglib.util;version="[2.1.3, 2.2.0)",net.sf.ehcac - he;version="[1.2.3, 2.0.0)";resolution:="optional",net.sf.swarmcache; - version="[1.0.0.RC2a, 1.1.0)";resolution:="optional",org.apache.commo - ns.collections.map;version="[3.2.0, 4.0.0)",org.apache.tools.ant;vers - ion="[1.7.0, 2.0.0)";resolution:="optional",org.apache.tools.ant.task - defs;version="[1.7.0, 2.0.0)";resolution:="optional",org.apache.tools - .ant.types;version="[1.7.0, 2.0.0)";resolution:="optional",org.codeha - us.aspectwerkz.hook;version="[0.8.1, 0.9.0)";resolution:="optional",o - rg.dom4j;version="[1.6.1, 1.7.0)",org.dom4j.io;version="[1.6.1, 1.7.0 - )",org.jboss.cache;version="[1.2.2, 2.0.0)";resolution:="optional",or - g.jboss.cache.config;version="[1.2.2, 2.0.0)";resolution:="optional", - org.jboss.cache.lock;version="[1.2.2, 2.0.0)";resolution:="optional", - org.jboss.cache.notifications.annotation;version="[1.2.2, 2.0.0)";res - olution:="optional",org.jboss.cache.notifications.event;version="[1.2 - .2, 2.0.0)";resolution:="optional",org.jboss.cache.optimistic;version - ="[1.2.2, 2.0.0)";resolution:="optional",org.jgroups;version="[2.2.7, - 3.0.0)",org.logicalcobwebs.proxool;version="[0.8.3, 0.9.0)";resoluti - on:="optional",org.logicalcobwebs.proxool.configuration;version="[0.8 - .3, 0.9.0)";resolution:="optional",org.slf4j;version="[1.5.2, 1.6.0)" - ,org.w3c.dom;version="0",org.xml.sax;version="0" -Archiver-Version: Plexus Archiver diff --git a/legacy/runtime/org.argeo.slc.support.activemq/.classpath b/legacy/runtime/org.argeo.slc.support.activemq/.classpath deleted file mode 100644 index 581598319..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - >> - - - diff --git a/legacy/runtime/org.argeo.slc.support.activemq/.project b/legacy/runtime/org.argeo.slc.support.activemq/.project deleted file mode 100644 index c1292c0e6..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.slc.support.activemq - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/legacy/runtime/org.argeo.slc.support.activemq/.settings/org.eclipse.jdt.core.prefs b/legacy/runtime/org.argeo.slc.support.activemq/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 8bd7b109a..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Sat Jan 10 17:12:41 CET 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 diff --git a/legacy/runtime/org.argeo.slc.support.activemq/.settings/org.maven.ide.eclipse.prefs b/legacy/runtime/org.argeo.slc.support.activemq/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index 9b6b74ee9..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Sat Jan 10 17:11:12 CET 2009 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -version=1 diff --git a/legacy/runtime/org.argeo.slc.support.activemq/build.properties b/legacy/runtime/org.argeo.slc.support.activemq/build.properties deleted file mode 100644 index f0cc4f1b4..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -source.. = src/main/java/,\ - src/main/resources/ diff --git a/legacy/runtime/org.argeo.slc.support.activemq/pom.xml b/legacy/runtime/org.argeo.slc.support.activemq/pom.xml deleted file mode 100644 index 6b3c1db5e..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - 4.0.0 - - org.argeo.slc - runtime - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.runtime - org.argeo.slc.support.activemq - SLC Support ActiveMQ - - - - org.apache.felix - maven-bundle-plugin - - - - - org.argeo.slc.jms.*,org.argeo.slc.activemq - - - javax.xml.transform;version="0.0.0", - * - - - - - - - - - - org.argeo.slc.runtime - org.argeo.slc.core - 1.1.3-SNAPSHOT - - - - - org.argeo.tp - org.springframework.jms - - - org.argeo.tp - org.springframework.oxm - - - org.argeo.tp - org.springframework.transaction - - - - - org.argeo.tp - org.aspectj.weaver - - - - - org.argeo.tp - javax.jms - - - - - org.argeo.tp - org.apache.activemq - - - org.argeo.tp - org.apache.commons.pool - - - - - org.argeo.tp - javax.management.j2ee - - - org.argeo.tp - javax.ejb - - - org.argeo.tp - javax.xml.rpc - - - org.argeo.tp - javax.servlet - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgent.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgent.java deleted file mode 100644 index 3851a2a9c..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgent.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.util.List; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.argeo.slc.core.runtime.DefaultAgent; -import org.argeo.slc.execution.ExecutionModuleDescriptor; -import org.argeo.slc.msg.ExecutionAnswer; -import org.argeo.slc.msg.MsgConstants; -import org.argeo.slc.msg.ReferenceList; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.runtime.SlcAgentDescriptor; -import org.springframework.jms.JmsException; -import org.springframework.jms.core.JmsTemplate; -import org.springframework.jms.core.MessagePostProcessor; - -/** JMS based implementation of an SLC Agent. */ -public class JmsAgent extends DefaultAgent implements MessageListener { - public final static String PROPERTY_QUERY = "query"; - public final static String QUERY_PING_ALL = "pingAll"; - - private final static Log log = LogFactory.getLog(JmsAgent.class); - - private JmsTemplate jmsTemplate; - private Destination agentRegister; - private Destination agentUnregister; - - private Destination responseDestination; - - public void init() { - super.init(); - try { - jmsTemplate.convertAndSend(agentRegister, getAgentDescriptor()); - log.info("Agent #" + getAgentUuid() + " registered to " - + agentRegister); - } catch (JmsException e) { - log.warn("Could not register agent " - + getAgentDescriptor().getUuid() - + " to server: " - + e.getMessage() - + ". The agent will stay offline but will keep listening for a ping all sent by server."); - if (log.isTraceEnabled()) - log.debug("Original error.", e); - } - } - - @Override - public void destroy() { - try { - jmsTemplate.convertAndSend(agentUnregister, getAgentDescriptor()); - log.info("Agent #" + getAgentUuid() + " unregistered from " - + agentUnregister); - } catch (JmsException e) { - log.warn("Could not unregister agent " + getAgentUuid() + ": " - + e.getMessage()); - if (log.isTraceEnabled()) - log.debug("Original error.", e); - } - super.destroy(); - } - - public void setAgentRegister(Destination agentRegister) { - this.agentRegister = agentRegister; - } - - public void setAgentUnregister(Destination agentUnregister) { - this.agentUnregister = agentUnregister; - } - - public String getMessageSelector() { - String messageSelector = "slc_agentId='" + getAgentUuid() + "'"; - // if (log.isDebugEnabled()) - // log.debug("Message selector: " + messageSelector); - return messageSelector; - } - - public void onMessage(final Message message) { - final String query; - final String correlationId; - try { - query = message.getStringProperty(PROPERTY_QUERY); - correlationId = message.getJMSCorrelationID(); - } catch (JMSException e1) { - throw new SlcException("Cannot analyze incoming message " + message); - } - - final Object response; - final Destination destinationSend; - if (QUERY_PING_ALL.equals(query)) { - ReferenceList refList = (ReferenceList) convertFrom(message); - if (!refList.getReferences().contains(getAgentUuid())) { - response = getAgentDescriptor(); - destinationSend = agentRegister; - log.info("Agent #" + getAgentUuid() + " registering to " - + agentRegister + " in reply to a " + QUERY_PING_ALL - + " query"); - } else { - return; - } - } else { - response = process(query, message); - destinationSend = responseDestination; - } - - // Send response - if (log.isTraceEnabled()) - log.trace("About to send response " + response.getClass()); - jmsTemplate.convertAndSend(destinationSend, response, - new MessagePostProcessor() { - public Message postProcessMessage(Message messageToSend) - throws JMSException { - messageToSend.setStringProperty(PROPERTY_QUERY, query); - messageToSend.setStringProperty( - MsgConstants.PROPERTY_SLC_AGENT_ID, - getAgentUuid()); - messageToSend.setJMSCorrelationID(correlationId); - return messageToSend; - } - }); - if (log.isTraceEnabled()) - log.debug("Sent response to query '" + query - + "' with correlationId " + correlationId); - } - - /** @return response */ - public Object process(String query, Message message) { - try { - if ("getExecutionModuleDescriptor".equals(query)) { - String moduleName = message.getStringProperty("moduleName"); - String version = message.getStringProperty("version"); - return getExecutionModuleDescriptor(moduleName, version); - } else if ("listExecutionModuleDescriptors".equals(query)) { - - List lst = listExecutionModuleDescriptors(); - SlcAgentDescriptor agentDescriptorToSend = new SlcAgentDescriptor( - getAgentDescriptor()); - agentDescriptorToSend.setModuleDescriptors(lst); - return agentDescriptorToSend; - } else if ("runSlcExecution".equals(query)) { - final SlcExecution slcExecution = (SlcExecution) convertFrom(message); - new Thread() { - public void run() { - process(slcExecution); - } - }.start(); - return ExecutionAnswer.ok("Execution started on agent " - + getAgentUuid()); - } else if ("ping".equals(query)) { - return ExecutionAnswer.ok("Agent " + getAgentUuid() - + " is alive."); - } else { - throw new SlcException("Unsupported query " + query); - } - } catch (Exception e) { - log.error("Processing of query " + query + " failed", e); - return ExecutionAnswer.error(e); - } - } - - protected Object convertFrom(Message message) { - try { - return jmsTemplate.getMessageConverter().fromMessage(message); - } catch (JMSException e) { - throw new SlcException("Cannot convert message", e); - } - } - - public void setResponseDestination(Destination responseDestination) { - this.responseDestination = responseDestination; - } - - public void setJmsTemplate(JmsTemplate jmsTemplate) { - this.jmsTemplate = jmsTemplate; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxy.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxy.java deleted file mode 100644 index 3b0129fc7..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxy.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.util.List; -import java.util.UUID; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Session; -import javax.jms.TextMessage; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.argeo.slc.execution.ExecutionModuleDescriptor; -import org.argeo.slc.execution.ExecutionProcess; -import org.argeo.slc.msg.ExecutionAnswer; -import org.argeo.slc.msg.MsgConstants; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.runtime.SlcAgent; -import org.argeo.slc.runtime.SlcAgentDescriptor; -import org.springframework.jms.core.JmsTemplate; -import org.springframework.jms.core.MessageCreator; - -public class JmsAgentProxy implements SlcAgent { - private final static Log log = LogFactory.getLog(JmsAgentProxy.class); - - private final String agentUuid; - private final Destination requestDestination; - private final Destination responseDestination; - private final JmsTemplate jmsTemplate; - - public JmsAgentProxy(String agentUuid, Destination requestDestination, - Destination responseDestination, JmsTemplate jmsTemplate) { - this.agentUuid = agentUuid; - this.requestDestination = requestDestination; - this.responseDestination = responseDestination; - this.jmsTemplate = jmsTemplate; - } - - public String getAgentUuid() { - return agentUuid; - } - - public ExecutionModuleDescriptor getExecutionModuleDescriptor( - final String moduleName, final String version) { - return (ExecutionModuleDescriptor) sendReceive(new AgentMC( - "getExecutionModuleDescriptor") { - public void setArguments(Message message) throws JMSException { - message.setStringProperty("moduleName", moduleName); - message.setStringProperty("version", version); - } - }); - } - - public List listExecutionModuleDescriptors() { - return ((SlcAgentDescriptor) sendReceive(new AgentMC( - "listExecutionModuleDescriptors"))).getModuleDescriptors(); - } - - public void runSlcExecution(SlcExecution slcExecution) { - process(slcExecution); - } - - public void process(ExecutionProcess executionProcess) { - if (!(executionProcess instanceof SlcExecution)) - throw new SlcException("Unsupported process type " - + executionProcess.getClass()); - sendReceive(new AgentMC("runSlcExecution", - (SlcExecution) executionProcess)); - } - - public boolean ping() { - Object response = sendReceive(new AgentMC("ping"), false); - if (response == null) - return false; - else { - ExecutionAnswer answer = (ExecutionAnswer) response; - return ExecutionAnswer.OK.equals(answer.getStatus()); - } - } - - public void kill(ExecutionProcess process) { - throw new UnsupportedOperationException(); - } - - protected Object sendReceive(AgentMC messageCreator) { - long begin = System.currentTimeMillis(); - Object res; - try { - res = sendReceive(messageCreator, true); - } finally { - if (log.isTraceEnabled()) - log.trace("To agent #" + agentUuid + " in " - + (System.currentTimeMillis() - begin) + " ms, query '" - + messageCreator.getQuery() + "', correlationId " - + messageCreator.getCorrelationId()); - } - return res; - } - - /** - * @param timeoutException - * if true throws an exception if reception timeouted, else - * return null - */ - protected Object sendReceive(AgentMC messageCreator, - boolean timeoutException) { - String correlationId = UUID.randomUUID().toString(); - messageCreator.setCorrelationId(correlationId); - send(messageCreator); - - Object response = processResponse(messageCreator, timeoutException); - - if (response instanceof ExecutionAnswer) { - ExecutionAnswer answer = (ExecutionAnswer) response; - if (ExecutionAnswer.ERROR.equals(answer.getStatus())) - throw new SlcException("Execution of '" - + messageCreator.getQuery() + "' failed on the agent " - + agentUuid + ": " + answer.getMessage() - + " (correlationId=" + correlationId + ")"); - else - return answer; - } else { - return response; - } - } - - protected void send(AgentMC messageCreator) { - jmsTemplate.send(requestDestination, messageCreator); - } - - protected Object processResponse(AgentMC messageCreator, - boolean timeoutException) { - String correlationId = messageCreator.getCorrelationId(); - String query = messageCreator.getQuery(); - Message responseMsg = null; - try { - responseMsg = jmsTemplate.receiveSelected(responseDestination, - "JMSCorrelationID='" + correlationId + "'"); - } catch (Exception e) { - throw new SlcException("Could not receive response from agent " - + agentUuid + " with correlationId " + correlationId - + " (query '" + query + "')", e); - } - - if (responseMsg == null) {// timeout - if (timeoutException) - throw new SlcException("TIMEOUT: Query '" + query + "'" - + " with correlationId " + correlationId - + " sent to agent " + agentUuid + " timed out."); - else - return null; - } - - try { - return fromMessage(responseMsg); - } catch (Exception e) { - throw new SlcException("Could not convert response from agent " - + agentUuid + " with correlationId " + correlationId - + " (query '" + query + "')", e); - } - } - - protected Object fromMessage(Message message) throws JMSException { - return jmsTemplate.getMessageConverter().fromMessage(message); - } - - protected Message toMessage(Object obj, Session session) - throws JMSException { - return jmsTemplate.getMessageConverter().toMessage(obj, session); - } - - protected class AgentMC implements MessageCreator { - private final String query; - private Object body = null; - private String correlationId; - - public AgentMC(String query) { - this.query = query; - } - - public AgentMC(String query, Object body) { - this.query = query; - this.body = body; - } - - public final Message createMessage(Session session) throws JMSException { - if (agentUuid == null) - throw new SlcException("Agent UUID not set"); - if (correlationId == null) - throw new SlcException("JMSCorrelationID not set"); - final Message msg; - if (body == null) - msg = session.createTextMessage(); - else - msg = toMessage(body, session); - msg.setStringProperty(MsgConstants.PROPERTY_SLC_AGENT_ID, agentUuid); - msg.setStringProperty(JmsAgent.PROPERTY_QUERY, query); - msg.setJMSCorrelationID(correlationId); - setArguments(msg); - if (msg instanceof TextMessage) { - TextMessage textMessage = (TextMessage) msg; - if (textMessage.getText() == null) { - // TODO: remove workaround when upgrading to ActiveMQ 5.3 - // Workaround for - // https://issues.apache.org/activemq/browse/AMQ-2046 - textMessage.setText(""); - } - } - return msg; - } - - protected void setArguments(Message message) throws JMSException { - } - - public String getQuery() { - return query; - } - - public String getCorrelationId() { - return correlationId; - } - - public void setCorrelationId(String correlationId) { - this.correlationId = correlationId; - } - - } -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxyFactory.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxyFactory.java deleted file mode 100644 index 683077257..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxyFactory.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.util.List; -import java.util.UUID; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; - -import org.argeo.slc.msg.ReferenceList; -import org.argeo.slc.runtime.SlcAgent; -import org.argeo.slc.runtime.SlcAgentFactory; -import org.springframework.jms.core.JmsTemplate; -import org.springframework.jms.core.MessagePostProcessor; - -public class JmsAgentProxyFactory implements SlcAgentFactory { - private Destination requestDestination; - private Destination responseDestination; - private Destination pingAllDestination; - private JmsTemplate jmsTemplate; - - public SlcAgent getAgent(String uuid) { - return new JmsAgentProxy(uuid, requestDestination, responseDestination, - jmsTemplate); - } - - public void pingAll(List activeAgentIds) { - ReferenceList referenceList = new ReferenceList(activeAgentIds); - jmsTemplate.convertAndSend(pingAllDestination, referenceList, - new MessagePostProcessor() { - - public Message postProcessMessage(Message message) - throws JMSException { - message.setJMSCorrelationID(UUID.randomUUID() - .toString()); - message.setStringProperty(JmsAgent.PROPERTY_QUERY, - JmsAgent.QUERY_PING_ALL); - return message; - } - }); - } - - public void setRequestDestination(Destination requestDestination) { - this.requestDestination = requestDestination; - } - - public void setResponseDestination(Destination responseDestination) { - this.responseDestination = responseDestination; - } - - public void setJmsTemplate(JmsTemplate jmsTemplate) { - this.jmsTemplate = jmsTemplate; - } - - public void setPingAllDestination(Destination pingAllDestination) { - this.pingAllDestination = pingAllDestination; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAttachmentListener.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAttachmentListener.java deleted file mode 100644 index 57725fc95..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAttachmentListener.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import javax.jms.BytesMessage; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; - -import org.apache.commons.io.IOUtils; -import org.argeo.slc.SlcException; -import org.argeo.slc.core.attachment.AttachmentsStorage; -import org.argeo.slc.core.attachment.SimpleAttachment; - -public class JmsAttachmentListener implements MessageListener { - private AttachmentsStorage attachmentsStorage; - - public void onMessage(Message msg) { - BytesMessage message = (BytesMessage) msg; - - InputStream in = null; - try { - SimpleAttachment attachment = new SimpleAttachment(); - attachment.setUuid(msg - .getStringProperty(JmsAttachmentUploader.ATTACHMENT_ID)); - attachment.setName(msg - .getStringProperty(JmsAttachmentUploader.ATTACHMENT_NAME)); - attachment - .setContentType(msg - .getStringProperty(JmsAttachmentUploader.ATTACHMENT_CONTENT_TYPE)); - - // Check body length - Long bodyLength = message.getBodyLength(); - if (bodyLength > Integer.MAX_VALUE) - throw new SlcException("Attachment cannot be bigger than " - + Integer.MAX_VALUE - + " bytes with this transport. Use another transport."); - - byte[] buffer = new byte[bodyLength.intValue()]; - message.readBytes(buffer); - in = new ByteArrayInputStream(buffer); - attachmentsStorage.storeAttachment(attachment, in); - } catch (JMSException e) { - throw new SlcException("Could not process attachment message " - + msg, e); - } finally { - IOUtils.closeQuietly(in); - } - } - - public void setAttachmentsStorage(AttachmentsStorage attachmentsStorage) { - this.attachmentsStorage = attachmentsStorage; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAttachmentUploader.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAttachmentUploader.java deleted file mode 100644 index 740826675..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAttachmentUploader.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.io.IOException; -import java.io.InputStream; - -import javax.jms.BytesMessage; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Session; - -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.argeo.slc.core.attachment.Attachment; -import org.argeo.slc.core.attachment.AttachmentUploader; -import org.springframework.core.io.Resource; -import org.springframework.jms.JmsException; -import org.springframework.jms.core.JmsTemplate; -import org.springframework.jms.core.MessageCreator; - -public class JmsAttachmentUploader implements AttachmentUploader { - private final static Log log = LogFactory - .getLog(JmsAttachmentUploader.class); - - public final static String ATTACHMENT_ID = "slc_attachmentId"; - public final static String ATTACHMENT_NAME = "slc_attachmentName"; - public final static String ATTACHMENT_CONTENT_TYPE = "slc_attachmentContentType"; - - private JmsTemplate jmsTemplate; - private Destination destination; - - public void upload(final Attachment attachment, final Resource resource) { - try { - jmsTemplate.send(destination, new MessageCreator() { - - public Message createMessage(Session session) - throws JMSException { - BytesMessage message = session.createBytesMessage(); - message.setStringProperty(ATTACHMENT_ID, attachment - .getUuid()); - message.setStringProperty(ATTACHMENT_NAME, attachment - .getName()); - message.setStringProperty(ATTACHMENT_CONTENT_TYPE, - attachment.getContentType()); - - InputStream in = null; - try { - in = resource.getInputStream(); - byte[] buffer = new byte[1024 * 1024]; - int read = -1; - while ((read = in.read(buffer)) > 0) { - message.writeBytes(buffer, 0, read); - } - } catch (IOException e) { - throw new SlcException( - "Cannot write into byte message for attachment " - + attachment + " and resource " - + resource, e); - } finally { - IOUtils.closeQuietly(in); - } - return message; - } - }); - } catch (JmsException e) { - if (log.isTraceEnabled()) - log.debug("Cannot upload", e); - else if (log.isDebugEnabled()) - log.debug("Cannot upload: " + e.getMessage()); - } - - } - - public void setJmsTemplate(JmsTemplate jmsTemplate) { - this.jmsTemplate = jmsTemplate; - } - - public void setDestination(Destination destination) { - this.destination = destination; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsExecutionHandler.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsExecutionHandler.java deleted file mode 100644 index 9239c7a33..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsExecutionHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; - -import org.argeo.slc.SlcException; -import org.argeo.slc.msg.MsgHandler; -import org.springframework.jms.support.converter.MessageConverter; - -public class JmsExecutionHandler implements MessageListener { - - private MessageConverter messageConverter; - private MsgHandler serviceMsgHandler; - - public void onMessage(Message message) { - try { - serviceMsgHandler.handleMsg(messageConverter.fromMessage(message)); - } catch (JMSException e) { - throw new SlcException("Could not interpret message " + message, e); - } - } - - public void setMessageConverter(MessageConverter messageConverter) { - this.messageConverter = messageConverter; - } - - public void setServiceMsgHandler(MsgHandler serviceMsgHandler) { - this.serviceMsgHandler = serviceMsgHandler; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcEventListener.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcEventListener.java deleted file mode 100644 index 35cbc70d8..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcEventListener.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Session; -import javax.jms.Topic; -import javax.jms.TopicSubscriber; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.argeo.slc.msg.event.SlcEvent; -import org.argeo.slc.msg.event.SlcEventListener; -import org.argeo.slc.msg.event.SlcEventListenerDescriptor; -import org.springframework.jms.connection.ConnectionFactoryUtils; -import org.springframework.jms.support.JmsUtils; -import org.springframework.jms.support.converter.MessageConverter; - -public class JmsSlcEventListener implements SlcEventListener { - private final static Log log = LogFactory.getLog(JmsSlcEventListener.class); - - // IoC - private Topic eventsDestination; - private ConnectionFactory jmsConnectionFactory; - private MessageConverter messageConverter; - - // Initialized with init() method, released with close() - private Connection connection = null; - - // One by instance - private String connectionClientId = getClass() + "#" - + UUID.randomUUID().toString(); - private Boolean isClosed = false; - - private List subscriberIds = new ArrayList(); - - // private Map clients = Collections - // .synchronizedMap(new HashMap()); - - public SlcEvent listen(String subscriberId, - List descriptors, Long timeout) { - if (descriptors.size() == 0) { - // No listener, just waiting - try { - if (log.isTraceEnabled()) - log.trace("No event listener registered, sleeping..."); - Thread.sleep(timeout); - } catch (InterruptedException e) { - // silent - } - return null; - } else { - Object obj = null; - synchronized (subscriberIds) { - while (subscriberIds.contains(subscriberId)) { - try { - subscriberIds.wait(500); - if (isClosed) - return null; - } catch (InterruptedException e) { - // silent - } - } - subscriberIds.add(subscriberId); - Session session = null; - TopicSubscriber topicSubscriber = null; - try { - // ListeningClient client = (ListeningClient) - // getClient(clientId); - session = connection.createSession(false, - Session.AUTO_ACKNOWLEDGE); - topicSubscriber = session.createDurableSubscriber( - eventsDestination, subscriberId, - createSelector(descriptors), true); - Message message = topicSubscriber.receive(timeout); - obj = messageConverter.fromMessage(message); - } catch (JMSException e) { - throw new SlcException("Cannot poll events for subscriber " - + subscriberId, e); - } finally { - JmsUtils.closeMessageConsumer(topicSubscriber); - JmsUtils.closeSession(session); - subscriberIds.remove(subscriberId); - subscriberIds.notifyAll(); - } - - } - - if (obj == null) - return null; - else - return (SlcEvent) obj; - } - } - - /** Returns null if no filter */ - protected String createSelector(List descriptors) { - if (descriptors.size() == 0) - throw new SlcException("No listeners, cannot generate JMS selector"); - - StringBuffer buf = new StringBuffer(256); - Boolean first = true; - for (SlcEventListenerDescriptor descriptor : descriptors) { - if (first) - first = false; - else - buf.append(" OR "); - - buf.append('('); - buf.append(SlcEvent.EVENT_TYPE).append("=").append('\'').append( - descriptor.getEventType()).append('\''); - if (descriptor.getFilter() != null) { - buf.append(" AND "); - buf.append('(').append(descriptor.getFilter()).append(')'); - } - buf.append(')'); - } - if (log.isTraceEnabled()) - log.trace("selector created : " + buf.toString()); - return buf.toString(); - } - - public boolean isClosed() { - return isClosed; - } - - // Ioc - public void setEventsDestination(Topic eventsDestination) { - this.eventsDestination = eventsDestination; - } - - public void setJmsConnectionFactory(ConnectionFactory jmsConnectionFactory) { - this.jmsConnectionFactory = jmsConnectionFactory; - } - - public void setMessageConverter(MessageConverter messageConverter) { - this.messageConverter = messageConverter; - } - - // Life Cycle - public void init() { - try { - connection = jmsConnectionFactory.createConnection(); - connection.setClientID(connectionClientId); - connection.start(); - } catch (JMSException e) { - throw new SlcException("Could not init connection", e); - } - } - - public void close() { - ConnectionFactoryUtils.releaseConnection(connection, - jmsConnectionFactory, true); - isClosed = true; - synchronized (subscriberIds) { - subscriberIds.notifyAll(); - } - } - - // public void close(String clientId) { - // // Session session = null; - // // // ListeningClient client = getClient(clientId); - // // // Connection connection = client.getConnection(); - // // try { - // // session = client.getSession(); - // // session.unsubscribe(clientId); - // // } catch (JMSException e) { - // // log.warn("Could not unsubscribe client " + clientId, e); - // // } finally { - // // JmsUtils.closeSession(session); - // // } - // // - // // // synchronized (client) { - // // // clients.remove(clientId); - // // // client.notify(); - // // // } - // } - - // protected ListeningClient getClient(String clientId) { - // ListeningClient client = clients.get(clientId); - // if (client == null) { - // // Lazy init - // client = new ListeningClient(connection); - // clients.put(clientId, client); - // } - // return client; - // } - - // protected class ListeningClient { - // private final Connection connection; - // private final Session session; - // - // public ListeningClient(Connection connection) { - // super(); - // this.connection = connection; - // try { - // session = connection.createSession(false, - // Session.AUTO_ACKNOWLEDGE); - // } catch (JMSException e) { - // throw new SlcException("Cannot create session"); - // } - // } - // - // public Connection getConnection() { - // return connection; - // } - // - // public Session getSession() { - // return session; - // } - // - // } -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcEventPublisher.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcEventPublisher.java deleted file mode 100644 index a95ffc810..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcEventPublisher.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.util.Map; - -import javax.jms.DeliveryMode; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.argeo.slc.msg.event.SlcEvent; -import org.argeo.slc.msg.event.SlcEventPublisher; -import org.springframework.jms.core.JmsTemplate; -import org.springframework.jms.core.MessagePostProcessor; - -public class JmsSlcEventPublisher implements SlcEventPublisher { - private static final Log log = LogFactory - .getLog(JmsSlcEventPublisher.class); - private Destination eventsDestination; - private JmsTemplate jmsTemplate; - - public void publish(final SlcEvent event) { - if (jmsTemplate.getDeliveryMode() != DeliveryMode.PERSISTENT) - throw new SlcException( - "Delivery mode has to be persistent in order to have durable subscription"); - - jmsTemplate.convertAndSend(eventsDestination, event, - new MessagePostProcessor() { - - public Message postProcessMessage(Message message) - throws JMSException { - Map headers = event.getHeaders(); - for (String key : headers.keySet()) { - message.setStringProperty(key, headers.get(key)); - } - return message; - } - }); - if (log.isTraceEnabled()) { - log.trace("Event " + event.toString() + " sent to " - + eventsDestination.toString()); - } - - } - - public void setEventsDestination(Destination eventsDestination) { - this.eventsDestination = eventsDestination; - } - - public void setJmsTemplate(JmsTemplate jmsTemplate) { - this.jmsTemplate = jmsTemplate; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcExecutionNotifier.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcExecutionNotifier.java deleted file mode 100644 index 4e68db35e..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsSlcExecutionNotifier.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.util.List; - -import javax.jms.Destination; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.UnsupportedException; -import org.argeo.slc.execution.ExecutionProcess; -import org.argeo.slc.execution.ExecutionStep; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionNotifier; -import org.argeo.slc.process.SlcExecutionStep; -import org.springframework.jms.JmsException; -import org.springframework.jms.core.JmsTemplate; - -@SuppressWarnings("deprecation") -public class JmsSlcExecutionNotifier implements SlcExecutionNotifier { - private final static Log log = LogFactory - .getLog(JmsSlcExecutionNotifier.class); - - private JmsTemplate jmsTemplate; - - private Destination executionEventDestination; - - // private Destination updateStatusDestination; - - public void updateStatus(ExecutionProcess slcExecution, String oldStatus, - String newStatus) { - SlcExecutionStatusRequest req = new SlcExecutionStatusRequest( - slcExecution.getUuid(), newStatus); - convertAndSend(req); - } - - public void addSteps(ExecutionProcess slcExecution, - List additionalSteps) { - SlcExecutionStepsRequest req = new SlcExecutionStepsRequest( - slcExecution.getUuid(), additionalSteps); - convertAndSend(req); - } - - public void newExecution(SlcExecution slcExecution) { - throw new UnsupportedException(); - } - - public void updateExecution(SlcExecution slcExecution) { - throw new UnsupportedException(); - } - - public void setJmsTemplate(JmsTemplate jmsTemplate) { - this.jmsTemplate = jmsTemplate; - } - - public void setExecutionEventDestination( - Destination executionEventDestination) { - this.executionEventDestination = executionEventDestination; - } - - protected void convertAndSend(Object req) { - try { - jmsTemplate.convertAndSend(executionEventDestination, req); - } catch (JmsException e) { - log.warn("Send request " + req.getClass() + " to server: " - + e.getMessage()); - if (log.isTraceEnabled()) - log.debug("Original error.", e); - } - } -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsTreeTestResultListener.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsTreeTestResultListener.java deleted file mode 100644 index 2cd88c490..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsTreeTestResultListener.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import javax.jms.Destination; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.argeo.slc.core.attachment.Attachment; -import org.argeo.slc.core.attachment.SimpleAttachment; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.core.test.tree.TreeTestResultListener; -import org.argeo.slc.msg.test.tree.AddTreeTestResultAttachmentRequest; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.test.TestResultPart; -import org.springframework.jms.JmsException; -import org.springframework.jms.core.JmsTemplate; - -/** JMS based tree test result listener implementation. */ -public class JmsTreeTestResultListener implements TreeTestResultListener { - private final Log log = LogFactory.getLog(getClass()); - - private Boolean onlyOnClose = false; - private JmsTemplate jmsTemplate; - - private Destination executionEventDestination; - - public void resultPartAdded(TreeTestResult testResult, - TestResultPart testResultPart) { - if (onlyOnClose) - return; - - try { - if (testResult.getResultParts().size() == 1 - && testResult.getResultParts().values().iterator().next() - .getParts().size() == 1) { - CreateTreeTestResultRequest req = new CreateTreeTestResultRequest( - testResult); - - if (log.isTraceEnabled()) - log.trace("Send create result request for result " - + testResult.getUuid()); - - jmsTemplate.convertAndSend(executionEventDestination, req); - } else { - ResultPartRequest req = new ResultPartRequest(testResult); - - if (log.isTraceEnabled()) - log.trace("Send result parts for result " - + testResult.getUuid()); - - jmsTemplate.convertAndSend(executionEventDestination, req); - } - } catch (JmsException e) { - log.warn("Could not notify result part to server: " - + e.getMessage()); - if (log.isTraceEnabled()) - log.debug("Original error.", e); - } catch (Exception e) { - throw new SlcException("Could not notify to JMS", e); - } - } - - public void close(TreeTestResult testResult) { - try { - if (onlyOnClose) { - CreateTreeTestResultRequest req = new CreateTreeTestResultRequest( - testResult); - - if (log.isTraceEnabled()) - log.trace("Send onClose create result request for result " - + testResult.getUuid()); - - jmsTemplate.convertAndSend(executionEventDestination, req); - } else { - CloseTreeTestResultRequest req = new CloseTreeTestResultRequest( - testResult); - - if (log.isTraceEnabled()) - log.trace("Send close result request for result " - + testResult.getUuid()); - - jmsTemplate.convertAndSend(executionEventDestination, req); - - } - } catch (JmsException e) { - log.warn("Could not notify result close to server: " - + e.getMessage()); - if (log.isTraceEnabled()) - log.debug("Original error.", e); - } catch (Exception e) { - throw new SlcException("Could not notify to JMS", e); - } - } - - public void addAttachment(TreeTestResult testResult, Attachment attachment) { - if (onlyOnClose) - return; - - try { - AddTreeTestResultAttachmentRequest req = new AddTreeTestResultAttachmentRequest(); - req.setResultUuid(testResult.getUuid()); - req.setAttachment((SimpleAttachment) attachment); - jmsTemplate.convertAndSend(executionEventDestination, req); - - } catch (JmsException e) { - log - .warn("Could not notify attachment to server: " - + e.getMessage()); - if (log.isTraceEnabled()) - log.debug("Original error.", e); - } catch (Exception e) { - throw new SlcException("Could not notify to JMS", e); - } - - } - - /** Publishes the test result only when it gets closed. */ - public void setOnlyOnClose(Boolean onlyOnClose) { - this.onlyOnClose = onlyOnClose; - } - - public void setJmsTemplate(JmsTemplate jmsTemplate) { - this.jmsTemplate = jmsTemplate; - } - - public void setExecutionEventDestination( - Destination executionEventDestination) { - this.executionEventDestination = executionEventDestination; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/MarshallerMessageConverter.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/MarshallerMessageConverter.java deleted file mode 100644 index 797abb910..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/MarshallerMessageConverter.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.io.Serializable; -import java.util.Enumeration; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.ObjectMessage; -import javax.jms.Session; -import javax.jms.TextMessage; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.springframework.jms.support.converter.MessageConversionException; -import org.springframework.jms.support.converter.MessageConverter; -import org.springframework.oxm.Marshaller; -import org.springframework.oxm.Unmarshaller; -import org.springframework.xml.transform.StringResult; -import org.springframework.xml.transform.StringSource; - -public class MarshallerMessageConverter implements MessageConverter { - private final static Log log = LogFactory - .getLog(MarshallerMessageConverter.class); - - private Marshaller marshaller; - private Unmarshaller unmarshaller; - - /** Use unmarshalled ObjectMessages instead of TextMessages */ - private Boolean disableMarshalling = false; - - /** @return the converted message or null if the message itself is null */ - @SuppressWarnings("unchecked") - public Object fromMessage(Message message) throws JMSException, - MessageConversionException { - long begin = System.currentTimeMillis(); - if (message == null) - return null; - if (log.isTraceEnabled()) { - Enumeration names = message.getPropertyNames(); - while (names.hasMoreElements()) { - String name = names.nextElement(); - log.trace("JMS Property: " + name + "=" - + message.getObjectProperty(name)); - } - } - - Object res; - if (message instanceof TextMessage) { - String text = ((TextMessage) message).getText(); - if (text == null) - throw new SlcException( - "Cannot unmarshall message without body: " + message); - try { - res = unmarshaller.unmarshal(new StringSource(text)); - } catch (Exception e) { - throw new SlcException("Could not unmarshall " + text, e); - } - } else if (message instanceof ObjectMessage) { - res = ((ObjectMessage) message).getObject(); - if (res == null) - throw new SlcException("Message without body: " + message); - } else { - throw new SlcException("This type of messages is not supported: " - + message); - } - if (log.isTraceEnabled()) - log.trace("'From' message processed in " + (System.currentTimeMillis() - begin) - + " ms"); - return res; - } - - public Message toMessage(Object object, Session session) - throws JMSException, MessageConversionException { - long begin = System.currentTimeMillis(); - Message msg; - if (disableMarshalling) { - msg = session.createObjectMessage(); - ((ObjectMessage) msg).setObject((Serializable) object); - } else { - StringResult result = new StringResult(); - try { - marshaller.marshal(object, result); - } catch (Exception e) { - throw new SlcException("Could not marshall " + object, e); - } - msg = session.createTextMessage(); - ((TextMessage) msg).setText(result.toString()); - } - if (log.isTraceEnabled()) - log.trace("'To' message processed in " + (System.currentTimeMillis() - begin) - + " ms"); - return msg; - } - - public void setMarshaller(Marshaller marshaller) { - this.marshaller = marshaller; - } - - public void setUnmarshaller(Unmarshaller unmarshaller) { - this.unmarshaller = unmarshaller; - } - - public void setDisableMarshalling(Boolean disableMarshalling) { - this.disableMarshalling = disableMarshalling; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/ServiceMessageListenerAdapter.java b/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/ServiceMessageListenerAdapter.java deleted file mode 100644 index b35034041..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/ServiceMessageListenerAdapter.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.jms; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.Session; - -import org.argeo.slc.SlcException; -import org.argeo.slc.msg.ExecutionAnswer; -import org.springframework.jms.listener.adapter.MessageListenerAdapter; - -public class ServiceMessageListenerAdapter extends MessageListenerAdapter { - public final static String DEFAULT_METHOD_NAME_PARAMETER = "action"; - public final static String BODY_ARGUMENT = "BODY"; - - private Map> methodArguments = new HashMap>(); - - private static String methodNameParameter = DEFAULT_METHOD_NAME_PARAMETER; - - @Override - protected Object extractMessage(Message message) throws JMSException { - return new ExtractedMessage(message); - } - - @Override - protected String getListenerMethodName(Message originalMessage, - Object extractedMessage) throws JMSException { - return ((ExtractedMessage) extractedMessage).methodName; - } - - @Override - protected Object[] buildListenerArguments(Object extractedMessage) { - return ((ExtractedMessage) extractedMessage).arguments; - } - - @Override - public void onMessage(Message message, Session session) throws JMSException { - try {// hacked and simplified from parent class - // Regular case: find a handler method reflectively. - Object convertedMessage = extractMessage(message); - String methodName = getListenerMethodName(message, convertedMessage); - - // Invoke the handler method with appropriate arguments. - Object[] listenerArguments = buildListenerArguments(convertedMessage); - Object result = invokeListenerMethod(methodName, listenerArguments); - if (result != null) { - handleResult(result, message, session); - } else { - ExecutionAnswer answer = ExecutionAnswer.ok("Execution of " - + methodName + " on " + getDelegate() + " succeeeded."); - Message okMessage = getMessageConverter().toMessage(answer, - session); - sendResponse(session, getResponseDestination(message, - okMessage, session), okMessage); - } - } catch (Exception e) { - if (session == null) - return; - - StringWriter writer = new StringWriter(); - e.printStackTrace(new PrintWriter(writer)); - ExecutionAnswer answer = ExecutionAnswer.error(writer.toString()); - Message errorMessage = getMessageConverter().toMessage(answer, - session); - sendResponse(session, getResponseDestination(message, errorMessage, - session), errorMessage); - } - } - - protected class ExtractedMessage { - private final String methodName; - private final Object[] arguments; -// private final Message originalMessage; - - public ExtractedMessage(Message originalMessage) throws JMSException { -// this.originalMessage = originalMessage; - - if (!originalMessage.propertyExists(methodNameParameter)) - throw new SlcException("No property " + methodNameParameter - + " in incoming message," - + " cannot determine service method"); - - methodName = originalMessage.getStringProperty(methodNameParameter); - - if (!methodArguments.containsKey(methodName)) {// no arg specified - arguments = new Object[0]; - } else { - List parameterNames = methodArguments.get(methodName); - List arguments = new ArrayList(); - int count = 0; - for (String name : parameterNames) { - if (name.equals(BODY_ARGUMENT)) { - Object body = getMessageConverter().fromMessage( - originalMessage); - arguments.add(body); - } else { - if (!originalMessage.propertyExists(name)) - throw new SlcException("No property " + name - + " in incoming message," - + " cannot determine argument #" + count); - arguments.add(originalMessage.getObjectProperty(name)); - } - count++; - } - this.arguments = arguments.toArray(); - } - } - } - - public void setMethodArguments(Map> methodArguments) { - this.methodArguments = methodArguments; - } - - public static void setMethodNameParameter(String methodNameParameter) { - ServiceMessageListenerAdapter.methodNameParameter = methodNameParameter; - } - - -} diff --git a/legacy/runtime/org.argeo.slc.support.activemq/src/main/resources/org/argeo/slc/activemq/destinations.xml b/legacy/runtime/org.argeo.slc.support.activemq/src/main/resources/org/argeo/slc/activemq/destinations.xml deleted file mode 100644 index 4a27b6330..000000000 --- a/legacy/runtime/org.argeo.slc.support.activemq/src/main/resources/org/argeo/slc/activemq/destinations.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/.classpath b/legacy/runtime/org.argeo.slc.support.castor/.classpath deleted file mode 100644 index 238982686..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/legacy/runtime/org.argeo.slc.support.castor/.project b/legacy/runtime/org.argeo.slc.support.castor/.project deleted file mode 100644 index c0bc103dd..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.slc.support.castor - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/legacy/runtime/org.argeo.slc.support.castor/.settings/org.eclipse.jdt.core.prefs b/legacy/runtime/org.argeo.slc.support.castor/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 93d31747f..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#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 diff --git a/legacy/runtime/org.argeo.slc.support.castor/build.properties b/legacy/runtime/org.argeo.slc.support.castor/build.properties deleted file mode 100644 index a3d626614..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -additional.bundles = org.argeo.slc.unit,\ - junit,\ - org.apache.xml.serializer,\ - org.apache.xerces -source.. = src/main/java/,\ - src/main/resources/,\ - src/test/java/,\ - src/test/resources/ diff --git a/legacy/runtime/org.argeo.slc.support.castor/pom.xml b/legacy/runtime/org.argeo.slc.support.castor/pom.xml deleted file mode 100644 index 0d1cd779c..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - 4.0.0 - - org.argeo.slc - runtime - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.support.castor - SLC Support Castor - Implementations of SLC Specs using Castor - - - - org.apache.felix - maven-bundle-plugin - - - - - org.argeo.slc.* - - - org.argeo.slc.*;resolution:=optional, - org.argeo.slc.deploy;resolution:=optional, - org.argeo.slc.build;resolution:=optional, - org.argeo.slc.execution;resolution:=optional, - org.argeo.slc.core.attachment;resolution:=optional, - org.argeo.slc.core.structure;resolution:=optional, - org.argeo.slc.core.structure.tree;resolution:=optional, - org.argeo.slc.core.test;resolution:=optional, - org.argeo.slc.core.test.tree;resolution:=optional, - org.argeo.slc.runtime;resolution:=optional, - org.argeo.slc.core.execution;resolution:=optional, - org.argeo.slc.msg;resolution:=optional, - org.argeo.slc.msg.build;resolution:=optional, - org.argeo.slc.msg.process;resolution:=optional, - org.argeo.slc.msg.event;resolution:=optional, - org.argeo.slc.msg.test.tree;resolution:=optional, - org.argeo.slc.detached;resolution:=optional, - org.apache.xml.serialize;resolution:=optional, - org.apache.xerces.jaxp;resolution:=optional, - org.w3c.dom.*;version="0.0.0";resolution:=optional, - org.xml.sax.*;version="0.0.0";resolution:=optional, - javax.xml.transform.*;version="0.0.0";resolution:=optional, - javax.xml.parsers.*;version="0.0.0";resolution:=optional, - org.springframework.xml.validation;resolution:=optional, - org.apache.commons.io, - org.springframework.oxm, - org.springframework.core, - org.springframework.xml.transform, - org.springframework.core.io, - * - - org.castor - - - - - - - - - org.argeo.slc - org.argeo.slc.core - 1.1.3-SNAPSHOT - - - - org.argeo.tp - org.springframework.oxm - - - - org.argeo.tp - org.castor - - - - org.argeo.tp - org.apache.xerces - - - - org.argeo.tp - org.apache.xalan - - - - - org.argeo.slc - org.argeo.slc.unit - test - 1.1.3-SNAPSHOT - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/execution/PrimitiveFieldHandler.java b/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/execution/PrimitiveFieldHandler.java deleted file mode 100644 index 4a250e4cf..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/execution/PrimitiveFieldHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor.execution; - -import org.argeo.slc.core.execution.PrimitiveAccessor; -import org.argeo.slc.core.execution.PrimitiveUtils; -import org.exolab.castor.mapping.AbstractFieldHandler; - -public class PrimitiveFieldHandler extends AbstractFieldHandler { - - @Override - public Object getValue(Object object) throws IllegalStateException { - if (object == null) - return null; - - Object value = ((PrimitiveAccessor) object).getValue(); - return value != null ? value.toString() : null; - } - - @Override - public Object newInstance(Object parent, Object[] args) - throws IllegalStateException { - return null; - } - - @Override - public Object newInstance(Object parent) throws IllegalStateException { - return null; - } - - @Override - public void resetValue(Object object) throws IllegalStateException, - IllegalArgumentException { - } - - @Override - public void setValue(Object object, Object value) - throws IllegalStateException, IllegalArgumentException { - PrimitiveAccessor primitiveAccessor = (PrimitiveAccessor) object; - String type = primitiveAccessor.getType(); - String str = value.toString(); - primitiveAccessor.setValue(PrimitiveUtils.convert(type, str)); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/structure/tree/TreeSPathFieldHandler.java b/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/structure/tree/TreeSPathFieldHandler.java deleted file mode 100644 index 5d56fb99f..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/structure/tree/TreeSPathFieldHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor.structure.tree; - -import org.exolab.castor.mapping.AbstractFieldHandler; -import org.exolab.castor.mapping.MapItem; - -import org.argeo.slc.core.structure.tree.TreeSPath; - -public class TreeSPathFieldHandler extends AbstractFieldHandler { - - @Override - public Object getValue(Object object) throws IllegalStateException { - MapItem part = (MapItem) object; - return ((TreeSPath) part.getKey()).getAsUniqueString(); - } - - @Override - public Object newInstance(Object parent) throws IllegalStateException { - return null; - } - - @Override - public Object newInstance(Object parent, Object[] args) - throws IllegalStateException { - return null; - } - - @Override - public void resetValue(Object object) throws IllegalStateException, - IllegalArgumentException { - MapItem part = (MapItem) object; - part.setKey(null); - } - - @Override - public void setValue(Object object, Object value) - throws IllegalStateException, IllegalArgumentException { - MapItem part = (MapItem) object; - part.setKey(new TreeSPath(value.toString())); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/test/tree/StatusFieldHandler.java b/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/test/tree/StatusFieldHandler.java deleted file mode 100644 index a69eb87da..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/castor/test/tree/StatusFieldHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor.test.tree; - -import org.argeo.slc.core.test.SimpleResultPart; -import org.argeo.slc.core.test.SlcTestUtils; -import org.argeo.slc.test.TestStatus; -import org.exolab.castor.mapping.AbstractFieldHandler; - -public class StatusFieldHandler extends AbstractFieldHandler { - - @Override - public Object getValue(Object object) throws IllegalStateException { - SimpleResultPart part = (SimpleResultPart) object; - return SlcTestUtils.statusToString(part.getStatus()); - } - - @Override - public Object newInstance(Object parent) throws IllegalStateException { - return null; - } - - @Override - public Object newInstance(Object parent, Object[] args) - throws IllegalStateException { - return null; - } - - @Override - public void resetValue(Object object) throws IllegalStateException, - IllegalArgumentException { - SimpleResultPart part = (SimpleResultPart) object; - // ERROR by default since it should be explicitely set - part.setStatus(TestStatus.ERROR); - } - - @Override - public void setValue(Object object, Object value) - throws IllegalStateException, IllegalArgumentException { - SimpleResultPart part = (SimpleResultPart) object; - Integer status = SlcTestUtils.stringToStatus((String) value); - part.setStatus(status); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/process/FileSlcExecutionNotifier.java b/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/process/FileSlcExecutionNotifier.java deleted file mode 100644 index ad6bcdc24..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/process/FileSlcExecutionNotifier.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.xml.process; - -import java.io.File; -import java.io.FileWriter; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.transform.stream.StreamResult; - -import org.apache.commons.io.IOUtils; -import org.argeo.slc.SlcException; -import org.argeo.slc.execution.ExecutionProcess; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionNotifier; -import org.argeo.slc.execution.ExecutionStep; -import org.argeo.slc.process.SlcExecutionStep; -import org.springframework.oxm.Marshaller; - -/** @deprecated Probably not even working anymore */ -public class FileSlcExecutionNotifier implements SlcExecutionNotifier { - // private final static SimpleDateFormat sdf = new SimpleDateFormat( - // "yyyyMMdd-HHmmss"); - // - // private String basePath; - private Marshaller marshaller; - - private Map uuidToDir = new HashMap(); - - public void addSteps(ExecutionProcess slcExecution, - List additionalSteps) { - writeSlcExecution(slcExecution); - } - - public void updateStatus(ExecutionProcess slcExecution, String oldStatus, - String newStatus) { - writeSlcExecution(slcExecution); - } - - protected void writeSlcExecution(ExecutionProcess process) { - if (!(process instanceof SlcExecution)) - throw new SlcException("Unsupported process type " - + process.getClass()); - SlcExecution slcExecution = (SlcExecution) process; - FileWriter out = null; - try { - out = new FileWriter(getFilePath(slcExecution)); - marshaller.marshal(slcExecution, new StreamResult(out)); - } catch (Exception e) { - throw new SlcException("Cannot marshall SlcExecution to " - + getFilePath(slcExecution), e); - } finally { - IOUtils.closeQuietly(out); - } - } - - protected String getFileName(SlcExecution slcExecution) { - return "SlcExecution-" + slcExecution.getUuid() + ".xml"; - } - - protected String getFilePath(SlcExecution slcExecution) { - String dirPath = uuidToDir.get(slcExecution.getUuid()); - return dirPath + File.separator + "SlcExecution-" - + slcExecution.getUuid() + ".xml"; - } - - public void setBasePath(String basePath) { - // this.basePath = basePath; - } - - public void setMarshaller(Marshaller marshaller) { - this.marshaller = marshaller; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/test/tree/XsltReportGenerator.java b/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/test/tree/XsltReportGenerator.java deleted file mode 100644 index 0a99356df..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/java/org/argeo/slc/xml/test/tree/XsltReportGenerator.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.xml.test.tree; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.Templates; -import javax.xml.transform.Transformer; -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.springframework.core.io.Resource; -import org.springframework.oxm.Marshaller; -import org.springframework.xml.transform.StringResult; -import org.w3c.dom.Document; - -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.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.test.TestResultListener; -import org.argeo.slc.test.TestResultPart; - -/** Build a report based on a tree test result using an XSLT stylesheet. */ -public class XsltReportGenerator implements TestResultListener { - private final static Log log = LogFactory.getLog(XsltReportGenerator.class); - - private DocumentBuilder documentBuilder = null; - - private Resource xsltStyleSheet; - - private Templates templates; - - private Marshaller marshaller; - - private String outputDir; - private String outputFileExtension = "html"; - - private Boolean logXml = false; - - private Map xsltParameters = new HashMap(); - - public void init() { - if (templates != null) - return; - - if (xsltStyleSheet == null) - throw new SlcException("XSLT style sheet not specified."); - - InputStream in = null; - try { - TransformerFactory transformerFactory = TransformerFactory - .newInstance(); - in = xsltStyleSheet.getInputStream(); - StreamSource xsltSource = new StreamSource(in); - templates = transformerFactory.newTemplates(xsltSource); - } catch (Exception e) { - throw new SlcException("Could not initialize templates", e); - } finally { - IOUtils.closeQuietly(in); - } - } - - public void resultPartAdded(TreeTestResult testResult, - TestResultPart testResultPart) { - - } - - public void close(TreeTestResult testResult) { - if (templates == null) - throw new SlcException("XSLT template not initialized"); - - File file = getFile(testResult); - OutputStream out = null; - - try { - Transformer transformer = templates.newTransformer(); - for (String paramKey : xsltParameters.keySet()) { - transformer - .setParameter(paramKey, xsltParameters.get(paramKey)); - if (log.isTraceEnabled()) - log.trace("Set XSLT parameter " + paramKey + " to " - + xsltParameters.get(paramKey)); - } - - if (documentBuilder == null) - documentBuilder = DocumentBuilderFactory.newInstance() - .newDocumentBuilder(); - - Document document = documentBuilder.newDocument(); - DOMResult marshallResult = new DOMResult(document); - marshaller.marshal(testResult, marshallResult); - - if (logXml) { - Transformer identityTransformer = TransformerFactory - .newInstance().newTransformer(); - StringResult xmlResult = new StringResult(); - identityTransformer.transform(new DOMSource(marshallResult - .getNode()), xmlResult); - log.info("Marshalled XML:\n" + xmlResult); - } - - DOMSource transfoSource = new DOMSource(marshallResult.getNode()); - - if (outputDir != null) { - File dir = new File(outputDir); - dir.mkdirs(); - out = new FileOutputStream(file); - StreamResult outputResult = new StreamResult(out); - transformer.transform(transfoSource, outputResult); - } else { - // print on console if no output dir - StringResult result = new StringResult(); - transformer.transform(transfoSource, result); - log.info("Generated report:\n" + result); - } - } catch (Exception e) { - throw new SlcException( - "Could not transform test result to " + file, e); - } finally { - IOUtils.closeQuietly(out); - } - } - - public Resource getXsltStyleSheet() { - return xsltStyleSheet; - } - - public void setXsltStyleSheet(Resource xsltStyleSheet) { - this.xsltStyleSheet = xsltStyleSheet; - } - - public void setTemplates(Templates templates) { - this.templates = templates; - } - - public void setMarshaller(Marshaller marshaller) { - this.marshaller = marshaller; - } - - public void setOutputDir(String outputDir) { - this.outputDir = outputDir; - } - - public void setOutputFileExtension(String outputFileExtension) { - this.outputFileExtension = outputFileExtension; - } - - protected File getFile(TreeTestResult result) { - Long time = System.currentTimeMillis(); - return new File(outputDir + File.separator + time + "-" - + result.getUuid() + "." + outputFileExtension); - } - - public void setLogXml(Boolean logXml) { - this.logXml = logXml; - } - - public void setXsltParameters(Map xsltParameters) { - this.xsltParameters = xsltParameters; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/attachment.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/attachment.xml deleted file mode 100644 index 774e1bf07..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/attachment.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Attachment objects XML mapping - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/common.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/common.xml deleted file mode 100644 index ae97e3465..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/common.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - Build objects XML mapping - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/execution.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/execution.xml deleted file mode 100644 index 662cbe6af..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/execution.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - Execution objects XML mapping - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/msg.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/msg.xml deleted file mode 100644 index 269903113..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/msg.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - Message objects XML mapping - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/process.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/process.xml deleted file mode 100644 index 67bba2743..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/process.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - Process objects XML mapping - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/runtime.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/runtime.xml deleted file mode 100644 index 9b1a1c07b..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/runtime.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - Runtime objects XML mapping - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/spring.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/spring.xml deleted file mode 100644 index 0b73dee77..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/spring.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - classpath:org/argeo/slc/castor/common.xml - classpath:org/argeo/slc/castor/msg.xml - classpath:org/argeo/slc/castor/process.xml - classpath:org/argeo/slc/castor/runtime.xml - classpath:org/argeo/slc/castor/structure.xml - classpath:org/argeo/slc/castor/test.xml - classpath:org/argeo/slc/castor/execution.xml - classpath:org/argeo/slc/castor/attachment.xml - - - - - - - - - - - - - - - - - - - diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/structure.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/structure.xml deleted file mode 100644 index ad63a7a3f..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/structure.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - Structure related objects XML mapping - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/test.xml b/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/test.xml deleted file mode 100644 index 45b9bbe0a..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/main/resources/org/argeo/slc/castor/test.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - Test objects XML mapping - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/site/apt/index.apt b/legacy/runtime/org.argeo.slc.support.castor/src/site/apt/index.apt deleted file mode 100644 index f414460db..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/site/apt/index.apt +++ /dev/null @@ -1 +0,0 @@ -Argeo SLC Site \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/AbstractCastorTestCase.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/AbstractCastorTestCase.java deleted file mode 100644 index f91ad0b6e..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/AbstractCastorTestCase.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.unit.AbstractSpringTestCase; -import org.argeo.slc.unit.UnitXmlUtils; -import org.springframework.oxm.Marshaller; -import org.springframework.oxm.Unmarshaller; -import org.springframework.xml.transform.StringResult; -import org.springframework.xml.transform.StringSource; -import org.springframework.xml.validation.XmlValidator; - -public abstract class AbstractCastorTestCase extends AbstractSpringTestCase { - protected Log log = LogFactory.getLog(getClass()); - - private Marshaller marshaller; - private Unmarshaller unmarshaller; - - @Override - public void setUp() { - marshaller = getBean(Marshaller.class); - unmarshaller = getBean(Unmarshaller.class); - } - - protected StringResult marshal(Object obj) throws Exception { - return marshal(obj, false); - } - - protected StringResult marshalAndValidate(Object obj) throws Exception { - return marshal(obj, true); - } - - protected StringResult marshal(Object obj, boolean validate) - throws Exception { - StringResult xml = new StringResult(); - marshaller.marshal(obj, xml); - - log.info("Marshalled " + obj.getClass() + ": " + xml + "\n"); - - if (validate) - UnitXmlUtils.assertXmlValidation(getBean(XmlValidator.class), - new StringSource(xml.toString())); - return xml; - } - - @SuppressWarnings("unchecked") - protected T unmarshal(StringResult xml) throws Exception { - return (T) unmarshaller.unmarshal(new StringSource(xml.toString())); - } - - @SuppressWarnings("unchecked") - protected T marshUnmarsh(Object obj, boolean validate) throws Exception { - StringResult xml = marshal(obj, validate); - return (T) unmarshal(xml); - } - - @SuppressWarnings("unchecked") - protected T marshUnmarsh(Object obj) throws Exception { - return (T) marshUnmarsh(obj, true); - } -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionAnswerCastorTest.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionAnswerCastorTest.java deleted file mode 100644 index ea3b55012..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionAnswerCastorTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import org.argeo.slc.msg.ExecutionAnswer; - -public class ExecutionAnswerCastorTest extends AbstractCastorTestCase { - public void testMarshUnmarshOk() throws Exception { - ExecutionAnswer answer = new ExecutionAnswer(ExecutionAnswer.OK, - "No problem!"); - ExecutionAnswer answerUnm = marshUnmarsh(answer); - assertExecutionAnswer(answer, answerUnm); - } - - public void testMarshUnmarshError() throws Exception { - ExecutionAnswer answer = new ExecutionAnswer(ExecutionAnswer.ERROR, - "Oooops..."); - ExecutionAnswer answerUnm = marshUnmarsh(answer); - assertExecutionAnswer(answer, answerUnm); - } - - public static void assertExecutionAnswer(ExecutionAnswer expected, - ExecutionAnswer reached) { - assertEquals(expected.getStatus(), reached.getStatus()); - assertEquals(expected.getMessage(), reached.getMessage()); - } -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionModuleDescriptorCastorTest.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionModuleDescriptorCastorTest.java deleted file mode 100644 index b25f52b7b..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionModuleDescriptorCastorTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import java.util.ArrayList; -import java.util.List; - -import org.argeo.slc.execution.ExecutionFlowDescriptor; -import org.argeo.slc.execution.ExecutionModuleDescriptor; -import org.argeo.slc.execution.ExecutionSpec; -import org.argeo.slc.unit.execution.ExecutionFlowDescriptorTestUtils; - -public class ExecutionModuleDescriptorCastorTest extends AbstractCastorTestCase { - public void testMarshUnmarsh() throws Exception { - ExecutionModuleDescriptor moduleDescriptor = new ExecutionModuleDescriptor(); - moduleDescriptor.setName("test.module"); - moduleDescriptor.setVersion("1.0.0"); - moduleDescriptor.setLabel("Test Module"); - moduleDescriptor.setDescription("module descriptor"); - - ExecutionFlowDescriptor flowDescriptor = ExecutionFlowDescriptorTestUtils - .createSimpleExecutionFlowDescriptor(); - - List flows = new ArrayList(); - flows.add(flowDescriptor); - moduleDescriptor.setExecutionFlows(flows); - - List specs = new ArrayList(); - specs.add(flowDescriptor.getExecutionSpec()); - moduleDescriptor.setExecutionSpecs(specs); - - marshUnmarsh(moduleDescriptor, false); - } - - public void testMarshUnmarshMini() throws Exception { - ExecutionModuleDescriptor moduleDescriptor = new ExecutionModuleDescriptor(); - moduleDescriptor.setName("test.moodule"); - moduleDescriptor.setVersion("1.0.0"); - marshUnmarsh(moduleDescriptor, false); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ModularDistributionCastorTest.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ModularDistributionCastorTest.java deleted file mode 100644 index 317d01993..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ModularDistributionCastorTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.msg.build.ModularDistributionDescriptor; - -public class ModularDistributionCastorTest extends AbstractCastorTestCase { - public void testModularDistributionDescriptor() throws Exception { - ModularDistributionDescriptor mdd = new ModularDistributionDescriptor(); - mdd.setName("name"); - mdd.setVersion("0.1.0"); - mdd.getModulesDescriptors().put("eclipse", - "http://localhost/updateSite"); - mdd.getModulesDescriptors().put("modularDistribution", - "http://localhost/modularDistribution"); - - marshUnmarsh(mdd, false); - } - - public void testModularDistributionDescriptorList() throws Exception { - ModularDistributionDescriptor mdd = new ModularDistributionDescriptor(); - mdd.setName("name"); - mdd.setVersion("0.1.0"); - mdd.getModulesDescriptors().put("eclipse", - "http://localhost/updateSite"); - mdd.getModulesDescriptors().put("modularDistribution", - "http://localhost/modularDistribution"); - - ModularDistributionDescriptor mdd2 = new ModularDistributionDescriptor(); - mdd2.setName("name2"); - mdd2.setVersion("0.1.1"); - mdd2.getModulesDescriptors().put("eclipse", - "http://localhost/updateSite2"); - mdd2.getModulesDescriptors().put("modularDistribution", - "http://localhost/modularDistribution2"); - - ObjectList ol = new ObjectList(); - ol.getObjects().add(mdd); - ol.getObjects().add(mdd2); - - marshUnmarsh(ol, false); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ObjectListCastorTest.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ObjectListCastorTest.java deleted file mode 100644 index b01d9a7de..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ObjectListCastorTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.runtime.SlcAgentDescriptor; - -public class ObjectListCastorTest extends AbstractCastorTestCase { - - public void testAgentDescriptorList() throws Exception { - SlcAgentDescriptor agentDescriptor = SlcAgentDescriptorCastorTest - .createMiniAgentDescriptor(); - ObjectList lst = new ObjectList(); - lst.getObjects().add(agentDescriptor); - ObjectList lstUnm = (ObjectList) marshUnmarsh(lst, false); - assertEquals(1, lstUnm.getObjects().size()); - } -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/SlcAgentDescriptorCastorTest.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/SlcAgentDescriptorCastorTest.java deleted file mode 100644 index 0367da70f..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/SlcAgentDescriptorCastorTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import java.util.ArrayList; -import java.util.List; - -import org.argeo.slc.execution.ExecutionModuleDescriptor; -import org.argeo.slc.runtime.SlcAgentDescriptor; - -public class SlcAgentDescriptorCastorTest extends AbstractCastorTestCase { - public void testMarshUnmarshMini() throws Exception { - SlcAgentDescriptor agentDescriptor = createMiniAgentDescriptor(); - SlcAgentDescriptor agentDescriptorUnm = marshUnmarsh(agentDescriptor, - false); - assertSlcAgentDescriptor(agentDescriptor, agentDescriptorUnm); - } - - public void testMarshUnmarshWithModuleDescriptor() throws Exception { - SlcAgentDescriptor agentDescriptor = createMiniAgentDescriptor(); - - List lst = new ArrayList(); - ExecutionModuleDescriptor moduleDescriptor = new ExecutionModuleDescriptor(); - moduleDescriptor.setName("test.moodule"); - moduleDescriptor.setVersion("1.0.0"); - lst.add(moduleDescriptor); - agentDescriptor.setModuleDescriptors(lst); - - SlcAgentDescriptor agentDescriptorUnm = marshUnmarsh(agentDescriptor, - false); - assertSlcAgentDescriptor(agentDescriptor, agentDescriptorUnm); - } - - protected static SlcAgentDescriptor createMiniAgentDescriptor() { - SlcAgentDescriptor agentDescriptor = new SlcAgentDescriptor(); - agentDescriptor.setHost("localhost"); - agentDescriptor.setUuid("555"); - return agentDescriptor; - } - - protected static void assertSlcAgentDescriptor(SlcAgentDescriptor expected, - SlcAgentDescriptor reached) { - assertNotNull(reached); - assertEquals(expected.getHost(), reached.getHost()); - assertEquals(expected.getUuid(), expected.getUuid()); - assertEquals(expected.getModuleDescriptors().size(), reached - .getModuleDescriptors().size()); - } -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/SlcExecutionCastorTest.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/SlcExecutionCastorTest.java deleted file mode 100644 index 44794e163..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/SlcExecutionCastorTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import java.text.SimpleDateFormat; -import java.util.UUID; - -import org.argeo.slc.msg.process.SlcExecutionRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.unit.process.SlcExecutionTestUtils; -import org.springframework.xml.transform.StringResult; - -public class SlcExecutionCastorTest extends AbstractCastorTestCase { - public void testMarshalling() throws Exception { - SlcExecution slcExec = SlcExecutionTestUtils.createSimpleSlcExecution(); - - SlcExecutionRequest msgSave = new SlcExecutionRequest(); - msgSave.setSlcExecution(slcExec); - - StringResult msgSaveXml = marshalAndValidate(msgSave); - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - SlcExecutionStep step0 = new SlcExecutionStep(); - step0.setUuid(UUID.randomUUID().toString()); - step0.setTimestamp(sdf.parse("2008-04-17 18:21")); - step0.setType("LOG"); - step0.addLog("A log message\nand another line"); - - SlcExecutionStep step1 = new SlcExecutionStep(); - step1.setUuid(UUID.randomUUID().toString()); - step1.setTimestamp(sdf.parse("2008-04-17 18:25")); - step1.setType("LOG"); - step1.addLog("A nother log message"); - - SlcExecutionStepsRequest msgNotif = new SlcExecutionStepsRequest(); - msgNotif.addStep(step0); - msgNotif.addStep(step1); - msgNotif.setSlcExecutionUuid(slcExec.getUuid()); - - StringResult msgNotifXml = marshalAndValidate(msgNotif); - - SlcExecutionRequest msgSaveUnm = unmarshal(msgSaveXml); - assertNotNull(msgSaveUnm); - SlcExecutionTestUtils.assertSlcExecution(slcExec, msgSaveUnm - .getSlcExecution()); - - SlcExecutionStepsRequest msgNotifUnm = unmarshal(msgNotifXml); - assertNotNull(msgNotifUnm); - assertEquals(slcExec.getUuid(), msgNotifUnm.getSlcExecutionUuid()); - assertEquals(2, msgNotifUnm.getSteps().size()); - SlcExecutionTestUtils.assertSlcExecutionStep(step0, msgNotifUnm - .getSteps().get(0)); - SlcExecutionTestUtils.assertSlcExecutionStep(step1, msgNotifUnm - .getSteps().get(1)); - - SlcExecution slcExecUnm = msgSaveUnm.getSlcExecution(); - slcExecUnm.getSteps().addAll(msgNotifUnm.getSteps()); - - SlcExecutionRequest msgUpdate = new SlcExecutionRequest(); - msgUpdate.setSlcExecution(slcExecUnm); - StringResult msgUpdateXml = marshalAndValidate(msgUpdate); - - SlcExecutionRequest msgUpdateUnm = unmarshal(msgUpdateXml); - assertNotNull(msgUpdateUnm); - } - - public void testMarshUnmarsh() throws Exception { - SlcExecution slcExec = SlcExecutionTestUtils - .createSlcExecutionWithRealizedFlows(); - marshUnmarsh(slcExec, false); - } -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/TreeTestResultCastorTest.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/TreeTestResultCastorTest.java deleted file mode 100644 index 7d6d6e961..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/TreeTestResultCastorTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import static org.argeo.slc.unit.UnitUtils.assertDateSec; -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createCompleteTreeTestResult; -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createSimpleResultPartRequest; - -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.unit.test.tree.UnitTestTreeUtil; -import org.springframework.xml.transform.StringResult; - -public class TreeTestResultCastorTest extends AbstractCastorTestCase { - public void testMarshUnmarsh() throws Exception { - TreeTestResult ttr = createCompleteTreeTestResult(); - - StringResult xml = marshalAndValidate(ttr); - - TreeTestResult ttrUnm = unmarshal(xml); - - UnitTestTreeUtil.assertTreeTestResult(ttr, ttrUnm); - } - - public void testCreateTreeTestResultRequest() throws Exception { - CreateTreeTestResultRequest req = new CreateTreeTestResultRequest(); - req.setTreeTestResult(createCompleteTreeTestResult()); - - StringResult xml = marshalAndValidate(req); - - CreateTreeTestResultRequest reqUnm = unmarshal(xml); - - UnitTestTreeUtil.assertTreeTestResult(req.getTreeTestResult(), reqUnm - .getTreeTestResult()); - } - - public void testResultPartRequest() throws Exception { - TreeTestResult ttr = createCompleteTreeTestResult(); - ResultPartRequest req = createSimpleResultPartRequest(ttr); - - StringResult xml = marshalAndValidate(req); - - ResultPartRequest reqUnm = unmarshal(xml); - - UnitTestTreeUtil - .assertPart(req.getResultPart(), reqUnm.getResultPart()); - } - - public void testCloseTreeTestResultRequest() throws Exception { - TreeTestResult ttr = createCompleteTreeTestResult(); - ttr.close(); - - CloseTreeTestResultRequest req = new CloseTreeTestResultRequest(ttr - .getUuid(), ttr.getCloseDate()); - - StringResult xml = marshalAndValidate(req); - - CloseTreeTestResultRequest reqUnm = unmarshal(xml); - - assertEquals(ttr.getUuid(), reqUnm.getResultUuid()); - assertDateSec(ttr.getCloseDate(), ttr.getCloseDate()); - } -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/TreeTestResultCollectionCastorTest.java b/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/TreeTestResultCollectionCastorTest.java deleted file mode 100644 index 46fc836e1..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/TreeTestResultCollectionCastorTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.castor; - -import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createCompleteTreeTestResult; - -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.core.test.tree.TreeTestResultCollection; -import org.argeo.slc.unit.test.tree.UnitTestTreeUtil; -import org.springframework.xml.transform.StringResult; - -public class TreeTestResultCollectionCastorTest extends AbstractCastorTestCase { - public void testMarshUnmarsh() throws Exception { - TreeTestResult ttr = createCompleteTreeTestResult(); - TreeTestResult ttr2 = createCompleteTreeTestResult(); - - TreeTestResultCollection ttrc = new TreeTestResultCollection(); - ttrc.setId("testCollection"); - ttrc.getResults().add(ttr); - ttrc.getResults().add(ttr2); - - StringResult xml = marshalAndValidate(ttrc); - - TreeTestResultCollection ttrcUnm = unmarshal(xml); - - assertEquals(ttrc.getId(), ttrcUnm.getId()); - assertEquals(ttrc.getResults().size(), ttrcUnm.getResults().size()); - for (TreeTestResult ttrT : ttrc.getResults()) { - if (ttrT.getUuid().equals(ttr.getUuid())) - UnitTestTreeUtil.assertTreeTestResult(ttr, ttrT); - else - UnitTestTreeUtil.assertTreeTestResult(ttr2, ttrT); - } - } -} diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/resources/log4j.properties b/legacy/runtime/org.argeo.slc.support.castor/src/test/resources/log4j.properties deleted file mode 100644 index 0133bab88..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/resources/log4j.properties +++ /dev/null @@ -1,22 +0,0 @@ -# Set root logger level to DEBUG and its only appender to A1. -log4j.rootLogger=WARN, console - -## Levels -# Slc -log4j.logger.org.argeo=DEBUG - -# Castor -log4j.logger.org.exolab.castor=WARN - -# Spring -log4j.logger.org.springframework=WARN - - -## Appenders -# A1 is set to be a ConsoleAppender. -log4j.appender.console=org.apache.log4j.ConsoleAppender - -# A1 uses PatternLayout. -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n - diff --git a/legacy/runtime/org.argeo.slc.support.castor/src/test/resources/org/argeo/slc/castor/applicationContext.xml b/legacy/runtime/org.argeo.slc.support.castor/src/test/resources/org/argeo/slc/castor/applicationContext.xml deleted file mode 100644 index c479075b8..000000000 --- a/legacy/runtime/org.argeo.slc.support.castor/src/test/resources/org/argeo/slc/castor/applicationContext.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/.classpath b/legacy/runtime/org.argeo.slc.support.hibernate/.classpath deleted file mode 100644 index 26b349477..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/.project b/legacy/runtime/org.argeo.slc.support.hibernate/.project deleted file mode 100644 index 080510172..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.slc.support.hibernate - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/.settings/org.eclipse.jdt.core.prefs b/legacy/runtime/org.argeo.slc.support.hibernate/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b5feaf2d2..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Fri Aug 29 11:24:23 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 diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/.settings/org.eclipse.pde.core.prefs b/legacy/runtime/org.argeo.slc.support.hibernate/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index 0572a4a46..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Mon Feb 14 20:13:33 CET 2011 -eclipse.preferences.version=1 -selfhosting.binExcludes=/org.argeo.slc.support.hibernate/target/test-classes,/org.argeo.slc.support.hibernate/target/test-classes diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/build.properties b/legacy/runtime/org.argeo.slc.support.hibernate/build.properties deleted file mode 100644 index 0f69dad3b..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/build.properties +++ /dev/null @@ -1,21 +0,0 @@ -additional.bundles = org.springframework.transaction,\ - org.argeo.slc.unit,\ - junit,\ - org.springframework.oxm,\ - org.springframework.xml,\ - org.dom4j,\ - org.springframework.jdbc,\ - org.springframework.context.support,\ - net.sf.ehcache,\ - org.hsqldb,\ - org.apache.commons.collections,\ - antlr,\ - org.argeo.slc.support.castor,\ - org.castor,\ - org.apache.xml.serializer,\ - org.apache.xerces,\ - org.h2 -source.. = src/main/java/,\ - src/main/resources/,\ - src/test/java/,\ - src/test/resources/ diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/pom.xml b/legacy/runtime/org.argeo.slc.support.hibernate/pom.xml deleted file mode 100644 index d996e2f16..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/pom.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - 4.0.0 - - org.argeo.slc - runtime - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.runtime - org.argeo.slc.support.hibernate - SLC Support Hibernate - - - - org.apache.felix - maven-bundle-plugin - - - org.argeo.slc.core - !org.argeo.slc.core.*,org.hibernate.proxy,javassist.util.proxy,* - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - true - - - - - - - org.argeo.slc.runtime - org.argeo.slc.core - 1.1.3-SNAPSHOT - - - - org.argeo.tp - org.hibernate - - - org.argeo.tp - net.sf.ehcache - - - org.argeo.tp - edu.emory.mathcs.backport - - - org.argeo.tp - org.springframework.orm - - - org.argeo.tp - org.springframework.jdbc - - - org.argeo.tp - org.springframework.context.support - - - org.argeo.tp - org.springframework.transaction - - - - org.argeo.tp - org.apache.commons.dbcp - - - - - org.argeo.slc.runtime - org.argeo.slc.unit - test - 1.1.3-SNAPSHOT - - - - org.argeo.slc.runtime - org.argeo.slc.support.castor - test - 1.1.3-SNAPSHOT - - - - org.argeo.tp - org.hsqldb - test - - - org.argeo.tp - org.h2 - test - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/assembly/base.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/assembly/base.xml deleted file mode 100644 index c135b91e5..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/assembly/base.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - base - false - - zip - - - - src/base - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/base/bin/slc b/legacy/runtime/org.argeo.slc.support.hibernate/src/base/bin/slc deleted file mode 100644 index bcc63c85a..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/base/bin/slc +++ /dev/null @@ -1,326 +0,0 @@ -#! /bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Extract launch and ant arguments, (see details below). -ant_exec_args= -no_config=false -use_jikes_default=false -ant_exec_debug=false -show_help=false -for arg in "$@" ; do - if [ "$arg" = "--noconfig" ] ; then - no_config=true - elif [ "$arg" = "--usejikes" ] ; then - use_jikes_default=true - elif [ "$arg" = "--execdebug" ] ; then - ant_exec_debug=true - elif [ my"$arg" = my"--h" -o my"$arg" = my"--help" ] ; then - show_help=true - ant_exec_args="$ant_exec_args -h" - else - if [ my"$arg" = my"-h" -o my"$arg" = my"-help" ] ; then - show_help=true - fi - ant_exec_args="$ant_exec_args \"$arg\"" - fi -done - -# Source/default ant configuration -if $no_config ; then - rpm_mode=false - usejikes=$use_jikes_default -else - # load system-wide ant configuration (ONLY if ANT_HOME has NOT been set) - if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ]; then - if [ -f "/etc/ant.conf" ] ; then - . /etc/ant.conf - fi - fi - - # load user ant configuration - if [ -f "$HOME/.ant/ant.conf" ] ; then - . $HOME/.ant/ant.conf - fi - if [ -f "$HOME/.antrc" ] ; then - . "$HOME/.antrc" - fi - - # provide default configuration values - if [ -z "$rpm_mode" ] ; then - rpm_mode=false - fi - if [ -z "$usejikes" ] ; then - usejikes=$use_jikes_default - fi -fi - -# Setup Java environment in rpm mode -if $rpm_mode ; then - if [ -f /usr/share/java-utils/java-functions ] ; then - . /usr/share/java-utils/java-functions - set_jvm - set_javacmd - fi -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -case "`uname`" in - CYGWIN*) cygwin=true ;; - Darwin*) darwin=true - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home - fi - ;; -esac - -if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then - ## resolve links - $0 may be a link to ant's home - PRG="$0" - progname=`basename "$0"` - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi - done - - ANT_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - ANT_HOME=`cd "$ANT_HOME" && pwd` -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$ANT_HOME" ] && - ANT_HOME=`cygpath --unix "$ANT_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# set ANT_LIB location -ANT_LIB="${ANT_HOME}/lib" - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - JAVACMD="$JAVA_HOME/jre/sh/java" - elif [ -x "$JAVA_HOME/jre/bin/java" ] ; then - JAVACMD="$JAVA_HOME/jre/bin/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD=`which java 2> /dev/null ` - if [ -z "$JAVACMD" ] ; then - JAVACMD=java - fi - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." - echo " We cannot execute $JAVACMD" - exit 1 -fi - -# Build local classpath using just the launcher in non-rpm mode or -# use the Jpackage helper in rpm mode with basic and default jars -# specified in the ant.conf configuration. Because the launcher is -# used, libraries linked in ANT_HOME/lib will also be included, but this -# is discouraged as it is not java-version safe. A user should -# request optional jars and their dependencies via the OPT_JAR_LIST -# variable -if $rpm_mode && [ -x /usr/bin/build-classpath ] ; then - LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl xml-commons-apis)" - - # If no optional jars have been specified then build the default list - if [ -z "$OPT_JAR_LIST" ] ; then - for file in /etc/ant.d/*; do - if [ -f "$file" ]; then - case "$file" in - *~) ;; - *#*) ;; - *.rpmsave) ;; - *.rpmnew) ;; - *) - for dep in `cat "$file"`; do - case "$OPT_JAR_LIST" in - *"$dep"*) ;; - *) OPT_JAR_LIST="$OPT_JAR_LIST${OPT_JAR_LIST:+ }$dep" - esac - done - esac - fi - done - fi - - # If the user requested to try to add some other jars to the classpath - if [ -n "$OPT_JAR_LIST" ] ; then - _OPTCLASSPATH="$(/usr/bin/build-classpath $OPT_JAR_LIST 2> /dev/null)" - if [ -n "$_OPTCLASSPATH" ] ; then - LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH" - fi - fi - - # Explicitly add javac path to classpath, assume JAVA_HOME set - # properly in rpm mode - if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then - LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar" - fi - if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then - LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip" - fi - - # if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be - # user CLASSPATH first and ant-found jars after. - # In that case, the user CLASSPATH will override ant-found jars - # - # if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour - # with ant-found jars first and user CLASSPATH after - if [ -n "$CLASSPATH" ] ; then - # merge local and specified classpath - if [ -z "$LOCALCLASSPATH" ] ; then - LOCALCLASSPATH="$CLASSPATH" - elif [ -n "$CLASSPATH_OVERRIDE" ] ; then - LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH" - else - LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH" - fi - - # remove class path from launcher -cp option - CLASSPATH="" - fi -else - # not using rpm_mode; use launcher to determine classpaths - if [ -z "$LOCALCLASSPATH" ] ; then - LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar - else - LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH - fi -fi - -if [ -n "$JAVA_HOME" ] ; then - # OSX hack to make Ant work with jikes - if $darwin ; then - OSXHACK="${JAVA_HOME}/../Classes" - if [ -d "${OSXHACK}" ] ; then - for i in "${OSXHACK}"/*.jar - do - JIKESPATH="$JIKESPATH:$i" - done - fi - fi -fi - -# Allow Jikes support (off by default) -if $usejikes; then - ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes" -fi - -# For Cygwin, switch paths to appropriate format before running java -# For PATHs convert to unix format first, then to windows format to ensure -# both formats are supported. Probably this will fail on directories with ; -# in the name in the path. Let's assume that paths containing ; are more -# rare than windows style paths on cygwin. -if $cygwin; then - if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then - format=mixed - else - format=windows - fi - ANT_HOME=`cygpath --$format "$ANT_HOME"` - ANT_LIB=`cygpath --$format "$ANT_LIB"` - JAVA_HOME=`cygpath --$format "$JAVA_HOME"` - LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"` - LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"` - if [ -n "$CLASSPATH" ] ; then - CP_TEMP=`cygpath --path --unix "$CLASSPATH"` - CLASSPATH=`cygpath --path --$format "$CP_TEMP"` - fi - CYGHOME=`cygpath --$format "$HOME"` -fi - -# Show script help if requested -if $show_help ; then - echo $0 '[script options] [options] [target [target2 [target3] ..]]' - echo 'Script Options:' - echo ' --help, --h print this message and ant help' - echo ' --noconfig suppress sourcing of /etc/ant.conf,' - echo ' $HOME/.ant/ant.conf, and $HOME/.antrc' - echo ' configuration files' - echo ' --usejikes enable use of jikes by default, unless' - echo ' set explicitly in configuration files' - echo ' --execdebug print ant exec line generated by this' - echo ' launch script' - echo ' ' -fi -# add a second backslash to variables terminated by a backslash under cygwin -if $cygwin; then - case "$ANT_HOME" in - *\\ ) - ANT_HOME="$ANT_HOME\\" - ;; - esac - case "$CYGHOME" in - *\\ ) - CYGHOME="$CYGHOME\\" - ;; - esac - case "$JIKESPATH" in - *\\ ) - JIKESPATH="$JIKESPATH\\" - ;; - esac - case "$LOCALCLASSPATH" in - *\\ ) - LOCALCLASSPATH="$LOCALCLASSPATH\\" - ;; - esac - case "$CLASSPATH" in - *\\ ) - CLASSPATH="$CLASSPATH\\" - ;; - esac -fi -# Execute ant using eval/exec to preserve spaces in paths, -# java options, and ant args -ant_sys_opts= -if [ -n "$CYGHOME" ]; then - if [ -n "$JIKESPATH" ]; then - ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\"" - else - ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\"" - fi -else - if [ -n "$JIKESPATH" ]; then - ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\"" - fi -fi -ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args" -if $ant_exec_debug ; then - echo $ant_exec_command -fi -eval $ant_exec_command diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/base/bin/slc.bat b/legacy/runtime/org.argeo.slc.support.hibernate/src/base/bin/slc.bat deleted file mode 100644 index f8fb7d5da..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/base/bin/slc.bat +++ /dev/null @@ -1,226 +0,0 @@ -@echo off - -REM Licensed to the Apache Software Foundation (ASF) under one or more -REM contributor license agreements. See the NOTICE file distributed with -REM this work for additional information regarding copyright ownership. -REM The ASF licenses this file to You under the Apache License, Version 2.0 -REM (the "License"); you may not use this file except in compliance with -REM the License. You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. - -REM This is an inordinately troublesome piece of code, particularly because it -REM tries to work on both Win9x and WinNT-based systems. If we could abandon '9x -REM support, things would be much easier, but sadly, it is not yet time. -REM Be cautious about editing this, and only add WinNT specific stuff in code that -REM only runs on WinNT. - -if "%HOME%"=="" goto homeDrivePathPre -if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat" - -:homeDrivePathPre -if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre -if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre -if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" - -:userProfilePre -if "%USERPROFILE%"=="" goto alpha -if "%USERPROFILE%"=="%HOME%" goto alpha -if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha -if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat" - -:alpha - -if "%OS%"=="Windows_NT" @setlocal -if "%OS%"=="WINNT" @setlocal - -if "%ANT_HOME%"=="" goto setDefaultAntHome - -:stripAntHome -if not _%ANT_HOME:~-1%==_\ goto checkClasspath -set ANT_HOME=%ANT_HOME:~0,-1% -goto stripAntHome - -:setDefaultAntHome -rem %~dp0 is expanded pathname of the current script under NT -set ANT_HOME=%~dp0.. - -:checkClasspath -set _USE_CLASSPATH=yes -rem CLASSPATH must not be used if it is equal to "" -if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no -if "%CLASSPATH%"=="" set _USE_CLASSPATH=no - -rem Slurp the command line arguments. This loop allows for an unlimited number -rem of arguments (up to the command line limit, anyway). -set ANT_CMD_LINE_ARGS=%1 -if ""%1""=="""" goto doneStart -shift -:setupArgs -if ""%1""=="""" goto doneStart -if ""%1""==""-noclasspath"" goto clearclasspath -set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 -shift -goto setupArgs - -rem here is there is a -noclasspath in the options -:clearclasspath -set _USE_CLASSPATH=no -shift -goto setupArgs - -rem This label provides a place for the argument list loop to break out -rem and for NT handling to skip to. - -:doneStart - -if _USE_CLASSPATH==no goto findAntHome - -:stripClasspath -if not _%CLASSPATH:~-1%==_\ goto findAntHome -set CLASSPATH=%CLASSPATH:~0,-1% -goto stripClasspath - -:findAntHome -rem find ANT_HOME if it does not exist due to either an invalid value passed -rem by the user or the %0 problem on Windows 9x -if exist "%ANT_HOME%\lib\ant.jar" goto checkJava - -rem check for ant in Program Files -if not exist "%ProgramFiles%\ant" goto checkSystemDrive -set ANT_HOME=%ProgramFiles%\ant -goto checkJava - -:checkSystemDrive -rem check for ant in root directory of system drive -if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive -set ANT_HOME=%SystemDrive%\ant -goto checkJava - -:checkCDrive -rem check for ant in C:\ant for Win9X users -if not exist C:\ant\lib\ant.jar goto noAntHome -set ANT_HOME=C:\ant -goto checkJava - -:noAntHome -echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME. -goto end - -:checkJava -set _JAVACMD=%JAVACMD% - -if "%JAVA_HOME%" == "" goto noJavaHome -if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome -if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe -goto checkJikes - -:noJavaHome -if "%_JAVACMD%" == "" set _JAVACMD=java.exe - -:checkJikes -if not "%JIKESPATH%"=="" goto runAntWithJikes - -:runAnt -if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath -:runAntWithClasspath -"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS% -rem Check the error code of the Ant build -if not "%OS%"=="Windows_NT" goto onError -set ANT_ERROR=%ERRORLEVEL% -goto end - -:runAntNoClasspath -"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS% -rem Check the error code of the Ant build -if not "%OS%"=="Windows_NT" goto onError -set ANT_ERROR=%ERRORLEVEL% -goto end - -:runAntWithJikes - -if not _%JIKESPATH:~-1%==_\ goto checkJikesAndClasspath -set JIKESPATH=%JIKESPATH:~0,-1% -goto runAntWithJikes - -:checkJikesAndClasspath - -if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath - -:runAntWithJikesAndClasspath -"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS% -rem Check the error code of the Ant build -if not "%OS%"=="Windows_NT" goto onError -set ANT_ERROR=%ERRORLEVEL% -goto end - -:runAntWithJikesNoClasspath -"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS% -rem Check the error code of the Ant build -if not "%OS%"=="Windows_NT" goto onError -set ANT_ERROR=%ERRORLEVEL% -goto end - -:onError -rem Windows 9x way of checking the error code. It matches via brute force. -for %%i in (1 10 100) do set err%%i= -for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i -if %err100%==2 goto onError200 -if %err100%==0 set err100= -for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i -if "%err100%"=="" if %err10%==0 set err10= -:onError1 -for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i -goto onErrorEnd -:onError200 -for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i -if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i -if not err10==5 goto onError1 -:onErrorEnd -set ANT_ERROR=%err100%%err10%%err1% -for %%i in (1 10 100) do set err%%i= - -:end -rem bug ID 32069: resetting an undefined env variable changes the errorlevel. -if not "%_JAVACMD%"=="" set _JAVACMD= -if not "%_ANT_CMD_LINE_ARGS%"=="" set ANT_CMD_LINE_ARGS= - -if "%ANT_ERROR%"=="0" goto mainEnd - -rem Set the return code if we are not in NT. We can only set -rem a value of 1, but it's better than nothing. -if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1 - -rem Set the ERRORLEVEL if we are running NT. -if "%OS%"=="Windows_NT" color 00 - -goto omega - -:mainEnd - -rem If there were no errors, we run the post script. -if "%OS%"=="Windows_NT" @endlocal -if "%OS%"=="WINNT" @endlocal - -if "%HOME%"=="" goto homeDrivePathPost -if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat" - -:homeDrivePathPost -if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost -if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost -if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" - -:userProfilePost -if "%USERPROFILE%"=="" goto omega -if "%USERPROFILE%"=="%HOME%" goto omega -if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega -if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat" - -:omega - diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/process/SlcExecutionDaoHibernate.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/process/SlcExecutionDaoHibernate.java deleted file mode 100644 index f581f9261..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/process/SlcExecutionDaoHibernate.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.process; - -import java.sql.SQLException; -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.dao.process.SlcExecutionDao; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionStep; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; - -public class SlcExecutionDaoHibernate extends HibernateDaoSupport implements - SlcExecutionDao { - private final static Log log = LogFactory - .getLog(SlcExecutionDaoHibernate.class); - - public void create(SlcExecution slcExecution) { - getHibernateTemplate().save(slcExecution); - } - - public void update(final SlcExecution slcExecution) { - getHibernateTemplate().update(slcExecution); - } - - public void merge(final SlcExecution slcExecution) { - getHibernateTemplate().merge(slcExecution); - } - - public SlcExecution getSlcExecution(String uuid) { - return (SlcExecution) getHibernateTemplate().get(SlcExecution.class, - uuid); - } - - @SuppressWarnings("unchecked") - public List listSlcExecutions() { - return (List) getHibernateTemplate().loadAll( - SlcExecution.class); - } - - public void addSteps(final String slcExecutionId, - final List additionalSteps) { - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - SlcExecution slcExecution = getSlcExecution(session, - slcExecutionId); - slcExecution.getSteps().addAll(additionalSteps); - session.update(slcExecution); - return slcExecution; - } - }); - - } - - @SuppressWarnings("unchecked") - public List tailSteps(final String slcExecutionId, - final Integer nbrOfSteps) { - return (List) getHibernateTemplate().execute( - new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - SlcExecution slcExecution = getSlcExecution(session, - slcExecutionId); - // TODO: do a query count() instead? - int stepCount = slcExecution.getSteps().size(); - if (stepCount > nbrOfSteps) { - return session.createFilter( - slcExecution.getSteps(), "") - .setFirstResult(stepCount - nbrOfSteps) - .setMaxResults(nbrOfSteps).list(); - } else { - return slcExecution.getSteps(); - } - } - }); - } - - @SuppressWarnings("unchecked") - public List tailSteps(final String slcExecutionId, - final String slcExecutionStepId) { - Object[] values = { slcExecutionStepId, slcExecutionId }; - List indexes = getHibernateTemplate().findByNamedQuery( - SlcExecutionStep.class.getName() + ".stepIndex", values); - - Integer index = indexes.get(0); - if (log.isTraceEnabled()){ - log.trace(indexes.size()); - log.trace("Index " + index + " for step " + slcExecutionStepId - + " in process " + slcExecutionId); - } - Object[] values2 = { slcExecutionId, index }; - return getHibernateTemplate().findByNamedQuery( - SlcExecutionStep.class.getName() + ".stepsAfter", values2); - } - - protected SlcExecution getSlcExecution(Session session, - String slcExecutionId) { - SlcExecution slcExecution = (SlcExecution) session.get( - SlcExecution.class, slcExecutionId); - - if (slcExecution == null) - throw new SlcException("Could not find SLC execution " - + slcExecutionId); - - return slcExecution; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/runtime/SlcAgentDescriptorDaoHibernate.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/runtime/SlcAgentDescriptorDaoHibernate.java deleted file mode 100644 index 5e090598f..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/runtime/SlcAgentDescriptorDaoHibernate.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.runtime; - -import java.util.List; - -import org.argeo.slc.dao.runtime.SlcAgentDescriptorDao; -import org.argeo.slc.runtime.SlcAgentDescriptor; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; - -public class SlcAgentDescriptorDaoHibernate extends HibernateDaoSupport - implements SlcAgentDescriptorDao { - - public void create(SlcAgentDescriptor slcAgentDescriptor) { - getHibernateTemplate().save(slcAgentDescriptor); - } - - public void delete(SlcAgentDescriptor slcAgentDescriptor) { - getHibernateTemplate().delete(slcAgentDescriptor); - } - - public void delete(String agentId) { - Object obj = getHibernateTemplate().get(SlcAgentDescriptor.class, - agentId); - if (obj != null) - getHibernateTemplate().delete(obj); - } - - public SlcAgentDescriptor getAgentDescriptor(String agentId) { - - return (SlcAgentDescriptor) getHibernateTemplate().get( - SlcAgentDescriptor.class, agentId); - } - - @SuppressWarnings("unchecked") - public List listSlcAgentDescriptors() { - return (List) getHibernateTemplate().loadAll( - SlcAgentDescriptor.class); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/TestRunDescriptorDaoHibernate.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/TestRunDescriptorDaoHibernate.java deleted file mode 100644 index 3ddf0e18e..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/TestRunDescriptorDaoHibernate.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.test; - -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; - -import org.argeo.slc.dao.test.TestRunDescriptorDao; -import org.argeo.slc.test.TestRunDescriptor; - -public class TestRunDescriptorDaoHibernate extends HibernateDaoSupport - implements TestRunDescriptorDao { - - public TestRunDescriptor getTestRunDescriptor(String id) { - return (TestRunDescriptor) getHibernateTemplate().get( - TestRunDescriptor.class, id); - } - - public void saveOrUpdate(TestRunDescriptor testRunDescriptor) { - getHibernateTemplate().saveOrUpdate(testRunDescriptor); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/TreeTestResultCollectionDaoHibernate.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/TreeTestResultCollectionDaoHibernate.java deleted file mode 100644 index dc99deecf..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/TreeTestResultCollectionDaoHibernate.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.test.tree; - -import java.sql.SQLException; -import java.util.List; -import java.util.Map; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.argeo.slc.SlcException; -import org.argeo.slc.core.test.tree.ResultAttributes; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.core.test.tree.TreeTestResultCollection; -import org.argeo.slc.dao.test.tree.TreeTestResultCollectionDao; -import org.hibernate.HibernateException; -import org.hibernate.LockMode; -import org.hibernate.Session; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; - -/** Hibernate implementation of collections DAO. */ -public class TreeTestResultCollectionDaoHibernate extends HibernateDaoSupport - implements TreeTestResultCollectionDao { - - public void create(TreeTestResultCollection ttrCollection) { - getHibernateTemplate().save(ttrCollection); - } - - public TreeTestResultCollection getTestResultCollection(String id) { - return (TreeTestResultCollection) getHibernateTemplate().get( - TreeTestResultCollection.class, id); - } - - public void update(TreeTestResultCollection ttrCollection) { - getHibernateTemplate().update(ttrCollection); - } - - public void delete(TreeTestResultCollection ttrCollection) { - getHibernateTemplate().delete(ttrCollection); - } - - @SuppressWarnings("unchecked") - public SortedSet listCollections() { - return new TreeSet(getHibernateTemplate() - .find("from TreeTestResultCollection")); - } - - public void addResultToCollection(final TreeTestResultCollection ttrc, - final String resultUuid) { - getHibernateTemplate().execute(new HibernateCallback() { - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - session.lock(ttrc, LockMode.NONE); - TreeTestResult ttr = (TreeTestResult) session.get( - TreeTestResult.class, resultUuid); - ttrc.getResults().add(ttr); - session.update(ttrc); - return ttrc; - } - }); - } - - public void removeResultFromCollection(final TreeTestResultCollection ttrc, - final String resultUuid) { - getHibernateTemplate().execute(new HibernateCallback() { - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - session.lock(ttrc, LockMode.NONE); - TreeTestResult ttr = (TreeTestResult) session.get( - TreeTestResult.class, resultUuid); - if (ttrc.getResults().remove(ttr)) - session.update(ttrc); - return ttrc; - } - }); - } - - @SuppressWarnings("unchecked") - public List listResultAttributes(String collectionId) { - List list; - if (collectionId == null) - list = getHibernateTemplate().find( - "select new org.argeo.slc.core.test.tree.ResultAttributes(ttr)" - + " from TreeTestResult ttr"); - else - list = getHibernateTemplate() - .find( - "select new org.argeo.slc.core.test.tree.ResultAttributes(ttr) " - + " from TreeTestResult ttr, TreeTestResultCollection ttrc " - + " where ttr in elements(ttrc.results) and ttrc.id=?", - collectionId); - - return list; - } - - @SuppressWarnings("unchecked") - public List listResults(String collectionId, - Map attributes) { - List list; - - if (collectionId == null) { - if (attributes == null || attributes.size() == 0) - list = getHibernateTemplate().find("from TreeTestResult"); - else if (attributes.size() == 1) { - Map.Entry entry = attributes.entrySet() - .iterator().next(); - Object[] args = { entry.getKey(), entry.getValue() }; - list = getHibernateTemplate().find( - "select ttr from TreeTestResult ttr" - + " where attributes[?]=?", args); - } else { - throw new SlcException( - "Multiple attributes filter are currently not supported."); - } - } else { - if (attributes == null || attributes.size() == 0) - list = getHibernateTemplate() - .find( - "select ttr " - + " from TreeTestResult ttr, TreeTestResultCollection ttrc " - + " where ttr in elements(ttrc.results) and ttrc.id=?", - collectionId); - else if (attributes.size() == 1) { - Map.Entry entry = attributes.entrySet() - .iterator().next(); - Object[] args = { collectionId, entry.getKey(), - entry.getValue() }; - list = getHibernateTemplate() - .find( - "select ttr from TreeTestResult ttr, TreeTestResultCollection ttrc " - + " where ttr in elements(ttrc.results) and ttrc.id=?" - + " and attributes[?]=?", args); - } else { - throw new SlcException( - "Multiple attributes filter are currently not supported."); - } - } - return list; - } -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/TreeTestResultDaoHibernate.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/TreeTestResultDaoHibernate.java deleted file mode 100644 index c25a156ef..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/TreeTestResultDaoHibernate.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.test.tree; - -import java.sql.SQLException; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.SortedMap; - -import org.argeo.slc.SlcException; -import org.argeo.slc.core.attachment.SimpleAttachment; -import org.argeo.slc.core.structure.tree.TreeSPath; -import org.argeo.slc.core.test.SimpleResultPart; -import org.argeo.slc.core.test.tree.PartSubList; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.dao.test.tree.TreeTestResultDao; -import org.argeo.slc.structure.StructureElement; -import org.argeo.slc.test.TestResult; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.util.Assert; - -/** - * The Hibernate implementation for tree-based result of the test result dao. - * - * @see TreeTestResult - */ -public class TreeTestResultDaoHibernate extends HibernateDaoSupport implements - TreeTestResultDao { - - public void create(TestResult testResult) { - getHibernateTemplate().save(testResult); - } - - public void update(TestResult testResult) { - getHibernateTemplate().saveOrUpdate(testResult); - } - - public TreeTestResult getTestResult(String uuid) { - List list = getHibernateTemplate().find( - "from TreeTestResult where uuid=?", uuid); - if (list.size() == 0) { - return null; - } else { - return (TreeTestResult) list.get(0); - } - - } - - @SuppressWarnings("unchecked") - public List listTestResults() { - return (List) getHibernateTemplate().find( - "from TreeTestResult"); - } - - @SuppressWarnings("unchecked") - public List listResults(TreeSPath path) { - List list = getHibernateTemplate().find( - "from TreeTestResult res where ? in indices(res.resultParts)", - path.getAsUniqueString()); - return list; - } - - public void close(final String testResultId, final Date closeDate) { - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - TreeTestResult treeTestResult = getTreeTestResult(session, - testResultId); - treeTestResult.setCloseDate(closeDate); - session.update(treeTestResult); - return treeTestResult; - } - }); - } - - public void addResultPart(final String testResultId, final TreeSPath path, - final SimpleResultPart resultPart, - final Map relatedElements) { - - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - TreeTestResult treeTestResult = getTreeTestResult(session, - testResultId); - PartSubList lst = treeTestResult.getResultParts().get(path); - if (lst == null) { - lst = new PartSubList(); - treeTestResult.getResultParts().put(path, lst); - } - lst.getParts().add(resultPart); - if (relatedElements != null) - treeTestResult.getElements().putAll(relatedElements); - - session.update(treeTestResult); - return treeTestResult; - } - }); - - } - - public void addAttachment(final String testResultId, - final SimpleAttachment attachment) { - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - TreeTestResult treeTestResult = getTreeTestResult(session, - testResultId); - - // Check is there is already such an attachment - Assert.notNull(attachment, "attachment is null"); - Assert.notNull(session, "session is null"); - SimpleAttachment att = (SimpleAttachment) session.get( - attachment.getClass(), attachment.getUuid()); - if (att != null) - throw new SlcException( - "There is already an attachement with id " - + attachment.getUuid()); - - treeTestResult.getAttachments().add(attachment); - session.update(treeTestResult); - return treeTestResult; - } - }); - - } - - protected TreeTestResult getTreeTestResult(Session session, - String testResultId) { - TreeTestResult treeTestResult = (TreeTestResult) session.get( - TreeTestResult.class, testResultId); - if (treeTestResult == null) - throw new SlcException("No result with id " + testResultId); - return treeTestResult; - } - - public void updateAttributes(final String testResultId, - final SortedMap attributes) { - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - TreeTestResult treeTestResult = getTreeTestResult(session, - testResultId); - treeTestResult.setAttributes(attributes); - - session.update(treeTestResult); - return treeTestResult; - } - }); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/package.html b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/package.html deleted file mode 100644 index 6042b0789..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/java/org/argeo/slc/hibernate/test/tree/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -Hibernate based DAO implementations for tree-based SLC Test. - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/attachment/SimpleAttachment.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/attachment/SimpleAttachment.hbm.xml deleted file mode 100644 index d35d9ff98..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/attachment/SimpleAttachment.hbm.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/dao.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/dao.xml deleted file mode 100644 index baac4036e..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/dao.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/ehcache.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/ehcache.xml deleted file mode 100644 index b09747786..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/ehcache.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/RealizedFlow.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/RealizedFlow.hbm.xml deleted file mode 100644 index c56231d83..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/RealizedFlow.hbm.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/SlcExecution.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/SlcExecution.hbm.xml deleted file mode 100644 index 526d6bf0c..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/SlcExecution.hbm.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/SlcExecutionStep.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/SlcExecutionStep.hbm.xml deleted file mode 100644 index 0a1ce76dc..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/process/SlcExecutionStep.hbm.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - ? - ]]> - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/runtime/SlcAgentDescriptor.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/runtime/SlcAgentDescriptor.hbm.xml deleted file mode 100644 index 90ada75f3..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/runtime/SlcAgentDescriptor.hbm.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/sessionFactories.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/sessionFactories.xml deleted file mode 100644 index 48544ecb9..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/sessionFactories.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - org/argeo/slc/hibernate/structure/SimpleSElement.hbm.xml - - - org/argeo/slc/hibernate/test/SimpleResultPart.hbm.xml - - - org/argeo/slc/hibernate/test/tree/TreeTestResult.hbm.xml - - - org/argeo/slc/hibernate/test/tree/TreeTestResultCollection.hbm.xml - - - org/argeo/slc/hibernate/test/tree/PartSubList.hbm.xml - - - org/argeo/slc/hibernate/test/TestRunDescriptor.hbm.xml - - - org/argeo/slc/hibernate/process/SlcExecution.hbm.xml - - - org/argeo/slc/hibernate/process/SlcExecutionStep.hbm.xml - - - org/argeo/slc/hibernate/runtime/SlcAgentDescriptor.hbm.xml - - - org/argeo/slc/hibernate/attachment/SimpleAttachment.hbm.xml - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/spring.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/spring.xml deleted file mode 100644 index 240aa921a..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/spring.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/structure/SimpleSElement.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/structure/SimpleSElement.hbm.xml deleted file mode 100644 index 2244d49c6..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/structure/SimpleSElement.hbm.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/SimpleResultPart.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/SimpleResultPart.hbm.xml deleted file mode 100644 index b84cfd679..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/SimpleResultPart.hbm.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/TestRunDescriptor.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/TestRunDescriptor.hbm.xml deleted file mode 100644 index a0ba08c9b..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/TestRunDescriptor.hbm.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/PartSubList.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/PartSubList.hbm.xml deleted file mode 100644 index 08fc99203..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/PartSubList.hbm.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/TreeTestResult.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/TreeTestResult.hbm.xml deleted file mode 100644 index 6144656e7..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/TreeTestResult.hbm.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/TreeTestResultCollection.hbm.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/TreeTestResultCollection.hbm.xml deleted file mode 100644 index 7988d2bd9..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/main/resources/org/argeo/slc/hibernate/test/tree/TreeTestResultCollection.hbm.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/site/apt/index.apt b/legacy/runtime/org.argeo.slc.support.hibernate/src/site/apt/index.apt deleted file mode 100644 index f414460db..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/site/apt/index.apt +++ /dev/null @@ -1 +0,0 @@ -Argeo SLC Site \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/process/CastorSlcExecutionHibernateTest.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/process/CastorSlcExecutionHibernateTest.java deleted file mode 100644 index d2698c2ed..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/process/CastorSlcExecutionHibernateTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.process; - -import java.sql.SQLException; - -import org.argeo.slc.dao.process.SlcExecutionDao; -import org.argeo.slc.hibernate.unit.HibernateTestCase; -import org.argeo.slc.msg.ObjectList; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.unit.process.SlcExecutionTestUtils; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.oxm.Marshaller; -import org.springframework.oxm.Unmarshaller; -import org.springframework.xml.transform.StringResult; -import org.springframework.xml.transform.StringSource; - -public class CastorSlcExecutionHibernateTest extends HibernateTestCase { - - public void testSaveWithRealizedFlowsXml() throws Exception { - SlcExecutionDao dao = getBean(SlcExecutionDao.class); - - SlcExecution slcExec = SlcExecutionTestUtils - .createSlcExecutionWithRealizedFlows(); - - ObjectList ol = new ObjectList(slcExec.getRealizedFlows()); - StringResult result = new StringResult(); - getBean(Marshaller.class).marshal(ol, result); - slcExec.setRealizedFlowsXml(result.toString()); - - dao.create(slcExec); - - SlcExecution slcExecPersisted = dao.getSlcExecution(slcExec.getUuid()); - assertSlcExecution(slcExec, slcExecPersisted); - - StringSource source = new StringSource(slcExecPersisted - .getRealizedFlowsXml()); - ObjectList ol2 = (ObjectList) getBean(Unmarshaller.class).unmarshal( - source); - ol2.fill(slcExec.getRealizedFlows()); - - } - - public void assertSlcExecution(final SlcExecution expected, - final SlcExecution persisted) { - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - session.refresh(persisted); - SlcExecutionTestUtils.assertSlcExecution(expected, persisted); - return null; - } - }); - } - - @Override - protected String getApplicationContextLocation() { - return "org/argeo/slc/hibernate/withCastor.xml"; - } -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/process/SlcExecutionHibernateTest.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/process/SlcExecutionHibernateTest.java deleted file mode 100644 index b4798ce60..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/process/SlcExecutionHibernateTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.process; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -import org.argeo.slc.dao.process.SlcExecutionDao; -import org.argeo.slc.hibernate.unit.HibernateTestCase; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.unit.process.SlcExecutionTestUtils; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.springframework.orm.hibernate3.HibernateCallback; - -public class SlcExecutionHibernateTest extends HibernateTestCase { - - public void testSave() { - SlcExecutionDao dao = getBean(SlcExecutionDao.class); - - SlcExecution slcExec = SlcExecutionTestUtils.createSimpleSlcExecution(); - slcExec.getSteps().add(new SlcExecutionStep("A log line")); - slcExec.getSteps().add(new SlcExecutionStep("Two log\nlines")); - - dao.create(slcExec); - - SlcExecution slcExecPersisted = dao.getSlcExecution(slcExec.getUuid()); - assertSlcExecution(slcExec, slcExecPersisted); - } - - public void testTailSteps() { - SlcExecutionDao dao = getBean(SlcExecutionDao.class); - - SlcExecution slcExec = SlcExecutionTestUtils.createSimpleSlcExecution(); - int totalStepCount = 20; - for (int i = 0; i < totalStepCount; i++) { - slcExec.getSteps().add(new SlcExecutionStep("Log " + i)); - } - dao.create(slcExec); - - int lastStepsCount = 7; - List firstSteps = dao.tailSteps(slcExec.getUuid(), - lastStepsCount); - assertEquals(lastStepsCount, firstSteps.size()); - - SlcExecutionStep lastStep = firstSteps.get(lastStepsCount - 1); - - List additionalSteps = new ArrayList(); - int additionalStepsCount = 13; - for (int i = 0; i < additionalStepsCount; i++) { - additionalSteps.add(new SlcExecutionStep("Additonal log " + i)); - } - dao.addSteps(slcExec.getUuid(), additionalSteps); - - List lastSteps = dao.tailSteps(slcExec.getUuid(), - lastStep.getUuid()); - assertEquals(additionalStepsCount, lastSteps.size()); - } - - public void testModify() { - SlcExecutionDao dao = getBean(SlcExecutionDao.class); - - // slcExecution Creation - SlcExecution slcExec = SlcExecutionTestUtils.createSimpleSlcExecution(); - slcExec.getSteps().add(new SlcExecutionStep("A log line")); - slcExec.getSteps().add(new SlcExecutionStep("Two log\nlines")); - - dao.create(slcExec); - - // slcExecution retrieval and update - final SlcExecution slcExecRetrieved = dao.getSlcExecution(slcExec - .getUuid()); - - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - session.refresh(slcExecRetrieved); - List logLineListStep0 = slcExecRetrieved.getSteps() - .get(0).getLogLines(); - for (String logLine : logLineListStep0) - logLine = logLine + "appended Log text"; - - slcExecRetrieved.getSteps().get(0) - .setLogLines(logLineListStep0); - slcExecRetrieved.getSteps().add( - new SlcExecutionStep("Three \n log \n lines")); - return null; - } - }); - - dao.update(slcExecRetrieved); - - // updated slcExecution retrieval and comparison - SlcExecution slcExecUpdated = dao.getSlcExecution(slcExec.getUuid()); - - assertSlcExecution(slcExecRetrieved, slcExecUpdated); - } - - public void assertSlcExecution(final SlcExecution expected, - final SlcExecution persisted) { - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - session.refresh(persisted); - SlcExecutionTestUtils.assertSlcExecution(expected, persisted); - return null; - } - }); - } - - @Override - protected String getApplicationContextLocation() { - return "org/argeo/slc/hibernate/applicationContext.xml"; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/CastorTestResultDaoHibernateTest.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/CastorTestResultDaoHibernateTest.java deleted file mode 100644 index c922809b7..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/CastorTestResultDaoHibernateTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.test.tree; - -import org.argeo.slc.core.structure.tree.TreeSPath; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.dao.test.tree.TreeTestResultDao; -import org.argeo.slc.hibernate.unit.HibernateTestCase; -import org.argeo.slc.unit.test.tree.TreeTestResultTestUtils; -import org.springframework.oxm.Marshaller; -import org.springframework.oxm.Unmarshaller; -import org.springframework.xml.transform.StringResult; -import org.springframework.xml.transform.StringSource; - -public class CastorTestResultDaoHibernateTest extends HibernateTestCase { - - public void testUnmarshallAndCreate() throws Exception { - TreeTestResult ttr = TreeTestResultTestUtils - .createCompleteTreeTestResult(); - - StringResult result = new StringResult(); - getBean(Marshaller.class).marshal(ttr, result); - - StringSource source = new StringSource(result.toString()); - TreeTestResult ttrUnm = (TreeTestResult) getBean(Unmarshaller.class) - .unmarshal(source); - - for (TreeSPath path : ttrUnm.getResultParts().keySet()) { - log.debug("Path: " + path.getClass() + ": " + path); - } - - TreeTestResultDao ttrDao = getBean(TreeTestResultDao.class); - ttrDao.create(ttrUnm); - TreeTestResult ttrPersist = ttrDao.getTestResult(ttr.getUuid()); - - TreeTestResultDaoHibernateTest.assertInHibernate( - getHibernateTemplate(), ttr, ttrPersist); - } - - @Override - protected String getApplicationContextLocation() { - return "org/argeo/slc/hibernate/withCastor.xml"; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/TreeTestResultCollectionDaoHibernateTest.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/TreeTestResultCollectionDaoHibernateTest.java deleted file mode 100644 index de9aa1685..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/TreeTestResultCollectionDaoHibernateTest.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.test.tree; - -import java.sql.SQLException; -import java.util.Date; - -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.core.test.tree.TreeTestResultCollection; -import org.argeo.slc.dao.test.tree.TreeTestResultCollectionDao; -import org.argeo.slc.dao.test.tree.TreeTestResultDao; -import org.argeo.slc.hibernate.unit.HibernateTestCase; -import org.argeo.slc.unit.test.tree.TreeTestResultTestUtils; -import org.argeo.slc.unit.test.tree.UnitTestTreeUtil; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.springframework.orm.hibernate3.HibernateCallback; - -public class TreeTestResultCollectionDaoHibernateTest extends HibernateTestCase { - - public void testScenario() { - TreeTestResultDao ttrDao = getBean(TreeTestResultDao.class); - TreeTestResultCollectionDao ttrcDao = getBean(TreeTestResultCollectionDao.class); - - String ttrcName = "testCollection"; - - TreeTestResult ttr1 = TreeTestResultTestUtils - .createCompleteTreeTestResult(); - ttrDao.create(ttr1); - - TreeTestResultCollection ttrc = new TreeTestResultCollection(ttrcName); - ttrcDao.create(ttrc); - - ttrc.getResults().add(ttr1); - ttrcDao.update(ttrc); - - final TreeTestResult ttr2 = TreeTestResultTestUtils - .createCompleteTreeTestResult(); - ttrDao.create(ttr2); - - ttrc.getResults().add(ttr2); - ttrcDao.update(ttrc); - - ttrc.getResults().remove(ttr1); - ttrcDao.update(ttrc); - - final TreeTestResultCollection ttrcPersist = ttrcDao - .getTestResultCollection(ttrcName); - - // Because of lazy initialization - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - session.refresh(ttrcPersist); - assertEquals(1, ttrcPersist.getResults().size()); - UnitTestTreeUtil.assertTreeTestResult(ttr2, ttrcPersist - .getResults().iterator().next()); - return null; - } - }); - } - - public void testResultsWithSameCloseDate() { - TreeTestResultDao ttrDao = getBean(TreeTestResultDao.class); - TreeTestResultCollectionDao ttrcDao = getBean(TreeTestResultCollectionDao.class); - - String ttrcName = "testCollection"; - - Date closeDate = new Date(); - - // TTR1 - TreeTestResult ttr1 = TreeTestResultTestUtils - .createCompleteTreeTestResult(); - ttr1.setCloseDate(closeDate); - ttrDao.create(ttr1); - - // TTR2 - TreeTestResult ttr2 = TreeTestResultTestUtils - .createCompleteTreeTestResult(); - ttr2.setCloseDate(closeDate); - ttrDao.create(ttr2); - - // TTRC - TreeTestResultCollection ttrc = new TreeTestResultCollection(ttrcName); - ttrc.getResults().add(ttr1); - ttrc.getResults().add(ttr2); - ttrcDao.create(ttrc); - - final TreeTestResultCollection ttrcPersist = ttrcDao - .getTestResultCollection(ttrcName); - // Because of lazy initialization - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - session.refresh(ttrcPersist); - assertEquals(2, ttrcPersist.getResults().size()); - return null; - } - }); - } - - @Override - protected String getApplicationContextLocation() { - return "org/argeo/slc/hibernate/applicationContext.xml"; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/TreeTestResultDaoHibernateTest.java b/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/TreeTestResultDaoHibernateTest.java deleted file mode 100644 index 4c5baa6fa..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/java/org/argeo/slc/hibernate/test/tree/TreeTestResultDaoHibernateTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.hibernate.test.tree; - -import java.sql.SQLException; - -import org.argeo.slc.core.structure.SimpleSElement; -import org.argeo.slc.core.structure.tree.TreeSPath; -import org.argeo.slc.core.structure.tree.TreeSRegistry; -import org.argeo.slc.core.test.SimpleResultPart; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.dao.test.tree.TreeTestResultDao; -import org.argeo.slc.hibernate.unit.HibernateTestCase; -import org.argeo.slc.test.TestStatus; -import org.argeo.slc.unit.test.tree.TreeTestResultTestUtils; -import org.argeo.slc.unit.test.tree.UnitTestTreeUtil; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.HibernateTemplate; - -public class TreeTestResultDaoHibernateTest extends HibernateTestCase { - private TreeTestResultDao testResultDao = null; - - @Override - public void setUp() { - testResultDao = getBean(TreeTestResultDao.class); - } - - public void testCreate() { - - TreeTestResult ttr = TreeTestResultTestUtils - .createCompleteTreeTestResult(); - testResultDao.create(ttr); - - TreeTestResult ttrPersisted = (TreeTestResult) testResultDao - .getTestResult(ttr.getUuid()); - - assertInHibernate(ttr, ttrPersisted); - } - - public void testUpdate() { - TreeTestResult ttr = TreeTestResultTestUtils - .createCompleteTreeTestResult(); - testResultDao.create(ttr); - - final TreeTestResult ttrUpdated = (TreeTestResult) testResultDao - .getTestResult(ttr.getUuid()); - - // Modifying ttrUpdated - - /** - * this closeDate update commented because the assertTreeTestResult will - * find a unexpected discrepancy in the date. - * ttrUpdated.setCloseDate(new Date()); - */ - - String pathStr = "/test"; - final TreeSPath path = new TreeSPath(pathStr); - - final TreeSRegistry registry = new TreeSRegistry(); - SimpleSElement elem = new SimpleSElement("Unit Test"); - elem.getTags().put("myTag", "myTagValue"); - registry.register(path, elem); - - getHibernateTemplate().execute(new HibernateCallback() { - - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - session.refresh(ttrUpdated); - ttrUpdated.notifyCurrentPath(registry, path); - - ttrUpdated.addResultPart(TreeTestResultTestUtils - .createSimpleResultPartPassed()); - ttrUpdated.addResultPart(TreeTestResultTestUtils - .createSimpleResultPartFailed()); - ttrUpdated.addResultPart(TreeTestResultTestUtils - .createSimpleResultPartError()); - return null; - } - }); - - testResultDao.update(ttrUpdated); - - // comparison of ttrUpdated and ttrRetrieved - TreeTestResult ttrRetrieved = (TreeTestResult) testResultDao - .getTestResult(ttr.getUuid()); - - assertInHibernate(ttrUpdated, ttrRetrieved); - } - - public void testMultipleUpdateScenario() throws Exception { - TreeSRegistry registry = new TreeSRegistry(); - - TreeSPath path = new TreeSPath("/root/test"); - SimpleSElement elem = new SimpleSElement("Unit Test"); - elem.getTags().put("myTag", "myTagValue"); - registry.register(path, elem); - - TreeTestResult ttr = TreeTestResultTestUtils - .createSimpleTreeTestResult(); - ttr.notifyCurrentPath(registry, path); - ttr - .addResultPart(new SimpleResultPart(TestStatus.PASSED, - "First test")); - - testResultDao.create(ttr); - - path = new TreeSPath("/root/test2/subtest"); - elem = new SimpleSElement("Sub Test"); - elem.getTags().put("myTag", "myTagValue"); - registry.register(path, elem); - - ttr.notifyCurrentPath(registry, path); - ttr - .addResultPart(new SimpleResultPart(TestStatus.PASSED, - "Second test")); - - testResultDao.update(ttr); - - ttr.notifyCurrentPath(registry, path); - ttr.addResultPart(new SimpleResultPart(TestStatus.PASSED, - "Third test with same path")); - - testResultDao.update(ttr); - - ttr.close(); - - testResultDao.close(ttr.getUuid(), ttr.getCloseDate()); - - TreeTestResult ttrRetrieved = (TreeTestResult) testResultDao - .getTestResult(ttr.getUuid()); - - assertInHibernate(ttr, ttrRetrieved); - - } - - @Override - protected String getApplicationContextLocation() { - return "org/argeo/slc/hibernate/applicationContext.xml"; - } - - public static void assertInHibernate(HibernateTemplate template, - final TreeTestResult ttrExpected, final TreeTestResult ttrPersisted) { - template.execute(new HibernateCallback() { - public Object doInHibernate(Session session) { - session.refresh(ttrPersisted); - UnitTestTreeUtil - .assertTreeTestResult(ttrExpected, ttrPersisted); - return null; - } - - }); - - } - - public void assertInHibernate(final TreeTestResult ttrExpected, - final TreeTestResult ttrPersisted) { - assertInHibernate(getHibernateTemplate(), ttrExpected, ttrPersisted); - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/log4j.properties b/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/log4j.properties deleted file mode 100644 index 4a97ea611..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/log4j.properties +++ /dev/null @@ -1,28 +0,0 @@ -# Set root logger level to DEBUG and its only appender to A1. -log4j.rootLogger=WARN, console - -## Levels -# Slc -log4j.logger.org.argeo=DEBUG -log4j.logger.org.argeo.slc.hibernate.process=TRACE - -# Castor -log4j.logger.org.exolab.castor=WARN - -# Spring -#log4j.logger.org.springframework=INFO -# Hibernate -log4j.logger.org.hibernate=WARN -#log4j.logger.org.hibernate.SQL=TRACE -#log4j.logger.org.hibernate.tool.hbm2ddl=TRACE -#log4j.logger.org.hibernate.type=TRACE - - -## Appenders -# A1 is set to be a ConsoleAppender. -log4j.appender.console=org.apache.log4j.ConsoleAppender - -# A1 uses PatternLayout. -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n - diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/org/argeo/slc/hibernate/applicationContext.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/org/argeo/slc/hibernate/applicationContext.xml deleted file mode 100644 index 739eb09bb..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/org/argeo/slc/hibernate/applicationContext.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/org/argeo/slc/hibernate/withCastor.xml b/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/org/argeo/slc/hibernate/withCastor.xml deleted file mode 100644 index 48bc9dcfb..000000000 --- a/legacy/runtime/org.argeo.slc.support.hibernate/src/test/resources/org/argeo/slc/hibernate/withCastor.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/.classpath b/legacy/runtime/org.argeo.slc.support.ws.client/.classpath deleted file mode 100644 index a002fffa3..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/.project b/legacy/runtime/org.argeo.slc.support.ws.client/.project deleted file mode 100644 index 142bb4ada..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.slc.support.ws.client - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/.settings/org.eclipse.jdt.core.prefs b/legacy/runtime/org.argeo.slc.support.ws.client/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 964778b0e..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#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 diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/pom.xml b/legacy/runtime/org.argeo.slc.support.ws.client/pom.xml deleted file mode 100644 index db1b5b66d..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - 4.0.0 - - org.argeo.slc - runtime - 1.1.3-SNAPSHOT - .. - - org.argeo.slc.runtime - org.argeo.slc.support.ws.client - jar - SLC Support Web Services Client (deprecated) - - - - org.apache.felix - maven-bundle-plugin - - - - - org.argeo.slc.ws.* - - org.w3c.dom;version="0.0.0", - javax.xml.*;version="0.0.0", - org.xml.*;version="0.0.0", - org.springframework.ws.*;resolution:="optional", - org.springframework.core;resolution:="optional", - * - - - - - - - - - org.argeo.slc.runtime - org.argeo.slc.support.simple - 1.1.3-SNAPSHOT - - - org.argeo.slc.runtime - org.argeo.slc.support.castor - 1.1.3-SNAPSHOT - - - - org.argeo.tp - org.springframework.ws - - - org.argeo.tp - com.sun.xml.messaging.saaj - - - \ No newline at end of file diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/client/ValidatingClientInterceptor.java b/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/client/ValidatingClientInterceptor.java deleted file mode 100644 index 84c4b193c..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/client/ValidatingClientInterceptor.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.ws.client; - -import java.io.IOException; - -import javax.xml.transform.Source; - -import org.springframework.ws.client.WebServiceClientException; -import org.springframework.ws.client.WebServiceIOException; -import org.springframework.ws.client.support.interceptor.ClientInterceptor; -import org.springframework.ws.context.MessageContext; -import org.springframework.xml.validation.XmlValidator; -import org.xml.sax.SAXParseException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -public class ValidatingClientInterceptor implements ClientInterceptor { - private final static Log log = LogFactory - .getLog(ValidatingClientInterceptor.class); - - private Boolean validateRequest = true; - private Boolean validateResponse = false; - private XmlValidator validator = null; - - public boolean handleFault(MessageContext messageContext) - throws WebServiceClientException { - return true; - } - - public boolean handleRequest(MessageContext messageContext) - throws WebServiceClientException { - if (validateRequest) { - if (messageContext.getRequest() == null) - return true; - - Source source = messageContext.getRequest().getPayloadSource(); - try { - return validate(source); - } catch (IOException e) { - throw new WebServiceIOException("Cannot validate request", e); - } - } else { - return true; - } - } - - public boolean handleResponse(MessageContext messageContext) - throws WebServiceClientException { - if (validateResponse) { - if (messageContext.getResponse() == null) - return true; - - Source source = messageContext.getResponse().getPayloadSource(); - try { - return validate(source); - } catch (IOException e) { - throw new WebServiceIOException("Cannot validate response", e); - } - } else { - return true; - } - } - - protected boolean validate(Source source) throws IOException { - SAXParseException[] exceptions = validator.validate(source); - if (exceptions.length != 0) { - for (SAXParseException ex : exceptions) { - log.error(ex.getMessage()); - } - return false; - } else { - return true; - } - } - - public void setValidateRequest(Boolean validateRequest) { - this.validateRequest = validateRequest; - } - - public void setValidateResponse(Boolean validateResponse) { - this.validateResponse = validateResponse; - } - - public void setValidator(XmlValidator validator) { - this.validator = validator; - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/client/WebServiceUtils.java b/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/client/WebServiceUtils.java deleted file mode 100644 index 02502306f..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/client/WebServiceUtils.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.ws.client; - -import java.util.Iterator; - -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMSource; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.ws.client.core.WebServiceTemplate; -import org.springframework.ws.soap.SoapFaultDetail; -import org.springframework.ws.soap.SoapFaultDetailElement; -import org.springframework.ws.soap.client.SoapFaultClientException; -import org.springframework.xml.transform.StringResult; -import org.w3c.dom.Node; - -public abstract class WebServiceUtils { - private final static Log log = LogFactory.getLog(WebServiceUtils.class); - - public static Object marshalSendAndReceiveSafe(WebServiceTemplate template, - Object req) { - try { - Object resp = marshalSendAndReceive(template, req); - return resp; - } catch (Exception e) { - log.error("Cannot send web servicerequest: " + e.getMessage()); - if (log.isDebugEnabled()) { - log.debug("Webservice exception details: ", e); - } - return null; - } - } - - public static Object marshalSendAndReceive(WebServiceTemplate template, - Object req) { - if (log.isTraceEnabled()) { - try { - StringResult result = new StringResult(); - template.getMarshaller().marshal(req, result); - log.trace("About to send " + result); - } catch (Exception e) { - log.error("Cannot marshall " + req + " for logging", e); - } - } - Object resp = template.marshalSendAndReceive(req); - return resp; - } - - public static void manageSoapException(SoapFaultClientException e) { - log - .error("WS root cause: " - + e.getSoapFault().getFaultStringOrReason()); - if (log.isTraceEnabled()) { - StringBuffer stack = new StringBuffer(""); - SoapFaultDetail detail = e.getSoapFault().getFaultDetail(); - if (detail != null) { - Iterator it = (Iterator) detail - .getDetailEntries(); - while (it.hasNext()) { - SoapFaultDetailElement elem = it.next(); - if (elem.getName().getLocalPart().equals("StackElement")) { - Source source = elem.getSource(); - if (source instanceof DOMSource) { - Node node = ((DOMSource) source).getNode(); - // stack.append(node.getTextContent()).append('\n'); - stack - .append( - node.getChildNodes().item(0) - .getNodeValue()).append( - '\n'); - } - } - } - - if (stack.length() > 0) - log.error("WS root cause stack: " + stack); - } - } - } - - private WebServiceUtils() { - - } -} diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/process/WebServiceSlcExecutionNotifier.java b/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/process/WebServiceSlcExecutionNotifier.java deleted file mode 100644 index d341a63a3..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/process/WebServiceSlcExecutionNotifier.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.ws.process; - -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.msg.process.SlcExecutionRequest; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.execution.ExecutionStep; -import org.argeo.slc.execution.ExecutionProcess; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionNotifier; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.ws.client.WebServiceUtils; -import org.springframework.ws.client.WebServiceIOException; -import org.springframework.ws.client.core.WebServiceTemplate; -import org.springframework.ws.soap.client.SoapFaultClientException; - -public class WebServiceSlcExecutionNotifier implements SlcExecutionNotifier { - private WebServiceTemplate template; - - private Log log = LogFactory.getLog(getClass()); - - private Boolean cannotConnect = false; - - public void newExecution(ExecutionProcess process) { - SlcExecution slcExecution = (SlcExecution) process; - if (cannotConnect) - return; - - SlcExecutionRequest req = new SlcExecutionRequest(); - req.setSlcExecution(slcExecution); - try { - WebServiceUtils.marshalSendAndReceive(template, req); - if (log.isTraceEnabled()) - log.trace("Notified creation of slc execution " - + slcExecution.getUuid()); - } catch (SoapFaultClientException e) { - WebServiceUtils.manageSoapException(e); - } catch (WebServiceIOException e) { - manageIoException(e); - } - } - - public void updateExecution(SlcExecution slcExecution) { - if (cannotConnect) - return; - - SlcExecutionRequest req = new SlcExecutionRequest(); - req.setSlcExecution(slcExecution); - try { - WebServiceUtils.marshalSendAndReceive(template, req); - if (log.isTraceEnabled()) - log.trace("Notified update of slc execution " - + slcExecution.getUuid()); - } catch (SoapFaultClientException e) { - WebServiceUtils.manageSoapException(e); - } catch (WebServiceIOException e) { - manageIoException(e); - } - } - - public void updateStatus(ExecutionProcess process, String oldStatus, - String newStatus) { - SlcExecution slcExecution = (SlcExecution) process; - if (cannotConnect) - return; - - SlcExecutionStatusRequest req = new SlcExecutionStatusRequest( - slcExecution.getUuid(), newStatus); - try { - WebServiceUtils.marshalSendAndReceive(template, req); - if (log.isTraceEnabled()) - log.trace("Notified status update of slc execution " - + slcExecution.getUuid()); - } catch (SoapFaultClientException e) { - WebServiceUtils.manageSoapException(e); - } catch (WebServiceIOException e) { - manageIoException(e); - } - } - - public void addSteps(ExecutionProcess process, - List additionalSteps) { - SlcExecution slcExecution = (SlcExecution) process; - if (cannotConnect) - return; - - SlcExecutionStepsRequest req = new SlcExecutionStepsRequest( - slcExecution.getUuid(), additionalSteps); - try { - WebServiceUtils.marshalSendAndReceive(template, req); - if (log.isTraceEnabled()) - log.trace("Added steps to slc execution " - + slcExecution.getUuid()); - } catch (SoapFaultClientException e) { - WebServiceUtils.manageSoapException(e); - } catch (WebServiceIOException e) { - manageIoException(e); - } - } - - public void setTemplate(WebServiceTemplate template) { - this.template = template; - } - - protected void manageIoException(WebServiceIOException e) { - if (!cannotConnect) { - log.error("Cannot connect to " + template.getDefaultUri() - + ". Won't try again.", e); - cannotConnect = true; - } - } - -} diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/test/tree/WebServiceTreeTestResultNotifier.java b/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/test/tree/WebServiceTreeTestResultNotifier.java deleted file mode 100644 index cefbcd138..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/test/tree/WebServiceTreeTestResultNotifier.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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. - */ -package org.argeo.slc.ws.test.tree; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.core.test.tree.TreeTestResult; -import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest; -import org.argeo.slc.msg.test.tree.ResultPartRequest; -import org.argeo.slc.test.TestResultListener; -import org.argeo.slc.test.TestResultPart; -import org.argeo.slc.ws.client.WebServiceUtils; -import org.springframework.ws.client.WebServiceIOException; -import org.springframework.ws.client.core.WebServiceTemplate; -import org.springframework.ws.soap.client.SoapFaultClientException; - -public class WebServiceTreeTestResultNotifier implements - TestResultListener { - private WebServiceTemplate template; - private Boolean onlyOnClose = false; - - private Log log = LogFactory.getLog(getClass()); - - private Boolean cannotConnect = false; - - public void resultPartAdded(TreeTestResult testResult, - TestResultPart testResultPart) { - if (onlyOnClose) - return; - - if (cannotConnect) - return; - - try { - if (testResult.getResultParts().size() == 1 - && testResult.getResultParts().values().iterator().next() - .getParts().size() == 1) { - CreateTreeTestResultRequest req = new CreateTreeTestResultRequest( - testResult); - - if (log.isDebugEnabled()) - log.debug("Send create result request for result " - + testResult.getUuid()); - - WebServiceUtils.marshalSendAndReceive(template, req); - } else { - ResultPartRequest req = new ResultPartRequest(testResult); - - if (log.isDebugEnabled()) - log.debug("Send result parts for result " - + testResult.getUuid()); - - WebServiceUtils.marshalSendAndReceive(template, req); - } - } catch (SoapFaultClientException e) { - WebServiceUtils.manageSoapException(e); - - } catch (WebServiceIOException e) { - manageIoException(e); - } - } - - public void close(TreeTestResult testResult) { - if (cannotConnect) - return; - - try { - if (onlyOnClose) { - CreateTreeTestResultRequest req = new CreateTreeTestResultRequest( - testResult); - - if (log.isDebugEnabled()) - log.debug("Send create result request for result " - + testResult.getUuid()); - - WebServiceUtils.marshalSendAndReceive(template, req); - } else { - CloseTreeTestResultRequest req = new CloseTreeTestResultRequest( - testResult); - - if (log.isDebugEnabled()) - log.debug("Send close result request for result " - + testResult.getUuid()); - - WebServiceUtils.marshalSendAndReceive(template, req); - - } - } catch (SoapFaultClientException e) { - WebServiceUtils.manageSoapException(e); - } catch (WebServiceIOException e) { - manageIoException(e); - } - } - - public void setTemplate(WebServiceTemplate template) { - this.template = template; - } - - public void setOnlyOnClose(Boolean onlyOnClose) { - this.onlyOnClose = onlyOnClose; - } - - protected void manageIoException(WebServiceIOException e) { - if (!cannotConnect) { - log.error("Cannot connect to " + template.getDefaultUri() - + ". Won't try again.", e); - cannotConnect = true; - } - } -} diff --git a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/resources/org/argeo/slc/ws/client/spring/applicationContext.xml b/legacy/runtime/org.argeo.slc.support.ws.client/src/main/resources/org/argeo/slc/ws/client/spring/applicationContext.xml deleted file mode 100644 index 2cf78df6a..000000000 --- a/legacy/runtime/org.argeo.slc.support.ws.client/src/main/resources/org/argeo/slc/ws/client/spring/applicationContext.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - http://localhost:9090/org.argeo.slc.webapp/slcService/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -