Change some navigation URLs

Keep removing old controller model.
This commit is contained in:
Paulo Gustavo Veiga 2012-04-14 18:46:07 -03:00
parent 583b2723d3
commit eb2efd2db0
11 changed files with 55 additions and 155 deletions

View File

@ -192,7 +192,7 @@ mindplot.widget.Menu = new Class({
this._addButton('export', false, false, function() { this._addButton('export', false, false, function() {
var reqDialog = new MooDialog.Request('c/export.htm?mapId=' + mapId, null, var reqDialog = new MooDialog.Request('c/map/' + mapId + '/export.htm', null,
{'class': 'exportModalDialog', {'class': 'exportModalDialog',
closeButton:true, closeButton:true,
destroyOnClose:true, destroyOnClose:true,
@ -209,7 +209,7 @@ mindplot.widget.Menu = new Class({
this._addButton('print', false, false, function() { this._addButton('print', false, false, function() {
window.open('c/print.htm?mapId=' + mapId) window.open('c/map/' + mapId + '/print.htm');
}); });
this._registerTooltip('print', "Print"); this._registerTooltip('print', "Print");

View File

@ -66,7 +66,7 @@ public class PublicPagesController extends BaseMultiActionController {
ModelAndView view = new ModelAndView("mindmapEditor", "mindmap", mindmap); ModelAndView view = new ModelAndView("mindmapEditor", "mindmap", mindmap);
final String xmlMap = mindmap.getXmlAsJsLiteral(); final String xmlMap = mindmap.getXmlAsJsLiteral();
view.addObject(MindmapEditorController.MAP_XML_PARAM, xmlMap); view.addObject(MAP_XML_PARAM, xmlMap);
view.addObject("editorTryMode", true); view.addObject("editorTryMode", true);
view.addObject("showHelp", true); view.addObject("showHelp", true);
return view; return view;
@ -77,5 +77,6 @@ public class PublicPagesController extends BaseMultiActionController {
} }
public static final int TRY_EXAMPLE_MINDMAP_ID = 3; public static final int TRY_EXAMPLE_MINDMAP_ID = 3;
public static final String MAP_XML_PARAM = "mapXml";
} }

View File

@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -27,12 +28,48 @@ public class MindmapController {
@Autowired @Autowired
private MindmapService mindmapService; private MindmapService mindmapService;
@RequestMapping(value = "export") @RequestMapping(value = "map/{id}/export")
public ModelAndView export(@RequestParam(required = true) long mapId) throws IOException { public ModelAndView export(@PathVariable int id) throws IOException {
final MindMapBean modelObject = findMindmapBean(mapId); final MindMapBean modelObject = findMindmapBean(id);
return new ModelAndView("mindmapExport", "mindmap", modelObject); return new ModelAndView("mindmapExport", "mindmap", modelObject);
} }
@RequestMapping(value = "map/{id}/details")
public ModelAndView showDetails(@PathVariable int id) {
final MindMapBean modelObject = findMindmapBean(id);
final ModelAndView view = new ModelAndView("mindmapDetail", "wisemapDetail", modelObject);
view.addObject("user", Utils.getUser());
return view;
}
@RequestMapping(value = "map/{id}/print")
public ModelAndView showPrintPage(@PathVariable int id) {
final MindMap mindmap = findMindmap(id);
final ModelAndView view = new ModelAndView("mindmapPrint", "mindmap", mindmap);
view.addObject("user", Utils.getUser());
return view;
}
@RequestMapping(value = "map/{id}/edit")
public ModelAndView editMap(@PathVariable int id, @NotNull HttpServletRequest request)
{
ModelAndView view;
final UserAgent userAgent = UserAgent.create(request);
if (userAgent.needsGCF()) {
view = new ModelAndView("gcfPluginNeeded");
// view.addObject(MINDMAP_ID_PARAMETER, mindmapId);
} else {
final MindMap mindmap = mindmapService.getMindmapById(id);
view = new ModelAndView("mindmapEditor", "mindmap", mindmap);
view.addObject("editorTryMode", false);
final boolean showHelp = isWelcomeMap(mindmap);
view.addObject("showHelp", showHelp);
view.addObject("user", Utils.getUser());
}
return view;
}
@RequestMapping(value = "collaborator") @RequestMapping(value = "collaborator")
public ModelAndView showCollaborator(@RequestParam(required = true) long mapId) { public ModelAndView showCollaborator(@RequestParam(required = true) long mapId) {
final MindMapBean modelObject = findMindmapBean(mapId); final MindMapBean modelObject = findMindmapBean(mapId);
@ -45,22 +82,6 @@ public class MindmapController {
return new ModelAndView("mindmapViewer", "wisemapsList", modelObject); return new ModelAndView("mindmapViewer", "wisemapsList", modelObject);
} }
@RequestMapping(value = "detail")
public ModelAndView showDetails(@RequestParam(required = true) long mapId) {
final MindMapBean modelObject = findMindmapBean(mapId);
final ModelAndView view = new ModelAndView("mindmapDetail", "wisemapDetail", modelObject);
view.addObject("user", Utils.getUser());
return view;
}
@RequestMapping(value = "print")
public ModelAndView showPrintPage(@RequestParam(required = true) long mapId) {
final MindMap mindmap = findMindmap(mapId);
final ModelAndView view = new ModelAndView("mindmapPrint", "mindmap", mindmap);
view.addObject("user", Utils.getUser());
return view;
}
@RequestMapping(value = "changeStatus") @RequestMapping(value = "changeStatus")
public ModelAndView changeStatus(@RequestParam(required = true) long mapId) throws WiseMappingException { public ModelAndView changeStatus(@RequestParam(required = true) long mapId) throws WiseMappingException {
final MindMap mindmap = findMindmap(mapId); final MindMap mindmap = findMindmap(mapId);
@ -130,5 +151,10 @@ public class MindmapController {
return new MindMapBean(findMindmap(mapId)); return new MindMapBean(findMindmap(mapId));
} }
private boolean isWelcomeMap(MindMap map) {
return map.getTitle().startsWith("Welcome ");
}
private static final String USER_AGENT = "wisemapping.userAgent"; private static final String USER_AGENT = "wisemapping.userAgent";
} }

View File

@ -210,7 +210,6 @@ public class MindmapController extends BaseController {
// Return the new created map ... // Return the new created map ...
response.setHeader("Location", "/service/maps/" + clonedMap.getId()); response.setHeader("Location", "/service/maps/" + clonedMap.getId());
response.setHeader("ResourceId", Integer.toString(clonedMap.getId())); response.setHeader("ResourceId", Integer.toString(clonedMap.getId()));
} }
} }

View File

@ -31,11 +31,6 @@
<property name="mindmapService" ref="mindmapService"/> <property name="mindmapService" ref="mindmapService"/>
</bean> </bean>
<bean id="editorController" class="com.wisemapping.controller.MindmapEditorController">
<property name="methodNameResolver" ref="paramResolverByAction"/>
<property name="mindmapService" ref="mindmapService"/>
<property name="userService" ref="userService"/>
</bean>
<bean id="cookerController" class="com.wisemapping.controller.MindmapCooker"> <bean id="cookerController" class="com.wisemapping.controller.MindmapCooker">
<property name="methodNameResolver" ref="paramResolverByAction"/> <property name="methodNameResolver" ref="paramResolverByAction"/>
@ -226,7 +221,6 @@
<prop key="/c/forgotPassword.htm">forgotPasswordController</prop> <prop key="/c/forgotPassword.htm">forgotPasswordController</prop>
<prop key="/c/activation.htm">activationController</prop> <prop key="/c/activation.htm">activationController</prop>
<prop key="/c/changePassword.htm">changePasswordController</prop> <prop key="/c/changePassword.htm">changePasswordController</prop>
<prop key="/c/editor.htm">editorController</prop>
<prop key="/c/cooker.htm">cookerController</prop> <prop key="/c/cooker.htm">cookerController</prop>
<prop key="/c/settings.htm">settingsController</prop> <prop key="/c/settings.htm">settingsController</prop>
<prop key="/c/publish.htm">publishController</prop> <prop key="/c/publish.htm">publishController</prop>

View File

@ -138,12 +138,6 @@
padding: 9px 9px 0; padding: 9px 9px 0;
} }
#searchTitleContainer {
background: url( ../images/search3.png ) no-repeat left;
padding-left: 35px;
padding-bottom: 10px;
}
#searchTitle { #searchTitle {
height: 16px; height: 16px;
top: 3px; top: 3px;
@ -174,62 +168,11 @@
margin-right: 10px; margin-right: 10px;
} }
#searchBtnStart {
width: 6px;
height: 25px;
background: url( ../images/btnStart.png ) no-repeat left top;
float: left;
}
#searchBtnBody {
background: url( ../images/btnBody.png );
height: 18px;
float: left;
padding: 5px 0 0;
text-align: center;
color: black;
}
#searchBtnEnd {
width: 7px;
height: 25px;
background: url( ../images/btnEnd.png ) no-repeat right top;
float: left;
}
#tryNow {
clear: both;
font-size: 20px;
text-align: center;
margin-top: 10px;
margin-left: 20px;
height:70px;
}
div#tryNow a { div#tryNow a {
text-decoration: none; text-decoration: none;
} }
div#tryNow .tryBtnStart {
width: 10px;
height: 70px;
background: url( ../images/tryItStartBtn2.png ) no-repeat left top;
float: left;
}
div#tryNow .tryBtnBody {
height: 70px;
background: url( ../images/tryItBodyBtn2.png );
float: left;
width: 145px;
}
div#tryNow .tryBtnEnd {
width: 11px;
height: 70px;
background: url( ../images/tryItEndBtn2.png ) no-repeat right top;
float: left;
}
div#tryNow .tryBtnText { div#tryNow .tryBtnText {
padding: 0 20px; padding: 0 20px;
@ -269,27 +212,6 @@ div#video a {
text-decoration: none; text-decoration: none;
} }
div#video .videoBtnStart {
width: 10px;
height: 51px;
background: url( ../images/videoStart.png ) no-repeat left top;
float: left;
}
div#video .videoBtnBody {
height: 51px;
background: url( ../images/videoBody.png );
float: left;
width: 145px;
}
div#video .videoBtnEnd {
width: 10px;
height: 51px;
background: url( ../images/videoEnd.png ) no-repeat right top;
float: left;
}
div#video .videoBtnText { div#video .videoBtnText {
position: relative; position: relative;
height: 70px; height: 70px;
@ -359,28 +281,6 @@ div#signUpButton .signUpBtnContainer {
left: 60px; left: 60px;
} }
div#signUpButton .signUpStartBtn {
width: 5px;
height: 25px;
background: url( ../images/signUpStartBtn.png ) no-repeat left top;
float: left;
}
div#signUpButton .signUpBodyBtn {
height: 25px;
width: 70px;
background: url( ../images/signUpBodyBtn.png );
white-space: nowrap;
float: left;
}
div#signUpButton .signUpEndBtn {
width: 7px;
height: 25px;
background: url( ../images/signUpEndBtn.png ) no-repeat right top;
float: left;
}
div#signUpButton .signUpText { div#signUpButton .signUpText {
padding: 0 20px; padding: 0 20px;
@ -483,22 +383,6 @@ div#mainBody {
height: 300px; height: 300px;
} }
div#news li {
background: transparent url( ../images/icon_triangle_grey_12x13.gif ) no-repeat scroll 0;
list-style: none outside none;
margin-bottom: 12px;
padding: 2px 0 5px 20px;
}
div#news ul {
padding: 5px 40px;
}
div#news h1 {
font-size: 200%;
color: #1E4BA5;
font-weight: bold;
}
div#login { div#login {
float: right; float: right;

View File

@ -6,7 +6,6 @@
<spring:message code="NO_ENOUGH_PERMISSIONS"/> <spring:message code="NO_ENOUGH_PERMISSIONS"/>
</title> </title>
<meta http-equiv="Content-type" value="text/html; charset=utf-8"> <meta http-equiv="Content-type" value="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../css/wisehome.css">
<link rel="stylesheet" type="text/css" href="../css/embedded.css"> <link rel="stylesheet" type="text/css" href="../css/embedded.css">
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"> <link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon">

View File

@ -12,7 +12,7 @@
</c:url> </c:url>
<html> <html>
<head> <head>
<base href="../"/> <base href="../../../"/>
<title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title> <title><spring:message code="SITE.TITLE"/> - ${mindmap.title} </title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>

View File

@ -3,7 +3,7 @@
<%@ include file="/jsp/init.jsp" %> <%@ include file="/jsp/init.jsp" %>
<html> <html>
<head> <head>
<base href="../"> <base href="${pageContext.request.contextPath}/"/>
<title><spring:message code="SITE.TITLE"/></title> <title><spring:message code="SITE.TITLE"/></title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
@ -45,9 +45,8 @@
bUseRendered : false, bUseRendered : false,
mDataProp: "title", mDataProp: "title",
fnRender : function(obj) { fnRender : function(obj) {
return '<a href="c/editor.htm?action=open&mapId=' + obj.aData.id + '">' + obj.aData.title + '</a>'; return '<a href="c/map/' + obj.aData.id + '/edit.htm">' + obj.aData.title + '</a>';
} }
}, },
{ {
sTitle : "Description", sTitle : "Description",
@ -75,10 +74,9 @@
bSortable : false, bSortable : false,
bSearchable : false, bSearchable : false,
fnRender : function(obj) { fnRender : function(obj) {
return '<span class="ui-icon ui-icon-circle-triangle-e" style="margin: 0 auto;"></span>'; return '<a href="c/map/' + obj.aData.id + '/details.htm"><span class="ui-icon ui-icon-circle-triangle-e" style="margin: 0 auto;"></span></a>';
} }
} }
], ],
"bAutoWidth" : false, "bAutoWidth" : false,
"oLanguage" : { "oLanguage" : {

View File

@ -5,9 +5,7 @@
<title> <title>
<spring:message code="SITE.TITLE"/> <spring:message code="SITE.TITLE"/>
-</title> -</title>
<link rel="stylesheet" type="text/css" href="../css/wisehome.css">
!--[if lt IE 9]> !--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="../css/wisehomeOldIE.css"/>
<![endif]--> <![endif]-->
<script type="text/javascript"> <script type="text/javascript">

View File

@ -7,6 +7,7 @@
<tiles:importAttribute name="details" scope="request"/> <tiles:importAttribute name="details" scope="request"/>
<html> <html>
<head> <head>
<base href="${pageContext.request.contextPath}/"/>
<title> <title>
<spring:message code="SITE.TITLE"/> <spring:message code="SITE.TITLE"/>
- -
@ -20,7 +21,7 @@
</c:choose> </c:choose>
</title> </title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="../css/wisehome.css"/> <link rel="stylesheet" type="text/css" href="css/pageTemplate.css"/>
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/> <link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
</head> </head>