Add REST service /service/maps.

This commit is contained in:
Paulo Gustavo Veiga
2012-02-20 14:42:07 -03:00
parent ae43a27dd2
commit 89f7fd8d3c
8 changed files with 163 additions and 44 deletions

View File

@@ -1,8 +1,8 @@
log4j.rootLogger=WARN, stdout, R
log4j.logger.net.sf=FATAL,stdout, R
log4j.logger.com.wisemapping=WARN,stdout,R
log4j.logger.org.wisemapping.ws= WARN,stdout, R
log4j.logger.org.acegisecurity.event.authentication= FATAL,stdout, R
log4j.logger.org.springframework=WARN,stdout,R
# Stdout logger <20>
log4j.appender.stdout=org.apache.log4j.ConsoleAppender

View File

@@ -1,24 +1,48 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Employees</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mindmap Detail</title>
</head>
<body>
<table border=1>
<thead><tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
</tr></thead>
<%--<c:forEach var="employee" items="${employees.employees}">--%>
<%--<tr>--%>
<%--<td>${employee.id}</td>--%>
<%--<td>${employee.name}</td>--%>
<%--<td>${employee.email}</td>--%>
<%--</tr>--%>
<%--</c:forEach>--%>
<h1>Details for map with id '${map.id}'</h1>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>Id:</td>
<td>${map.id}</td>
</tr>
<tr>
<td>Title:</td>
<td>${map.title}</td>
</tr>
<tr>
<td>Description:</td>
<td>${map.description}</td>
</tr>
<tr>
<td>Owner:</td>
<td>${map.owner}</td>
</tr>
<tr>
<td>Xml:</td>
<td><textarea rows="10" cols="100">${map.xml}</textarea></td>
</tr>
<tr>
<td>Last Modified:</td>
<td>${map.lastModifierUser}</td>
</tr>
<tr>
<td>Creator:</td>
<td>${map.creator}</td>
</tr>
<tr>
<td>Public:</td>
<td>${map.public}</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,51 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mindmaps List</title>
</head>
<body>
<h1>Mindmaps List</h1>
<c:forEach items="${list.mindmaps}" var="map">
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>Id:</td>
<td>${map.id}</td>
</tr>
<tr>
<td>Title:</td>
<td>${map.title}</td>
</tr>
<tr>
<td>Description:</td>
<td>${map.description}</td>
</tr>
<tr>
<td>Owner:</td>
<td>${map.owner}</td>
</tr>
<tr>
<td>Xml:</td>
<td><textarea rows="10" cols="100">${map.xml}</textarea></td>
</tr>
<tr>
<td>Last Modified:</td>
<td>${map.lastModifierUser}</td>
</tr>
<tr>
<td>Creator:</td>
<td>${map.creator}</td>
</tr>
<tr>
<td>Public:</td>
<td>${map.public}</td>
</tr>
</tbody>
</table>
</c:forEach>
<br/>
</body>
</html>

View File

@@ -19,6 +19,7 @@
<property name="classesToBeBound">
<list>
<value>com.wisemapping.rest.model.RestMindmap</value>
<value>com.wisemapping.rest.model.RestMindmapList</value>
</list>
</property>
</bean>
@@ -29,7 +30,7 @@
<property name="mediaTypes">
<map>
<entry key="html" value="text/html"/>
<entry key="xml" value="text/xml"/>
<entry key="xml" value="application/xml"/>
<entry key="json" value="application/json"/>
<entry key="freemind" value="application/freemind"/>
<entry key="pdf" value="application/pdf"/>

View File

@@ -29,14 +29,11 @@
<sec:http pattern="/dwr/engine.js" security="none"/>
<sec:http pattern="/dwr/interface/loggerservice.js" security="none"/>
<sec:http pattern="/dwr/call/plaincall/loggerservice.logerror.dwr" security="none"/>
<sec:http pattern="/service/transform.*" security="none"/>
<sec:http use-expressions="true" create-session="stateless" entry-point-ref="digestEntryPoint"
pattern="/service/**">
<sec:intercept-url pattern="/service/**" access="isAuthenticated()"/>
<sec:http use-expressions="true" create-session="never" pattern="/service/**">
<sec:intercept-url pattern="/service/**" access="isAuthenticated()"/>
<sec:http-basic/>
<sec:custom-filter ref="digestFilter" after="BASIC_AUTH_FILTER"/>
</sec:http>
<sec:http use-expressions="true">
@@ -61,17 +58,4 @@
<bean id="userDetailsService" class="com.wisemapping.security.UserDetailService">
<property name="userManager" ref="userManager"/>
</bean>
<bean id="digestFilter" class="org.springframework.security.web.authentication.www.DigestAuthenticationFilter">
<property name="userDetailsService" ref="userDetailsService"/>
<property name="authenticationEntryPoint" ref="digestEntryPoint"/>
</bean>
<bean id="digestEntryPoint"
class="org.springframework.security.web.authentication.www.DigestAuthenticationEntryPoint">
<property name="realmName" value="Wise Contacts Realm via Digest Authentication"/>
<property name="key" value="wisemapping-digest"/>
<property name="nonceValiditySeconds" value="10"/>
</bean>
</beans>