@@ -0,0 +1,3256 @@
+/**%0A * Copyright (c) 2016, German Neuroinformatics Node (G-Node)%0A *%0A * All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted under the terms of the BSD License. See%0A * LICENSE file in the root of the Project.%0A */%0A%0Apackage org.g_node.reporter.LKTLogbook;%0A%0Aimport org.apache.commons.cli.CommandLine;%0Aimport org.apache.commons.cli.Option;%0Aimport org.apache.commons.cli.Options;%0Aimport org.g_node.micro.commons.CliToolController;%0A%0A/**%0A * Class handling how to fetch reports from an RDF file specific to the LKT Logbook use case of Kay Thurley.%0A   *%0A * @author Michael Sonntag (sonntag@bio.lmu.de)%0A */%0Apublic class CliLKTController implements CliToolController %7B%0A    /**%0A     * Method returning the commandline options of the LKT reporter tool.%0A     *%0A     * @return Available %7B@link CommandLine%7D %7B@link Options%7D.%0A     */%0A    public final Options options() %7B%0A%0A        final Options options = new Options();%0A%0A        final Option opHelp = new Option(%22h%22, %22help%22, false, %22Print this message.%22);%0A%0A        final String inDesc = String.join(%22%22,%0A                %22RDF file containing the main database. %22,%0A                %22Data for the required report will be fetched from this file.%22);%0A%0A        final Option opInRdfFile = Option.builder(%22i%22)%0A                .longOpt(%22input-rdf%22)%0A                .desc(inDesc)%0A                .required()%0A                .hasArg()%0A                .valueSeparator()%0A                .build();%0A%0A        // TODO implement available reports%0A        final String reportDesc = String.join(%22%22,%0A                %22Reports available to the selected tool.%22);%0A%0A        final Option opReport = Option.builder(%22r%22)%0A                .longOpt(%22report%22)%0A                .desc(reportDesc)%0A                .required()%0A                .hasArg()%0A                .valueSeparator()%0A                .build();%0A%0A        final String outDesc = String.join(%22%22,%0A                %22Optional: Path and name of the output file. %22,%0A                %22Files with the same name will be overwritten. %22);%0A%0A        final Option opOut = Option.builder(%22o%22)%0A                .longOpt(%22out-file%22)%0A                .desc(outDesc)%0A                .hasArg()%0A                .valueSeparator()%0A                .build();%0A%0A        final String formatDesc = String.join(%22%22,%0A                %22Optional: format of the report file that will be written.%5Cn%22,%0A                %22%5CnDefault setting is the CSV format.%22);%0A%0A        final Option opFormat = Option.builder(%22f%22)%0A                .longOpt(%22out-format%22)%0A                .desc(formatDesc)%0A                .hasArg()%0A                .valueSeparator()%0A                .build();%0A%0A        options.addOption(opHelp);%0A        options.addOption(opInRdfFile);%0A        options.addOption(opReport);%0A        options.addOption(opOut);%0A        options.addOption(opFormat);%0A%0A        return options;%0A    %7D%0A%0A    /**%0A     * Method to check input file, available report, output file format and to facilitate the%0A     * delegation of creating the report and saving it an output file.%0A     *%0A     * @param cmd User provided %7B@link CommandLine%7D input.%0A     */%0A    public final void run(final CommandLine cmd) %7B%0A        System.out.println(%22Implement checks and actual call of reports.%22);%0A    %7D%0A%0A%7D%0A

Add controller for LKTLog use case