Package org.corpus_tools.pepper.common
Class PepperJob
- java.lang.Object
-
- org.corpus_tools.pepper.common.PepperJob
-
- Direct Known Subclasses:
PepperJobImpl
public abstract class PepperJob extends Object
-
-
Constructor Summary
Constructors Constructor Description PepperJob()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddStepDesc(StepDesc stepDesc)Adds aStepDescobject to job.abstract voidcancelConversion()Cancels the current conversion.abstract voidclear()Removes allSteps from all internal lists.abstract voidconvert()Starts the conversion of this job.abstract voidconvertFrom()Imports aSaltProjectfrom any format.abstract voidconvertTo()Exports theSaltProjectinto any format.StepDesccreateStepDesc()org.eclipse.emf.common.util.URIgetBaseDir()Returns the base directory for thisModuleController.StringgetId()Returns the unique identifier for this job.abstract org.corpus_tools.salt.common.SaltProjectgetSaltProject()Returns theSaltProjectwhich is converted by this job.JOB_STATUSgetStatus()Returns the current status of this job.abstract StringgetStatusReport()Returns a formated string as a kind of a document centric progress status.List<StepDesc>getStepDescs()Returns a list of all step descriptions.abstract voidload(org.eclipse.emf.common.util.URI uri)Loads a serialization of aPepperJoband fills this object with these entries.abstract org.eclipse.emf.common.util.URIsave(org.eclipse.emf.common.util.URI uri)Stores this job to the file at passed URI.voidsetBaseDir(org.eclipse.emf.common.util.URI baseDir)Sets the base directory for thisModuleController.StringtoString()Returns a textual representation of this Pepper job.
-
-
-
Field Detail
-
id
protected String id
Identifier of this job. Should be unique in Pepper.
-
status
protected JOB_STATUS status
status of job
-
-
Method Detail
-
getId
public String getId()
Returns the unique identifier for this job.- Returns:
- unique identifier.
-
setBaseDir
public void setBaseDir(org.eclipse.emf.common.util.URI baseDir)
Sets the base directory for thisModuleController. The base directory is either the directory from which the Pepper workflow description was loaded or the directory from which Pepper was started.- Parameters:
baseDir- base directory
-
getBaseDir
public org.eclipse.emf.common.util.URI getBaseDir()
Returns the base directory for thisModuleController. The base directory is either the directory from which the Pepper workflow description was loaded or the directory from which Pepper was started.- Returns:
- base directory
-
getStatus
public JOB_STATUS getStatus()
Returns the current status of this job.- Returns:
- status of this job
-
getSaltProject
public abstract org.corpus_tools.salt.common.SaltProject getSaltProject()
Returns theSaltProjectwhich is converted by this job.- Returns:
SaltProject
-
getStatusReport
public abstract String getStatusReport()
Returns a formated string as a kind of a document centric progress status. For each document its overall status and specific statuses in single modules are included.- Returns:
- a report of the progress status
-
getStepDescs
public List<StepDesc> getStepDescs()
Returns a list of all step descriptions. In order of how theStepDescobjects have been added via method#addStep(StepDesc).- Returns:
- list of
StepDescobjects
-
addStepDesc
public void addStepDesc(StepDesc stepDesc)
Adds aStepDescobject to job.- Parameters:
stepDesc- description object of a particular step
-
createStepDesc
public StepDesc createStepDesc()
Creates aStepDescobject an returns it, without adding the createdStepDescobject to thisPepperJobobject. For adding that object, calladdStepDesc(StepDesc). Or if you want to do that at once call#createStepDesc(MODULE_TYPE)- Returns:
- created
StepDescobject
-
convert
public abstract void convert()
Starts the conversion of this job.- If the single steps of the job has not already been wired, they will be wired.
- If
PepperImporter.importCorpusStructure(org.corpus_tools.salt.common.SCorpusGraph)has not already been called, it will be done.
-
convertFrom
public abstract void convertFrom()
Imports aSaltProjectfrom any format. For conversion a process can be modeled, similar toconvert()with the difference, that noPepperExportercould be defined. The imported Salt model can be accessed viagetSaltProject().
-
convertTo
public abstract void convertTo()
Exports theSaltProjectinto any format. For conversion, a normal process could be created, except the use of an importer. Here the do-nothing importer is used, and it is expected, that thegetSaltProject()is already 'filled'.
-
cancelConversion
public abstract void cancelConversion()
Cancels the current conversion. This might not stop immediately, but might finish the running document controller jobs first.
-
load
public abstract void load(org.eclipse.emf.common.util.URI uri)
Loads a serialization of aPepperJoband fills this object with these entries. The current implementation allows xml files following the workflow description scheme version 1.0 and xmi files following the (old) PepperParams schema. Only local files are supported.- Parameters:
uri- path of file to load.
-
save
public abstract org.eclipse.emf.common.util.URI save(org.eclipse.emf.common.util.URI uri)
Stores this job to the file at passed URI. If the URI points to a directory, a file having the namegetId().pepper is created in the passed directory.- Parameters:
uri- The location where to store this job.- Returns:
- Returns the URI where the Pepper job was stored, normally this is
the passed uri, but if the passed uri is a folder, than a file
having the job-if (
getId()).
-
clear
public abstract void clear()
Removes allSteps from all internal lists.
-
-