User 956e0ca334
25-01-2010 16:15:22
Hi there,
I hope you can give me some help on some mol file recognition. I have put an applet on a page, where 'structureText' is a hidden field holding a structure that had been previously generated using marvin sketch. (Marvin applets version 5.1.3) I try to reload inot the Marvin sketch. This page works perfectly on IE or Firefox on a PC. But on a mac gives the following error message shown below saying it does not recognise the file format.
The hidden value is read into marvin using your function
msketch_param("mol",local2unix(MarvinForm.structureText.value))
Rather implies local2unix function is not working correctly on a Mac?
Could you tell me exactly how I should change the contents of this hidden field so I can get it to be recognized on both platforms.
Thanks
Megan
++++++++++++++++ERROR MESSAGE+++++++++++++++++++++++++++++++++
chemaxon.formats.MolFormatException: Cannot recognize format (?)
Unrecognized file contents:
Marvin 01251015022D
10 11 0 0 0 0 999 V2000
...
at chemaxon.formats.recognizer.RecognitionSubsystem.getFormat(Unknown Source)
at chemaxon.formats.MolInputStream.b(Unknown Source)
at chemaxon.formats.MolInputStream.a(Unknown Source)
at chemaxon.formats.MolInputStream.<init>(Unknown Source)
at chemaxon.marvin.util.MolLoader.a(Unknown Source)
at chemaxon.marvin.util.MolLoader.run(Unknown Source)
at chemaxon.marvin.common.swing.MolPanel.startLoader(Unknown Source)
at chemaxon.marvin.sketch.swing.SketchPanel.molStart(Unknown Source)
at chemaxon.marvin.common.swing.MolPanel.init(Unknown Source)
at chemaxon.marvin.common.swing.MolPanel.init(Unknown Source)
at JMSketch.a(Unknown Source)
at JMSketch.a(Unknown Source)
at JMSketch$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at jep.MySimpleEventQueue.dispatchEvent(MySimpleEventQueue.java:59)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
+++++++++++++++++++++++++++++++++++++++++
<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="util" uri="/WEB-INF/tfi-util.tld" %>
<%@taglib prefix="c" uri="/WEB-INF/c.tld" %>
<%@taglib prefix="fmt" uri="/WEB-INF/fmt.tld" %>
<%@taglib prefix="tiles" uri="/WEB-INF/struts-tiles.tld" %>
<%@taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
<!-- find the product type by looking at the url -->
<jsp:useBean id="productDeployment" class="com.tfi.deployment.ProductDeployment" scope="request" />
<jsp:setProperty name="productDeployment" property="platform" value="<%= getServletConfig().getServletContext().getInitParameter(\"platform\") %>" />
<bean:define id="platform"><jsp:getProperty name="productDeployment" property="platform" /></bean:define>
<c:set var="chemAxonPath">
<util:string name="${platform}.chemAxonPath"/>
</c:set>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Structure Sketch</title>
<script type="text/javascript" language="JavaScript">
function submitIfLoaded(whatToDo)
{
MarvinForm.structureText.value = document.MSketch.getMol('mol');
if(opener.document.MView != null) {
var s = MarvinForm.structureText.value ;
var opts=null;
//copy to the marvin view window so users can edit
opener.document.MView.setMol(s, opts);
opener.document.savePropertiesForm.structureText.value=s;
} else {
alert("Cannot import molecule:\n"+
"no JavaScript to Java communication in your browser.\n");
}
}
</script>
</head>
<body>
<c:url value="/marvin.do" var="saveStructure">
<c:param name="id" value="${search.id}"/>
<c:param name="method" value="saveStructure"/>
</c:url>
<form id="MarvinForm" name="MarvinForm" method="POST" action="${saveStructure}" >
<input type="hidden" name="structureText" value="
Marvin 01251015022D
10 11 0 0 0 0 999 V2000
-1.4143 -0.2652 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.1287 0.1473 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.8433 -0.2652 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.8433 -1.0902 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.1287 -1.5027 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.4143 -1.0902 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.6998 -1.5027 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
0.0147 -1.0902 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0147 -0.2652 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.6998 0.1473 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 6 2 0 0 0 0
1 10 1 0 0 0 0
2 3 2 0 0 0 0
3 4 1 0 0 0 0
4 5 2 0 0 0 0
5 6 1 0 0 0 0
6 7 1 0 0 0 0
7 8 2 0 0 0 0
8 9 1 0 0 0 0
9 10 2 0 0 0 0
M END
"/>
<input type="hidden" name="chemAxonPath" value="${chemAxonPath}"/>
<script LANGUAGE="JavaScript1.1" SRC="${chemAxonPath}marvin/marvin.js"></script>
<script LANGUAGE="JavaScript1.1">
<!--
function undo() {
if(document.MSketch != null) {
document.MSketch.undo();
}
}
function redo() {
if(document.MSketch != null) {
document.MSketch.redo();
}
}
msketch_name = "MSketch";
msketch_begin(MarvinForm.chemAxonPath.value +'marvin', 540, 480);
msketch_param("mol",local2unix(MarvinForm.structureText.value));
msketch_end();
//-->
</script>
<table cellspacing="10" border=0 cellpadding="2"><tr><td>
<a href="#" onClick="javascript:submitIfLoaded('');document.MarvinForm.submit();self.close();">
<img src="<c:url value='/common/images/GreenArrow.gif'/>" width="193" height="28" align="top" border="0"></a>
</td><td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Click here to add structure to search query </font>
</td></tr>
</table>
</form>
</body>
</html>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++ i