Extension:Java Applet

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
Java Applet
Release status: beta
Implementation Tag
Description Add java applets to a wiki
Author(s)
Latest version 2.0 (2013-06-02)
MediaWiki Tested on 1.22beta
Database changes No
License CCPL
Download
README
Tags
<java_applet>
Added rights
javaapplet
Hooks used
ParserFirstCallInit
UploadVerifyFile
Translate the Java Applet extension if it is available at translatewiki.net
Check usage and version matrix.

The Java Applet extension allows users with the 'javaapplet' right to upload Java applets (class and jar files), which can then be inserted into pages by anyone using the <java_applet> tag.

Usage[edit]

Arguments[edit]

  • code, java class file (required)
  • width, applet width (required)
  • height, applet height (required)
  • archive, jar file name (required)

Example[edit]

<java_applet code="File:PegGame.class"  height="150" width="150" archive="File:PegGame.jar" />

Installation[edit]

First, ensure that MediaWiki enables Java uploads by setting

$wgFileExtensions = array_merge( $wgFileExtensions, array( 'class', 'jar' ) );
$wgAllowJavaUploads = true;

To install, download and extract the .zip snapshot in your extensions directory or clone https://github.com/TK-999/mw-ext-JavaApplet into your extensions directory. To import the extension, add

require_once( "$IP/extensions/JavaApplet/JavaApplet.php" );

to your LocalSettings.php file.

The extension only allows users with the 'javaapplet' right—by default, sysops—to upload .class and .jar files. You can adjust this by adding this right to other groups after require_once( "$IP/extensions/JavaApplet/JavaApplet.php" ); in LocalSettings.php:

require_once( "$IP/extensions/JavaApplet/JavaApplet.php" );
$wgGroupPermissions['ninjas']['javaapplet'] = true;

To Do[edit]

Automatically detect the 'code' value from jar files with properly setup manifests.