Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianZipser committed Jun 24, 2015
2 parents 6ae9935 + f251219 commit b7fa54a
Show file tree
Hide file tree
Showing 56 changed files with 1,756 additions and 645 deletions.
3 changes: 2 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This project includes:
CDI APIs under Apache License, Version 2.0
Common Eclipse Runtime under Eclipse Public License - v 1.0
Commons Codec under The Apache Software License, Version 2.0
Commons Compiler under New BSD License
Commons IO under The Apache Software License, Version 2.0
Commons Logging under The Apache Software License, Version 2.0
Core Runtime under Eclipse Public License - v 1.0
Expand All @@ -57,7 +58,7 @@ This project includes:
Fluent API for Apache HttpClient under Apache License
Guava: Google Core Libraries for Java under The Apache Software License, Version 2.0
Hamcrest Core under New BSD License
janino.wso2:janino under Apache License, Version 2.0
Janino under New BSD License
javax.inject under The Apache Software License, Version 2.0
JCL 1.1.1 implemented over SLF4J under MIT License
JSR-250 Common Annotations for the JavaTM Platform under COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public PepperMapper createPepperMapper(SElementId sElementId){
<para>In case you are wondering, yes this sounds a bit strange, since each file
ending which is not contained in the second list won't be imported by
default. But there is an option to set this to import each file, no matter
wjat's the ending.</para>
what's the ending.</para>
</footnote> Now let's show some code for adapting. The following snippet is placed
into the method 'isReadyToStart()', but even could be located inside the
constructor:
Expand All @@ -454,7 +454,7 @@ public PepperMapper createPepperMapper(SElementId sElementId){
getSDocumentEndings().add(ENDING_LEAF_FOLDER);
...
}</programlisting></para>
<para>In general the paramter of the method '<emphasis role="italic"
<para>In general the parameter of the method '<emphasis role="italic"
>getSDocumentEndings()</emphasis>' is just a String, but there are some
predefined endings you can use. The two lines marked as option 1, will add the
endings 'xml' and 'tab' to the list of file endings to be imported. That means, that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<listitem>
<para>Download Eclipse <footnote>
<para>Eclipse is available in several flavors e.g. for web developers,
mobile developers, C++ developers etc.. We recommend the Eclipse
mobile developers, C++ developers etc. We recommend the Eclipse
Modeling Tools, since you might want to create or use a model for
the format you want to support. In this documentation, we used
Eclipse kepler, version 4.3.1 (see: <link
Expand Down Expand Up @@ -196,7 +196,8 @@
GraphViz tool (see: <link xlink:href="http://www.graphviz.org/"
>http://www.graphviz.org/</link>) into a svg, png or another
graphical format.</para>
</footnote>. </para>
</footnote>
</para>
<para>Replace the entry with an absolute path to that file.</para>
</listitem>
<listitem>
Expand Down Expand Up @@ -373,8 +374,8 @@ public class MyImporter extends PepperImporterImpl
<para>Sometimes it is necessary to include libraries, which are not accessible via a
Maven repository and therefore can not be resolved by Maven. In that case we
recommend, to create a 'lib' folder in the project directory and to copy all the
libraries you need into it. Unfortunately, you have register them twice, first
for Maven and second for OSGi.</para>
libraries you need into it. Unfortunately, you have to register them twice,
first for Maven and second for OSGi.</para>
<para>To register such a library to Maven, you need to install them to your local
Maven repository. You can do that with:
<programlisting>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ protected void setUp() throws Exception {
//X SCorpus objects
assertEquals(X, getFixture().getSaltProject()
.getSCorpusGraphs().getSCorpora().size());
}</programlisting>More
samples for tests can be found in the sample project in the classes
}</programlisting></para>
<para>More samples for tests can be found in the sample project in the classes
<classname>SampleImporterTest</classname>,
<classname>SampleManipulatorTest</classname> and
<classname>SampleExporterTest</classname>. </para>
Expand All @@ -88,5 +88,16 @@ protected void setUp() throws Exception {
the layers, you want to use. For more information, take a look into the Salt quick
user's guide (see <link xlink:href="u.hu-berlin.de/saltnpepper"
/>).</para>
<para>The class de.hu_berlin.german.korpling.saltnpepper.pepper.testFramework.PepperTestUtil
provides some very helpful methods like getSrcResources() to get a reference to the
resources folder (.../src/main/resources) or the method getTestResources to get a
reference to the test resource folder (.../src/test/resources). </para>
<para>When you are implementing an importer and an exporter you may want to make sure that
no data is lost, you can orchestrate the im- and the exporter and compare the input
files with the output files. In that case implementing the classes PepperImporterTest
and PepperExporterTest want do the job, because they assume that you are testing a
single module. To load multiple modules in the Pepper test environment, use the method
PepperUtil.start(Collection&lt;PepperModule> fixtures) instead and pass your im- and
your exporter.</para>
</sect1>
</chapter>
1 change: 1 addition & 0 deletions pepper-framework/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This project includes:
Apache Commons Lang under The Apache Software License, Version 2.0
carrot-osgi-anno-scr-core under The BSD License
carrot-osgi-anno-scr-make under The BSD License
Commons IO under The Apache Software License, Version 2.0
Guava: Google Core Libraries for Java under The Apache Software License, Version 2.0
Hamcrest Core under New BSD License
JUnit under Common Public License Version 1.0
Expand Down
8 changes: 0 additions & 8 deletions pepper-framework/pepper-testEnvironment.launch
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
<stringAttribute key="featurePluginResolution" value="workspace"/>
<booleanAttribute key="includeOptional" value="true"/>
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<<<<<<< .mine
<mapEntry key="PEPPER_TEST_WORKFLOW_FILE" value="/home/florian/Test/Druskat/paula2relANNIS.pepperParams"/>
=======
<mapEntry key="PEPPER_TEST" value="d:\projects_work\SaltNPepper\PEPPER_TEST\"/>
<mapEntry key="PEPPER_TEST_WORKFLOW_FILE" value="d:\Test\tigerProblem\tiger2EXMARaLDA.pepperparams"/>
>>>>>>> .r8615
</mapAttribute>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
Expand Down Expand Up @@ -238,11 +234,7 @@
<setEntry value="org.sonatype.tycho.m2e.feature:default"/>
</setAttribute>
<booleanAttribute key="show_selected_only" value="false"/>
<<<<<<< .mine
<stringAttribute key="target_bundles" value="com.google.guava*14.0.1@default:default,com.ibm.icu@default:default,javax.inject@default:default,javax.servlet@default:default,javax.xml@default:default,org.apache.commons.lang@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.log4j@1:default,org.eclipse.ant.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.emf.cdo.ecore.retrofit@default:false,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.team.core@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.slf4j.api*1.6.4.v20120130-2120@default:default,org.slf4j.api*1.7.2.v20121108-1250@default:default"/>
=======
<stringAttribute key="target_bundles" value="com.google.guava*14.0.1@default:default,javax.servlet@default:default,org.apache.commons.lang@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.log4j@1:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.team.core@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.slf4j.api*1.6.4.v20120130-2120@default:default,org.slf4j.api*1.7.2.v20121108-1250@default:default"/>
>>>>>>> .r8615
<booleanAttribute key="tracing" value="true"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
Expand Down
2 changes: 1 addition & 1 deletion pepper-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>de.hu_berlin.german.korpling.saltnpepper</groupId>
<artifactId>pepper</artifactId>
<version>2.1.0</version>
<version>2.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<scm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
import org.eclipse.emf.common.util.URI;

/**
* This class realizes a description of a corpus to be imported or exported. The description consists of a
* path addressing the location of the corpus and a format description, in which the corpus currently is or
* is supposed to be persist in.
* This class realizes a description of a corpus to be imported or exported. The
* description consists of a path addressing the location of the corpus and a
* format description, in which the corpus currently is or is supposed to be
* persist in.
*
* @author Florian Zipser
*/
Expand All @@ -33,64 +34,77 @@ public class CorpusDesc {
public CorpusDesc() {
super();
}

/** format description belonging to this corpus */
protected FormatDesc formatDesc= null;
protected FormatDesc formatDesc = null;

/**
* Returns a set format description.
* If no {@link FormatDesc} object was set, a new one is created.
* Returns a set format description. If no {@link FormatDesc} object was
* set, a new one is created.
*
* @return a format description
*/
public FormatDesc getFormatDesc() {
if (formatDesc== null){
if (formatDesc == null) {
synchronized (this) {
formatDesc= new FormatDesc();
formatDesc = new FormatDesc();
}
}
return formatDesc;
}

/**
* Sets the format description for this corpus description.
* @param formatDesc format description object
*
* @param formatDesc
* format description object
* @return this
*/
public CorpusDesc setFormatDesc(FormatDesc formatDesc) {
this.formatDesc = formatDesc;
return(this);
return (this);
}

/** location of corpus**/
protected URI corpusPath= null;

/** location of corpus **/
protected URI corpusPath = null;

/**
* Returns the path of where to store or from where to load this corpus.
*
* @return location of corpus
*/
public URI getCorpusPath() {
return corpusPath;
}

/**
* Sets the path of where to store or from where to load this corpus.
* @param corpusPath location of corpus
*
* @param corpusPath
* location of corpus
* @param this object
*/
public CorpusDesc setCorpusPath(URI corpusPath) {
this.corpusPath = corpusPath;
return(this);
return (this);
}

/**
* Returns a string representation of this object.
* <strong>Note: This representation cannot be used for serialization/deserialization purposes.</strong>
* Returns a string representation of this object. <strong>Note: This
* representation cannot be used for serialization/deserialization
* purposes.</strong>
*/
@Override
public String toString(){
StringBuilder str= new StringBuilder();
public String toString() {
StringBuilder str = new StringBuilder();
str.append(getCorpusPath());
if (getFormatDesc()!= null){
if (getFormatDesc() != null) {
str.append("(");
str.append(getFormatDesc().getFormatName());
str.append(", ");
str.append(getFormatDesc().getFormatVersion());
str.append(")");
}
return(str.toString());
return (str.toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,8 @@ public FormatDesc setFormatReference(URI formatReference) {
}

/**
* Two objects are equal:
* <ul>
* <li>if they are the same object</li>
* <li>if the passed object is of type {@link FormatDesc} and both {@link FormatDesc#formatName} and both {@link FormatDesc#formatName} are the same</li>
* </ul>
* Compares a {@link CorpusDesc} object with this object. Both objects are equal, if and only if
* the have the same format name and format version. The comparison is case insensitive.
*/
@Override
public boolean equals(Object obj){
Expand All @@ -120,9 +117,9 @@ public boolean equals(Object obj){
if (obj!= null){
if (obj instanceof FormatDesc){
if ( (getFormatName()!= null)&&
(getFormatName().equals(((FormatDesc) obj).getFormatName()))&&
(getFormatName().equalsIgnoreCase(((FormatDesc) obj).getFormatName()))&&
(getFormatVersion()!= null)&&
(getFormatVersion().equals(((FormatDesc) obj).getFormatVersion()))){
(getFormatVersion().equalsIgnoreCase(((FormatDesc) obj).getFormatVersion()))){
return(true);
}else{
return(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public class PepperConfiguration extends Properties {
* terminates.
*/
public static final String PROP_KEEP_TEMP_DOCS = PROP_PREFIX + ".keepTempDocs";
/**
* Name of the property to determine Property to determine whether the status report should contain a progress for each module
* or just the global progress.
*/
public static final String PROP_DETAILED_STATUS_REPORT = PROP_PREFIX + ".detailedStatusReport";
/**
* name of the flag to determine a workspace for pepper, where all jobs are
* stored by default.
Expand Down Expand Up @@ -148,6 +153,7 @@ public PepperConfiguration() {
put(PROP_CALL_GC_AFTER_DOCUMENT, Boolean.TRUE);
put(PROP_MEMORY_POLICY, MEMORY_POLICY.MODERATE);
put(PROP_MAX_AMOUNT_OF_SDOCUMENTS, 10);
put(PROP_DETAILED_STATUS_REPORT, true);
}

/**
Expand Down Expand Up @@ -362,4 +368,12 @@ public Integer getReportInterval() {
String interval = getProperty(PROP_REPORT_INTERVAL, new Integer(1000).toString());
return (Integer.valueOf(interval));
}
/**
* Property to determine whether the status report should contain a progress for each module or just the global progress.
* @return
*/
public Boolean getDetaialedStatReport() {
String callGC = getProperty(PROP_DETAILED_STATUS_REPORT);
return (Boolean.valueOf(callGC));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
*/
package de.hu_berlin.german.korpling.saltnpepper.pepper.common;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Vector;

import org.eclipse.emf.common.util.URI;

import de.hu_berlin.german.korpling.saltnpepper.pepper.exceptions.WorkflowException;
import de.hu_berlin.german.korpling.saltnpepper.pepper.modules.ModuleController;
import de.hu_berlin.german.korpling.saltnpepper.salt.saltCommon.SaltProject;

public abstract class PepperJob {
Expand All @@ -35,6 +38,38 @@ public abstract class PepperJob {
public String getId() {
return id;
}

/** The base directory is either the directory from which the Pepper workflow description was loaded or the directory from
* which Pepper was started. **/
private URI baseDir= null;

/**
* Sets the base directory for this {@link ModuleController}. The base directory is either
* the directory from which the Pepper workflow description was loaded or the directory from
* which Pepper was started.
* @param baseDir base directory
*/
public void setBaseDir(URI baseDir){
this.baseDir= baseDir;
}

/**
* Returns the base directory for this {@link ModuleController}. The base directory is either
* the directory from which the Pepper workflow description was loaded or the directory from
* which Pepper was started.
* @return base directory
*/
public URI getBaseDir(){
if (baseDir== null){
try {
baseDir= URI.createFileURI(new File("./").getCanonicalPath());
} catch (IOException e) {
baseDir= URI.createFileURI(new File("./").getAbsolutePath());
}
}
return(baseDir);
}

/** status of job **/
protected JOB_STATUS status= JOB_STATUS.NOT_STARTED;
/**
Expand Down Expand Up @@ -89,21 +124,6 @@ public void addStepDesc(StepDesc stepDesc){
public StepDesc createStepDesc(){
return(new StepDesc());
}
// /**
// * Creates a {@link StepDesc} object an returns it. Further the {@link StepDesc} type {@link StepDesc}s
// * module type is set to the passed one.
// * @param moduleType
// * @return
// */
// public StepDesc createStepDesc(MODULE_TYPE moduleType){
// if (moduleType== null){
// throw new PepperException("Cannot create a step desc object when passed module type is empty.");
// }
// StepDesc stepDesc= createStepDesc();
// stepDesc.setModuleType(moduleType);
// addStepDesc(stepDesc);
// return(stepDesc);
// }

/**
* Starts the conversion of this job.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,11 @@ public static class PepperJobReporter extends Thread {
* the interval in which the status is printed
*/
public PepperJobReporter(PepperJob pepperJob, int interval) {
if (pepperJob == null)
if (pepperJob == null){
throw new PepperException("Cannot observe Pepper job, because it was null.");
}
this.pepperJob = pepperJob;
this.interval= interval;
}

/**
Expand Down
Loading

0 comments on commit b7fa54a

Please sign in to comment.