User 870ab5b546
21-01-2016 15:12:01
Trying to get an MRV out of this drawing in Marvin JS:
<cml><MDocument><MChemicalStruct><molecule molID="m1"><atomArray><atom id="a1" elementType="C" x2="-6.159999847412109" y2="2.0693750083446503"/><atom id="a2" elementType="C" x2="-5.389999847412109" y2="0.7356958865166148" formalCharge="1"/><atom id="a3" elementType="C" x2="-6.1599998474121085" y2="-0.597983235311421"/><atom id="a4" elementType="N" x2="-3.849999847412109" y2="0.7356958865166148" lonePair="1"/><atom id="a5" elementType="C" x2="-3.0799998474121084" y2="-0.5979832353114207"/><atom id="a6" elementType="C" x2="-3.0799998474121084" y2="2.0693750083446503"/><atom id="a7" elementType="C" x2="2.0212499713897705" y2="2.007429105138735"/><atom id="a8" elementType="C" x2="2.791249971389771" y2="0.6737499833106997"/><atom id="a9" elementType="C" x2="2.0212499713897714" y2="-0.659929138517336"/><atom id="a10" elementType="N" x2="4.331249971389771" y2="0.6737499833106997" formalCharge="1"/><atom id="a11" elementType="C" x2="5.101249971389771" y2="-0.6599291385173358"/><atom id="a12" elementType="C" x2="5.101249971389771" y2="2.007429105138735"/></atomArray><bondArray><bond atomRefs2="a1 a2" order="1" id="b1"/><bond atomRefs2="a2 a3" order="1" id="b2"/><bond atomRefs2="a2 a4" order="1" id="b3"/><bond atomRefs2="a4 a5" order="1" id="b4"/><bond atomRefs2="a4 a6" order="1" id="b5"/><bond atomRefs2="a7 a8" order="1" id="b6"/><bond atomRefs2="a8 a9" order="1" id="b7"/><bond atomRefs2="a8 a10" order="2" id="b8"/><bond atomRefs2="a10 a11" order="1" id="b9"/><bond atomRefs2="a10 a12" order="1" id="b10"/></bondArray></molecule></MChemicalStruct><MElectronContainer occupation="1 1" radical="0" id="o1"><MElectron atomRefs="m1.a4" difLoc="0.0 0.0 0.0"/><MElectron atomRefs="m1.a4" difLoc="0.0 0.0 0.0"/></MElectronContainer><MEFlow id="o2" arcAngle="270" baseElectronContainerIndex="0" baseElectronIndexInContainer="-1"><MEFlowBasePoint atomRef="m1.a4"/><MAtomSetPoint atomRefs="m1.a2 m1.a4"/></MEFlow><MRectangle lineColor="#000000" id="o3"><MPoint x="-7.349999904632568" y="-2.0999999046325684"/><MPoint x="-1.8083332777023315" y="-2.0999999046325684"/><MPoint x="-1.8083332777023315" y="3.616666555404663"/><MPoint x="-7.349999904632568" y="3.616666555404663"/></MRectangle><MRectangle lineColor="#000000" id="o4"><MPoint x="0.7291671633720398" y="-2.0999999046325684"/><MPoint x="6.270833790302277" y="-2.0999999046325684"/><MPoint x="6.270833790302277" y="3.616666555404663"/><MPoint x="0.7291671633720398" y="3.616666555404663"/></MRectangle><MPolyline headLength="0.6" headWidth="0.4" tailLength="0.6" tailWidth="0.4" tailFlags="1" id="o5"><MPoint x="-1.8083332777023315" y="0.7583333253860474"/><MRectanglePoint rectRef="o4" pos="7"/></MPolyline></MDocument></cml>
I get these errors in the Javascript console:
[Error] Failed to load resource: The network connection was lost. (answerframe.jsp, line 0)
[Error] Failed to load resource: the server responded with a status of 400 (Bad Request) (molExport, line 0)
Happens on both Chrome for PC and Safari for Mac. No such problem when I submit the same structure without the electron-flow arrow. ???
Could this problem be related to this one? If so, will upgrading Java WebServices solve the problem?
Using MarvinJS 15.12.14.
Javascript code is:
function callServer(evaluate) {
marvinSketcherInstance.exportStructure('mrv').then(function(source) {
if (marvinSketcherInstance.getStructureInfo
&& marvinSketcherInstance.getStructureInfo().
atomCount === 0) {
toAlert('ACE could not acquire your response to this question. Please submit a response that is not empty.');
return;
} // if response is empty
if (navigator.appName.toUpperCase().match(/NETSCAPE/)) { // breaks on Internet Explorer
if (getSelection().removeAllRanges) { // must check availability for Safari
getSelection().removeAllRanges(); // unselect for Firefox
} // if can remove all ranges
} // if browser
var submissionBld = new String.builder();
var selections = '';
var rxnIds = null;
selections =
marvinSketcherInstance.getSelection()['atoms'];
var molstruct =
source;
// alert('got molstruct from applet:\n' + molstruct);
if (molstruct.indexOf('mrvAlias') >= 0 && true) {
toAlert('You probably meant to add a shortcut group such as Ph or Et to your structure, but you added an atom alias instead. (Aliases and shortcut groups look alike, but ACE cannot interpret aliases properly.) To replace the alias with a shortcut group, type the name of the shortcut group in the Marvin window (not in the textbox in the More window), then click on the alias.');
return;
} // if response contains an alias
if (molstruct.indexOf('z3=') > 0
&& (molstruct.indexOf('<bondStereo>W') > 0
|| molstruct.indexOf('<bondStereo>H') > 0)) {
if (!toConfirm('Your response appears to be in 3D mode and to contain stereo bonds such as bold or hashed wedges. When a drawing is in 3D mode, ACE ignores the stereochemical information conveyed by stereo bonds. Do you still want to submit your response?')) {
toAlert('To convert your drawing back into 2D mode, either click on "3D" in the lower left corner of the applet, or choose Structure → Clean 2D → Clean in 2D. Then you can redraw your wedge bonds.');
return;
} // if no confirm
} // if response is in 3D and has wedge bonds
submissionBld.append(molstruct);
var submissionStr = submissionBld.toString();
// alert('submission =\n' + submissionStr);
if (isEmpty(submissionStr)) {
toAlert('ACE could not acquire your response to this question. Please submit a response that is not empty.');
return;
} // if response is empty string
var toSend = new String.builder();
toSend.append('submission=').
append(encodeURIComponent(submissionStr));
// evaluate is false for save without submitting
toSend.append('¤tQNum=4&haveNewResponse=true'
+ '&evaluate=').append(evaluate);
if (!isEmpty(selections)) toSend.append('&selections=').append(selections);
if (!isEmpty(rxnIds)) toSend.append('&rxnIds=').append(rxnIds);
// alert('calling 'answerframe.jsp' with params ' + toSend.toString());
setInnerHTML('submitCell', '<span class="boldtext">Processing... Please wait...<\/span>');
clearInnerHTML('statusText');
clearInnerHTML('status2Text');
clearInnerHTML('feedbackText');
callAJAX('answerframe.jsp', toSend.toString());
}, function(error) {
alert('Molecule export failed:' + error);
});
} // callServer