Fix resources generation bug

Add support for try.
This commit is contained in:
Paulo Gustavo Veiga 2012-08-23 22:07:37 -03:00
parent 73056de872
commit dcd15d8fa4
8 changed files with 44 additions and 47 deletions

View File

@ -61,7 +61,7 @@
println "Converting ${file.name} to ${outfile.name}";
outfile.withWriter('UTF-8') { out ->
out.writeLine "mindplot.Messages.BUNDLES['${lang}'] = { ";
out.writeLine "mindplot.Messages.BUNDLES['${lang.toLowerCase()}'] = { ";
file.eachLine('UTF-8') { line ->
if( line.trim()!="" && line[0]!='#' ) {
matcher = line =~ /(.+)=(.+)/;
@ -245,7 +245,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<skipTests>true</skipTests>
</configuration>

10
pom.xml
View File

@ -79,6 +79,16 @@
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>

View File

@ -384,7 +384,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>compile</id>

View File

@ -34,19 +34,6 @@ public class ExtensionsController {
@Autowired
private MindmapService mindmapService;
@RequestMapping(value = "try")
public ModelAndView tryEditor() throws IOException {
final Mindmap mindmap = mindmapService.findMindmapById(TRY_EXAMPLE_MINDMAP_ID);
ModelAndView view = new ModelAndView("mindmapEditor", "mindmap", mindmap);
final String xmlMap = mindmap.getXmlAsJsLiteral();
view.addObject(MAP_XML_PARAM, xmlMap);
view.addObject("editorTryMode", true);
view.addObject("showHelp", true);
return view;
}
@RequestMapping(value = "privacyPolicy")
public ModelAndView privacyPolicy() {
return new ModelAndView("privacyPolicy");
@ -56,8 +43,4 @@ public class ExtensionsController {
public ModelAndView faq() {
return new ModelAndView("faq");
}
public static final int TRY_EXAMPLE_MINDMAP_ID = 3;
public static final String MAP_XML_PARAM = "mapXml";
}

View File

@ -138,39 +138,43 @@ public class MindmapController {
final MindMapBean mindmapBean = findMindmapBean(id);
final Mindmap mindmap = mindmapBean.getDelegated();
String result;
if (mindmap.hasPermissions(Utils.getUser(), CollaborationRole.EDITOR)) {
model.addAttribute("mindmap", mindmapBean);
// Configure default locale for the editor ...
final Locale locale = LocaleContextHolder.getLocale();
model.addAttribute("locale", locale.toString().toLowerCase());
model.addAttribute("principal", Utils.getUser());
result = "mindmapEditor";
} else {
result = "redirect:view";
}
return result;
model.addAttribute("readOnlyMode", !mindmap.hasPermissions(Utils.getUser(), CollaborationRole.EDITOR));
return "mindmapEditor";
}
@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);
final String result = showMindmapEditorPage(id, model);
model.addAttribute("readOnlyMode", true);
return "mindmapEditor";
return result;
}
@RequestMapping(value = "maps/{id}/try", method = RequestMethod.GET)
public String showMindmapTryPage(@PathVariable int id, @NotNull Model model) {
final String result = showMindmapEditorPage(id, model);
model.addAttribute("memoryPersistence", true);
return result;
}
@RequestMapping(value = "maps/{id}/{hid}/view", method = RequestMethod.GET)
public String showMindmapViewerRevPage(@PathVariable int id, @PathVariable int hid, @NotNull Model model) throws WiseMappingException {
final MindMapBean mindmapBean = findMindmapBean(id);
final MindMapHistory mindmapHistory = mindmapService.findMindmapHistory(id, hid);
mindmapBean.getDelegated().setXml(mindmapHistory.getXml());
model.addAttribute("mindmap", mindmapBean);
final String result = showMindmapEditorPage(id, model);
model.addAttribute("readOnlyMode", true);
return "mindmapEditor";
// Change map XML ....
final MindMapBean mindmapBean = (MindMapBean) model.asMap().get("mindmap");
final MindMapHistory mindmapHistory = mindmapService.findMindmapHistory(id, hid);
mindmapBean.getDelegated().setXml(mindmapHistory.getXml());
return result;
}
@RequestMapping(value = "maps/{id}/embed")

View File

@ -209,7 +209,7 @@ KEYBOARD_SHORTCUTS_MSG=快捷键可以帮助你节约时间,使你的手不必
COPY_AND_PASTE_TOPICS=拷贝和粘贴节点
MULTIPLE_LINES=添加多行长文本
TERM_OF_USE=条款和条件
CONTACT_US=联系我们
FEEDBACK=反馈
SUPPORT=帮助
CONTACT_US=联系我们
FEEDBACK=反馈
SUPPORT=支援

View File

@ -209,7 +209,7 @@ KEYBOARD_SHORTCUTS_MSG=快捷鍵可以幫助你節約時間,使你的手不必
COPY_AND_PASTE_TOPICS=拷貝和粘貼節點
MULTIPLE_LINES=添加多行長文本
TERM_OF_USE=條款和條件
CONTACT_US=聯繫我們
FEEDBACK=反饋
SUPPORT=Âπ´Âä©
CONTACT_US=聯繫我們
FEEDBACK=反饋
SUPPORT=幫助

View File

@ -33,7 +33,9 @@
// Configure designer options ...
var options = loadDesignerOptions();
options.persistenceManager = new mindplot.RESTPersistenceManager("service/maps/{id}/document","service/maps/{id}/history/latest");
<c:if test="${!memoryPersistence}">
options.persistenceManager = new mindplot.RESTPersistenceManager("service/maps/{id}/document", "service/maps/{id}/history/latest");
</c:if>
var userOptions = ${mindmap.properties};
options.zoom = userOptions.zoom;
options.readOnly = ${!!readOnlyMode};