Goh, Swee-Doon (GPMS) wrote:
>
> I have a question about implementing the auto-save feature in the
> applet. I know it is available in the preference for running it as a
> desktop app. Is it possible to achieve the same feature in the applet
> (Editor 1, Editor 2)?
>
--> For Editor2, which knows how to save the edited XML document to a
WebDAV, FTP or SFTP server, the answer is yes.
For Editor1, the answer is no. Editor1 has no "Save" button or menu
item. Saving the XML document opened in Editor1 is expected to be
scripted in JavaScript.
--> How to enable this feature in Editor2:
[1] Notice that:
<part name="autoSavePart" />
is referenced in the <layout> element of the Editor2.xxe_gui file.
---
<layout>
<hidden>
<insert />
<part name="autoSavePart" />
</hidden>
</layout>
---
Without this specific part, there is to way to force the auto-save user
preference.
[2] Now you need to force the auto-save user preference by specifying
the proper ``command-line arguments'' in the parameters of the Applet.
Example:
---
<applet name="XXE" id="XXE" mayscript="true"
code="com.xmlmind.xmleditapp.applet.Applet"
width="100%" height="600">
<param name="jnlp_href" value="xxe.jnlp" />
<param name="appClass"
value="com.xmlmind.xmleditapp.applet.Editor2App" />
<param name="separate_jvm" value="true" />
<param name="classloader_cache" value="false" />
<param name="argument0" value="-putpref" />
<param name="argument1" value="autoSaveInterval" />
<param name="argument2" value="500" />
<param name="argument3" value="-putpref" />
<param name="argument4" value="autoSaveTimeout" />
<param name="argument5" value="60" />
</applet>
---
The two above user preferences autoSaveInterval and autoSaveTimeout are
documented here:
http://www.xmlmind.com/xmleditor/_distrib/doc/help/com.xmlmind.guiutil.PreferencesEditorDialog.html#saveOptions
See also
http://www.xmlmind.com/xmleditor/_distrib/doc/help/command_line_usage.html
to learn about command-line option "-putpref".
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support