Package org.corpus_tools.pepper.cli
Class ConvertWizardConsole
- java.lang.Object
-
- org.corpus_tools.pepper.cli.ConvertWizardConsole
-
public class ConvertWizardConsole extends Object
This class represents a console to realize a kind of an interactive wizard to guide the user through the workflow configuration. This is a step by step wizard in which the the user needs to make an input for each step:- Import phase
- choose source corpus
- choose importer (if possible show a list of recommended importers and the rest)
- choose configuration properties (wizard presents a list of possible properties)
- another importer? press enter for no, corpus path for yes
- Manipulation phase
- choose manipulator (enter for non)
- choose configuration properties (wizard presents a list of possible properties)
- another manipulator? press enter for no
- Export phase
- choose target path for corpus
- choose configuration properties (wizard presents a list of possible properties)
- another exporter? press enter for no, corpus path for yes
- Author:
- Florian Zipser
- Import phase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConvertWizardConsole.COMMANDstatic classConvertWizardConsole.ExitWizardException
-
Constructor Summary
Constructors Constructor Description ConvertWizardConsole(String prefixPrompt)Initializes an object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidderesolveURIs(File outputFile, org.corpus_tools.pepper.common.PepperJob pepperJob)Before saving, create relative URIs for Pepper job.booleanexportPhase(org.corpus_tools.pepper.common.PepperJob pepperJob)A sub wizard to manage the import phase.org.corpus_tools.pepper.common.PeppergetPepper()booleanimportPhase(org.corpus_tools.pepper.common.PepperJob pepperJob)A sub wizard to manage the import phase.voidmanipulationPhase(org.corpus_tools.pepper.common.PepperJob pepperJob)A sub wizard to manage the manipulation phase.voidsetPepper(org.corpus_tools.pepper.common.Pepper pepper)voidstart()Starts this console, using std in and std out.org.corpus_tools.pepper.common.PepperJobstart(BufferedReader in, PrintStream out)Starts the wizard for a 'session'.
-
-
-
Field Detail
-
isDebug
public Boolean isDebug
Determines if debug mode is on or off
-
-
Constructor Detail
-
ConvertWizardConsole
public ConvertWizardConsole(String prefixPrompt)
Initializes an object.- Parameters:
prefixPrompt- the prefix prompt to be displayed, before the prompt of this console.
-
-
Method Detail
-
getPepper
public org.corpus_tools.pepper.common.Pepper getPepper()
- Returns:
- The Pepper object, which shall create and run the job
-
setPepper
public void setPepper(org.corpus_tools.pepper.common.Pepper pepper)
- Parameters:
pepper- The Pepper object, which shall create and run the job
-
start
public void start()
Starts this console, using std in and std out.
-
start
public org.corpus_tools.pepper.common.PepperJob start(BufferedReader in, PrintStream out)
Starts the wizard for a 'session'. A wizard can only be started as singleton. That means it needs to be quit before it can be started again.- startes wizard for import phase
importPhase(PepperJob) - startes wizard for manipulation phase
manipulationPhase(PepperJob) - startes wizard for export phase
exportPhase(PepperJob) - requests user input to store workflow description or to start conversion
- Parameters:
in-out-
- startes wizard for import phase
-
deresolveURIs
public static void deresolveURIs(File outputFile, org.corpus_tools.pepper.common.PepperJob pepperJob) throws IOException
Before saving, create relative URIs for Pepper job. Create a base URI to deresolve relative URIs- Parameters:
outputFile-pepperJob-- Throws:
IOException
-
importPhase
public boolean importPhase(org.corpus_tools.pepper.common.PepperJob pepperJob)
A sub wizard to manage the import phase. Asks all importers from the user.- state 0: reads corpus path, empty input leads to exit import phase
- state 1: choose importer
- state 2: choose properties, empty input leads to state 0
- Parameters:
pepperJob- thePepperJobobject to be filled.- Returns:
- true if an importer was chosen, false if phase was aborted
-
manipulationPhase
public void manipulationPhase(org.corpus_tools.pepper.common.PepperJob pepperJob)
A sub wizard to manage the manipulation phase. Asks for all manipulators from the user.- state 1: reads name of manipulator, empty input leads to exit import phase
- state 2: asks for properties, input leads to state 1
- Parameters:
pepperJob- thePepperJobobject to be filled.
-
exportPhase
public boolean exportPhase(org.corpus_tools.pepper.common.PepperJob pepperJob)
A sub wizard to manage the import phase. Asks all importers from the user.- state 0: choose output path, empty input leads to exit of export phase
- state 1: choose exporter
- state 2: choose property, empty input leads to state 0
- Parameters:
pepperJob- thePepperJobobject to be filled.- Returns:
- if an exporter was set, false otherwise
-
-