mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-26 07:44:56 +01:00
Add readOnly support to the mindmapList.
This commit is contained in:
parent
5e67811dcf
commit
26766fdbc6
@ -38,6 +38,9 @@ mindplot.widget.Menu = new Class({
|
||||
|
||||
// Create panels ...
|
||||
var designerModel = designer.getModel();
|
||||
|
||||
var fontFamilyBtn = $('fontFamily');
|
||||
if (fontFamilyBtn) {
|
||||
var fontFamilyModel = {
|
||||
getValue: function() {
|
||||
var nodes = designerModel.filterSelectedTopics();
|
||||
@ -60,8 +63,10 @@ mindplot.widget.Menu = new Class({
|
||||
};
|
||||
this._toolbarElems.push(new mindplot.widget.FontFamilyPanel("fontFamily", fontFamilyModel));
|
||||
this._registerTooltip('fontFamily', "Text font");
|
||||
}
|
||||
|
||||
|
||||
var fontSizeBtn = $('fontSize');
|
||||
if (fontSizeBtn) {
|
||||
var fontSizeModel = {
|
||||
getValue: function() {
|
||||
var nodes = designerModel.filterSelectedTopics();
|
||||
@ -82,8 +87,10 @@ mindplot.widget.Menu = new Class({
|
||||
};
|
||||
this._toolbarElems.push(new mindplot.widget.FontSizePanel("fontSize", fontSizeModel));
|
||||
this._registerTooltip('fontSize', "Text size");
|
||||
}
|
||||
|
||||
|
||||
var topicShapeBtn = $('topicShapeBtn');
|
||||
if (topicShapeBtn) {
|
||||
var topicShapeModel = {
|
||||
getValue: function() {
|
||||
var nodes = designerModel.filterSelectedTopics();
|
||||
@ -104,8 +111,10 @@ mindplot.widget.Menu = new Class({
|
||||
};
|
||||
this._toolbarElems.push(new mindplot.widget.TopicShapePanel("topicShape", topicShapeModel));
|
||||
this._registerTooltip('topicShape', "Topic shape");
|
||||
}
|
||||
|
||||
|
||||
var topicIconBtn = $('topicIcon');
|
||||
if (topicIconBtn) {
|
||||
// Create icon panel dialog ...
|
||||
var topicIconModel = {
|
||||
getValue: function() {
|
||||
@ -117,11 +126,13 @@ mindplot.widget.Menu = new Class({
|
||||
};
|
||||
this._toolbarElems.push(new mindplot.widget.IconPanel('topicIcon', topicIconModel));
|
||||
this._registerTooltip('topicIcon', "Icon");
|
||||
|
||||
}
|
||||
|
||||
// Topic color item ...
|
||||
var topicColorModel =
|
||||
{
|
||||
var topicColorBtn = $('topicColor');
|
||||
if (topicColorBtn) {
|
||||
|
||||
var topicColorModel = {
|
||||
getValue : function() {
|
||||
var nodes = designerModel.filterSelectedTopics();
|
||||
var result = null;
|
||||
@ -141,9 +152,11 @@ mindplot.widget.Menu = new Class({
|
||||
};
|
||||
this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicColor', topicColorModel, widgetsBaseUrl));
|
||||
this._registerTooltip('topicColor', "Topic color");
|
||||
|
||||
}
|
||||
|
||||
// Border color item ...
|
||||
var topicBorderBtn = $('topicBorder');
|
||||
if (topicBorderBtn) {
|
||||
var borderColorModel =
|
||||
{
|
||||
getValue : function() {
|
||||
@ -165,9 +178,11 @@ mindplot.widget.Menu = new Class({
|
||||
};
|
||||
this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('topicBorder', borderColorModel, widgetsBaseUrl));
|
||||
this._registerTooltip('topicBorder', "Border color");
|
||||
|
||||
}
|
||||
|
||||
// Font color item ...
|
||||
var fontColorBtn = $('fontColor');
|
||||
if (fontColorBtn) {
|
||||
var fontColorModel =
|
||||
{
|
||||
getValue : function() {
|
||||
@ -189,7 +204,7 @@ mindplot.widget.Menu = new Class({
|
||||
};
|
||||
this._toolbarElems.push(new mindplot.widget.ColorPalettePanel('fontColor', fontColorModel, baseUrl));
|
||||
this._registerTooltip('fontColor', "Text color");
|
||||
|
||||
}
|
||||
|
||||
this._addButton('export', false, false, function() {
|
||||
var reqDialog = new MooDialog.Request('c/iframeWrapper.htm?url=c/maps/' + mapId + "/exportf", null,
|
||||
@ -208,7 +223,7 @@ mindplot.widget.Menu = new Class({
|
||||
this._registerTooltip('export', "Export");
|
||||
|
||||
this._addButton('print', false, false, function() {
|
||||
window.open('c/map/' + mapId + '/print');
|
||||
window.open('c/maps/' + mapId + '/print');
|
||||
});
|
||||
|
||||
this._registerTooltip('print', "Print");
|
||||
|
@ -20,6 +20,7 @@ package com.wisemapping.ncontroller;
|
||||
|
||||
|
||||
import com.wisemapping.filter.UserAgent;
|
||||
import com.wisemapping.model.CollaborationRole;
|
||||
import com.wisemapping.model.MindMap;
|
||||
import com.wisemapping.security.Utils;
|
||||
import com.wisemapping.service.MindmapService;
|
||||
@ -61,13 +62,6 @@ public class MindmapController {
|
||||
return "mindmapPrint";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "maps/{id}/view")
|
||||
public String showViewPage(@PathVariable int id, @NotNull Model model) {
|
||||
final MindMap mindmap = findMindmap(id);
|
||||
model.addAttribute("mindmap", mindmap);
|
||||
return "mindmapPrint";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "maps/{id}/export")
|
||||
public String showExportPage(@PathVariable int id, @NotNull Model model) throws IOException {
|
||||
final MindMap mindmap = findMindmap(id);
|
||||
@ -124,23 +118,27 @@ public class MindmapController {
|
||||
return "mindmapList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "maps/{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 {
|
||||
@RequestMapping(value = "maps/{id}/edit", method = RequestMethod.GET)
|
||||
public String showMindmapEditorPage(@PathVariable int id, @NotNull Model model) {
|
||||
final MindMapBean mindmapBean = findMindmapBean(id);
|
||||
final MindMap mindmap = mindmapBean.getDelegated();
|
||||
|
||||
final MindMapBean mindmap = findMindmapBean(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());
|
||||
String result;
|
||||
if (mindmap.hasPermissions(Utils.getUser(), CollaborationRole.EDITOR)) {
|
||||
model.addAttribute("mindmap", mindmapBean);
|
||||
result = "mindmapEditor";
|
||||
} else {
|
||||
result = "redirect:view";
|
||||
}
|
||||
return view;
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "maps/{id}/view", method = RequestMethod.GET)
|
||||
public String showMindmapViewerPage(@PathVariable int id, @NotNull Model model) {
|
||||
final MindMapBean mindmapBean = findMindmapBean(id);
|
||||
model.addAttribute("mindmap", mindmapBean);
|
||||
model.addAttribute("readOnlyMode", true);
|
||||
return "mindmapEditor";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "maps/{id}/embed")
|
||||
|
@ -1,72 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* 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 com.wisemapping.view;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
import java.text.DateFormat;
|
||||
|
||||
public class HistoryBean
|
||||
{
|
||||
private Calendar historyTime;
|
||||
private String author;
|
||||
private int mindmapId;
|
||||
private int historyId;
|
||||
|
||||
public HistoryBean() {}
|
||||
|
||||
public HistoryBean(int mindmapId,int historyId,String author, Calendar time)
|
||||
{
|
||||
this.mindmapId = mindmapId;
|
||||
this.author = author;
|
||||
this.historyTime = time;
|
||||
this.historyId = historyId;
|
||||
}
|
||||
|
||||
public Calendar getHistoryTime() {
|
||||
return historyTime;
|
||||
}
|
||||
|
||||
public String getCreation(Locale locale)
|
||||
{
|
||||
return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.DEFAULT,locale).format(historyTime.getTime());
|
||||
}
|
||||
|
||||
public void setHistoryTime(Calendar historyTime) {
|
||||
this.historyTime = historyTime;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public int getMindMapId()
|
||||
{
|
||||
return mindmapId;
|
||||
}
|
||||
|
||||
public int getHistoryId()
|
||||
{
|
||||
return historyId;
|
||||
}
|
||||
}
|
@ -31,11 +31,11 @@ import java.util.*;
|
||||
public class MindMapBean {
|
||||
private MindMap mindMap;
|
||||
private List<CollaboratorBean> viewers;
|
||||
private List<CollaboratorBean> colaborators;
|
||||
private List<CollaboratorBean> collaborators;
|
||||
|
||||
public MindMapBean(final MindMap mindmap) {
|
||||
this.mindMap = mindmap;
|
||||
this.colaborators = filterCollaboratorBy(mindmap.getCollaborations(), CollaborationRole.EDITOR);
|
||||
this.collaborators = filterCollaboratorBy(mindmap.getCollaborations(), CollaborationRole.EDITOR);
|
||||
this.viewers = filterCollaboratorBy(mindmap.getCollaborations(), CollaborationRole.VIEWER);
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class MindMapBean {
|
||||
}
|
||||
|
||||
public List<CollaboratorBean> getCollaborators() {
|
||||
return colaborators;
|
||||
return collaborators;
|
||||
}
|
||||
|
||||
public String getLastEditor() {
|
||||
@ -96,7 +96,7 @@ public class MindMapBean {
|
||||
}
|
||||
|
||||
public int getCountCollaborators() {
|
||||
return colaborators != null ? colaborators.size() : 0;
|
||||
return collaborators != null ? collaborators.size() : 0;
|
||||
}
|
||||
|
||||
public int getCountViewers() {
|
||||
@ -135,4 +135,12 @@ public class MindMapBean {
|
||||
return mindMap.hasPermissions(Utils.getUser(), CollaborationRole.OWNER);
|
||||
}
|
||||
|
||||
public boolean isEditor() {
|
||||
return mindMap.hasPermissions(Utils.getUser(), CollaborationRole.EDITOR);
|
||||
}
|
||||
|
||||
public MindMap getDelegated(){
|
||||
return mindMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 331 B After Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// @Todo: This must be reviewed ...
|
||||
function displayLoading() {
|
||||
$('headerLoading').style.visibility = 'visible';
|
||||
}
|
@ -25,13 +25,13 @@
|
||||
</c:choose>
|
||||
<div class="header_languages">
|
||||
<div class="header_language_flag">
|
||||
<a href="?language=en"><img src="../images/uk.gif" alt="English"></a>
|
||||
<a href="?language=en"><img src="../images/flag-uk.gif" alt="English"></a>
|
||||
</div>
|
||||
<div class="header_language_flag">
|
||||
<a href="?language=fr"><img src="../images/fr.gif" alt="Frances"></a>
|
||||
<a href="?language=fr"><img src="../images/flag-fr.gif" alt="Frances"></a>
|
||||
</div>
|
||||
<div class="header_language_flag">
|
||||
<a href="?language=es"><img src="../images/es.gif" alt="Espanol"></a>
|
||||
<a href="?language=es"><img src="../images/flag-es.gif" alt="Español"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -36,6 +36,7 @@
|
||||
options.persistenceManager = new mindplot.RESTPersistenceManager("service/maps/{id}/document");
|
||||
var userOptions = ${mindmap.properties};
|
||||
options.zoom = userOptions.zoom;
|
||||
options.readOnly = ${!!readOnlyMode};
|
||||
|
||||
// Set map id ...
|
||||
options.mapId = mapId;
|
||||
|
@ -2,19 +2,19 @@
|
||||
|
||||
<div id="toolbar">
|
||||
<div id="persist" class="buttonContainer">
|
||||
<c:if test="${!readOnlyMode}">
|
||||
<div id="save" class="buttonOn">
|
||||
<img src="../images/save.png"/>
|
||||
</div>
|
||||
<div id="discard" class="buttonOn">
|
||||
<img src="../images/discard.png"/>
|
||||
</div>
|
||||
</c:if>
|
||||
<div id="print" class="buttonOn">
|
||||
<img src="../images/print.png"/>
|
||||
</div>
|
||||
<div id="export" class="buttonOn">
|
||||
<img src="../images/export.png"/>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${!readOnlyMode}">
|
||||
<div id="edit" class="buttonContainer">
|
||||
<div id="undoEdition" class="buttonOn">
|
||||
<img src="../images/undo.png"/>
|
||||
@ -23,6 +23,7 @@
|
||||
<img src="../images/redo.png"/>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<div id="zoom" class="buttonContainer">
|
||||
<div id="zoomIn" class="buttonOn">
|
||||
<img src="../images/zoom-in.png"/>
|
||||
@ -31,6 +32,7 @@
|
||||
<img src="../images/zoom-out.png"/>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${!readOnlyMode}">
|
||||
<div id="node" class="buttonContainer">
|
||||
<div id="topicShape" class="buttonExtOn">
|
||||
<img src="../images/topic-shape.png"/>
|
||||
@ -77,9 +79,9 @@
|
||||
<img src="../images/font-color.png"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
<div id="collaboration" class="buttonContainer">
|
||||
<c:if test="${mindmap.owner}">
|
||||
<c:if test="${mindmap.owner && !readOnlyMode}">
|
||||
<div id="shareIt" class="buttonOn">
|
||||
<img src="../images/share.png"/>
|
||||
</div>
|
||||
@ -87,9 +89,14 @@
|
||||
<img src="../images/public.png"/>
|
||||
</div>
|
||||
</c:if>
|
||||
<div id="export" class="buttonOn">
|
||||
<img src="../images/export.png"/>
|
||||
</div>
|
||||
<c:if test="${!readOnlyMode}">
|
||||
<div id="history" class="buttonOn">
|
||||
<img src="../images/history.png"/>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
<div id="headerNotifier"></div>
|
||||
</div>
|
@ -18,7 +18,7 @@
|
||||
|
||||
<!--jQuery DataTables-->
|
||||
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="js/mymaps.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="js/mindmapList.js"></script>
|
||||
|
||||
<!-- Update timer plugging -->
|
||||
<script type="text/javascript" language="javascript" src="js/jquery.timeago.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user