I am trying everything I can think of but does not seem to work... my last
attempt is the following (saving the jmolGetPropertyAsString("stateInfo")
output into a file):

In the second php:

$ESTADO=$_POST["ESTADO"];
echo "$ESTADO";//IT IS SAVED CORRECTLY HERE
$File = "Jmol-12new/test.sptt";
$f = fopen($File, 'w') or die("Cannot create file $File");
fwrite($f, $ESTADO);
fclose($f);


$JMOL = "<script type=\"text/javascript\">
jmolInitialize(\"Jmol-12new\", true);
jmolSetAppletColor(\"white\");
var jmolcmds = [
\"load $ZIPtoUSE|$PREFIX-Models_$code/$PREFIX-$code.pdb\",
\"set frank off; select all; hbonds off; spin off; wireframe off; spacefill
off; trace off; set ambient 40; set specpower 40; slab off; ribbons off;
cartoons off; label off; monitor off\",
\"set isosurfacePropertySmoothing TRUE\",
\"set showAxes true\",
\"set appendNew true\",
\"frame all\",
\"display all\",
\"select 1.1; cartoon; set propertyColorScheme 'bwr'; color atoms property
temperature ABSOLUTE $range\",
\"script Jmol-12new/myJMOLfunctions.spt\",
\"script Jmol-12new/test.spt\"
];
jmolApplet([580,500], jmolcmds.join(\"; \"));
jmolScriptWait(\"_setState\");
</script>";


Of course this is NOT working... and I'd rather prefer Bob's way with "Jmol
Embedded Script" but I really don't know how to make it work... by the way,
should I keep all the specifications when initializing the applet before the
state script? Thanks a lot to everyone,
Daniel










2011/8/4 Daniel Carbajo <[email protected]>

> OK it seems I am able to pass the jmolGetPropertyAsString("stateInfo")
> value to a new php doing the following (in case anyone is interested):
>
> First php:
> $cont0 .= "<form name=\"PASARCOLORS\" action=\"MODshowCOLORS.php\"
> method=\"POST\" onSubmit='var state=jmolGetPropertyAsString(\"stateInfo\");
> document.PASARCOLORS.ESTADO.value=state;'>";
> $cont0 .= "<input type=\"hidden\" name=\"ESTADO\"></form>";
>
> Second php:
> $ESTADO=$_POST["ESTADO"];
> echo "$ESTADO<br>";
>
> So now I have it inside a variable in the second php... Should I do
> something like:
> $ESTADO="/****Jmol Embedded Script ****".$ESTADO."**/";
> JmolScript($ESTADO);
>
>
> Besides, answering to Rolf's previous question, the new files I want to
> load are exactly the same (just the B-factor records change), except for one
> file, that in the first php contains all chains, and in the second only the
> chain under study, but with the same coordinates and everything... (hope
> this is not a problem). In any case I should parse the $ESTADO variable
> because all pdb file names change, and the labels (though refering to the
> same residues), are slightly different...
> Thanks,
> Daniel
>
>
>
> 2011/8/4 Daniel Carbajo <[email protected]>
>
>> Thanks! I start to understand how this works but I have one problem: I
>> cannot pass the jmolGetPropertyAsString("stateInfo") information from one
>> php page to another... I have tried the following with no success:
>>
>> First php:
>> <input type="hidden" name="STATE\"
>> value='jmolGetPropertyAsString("stateInfo")'>
>>
>> Second php:
>> $STATE=$_POST["STATE"];
>> echo "$STATE<br>";
>>
>> But I get just the command, not the value... So how do you send it to the
>> new page? I am quite new to all this, sorry. And thanks a lot again!
>> Yours,
>> Daniel
>>
>>
>>
>>
>>
>> 2011/8/3 Robert Hanson <[email protected]>
>>
>>> Daniel,
>>>
>>> Yes, jmolGetPropertyAsString("stateInfo") returns the exact information
>>> to use to retrieve the exact state. This is what
>>> http://chemapps.stolaf.edu/jmol/docs/examples-12/JmolPopup.htm uses. If
>>> it does not reproduce the EXACT state, I want to know. (The only caveat is
>>> that labels can move if displayed in an applet that has a different size.)
>>> To use it, just run it with
>>>
>>> script [that filename]
>>>
>>> or send it to the new page as part of the page (I like to use <--
>>> /****Jmol Embedded Script ****   ....  **/ --> comments in the HTML and then
>>> just send the whole page to Jmol with JmolScript (grabbing that with
>>> document.getElementById(...).innerHTML. That works amazingly well, and you
>>> don't have to escape anything. The necessary term is
>>>
>>> /**** Jmol Embedded Script ****
>>>
>>> If Jmol finds that in a file, it reads only the data between that and
>>>
>>> **/
>>>
>>> and skips everything else in the file.
>>>
>>>
>>>
>>> On Wed, Aug 3, 2011 at 10:32 AM, Daniel Carbajo <
>>> [email protected]> wrote:
>>>
>>>> The point is that I have a page where I can load many proteins, change
>>>> them from cartoon to spacefill to whatever, highlight residues in
>>>> wireframe... and then I have a button which redirects to another page which
>>>> is similar, but with different proteins, which are actually the same ones
>>>> but with temperature factor records changed with other descriptors... In
>>>> this second page I want to restore all the settings from the previous
>>>> (proteins loaded, whether they are in cartoon, spacefill, etc., residues
>>>> highlighted, orientation...).
>>>> Which do you think would be the best way to do so?
>>>> Does jmolGetPropertyAsString("stateInfo") return all that information?
>>>> If so, I am not so sure where to put it so it can be used by the second
>>>> page...
>>>> This is my first attempt in php:
>>>> $content .= "<form><button type=\"submit\" onClick='var
>>>> state=jmolGetPropertyAsString(\"stateInfo\");
>>>> alert(state)'>CHECK</button></form>";
>>>> But I do not want a button and an alert... besides the output is cut so
>>>> I do not get to see everything that jmolGetPropertyAsString("stateInfo")
>>>> returns... Any suggestions?
>>>> Thanks again,
>>>> Daniel
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2011/8/3 Rolf Huehne <[email protected]>
>>>>
>>>>> On 08/03/2011 03:04 PM, Daniel Carbajo wrote:
>>>>> > Hello everyone,
>>>>> > is it possible to save a Jmol session in terms of proteins loaded,
>>>>> their
>>>>> > displays (cartoon, spacefill...), residues selected, labels, etc. in
>>>>> one php
>>>>> > page so everything is restored in another? Can I save the session
>>>>> > specifications into a file that is read by another php page? I am
>>>>> trying
>>>>> > with save/restore ORIENTATION saveName, but does not seem to be
>>>>> working.
>>>>> The "save state" command does this.
>>>>> (see
>>>>>
>>>>> http://jena3d.fli-leibniz.de/ImgLibPDB/Jena3D/doc/jmol_scripting/index.htm#save
>>>>> )
>>>>>
>>>>> But you will need the "signed" Jmol applet to be able to write it
>>>>> directly into a file.
>>>>>
>>>>> With the "unsigned" Jmol applet you can open the Jmol console, display
>>>>> the state (by clicking on a button) and copy+paste the state into a
>>>>> text
>>>>> editor and save it into a file.
>>>>> But depending on the combination of Java, browser and operating system
>>>>> version there might be copy+paste problems.
>>>>>
>>>>> With both applet types you could read the state information with
>>>>> javascript and then send the data to a server for storage:
>>>>>
>>>>> state = jmolGetPropertyAsString("stateInfo");
>>>>>
>>>>> Depending on the location of the other PHP page and the directory
>>>>> organization at this site it might be becessary to adapt the state
>>>>> script to the new location before it is loaded properly.
>>>>>
>>>>> Regards,
>>>>> Rolf
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>>>>> The must-attend event for mobile developers. Connect with experts.
>>>>> Get tools for creating Super Apps. See the latest technologies.
>>>>> Sessions, hands-on labs, demos & much more. Register early & save!
>>>>> http://p.sf.net/sfu/rim-blackberry-1
>>>>> _______________________________________________
>>>>> Jmol-users mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>>>> The must-attend event for mobile developers. Connect with experts.
>>>> Get tools for creating Super Apps. See the latest technologies.
>>>> Sessions, hands-on labs, demos & much more. Register early & save!
>>>> http://p.sf.net/sfu/rim-blackberry-1
>>>> _______________________________________________
>>>> Jmol-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>
>>>>
>>>
>>>
>>> --
>>> Robert M. Hanson
>>> Professor of Chemistry
>>> St. Olaf College
>>> 1520 St. Olaf Ave.
>>> Northfield, MN 55057
>>> http://www.stolaf.edu/people/hansonr
>>> phone: 507-786-3107
>>>
>>>
>>> If nature does not answer first what we want,
>>> it is better to take what answer we get.
>>>
>>> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>>> The must-attend event for mobile developers. Connect with experts.
>>> Get tools for creating Super Apps. See the latest technologies.
>>> Sessions, hands-on labs, demos & much more. Register early & save!
>>> http://p.sf.net/sfu/rim-blackberry-1
>>> _______________________________________________
>>> Jmol-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>
>>>
>>
>
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to