madkit.pluginmanager.actions
Class AddDocumentationReference

java.lang.Object
  extended by madkit.pluginmanager.actions.AddDocumentationReference
All Implemented Interfaces:
Action

public class AddDocumentationReference
extends java.lang.Object
implements Action

Adds a link in the documentation index of Madkit.
The documentation index is divided by sections. Sections can be added at will, however we encourage you to use on of the following sections:



The required arguments for this actions are:
This action is recognized as: adddocumentationreference
adddocref
docref

Version:
$Revision: 1.3 $
Author:
Sebastian Rodriguez - sebastian.rodriguez@utbm.fr

Field Summary
protected  java.io.File _madkitDir
           
 
Constructor Summary
AddDocumentationReference(java.io.File madkitDirectory, java.lang.String plugin, Version pluginVersion)
           
 
Method Summary
protected  void debug(java.lang.String str)
           
 boolean execute()
          Request the action to execute.
static void generateHtmlDocumentation(java.io.File madkitDirectory)
          Creates the Madkit Html Documentation index.
 java.lang.String getFailureReason()
          Gets the failure reason.
 java.util.Collection getMandatoryParameters()
          Get the Madatory parameters needed by the action to execute
 java.lang.String getName()
          Gets the action name.
 java.util.Collection getOptionalParameters()
          Get the Optional/b> parameters needed by the action to execute
 java.lang.String getOwnerPlugin()
          Gets the name of the plugin owner of this action
 Version getOwnerPluginVersion()
          Gets the version of the plugin owner of this action
 java.lang.String getQuestionToUser()
          If showAskUser() returns true, this method is called to get the Question.
protected  Document openXMLDocument(java.io.File file)
           
static void removePlugin(java.io.File madkitDirectory, java.lang.String plugin, Version pluginVersion)
           
 java.util.Collection requiredPlugins()
          Gets the required plugins to execute this action.
 void setParamenters(java.util.Properties params)
          Sets the parameters obtained from the plugin xml file.
 boolean shouldAskUser()
          Should the Plugin Manager ask for user confirmation before executing the action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface madkit.pluginmanager.Action
getName, getOwnerPlugin, getOwnerPluginVersion
 

Field Detail

_madkitDir

protected java.io.File _madkitDir
Constructor Detail

AddDocumentationReference

public AddDocumentationReference(java.io.File madkitDirectory,
                                 java.lang.String plugin,
                                 Version pluginVersion)
Method Detail

requiredPlugins

public java.util.Collection requiredPlugins()
Description copied from interface: Action
Gets the required plugins to execute this action.

Specified by:
requiredPlugins in interface Action
Returns:

getMandatoryParameters

public java.util.Collection getMandatoryParameters()
Description copied from interface: Action
Get the Madatory parameters needed by the action to execute

Specified by:
getMandatoryParameters in interface Action
Returns:
a collection of Strings with the paraments names
See Also:
Action.getOptionalParameters()

getOptionalParameters

public java.util.Collection getOptionalParameters()
Description copied from interface: Action
Get the Optional/b> parameters needed by the action to execute

Specified by:
getOptionalParameters in interface Action
Returns:
a collection of Strings with the paraments names
See Also:
Action.getMadatoryParameters()

setParamenters

public void setParamenters(java.util.Properties params)
Description copied from interface: Action
Sets the parameters obtained from the plugin xml file. params will contain both, mandatory and optional parameters

Specified by:
setParamenters in interface Action
Parameters:
params - set of parameters

execute

public boolean execute()
Description copied from interface: Action
Request the action to execute.

Specified by:
execute in interface Action
Returns:
true if and only if the action execution was successful

getFailureReason

public java.lang.String getFailureReason()
Description copied from interface: Action
Gets the failure reason. This method will be called only if execute return false

Specified by:
getFailureReason in interface Action
Returns:
failure reason

generateHtmlDocumentation

public static final void generateHtmlDocumentation(java.io.File madkitDirectory)
                                            throws java.io.IOException
Creates the Madkit Html Documentation index.

Parameters:
madkitDirectory -
Throws:
java.io.IOException

removePlugin

public static final void removePlugin(java.io.File madkitDirectory,
                                      java.lang.String plugin,
                                      Version pluginVersion)
                               throws java.io.IOException
Throws:
java.io.IOException

shouldAskUser

public boolean shouldAskUser()
Description copied from interface: Action
Should the Plugin Manager ask for user confirmation before executing the action.

Specified by:
shouldAskUser in interface Action
Returns:
true if the action requires user confirmation.

getQuestionToUser

public java.lang.String getQuestionToUser()
Description copied from interface: Action
If showAskUser() returns true, this method is called to get the Question. Please formulate your question so that "yes" means execute the Action

Specified by:
getQuestionToUser in interface Action
Returns:

getOwnerPlugin

public java.lang.String getOwnerPlugin()
Description copied from interface: Action
Gets the name of the plugin owner of this action

Specified by:
getOwnerPlugin in interface Action
Returns:

getOwnerPluginVersion

public Version getOwnerPluginVersion()
Description copied from interface: Action
Gets the version of the plugin owner of this action

Specified by:
getOwnerPluginVersion in interface Action
Returns:

getName

public java.lang.String getName()
Description copied from interface: Action
Gets the action name.

Specified by:
getName in interface Action
Returns:
Action name

openXMLDocument

protected Document openXMLDocument(java.io.File file)
                            throws SAXException,
                                   java.io.IOException,
                                   javax.xml.parsers.ParserConfigurationException,
                                   javax.xml.parsers.FactoryConfigurationError
Throws:
SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.FactoryConfigurationError

debug

protected void debug(java.lang.String str)


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.