Installation Guide
The following article contains information on how to deploy and configure the JavaDocPlus application on your web server. JavaDocPlus can be installed on a PHP 5 web server.Installation on a PHP 5 web server
Before installing JavaDocPlus, please ensure your server supports PHP 5 and has the ionCube Loader installed. For more information on how to install the ionCube Loader on your web site, have a look here:
http://www.ioncube.com/loader_installation.php
Follow these steps to perform the installation:
http://www.ioncube.com/loader_installation.php
Follow these steps to perform the installation:
Download the JavaDocPlus PHP archive. |
Extract the archive content and copy all the files to your web server. |
Edit the file « config.php » and follow the instructions in the file to configure access to your database. |
Run the JavaDocPlus Doclet and create the database tables as you have configured. Look below for instructions on how to run the Doclet. |
Open your web browser and go to the URL corresponding to the folder where you have copied the PHP files. Your documentation will be there. |
Running the JavaDocPlus Doclet
The JavaDocPlus Doclet uses the standard JavaDoc engine to parse your Java source files. The Doclet generates an SQL script file that you can use to create and fill the database tables used by JavaDocPlus.
To run the Doclet, locate the JAR file « javadocplusdoclet.jar » distributed in the JavaDocPlus archive. Add the following doclet parameters to your javadoc.exe command line:
After running the javadoc.exe command line, a file named « jdp_database.sql » will be created in the current directory. This file contains the SQL script you need to run on your database to create the JavaDocPlus tables.
To run the Doclet, locate the JAR file « javadocplusdoclet.jar » distributed in the JavaDocPlus archive. Add the following doclet parameters to your javadoc.exe command line:
> javadoc.exe -doclet com.moyosoft.jdplus.doclet.JdpDoclet -docletpath javadocplusdoclet.jar ...
After running the javadoc.exe command line, a file named « jdp_database.sql » will be created in the current directory. This file contains the SQL script you need to run on your database to create the JavaDocPlus tables.
Customizing style
To change the appearence of the JavaDocPlus pages, edit the file « jdp.css » distributed in the JavaDocPlus archive. This file defines the CSS styles for the fonts, colors and menus. The CSS rules are documented in this file.
Web site integration
You can use the JavaDocPlus component within your own PHP script to integrate it to your web site. You'll need to
create a new instance of the JavaDocPlus class:
And call the following methods:
You also need to include the CSS and JavaScript files in the head of your web page:
Please have a look at the JavaDocPlus « index.php » file for an example code.
$jdp = new JavaDocPlus();
And call the following methods:
$jdp->prepare(); | This method initializes the JavaDocPlus component. It has to be called at the begining of your script before any content is sent out. This method may modify the HTTP headers to redirect the user to another page. |
echo $jdp->createHeadContent(); | This method returns the <head> content. Include the content to the <head> section of your web page. Also please make sure the « jdp.js » file was included in your script before the output of this method. |
echo $jdp->createBodyContent(); | This method returns the <body> content. Print the content to where you'd like the JavaDocPlus to be displayed. Note that the whole body content is packaged in a <div> like that:<div class="jdp_body">...</div> |
$jdp->dispose(); | This method releases resources and closes the connection to the database. Call this method at the end of your PHP script. |
You also need to include the CSS and JavaScript files in the head of your web page:
<link rel="stylesheet" href="jdp.css" type="text/css" media="all"></link>
<script language="JavaScript" src="jdp.js" type="text/javascript"></script>
Please have a look at the JavaDocPlus « index.php » file for an example code.
URL handling
JavaDocPlus uses a single URL path. To access different pages, the following query string parameters are used:
Note that JavaDocPlus keeps all other query string parameters when generating links. Therefore if you integrate JavaDocPlus in a page accessible for example by /path/?showpage=documentation, JavaDocPlus will keep the existing parameter and append the « docclass » and « docmember » parameters.
docclass=com.example.MyClass | Specifies the class or interface page to be displayed. |
docmember=getName | Specifies the method or field of a class to be displayed, the "docclass" parameter is also required. |
docclass=all | Displays a listing of all classes. |
<no parameters> | Displays the overview page. |
Note that JavaDocPlus keeps all other query string parameters when generating links. Therefore if you integrate JavaDocPlus in a page accessible for example by /path/?showpage=documentation, JavaDocPlus will keep the existing parameter and append the « docclass » and « docmember » parameters.
Database structure
The PHP version of JavaDocPlus uses ADODB (http://adodb.sourceforge.net/) to access the database containing the documentation. ADODB supports MySQL, PostgreSQL and more. For a full list of supported databases, have a look here.
All JavaDocPlus tables names are prefixed with "jdp_". The following tables are used:
All JavaDocPlus tables names are prefixed with "jdp_". The following tables are used:
jdp_overview | Contains the overview text displayed on the main page. To specify an overview text, use the javadoc.exe -overview parameter. |
jdp_class | Contains all classes, interfaces, enums and annotations. |
jdp_class_link | Contains information on classes hierarchy. |
jdp_member | Contains all members (methods, fields, etc.) of a given class. |
jdp_member_param | Contains parameters of a given method. |
jdp_post | Contains comments posted by users. This table should not be regenerated. It is also recommended to backup the content of this table as it can't be regenerated from your source code comments. |
If you have any questions, please don't hesitate to contact us: info@moyosoft.com