Difference between revisions of "MediaWiki/Installation"

From Jmol
Jump to navigation Jump to search
(a separate page for collecting installation instructions (not available any more on MW))
 
(a separate page for collecting installation instructions (not available any more on MW))
Line 8: Line 8:
 
'''Note:''' Version 5 of the Jmol Extension has been tested against MediaWiki 1.32. There are significant changes in MediaWiki, so this procedure will not work with older versions.
 
'''Note:''' Version 5 of the Jmol Extension has been tested against MediaWiki 1.32. There are significant changes in MediaWiki, so this procedure will not work with older versions.
  
To install the Jmol extension:
+
== To install the Jmol extension using Jmol 14: ==
# Download the [https://sourceforge.net/projects/jmol/files/Jmol/ latest release] of [[:en:Jmol|Jmol]] (<code>Jmol-xx.xx.xx-binary.zip</code>) You need version 14.29.32 or later.
+
# Download the [https://sourceforge.net/projects/jmol/files/Jmol/ latest release] of [[:en:Jmol|Jmol]] (<code>Jmol-14.xx.xx-binary.zip</code>) You need version 14.29.32 or later.
 
# Extract into a temporary location the <code>jsmol.zip</code> file from the Jmol release.
 
# Extract into a temporary location the <code>jsmol.zip</code> file from the Jmol release.
 
# Create a <code>Jmol</code> folder in the <code>extensions</code> folder of your MediaWiki installation.
 
# Create a <code>Jmol</code> folder in the <code>extensions</code> folder of your MediaWiki installation.
Line 15: Line 15:
 
#* the <code>JSmol.min.js</code> file,
 
#* the <code>JSmol.min.js</code> file,
 
#* the <code>JSmol.GLmol.min.js</code> file,
 
#* the <code>JSmol.GLmol.min.js</code> file,
#* the <code>j2s</code>, <code>php</code> and <code>idioma</code> folders.
+
#* the <code>j2s</code>, <code>php</code> and <code>idioma</code> folders ''(the latter one may not exist in latest Jmol versions)''.
# If you want users to have the option of using the Java applet modality of Jmol:
 
## create a <code>java</code> subfolder inside the <code>extensions/Jmol</code> folder
 
## go back to the Jmol release <code>zip</code> file and extract from its <code>applet</code> folder all files which name starts with <code>JmolAppletSigned0</code> (that's currently 23 files)
 
 
# Download all the [http://sourceforge.net/p/jmol/code/HEAD/tree/trunk/Jmol-extensions/wiki/MediaWiki/ source files of the Jmol extension] and place them in the <code>extensions/Jmol</code> folder.
 
# Download all the [http://sourceforge.net/p/jmol/code/HEAD/tree/trunk/Jmol-extensions/wiki/MediaWiki/ source files of the Jmol extension] and place them in the <code>extensions/Jmol</code> folder.
# Add the following line to your [[Manual:LocalSettings.php|LocalSettings.php file]] (near the end):
+
# Add the following line to your [https://www.mediawiki.org/wiki/Manual:LocalSettings.php LocalSettings.php file] (near the end):
::<syntaxhighlight lang="php">
+
::<code>require_once("extensions/Jmol/Jmol.php");</code>
require_once("extensions/Jmol/Jmol.php");
 
</syntaxhighlight>
 
  
 +
== To install the Jmol extension using Jmol 16: ==
 +
# Download the [https://sourceforge.net/projects/jmol/files/Jmol/ latest release] of [[:en:Jmol|Jmol]] (<code>Jmol-16.xx.xx-binary.zip</code>) Good compatibility may be expected, but has not been tested yet.
 +
# Extract into a temporary location the <code>jsmol.zip</code> file from the Jmol release.
 +
# Create a <code>Jmol</code> folder in the <code>extensions</code> folder of your MediaWiki installation.
 +
# Extract into this <code>Jmol</code> folder the following contents from the <code>jsmol.zip</code> file (all located inside a <code>jsmol</code> subfolder):
 +
#* the <code>JSmol.min.js</code> file,
 +
#* the <code>JSmol.GLmol.min.js</code> file,
 +
#* the <code>j2s</code> and <code>php</code> folders.
 +
# Download all the [http://sourceforge.net/p/jmol/code/HEAD/tree/trunk/Jmol-extensions/wiki/MediaWiki/ source files of the Jmol extension] and place them in the <code>extensions/Jmol</code> folder.
 +
# Add the following line to your [https://www.mediawiki.org/wiki/Manual:LocalSettings.php LocalSettings.php file] (near the end):
 +
::<code>require_once("extensions/Jmol/Jmol.php");</code>
 +
 +
 +
== Further stpes ==
  
  

Revision as of 19:20, 22 April 2024

Installation of the Jmol (JSmol) Extension for Mediawiki

(This must be done by the wiki administrator.)

The files forming the Jmol Extension are part of the Jmol source code and may hence be retrieved from the SVN system.

arrangement of folders and files of the Jmol Extension

Note: Version 5 of the Jmol Extension has been tested against MediaWiki 1.32. There are significant changes in MediaWiki, so this procedure will not work with older versions.

To install the Jmol extension using Jmol 14:

  1. Download the latest release of Jmol (Jmol-14.xx.xx-binary.zip) You need version 14.29.32 or later.
  2. Extract into a temporary location the jsmol.zip file from the Jmol release.
  3. Create a Jmol folder in the extensions folder of your MediaWiki installation.
  4. Extract into this Jmol folder the following contents from the jsmol.zip file:
    • the JSmol.min.js file,
    • the JSmol.GLmol.min.js file,
    • the j2s, php and idioma folders (the latter one may not exist in latest Jmol versions).
  5. Download all the source files of the Jmol extension and place them in the extensions/Jmol folder.
  6. Add the following line to your LocalSettings.php file (near the end):
require_once("extensions/Jmol/Jmol.php");

To install the Jmol extension using Jmol 16:

  1. Download the latest release of Jmol (Jmol-16.xx.xx-binary.zip) Good compatibility may be expected, but has not been tested yet.
  2. Extract into a temporary location the jsmol.zip file from the Jmol release.
  3. Create a Jmol folder in the extensions folder of your MediaWiki installation.
  4. Extract into this Jmol folder the following contents from the jsmol.zip file (all located inside a jsmol subfolder):
    • the JSmol.min.js file,
    • the JSmol.GLmol.min.js file,
    • the j2s and php folders.
  5. Download all the source files of the Jmol extension and place them in the extensions/Jmol folder.
  6. Add the following line to your LocalSettings.php file (near the end):
require_once("extensions/Jmol/Jmol.php");


Further stpes

You can configure the Jmol extension with several settings added after the above line (default value in bold):

  • $wgJmolAuthorizeChoosingSignedApplet (true, false) : Authorize users to choose between the unsigned and the signed Jmol applet.
  • $wgJmolAuthorizeUploadedFile (true, false) : Authorize the use of <uploadedFileContents>.
  • $wgJmolAuthorizeUrl (true, false) : Authorize the use of <urlContents>.
  • $wgJmolDefaultAppletSize (400) : Size in pixels of the Jmol applet.
  • $wgJmolDefaultScript : Default script.
  • $wgJmolExtensionPath (extensions/Jmol) : Path to the directory where the Jmol extension is installed. This must be an absolute path, therefore if you customize it, make sure it is prepended with $wgScriptPath (see example in Jmol.php).
  • $wgJmolForceNameSpace : Force the NameSpace where the applet will go looking for wiki pages containing molecular data (using <wikiPageContents>).
  • $wgJmolShowWarnings (true, false) : Display warnings when users try to use disabled features.
  • $wgJmolUsingSignedAppletByDefault (true, false) : Choose if the signed Jmol applet will be used by default. Note: the signed Jmol applet is signed with a default certificate. If you want to use the signed Jmol applet in your wiki, I suggest resigning the Jmol applet with your own certificate.


Note: If you want to authorize users to upload files containing molecular data (for using the <uploadedFileContents> tag), you need to do the following:

  • By default, MediaWiki authorizes the uploading of files whose name ends with a limited number of extensions. For example, if you want to authorize uploading File icon.gif*.cml files, add $wgFileExtensions[] = 'cml'; in File icon.gifLocalSettings.php.
  • You can add an icon in the skins/common/images/icons/ directory for each extension (for example, File icon.giffileicon-cml.png). In this wiki, we are using this image, which leads to the following result.

Deprecated

Installation of the Jmol extension was described on the Jmol extension page on MediaWiki.

That page has been removed since the Jmol Extension is not compatible with recent versions of MediaWiki.

Contributors

AngelHerraez