GitLab wurde aktualisiert. Dank regelmäßiger Updates bleibt das THM GitLab sicher und Sie profitieren von den neuesten Funktionen. Vielen Dank für Ihre Geduld.

Commit 026b0c52 authored by Paul-Christian Volkmer's avatar Paul-Christian Volkmer
Browse files

Merge branch 'master' of scm.thm.de:arsnova/arsnova-war

parents 083d352c 804a6da8
......@@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import de.thm.arsnova.entities.Session;
import de.thm.arsnova.services.ISessionService;
......@@ -66,6 +67,7 @@ public class SessionController {
}
@RequestMapping(value="/session/{sessionkey}", method=RequestMethod.GET)
@ResponseBody
public Session getSession(@PathVariable String sessionkey, HttpServletResponse response) {
Session session = sessionService.getSession(sessionkey);
if (session != null) return session;
......@@ -75,6 +77,7 @@ public class SessionController {
}
@RequestMapping(value="/session", method=RequestMethod.POST)
@ResponseBody
public Session postNewSession(@RequestBody Session session, HttpServletResponse response) {
Session newSession = sessionService.saveSession(session);
if (session != null) {
......
......@@ -74,18 +74,21 @@ public class SessionService implements ISessionService {
public static final Logger logger = LoggerFactory.getLogger(SessionService.class);
@Value("#{props['couchdb.host']}")
@Value("${couchdb.host}")
public final void setDatabaseHost(String databaseHost) {
logger.info(databaseHost);
this.databaseHost = databaseHost;
}
@Value("#{props['couchdb.port']}")
@Value("${couchdb.port}")
public final void setDatabasePort(String databasePort) {
logger.info(databasePort);
this.databasePort = Integer.parseInt(databasePort);
}
@Value("#{props['couchdb.name']}")
@Value("${couchdb.name}")
public final void setDatabaseName(String databaseName) {
logger.info(databaseName);
this.databaseName = databaseName;
}
......
......@@ -178,8 +178,7 @@ public class ARSnovaSocketIOServer {
for (SocketIOClient client : server.getAllClients()) {
// Find the client whose feedback has been deleted and send a message.
if (client.getSessionId().compareTo(connectionId) == 0) {
ClientOperations clientOp = new ARSnovaClientOperations(client);
clientOp.sendEvent("removedFeedback", arsSessions);
client.sendEvent("removedFeedback", arsSessions);
break;
}
}
......@@ -202,59 +201,4 @@ public class ARSnovaSocketIOServer {
server.getBroadcastOperations().sendEvent("updateFeedback", fb.getValues());
}
}
private static class ARSnovaClientOperations implements ClientOperations {
private final SocketIOClient client;
public ARSnovaClientOperations(SocketIOClient client) {
this.client = client;
}
@Override
public void disconnect() {
throw new NotImplementedException();
}
@Override
public void send(Packet arg0) {
throw new NotImplementedException();
}
@Override
public void send(Packet arg0, AckCallback arg1) {
throw new NotImplementedException();
}
@Override
public void sendEvent(String eventName, Object data) {
client.sendEvent(eventName, data);
}
@Override
public void sendEvent(String arg0, Object arg1, AckCallback arg2) {
throw new NotImplementedException();
}
@Override
public void sendJsonObject(Object arg0) {
throw new NotImplementedException();
}
@Override
public void sendJsonObject(Object arg0, AckCallback arg1) {
throw new NotImplementedException();
}
@Override
public void sendMessage(String arg0) {
throw new NotImplementedException();
}
@Override
public void sendMessage(String arg0, AckCallback arg1) {
throw new NotImplementedException();
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd">
<context:component-scan base-package="de.thm.arsnova" />
<context:annotation-config />
<mvc:annotation-driven />
<task:annotation-driven />
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<bean
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
</list>
</property>
</bean>
<bean
class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="mediaTypes">
<map>
<entry key="json" value="application/json" />
</map>
</property>
<property name="defaultViews">
<list>
<bean
class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
</list>
</property>
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:component-scan base-package="de.thm.arsnova" />
<context:annotation-config />
<mvc:resources mapping="/**" location="/" />
<mvc:annotation-driven />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:viewClass="org.springframework.web.servlet.view.JstlView"
p:prefix="/WEB-INF/views/"
p:suffix=".jsp" />
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-3.1.xsd">
<!-- ARSnova Root Context: defines shared resources visible to all OTHER web components -->
</beans>
......@@ -2,9 +2,12 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd">
<bean id="propertyPlaceholderConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
......@@ -16,14 +19,48 @@
</list>
</property>
</bean>
<util:properties id="props"
location="file:///etc/arsnova/arsnova.properties" />
<import resource="spring-security.xml" />
<context:component-scan base-package="de.thm.arsnova" />
<context:annotation-config />
<mvc:annotation-driven />
<mvc:resources mapping="/**" location="/" />
<task:annotation-driven />
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
</list>
</property>
</bean>
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="mediaTypes">
<map>
<entry key="html" value="text/html"/>
<entry key="json" value="application/json" />
</map>
</property>
<property name="viewResolvers">
<list>
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
</list>
</property>
<property name="defaultViews">
<list>
<bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
<property name="prefixJson" value="false"/>
</bean>
</list>
</property>
</bean>
<bean id="socketServer" class="de.thm.arsnova.socket.ARSnovaSocketIOServer"
init-method="startServer" destroy-method="stopServer" scope="singleton"
......
......@@ -9,10 +9,6 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:component-scan base-package="de.thm.arsnova" />
<context:annotation-config />
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="facebookAuthProvider" />
<security:authentication-provider ref="twitterAuthProvider" />
......
......@@ -22,15 +22,6 @@
<servlet-name>arsnova</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>api</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>api</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
......
security.arsnova-url=http://localhost:8080
security.cas-server-url=https://cas.thm.de/cas
security.facebook.key=318531508227494
security.facebook.secret=e3f38cfc72bb63e35641b637081a6177
security.twitter.key=PEVtidSG0HzSrxVRPpsCXw
security.twitter.secret=mC0HOvxiEgqwdDWCcDoy3q75nUQPu1bYRp1ncHWGd0
security.google.key=110959746118.apps.googleusercontent.com
security.google.secret=CkzUJZswY8rjWCCYnHVovyGA
security.ssl=false
security.keystore=/etc/arsnova.thm.de.jks
security.storepass=arsnova
couchdb.host=localhost
couchdb.port=5984
couchdb.name=arsnova
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment