log4j.logger.org.springframework=WARN
log4j.logger.org.springframework.jms=WARN
+log4j.logger.org.springframework.security=INFO
log4j.logger.org.apache.activemq=WARN
log4j.logger.org.apache.activemq.transport=WARN
org.springframework.jms.connection,\r
org.springframework.oxm,\r
org.argeo.slc.jms,\r
- org.springframework.jms.support.converter\r
+ org.springframework.jms.support.converter,\r
+ org.springframework.beans.factory.config\r
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+ <bean
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
+ <property name="ignoreUnresolvablePlaceholders" value="true" />
+ <property name="locations">
+ <value>osgibundle:activemq.properties
+ </value>
+ </property>
+ </bean>
+
<!-- Connection Factory -->
<bean id="jmsConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
- <value>vm://localhost</value>
+ <value>${slc.server.jms.url}</value>
</property>
</bean>
</property>
Bundle-Name: SLC Webapp\r
Web-ContextPath: org.argeo.slc.webapp\r
Bundle-SymbolicName: org.argeo.slc.webapp\r
-Import-Package: org.springframework.web.context,\r
- org.springframework.osgi.web.context.support,\r
- org.springframework.web.context.support,\r
- org.springframework.orm.hibernate3.support,\r
- org.argeo.slc.dao.runtime,\r
+Import-Package: net.sf.cglib.core,\r
+ net.sf.cglib.proxy,\r
+ net.sf.cglib.reflect,\r
+ org.aopalliance.aop,\r
+ org.argeo.slc.build,\r
+ org.argeo.slc.core.attachment,\r
+ org.argeo.slc.core.test.tree,\r
org.argeo.slc.dao.process,\r
+ org.argeo.slc.dao.runtime,\r
org.argeo.slc.dao.test,\r
org.argeo.slc.dao.test.tree,\r
- org.springframework.web.servlet.mvc,\r
- org.hibernate,\r
- org.argeo.slc.services,\r
- org.springframework.transaction,\r
- org.argeo.slc.runtime,\r
- org.argeo.slc.core.test.tree,\r
- org.argeo.slc.msg.event,\r
- org.argeo.slc.core.attachment,\r
org.argeo.slc.deploy,\r
- org.argeo.slc.build,\r
- org.springframework.web.servlet,\r
- org.springframework.oxm,\r
- org.springframework.aop,\r
- org.springframework.aop.framework,\r
- org.springframework.aop.scope,\r
+ org.argeo.slc.msg.event,\r
+ org.argeo.slc.runtime,\r
+ org.argeo.slc.services,\r
+ org.argeo.slc.web.mvc,\r
+ org.argeo.slc.web.mvc.attachment,\r
+ org.argeo.slc.web.mvc.event,\r
+ org.argeo.slc.web.mvc.execution,\r
org.argeo.slc.web.mvc.management,\r
+ org.argeo.slc.web.mvc.process,\r
org.argeo.slc.web.mvc.provisioning,\r
org.argeo.slc.web.mvc.result,\r
- org.argeo.slc.web.mvc.process,\r
org.argeo.slc.web.mvc.runtime,\r
- org.argeo.slc.web.mvc.event,\r
- org.argeo.slc.web.mvc.attachment,\r
- org.argeo.slc.web.mvc.execution,\r
- org.argeo.slc.web.mvc,\r
- org.springframework.web.servlet.handler,\r
- org.aopalliance.aop,\r
- net.sf.cglib.core,\r
- net.sf.cglib.proxy,\r
- net.sf.cglib.reflect,\r
+ org.hibernate,\r
+ org.hibernate.hql.ast,\r
org.hibernate.jdbc,\r
- org.hibernate.hql.ast\r
+ org.springframework.aop,\r
+ org.springframework.aop.framework,\r
+ org.springframework.aop.scope,\r
+ org.springframework.beans.factory.support,\r
+ org.springframework.orm.hibernate3.support,\r
+ org.springframework.osgi.web.context.support,\r
+ org.springframework.oxm,\r
+ org.springframework.security.ui.webapp,\r
+ org.springframework.security.userdetails.memory,\r
+ org.springframework.transaction,\r
+ org.springframework.web.context,\r
+ org.springframework.web.context.request,\r
+ org.springframework.web.context.support,\r
+ org.springframework.web.filter,\r
+ org.springframework.web.servlet,\r
+ org.springframework.web.servlet.handler,\r
+ org.springframework.web.servlet.mvc\r
<!--
<import resource="classpath:/org/argeo/slc/server/spring/jmx.xml" />
-->
+ <import resource="security.xml" />
<import resource="osgi.xml" />
--- /dev/null
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+ xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
+
+ <http>
+ <intercept-url pattern="/**" access="ROLE_USER" />
+ <http-basic />
+ <anonymous />
+ </http>
+
+ <authentication-provider>
+ <user-service>
+ <user name="mbaudier" password="mbaudier" authorities="ROLE_USER,ROLE_ADMIN" />
+ <user name="cdujeu" password="cdujeu" authorities="ROLE_USER" />
+ </user-service>
+ </authentication-provider>
+
+</beans:beans>
<param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value>
</context-param>
- <!-- Log4j configContext loader config
- <listener>
+ <!-- Security -->
+ <filter>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!--
+ Log4j configContext loader config <listener>
<display-name>Log4j</display-name>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
- </listener>
- <context-param>
+ </listener> <context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
- </context-param>
- <context-param>
+ </context-param> <context-param>
<param-name>log4jRefreshInterval</param-name>
- <param-value>5000</param-value>
- </context-param>
- -->
-
- <!--
- Active MQ <context-param>
- <param-name>org.apache.activemq.brokerURL</param-name>
- <param-value>vm://localhost</param-value> </context-param>
-
- <context-param>
- <param-name>org.apache.activemq.embeddedBroker</param-name>
- <param-value>false</param-value> </context-param> <servlet>
- <servlet-name>MessageListenerServlet</servlet-name>
- <servlet-class>org.apache.activemq.web.MessageListenerServlet</servlet-class>
- <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping>
- <servlet-name>MessageListenerServlet</servlet-name>
- <url-pattern>/amq/*</url-pattern> </servlet-mapping> <filter>
- <filter-name>session</filter-name>
- <filter-class>org.apache.activemq.web.SessionFilter</filter-class>
- </filter> <filter-mapping> <filter-name>session</filter-name>
- <url-pattern>/amq/*</url-pattern> </filter-mapping>
+ <param-value>5000</param-value> </context-param>
-->
</web-app>
package org.argeo.slc.core.execution;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.argeo.slc.SlcException;
+import org.argeo.slc.UnsupportedException;
import org.argeo.slc.execution.ExecutionFlow;
import org.argeo.slc.execution.ExecutionFlowDescriptor;
import org.argeo.slc.execution.ExecutionFlowDescriptorConverter;
public class DefaultExecutionFlowDescriptorConverter implements
ExecutionFlowDescriptorConverter, ApplicationContextAware {
+ public final static String REF_VALUE_TYPE_BEAN_NAME = "beanName";
+
private final static Log log = LogFactory
.getLog(DefaultExecutionFlowDescriptorConverter.class);
public Map<String, Object> convertValues(
ExecutionFlowDescriptor executionFlowDescriptor) {
- // convert the values of flow.getFlowDescriptor()
Map<String, Object> values = executionFlowDescriptor.getValues();
-
Map<String, Object> convertedValues = new HashMap<String, Object>();
if (values != null) {
Object value = values.get(key);
if (value instanceof PrimitiveValue) {
PrimitiveValue primitiveValue = (PrimitiveValue) value;
-
- // TODO: check that the class of the the
- // primitiveValue.value
- // matches
- // the primitiveValue.type
+ // TODO: check class <=> type
convertedValues.put(key, primitiveValue.getValue());
} else if (value instanceof RefValue) {
- // not yet implemented
-
- // RefValue refValue = (RefValue) value;
- // convertedValues.put(key, refValue.getLabel());
+ RefValue refValue = (RefValue) value;
+
+ if (REF_VALUE_TYPE_BEAN_NAME.equals(refValue.getType()))
+ if (refValue.getRef() != null) {
+ Object obj = applicationContext.getBean(refValue
+ .getRef());
+ convertedValues.put(key, obj);
+ } else {
+ log.warn("Cannot interpret " + refValue);
+ }
+ else
+ throw new UnsupportedException("Ref value type",
+ refValue.getType());
}
}
}
if (executionFlow.getPath() != null)
efd.setPath(executionFlow.getPath());
+ // Takes description from spring
+ BeanDefinition bd = getBeanFactory().getBeanDefinition(name);
+ efd.setDescription(bd.getDescription());
+
// Add execution spec if necessary
if (!md.getExecutionSpecs().contains(executionSpec))
md.getExecutionSpecs().add(executionSpec);
protected RefValue buildRefValue(RefSpecAttribute rsa,
ExecutionFlow executionFlow, String key) {
RefValue refValue = new RefValue();
+ refValue.setType(REF_VALUE_TYPE_BEAN_NAME);
if (executionFlow.isSetAsParameter(key)) {
String ref = null;
}
if (ref == null)
log.warn("Cannot define reference for ref spec attribute "
- + key);
+ + key + " in " + executionFlow + " (" + rsa + ")");
+ else if (log.isDebugEnabled())
+ log.debug(ref + " is the reference for ref spec attribute "
+ + key + " in " + executionFlow + " (" + rsa + ")");
refValue.setRef(ref);
}
return refValue;
if (attr instanceof RefSpecAttribute) {
RefSpecAttribute rsa = (RefSpecAttribute) attr;
if (rsa.getChoices() == null) {
- rsa.setChoices(buildRefValueChoices(rsa));
+ List<RefValueChoice> choices = buildRefValueChoices(rsa);
+ if (log.isDebugEnabled())
+ log.debug("Found " + choices.size() + " choices for "
+ + rsa + " in spec " + name);
+
+ rsa.setChoices(choices);
}
}
}
RefValueChoice choice = new RefValueChoice();
choice.setName(beanName);
choice.setDescription(bd.getDescription());
+ if (log.isTraceEnabled())
+ log.debug("Found choice " + beanName + " for " + rsa);
+
+ choices.add(choice);
+
}
return choices;
}
return rsa;
}
+ @Override
+ public String toString() {
+ return "Ref spec attribute [" + targetClass + "]";
+ }
+
}
package org.argeo.slc.core.execution;
-
public class RefValue extends AbstractExecutionValue {
private String ref;
+ private String type;
public RefValue() {
}
this.ref = ref;
}
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ @Override
+ public String toString() {
+ return "Ref Value [" + type + "=" + ref + "]";
+ }
+
}
import javax.servlet.http.HttpServletRequest;\r
import javax.servlet.http.HttpServletResponse;\r
\r
+import org.apache.commons.logging.Log;\r
+import org.apache.commons.logging.LogFactory;\r
import org.argeo.slc.core.test.tree.TreeTestResult;\r
import org.argeo.slc.dao.test.tree.TreeTestResultCollectionDao;\r
import org.argeo.slc.msg.ObjectList;\r
\r
/** Lists results possibly filtering them. */\r
public class ListResultsController extends AbstractServiceController {\r
+ private final static Log log = LogFactory\r
+ .getLog(ListResultsController.class);\r
private final TreeTestResultCollectionDao testResultCollectionDao;\r
\r
public ListResultsController(\r
}\r
\r
@Override\r
- @SuppressWarnings(value={"unchecked"})\r
+ @SuppressWarnings(value = { "unchecked" })\r
protected void handleServiceRequest(HttpServletRequest request,\r
HttpServletResponse response, ModelAndView modelAndView)\r
throws Exception {\r
+\r
+ log.debug("userPrincipal=" + request.getUserPrincipal());\r
+ log.debug("authType= " + request.getAuthType());\r
+ log.debug("remoteUser=" + request.getRemoteUser());\r
+ log.debug("cookies=" + request.getCookies());\r
+ log.debug("requestedSessionId=" + request.getRequestedSessionId());\r
+ log.debug("session.id=" + request.getSession().getId());\r
+\r
String collectionId = request.getParameter("collectionId");\r
\r
Map<String, String[]> parameterMap = request.getParameterMap();\r
List<TreeTestResult> resultAttributes = testResultCollectionDao\r
.listResults(collectionId, attributes);\r
\r
- modelAndView.addObject("resultList", new ObjectList(\r
- resultAttributes));\r
+ modelAndView.addObject("resultList", new ObjectList(resultAttributes));\r
}\r
}\r
public void setValue(Object object, Object value)
throws IllegalStateException, IllegalArgumentException {
MapItem part = (MapItem) object;
- part.setKey(TreeSPath.parseToCreatePath(value.toString()));
+ part.setKey(new TreeSPath(value.toString()));
}
}
<field name="ref">\r
<bind-xml name="ref" node="attribute" />\r
</field>\r
+ <field name="type">\r
+ <bind-xml name="type" node="attribute" />\r
+ </field>\r
</class>\r
\r
<class name="org.argeo.slc.core.execution.RefValueChoice">\r
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC\r
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"\r
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">\r
+<hibernate-mapping package="org.argeo.slc.process">\r
+ <class name="RealizedFlow" table="REALIZED_FLOW">\r
+ <cache usage="read-write" />\r
+\r
+ <id column="ID" />\r
+ <property name="moduleName" column="MODULE_NAME" />\r
+ <property name="moduleVersion" column="MODULE_VERSION" />\r
+\r
+ </class>
+</hibernate-mapping>
\ No newline at end of file