Package org.mycore.frontend.cli
Class MCRBasicCommands
java.lang.Object
org.mycore.frontend.cli.MCRBasicCommands
This class contains the basic commands for MyCoRe Command Line and WebCLI.
- Author:
- Robert Stephan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static boolean
checkXMLFile
(String fileName) The method parse and check an XML file.static void
static void
executeShellCommand
(String command) static void
exit()
static void
static void
Shows a list of commands understood by the command line interface and shows their input syntax.static void
Shows the help text for one or more commands.static void
quit()
readCommandsFile
(String file) static void
static void
static void
static void
static void
whoami()
-
Constructor Details
-
MCRBasicCommands
public MCRBasicCommands()
-
-
Method Details
-
listKnownCommands
@MCRCommand(syntax="help", help="List all possible commands.", order=20) public static void listKnownCommands()Shows a list of commands understood by the command line interface and shows their input syntax. This method implements the "help" command -
listKnownCommandsBeginningWithPrefix
@MCRCommand(syntax="help {0}", help="Show the help text for the commands beginning with {0}.", order=10) public static void listKnownCommandsBeginningWithPrefix(String pattern) Shows the help text for one or more commands.- Parameters:
pattern
- the command, or a fragment of it
-
readCommandsFile
@MCRCommand(syntax="process {0}", help="Execute the commands listed in the text file {0}.", order=30) public static List<String> readCommandsFile(String file) throws IOException - Throws:
IOException
-
exit
@MCRCommand(syntax="exit", help="Stop and exit the commandline tool.", order=40) public static void exit() -
quit
@MCRCommand(syntax="quit", help="Stop and exit the commandline tool.", order=50) public static void quit() -
executeShellCommand
@MCRCommand(syntax="! {0}", help="Execute the shell command {0}, for example \'! ls\' or \'! cmd /c dir\'", order=60) public static void executeShellCommand(String command) throws Exception - Throws:
Exception
-
show
@MCRCommand(syntax="show file {0}", help="Show contents of local file {0}", order=70) public static void show(String file) throws Exception - Throws:
Exception
-
whoami
-
showCommandStatistics
@MCRCommand(syntax="show command statistics", help="Show statistics on number of commands processed and execution time needed per command", order=90) public static void showCommandStatistics() -
cancelonError
@MCRCommand(syntax="cancel on error", help="Cancel execution of further commands in case of error", order=100) public static void cancelonError() -
skipOnError
@MCRCommand(syntax="skip on error", help="Skip execution of failed command in case of error", order=110) public static void skipOnError() -
getURI
@MCRCommand(syntax="get uri {0} to file {1}", help="Get XML content from URI {0} and save it to a local file {1}", order=120) public static void getURI(String uri, String file) throws Exception - Throws:
Exception
-
createConfigurationDirectory
@MCRCommand(syntax="create configuration directory", help="Creates the MCRConfiguration directory if it does not exist.", order=130) public static void createConfigurationDirectory() throws IOException- Throws:
IOException
-
reloadJPAMappings
@MCRCommand(syntax="reload mappings in jpa configuration file", help="retrieves the mapping files from MyCoRe jars and adds them to the jpa configuration file.", order=140) public static void reloadJPAMappings() throws IOException, JDOMException- Throws:
IOException
JDOMException
-
checkXMLFile
@MCRCommand(syntax="check file {0}", help="Checks the data file {0} against the XML Schema.", order=160) public static boolean checkXMLFile(String fileName) throws MCRException, SAXParseException, IOException The method parse and check an XML file.- Parameters:
fileName
- the location of the xml file- Throws:
MCRException
SAXParseException
IOException
-