Skip to content

Commit

Permalink
Merge branch 'release/7.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rmknopf committed Aug 2, 2016
2 parents 073996d + 1f8b1cf commit 165a1ce
Show file tree
Hide file tree
Showing 697 changed files with 19,703 additions and 33,913 deletions.
18 changes: 12 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ buildscript {
maven { url 'https://maven.rapidminer.com/content/groups/public/' }
}
dependencies {
classpath 'com.rapidminer.gradle:java-basics:0.3.3'
classpath 'com.rapidminer.gradle:java-basics:0.4.0'
classpath 'com.rapidminer.gradle:java-publishing:0.2.0'
classpath 'com.rapidminer.gradle:java-signing:0.1.0'
classpath 'com.rapidminer.gradle:java-signing:0.1.0'
}
}

Expand All @@ -26,7 +26,7 @@ dependencies {

// RapidMiner license framework for license management
compile 'com.rapidminer.license:rapidminer-license-api:3.1.0'
compile 'com.rapidminer.license:rapidminer-license-commons:3.1.0'
compile 'com.rapidminer.license:rapidminer-license-commons:3.2.0'

// RapidMiner API
compile 'com.rapidminer:rapidminer-api:0.2.0'
Expand Down Expand Up @@ -59,8 +59,8 @@ dependencies {
compile('net.sourceforge.jexcelapi:jxl:2.6.12') { exclude group: 'log4j', module: 'log4j' }

// Apache POI for manipulating various file formats based upon Office Open XML standards (http://poi.apache.org/)
compile 'org.apache.poi:poi-ooxml:3.10-FINAL'
compile 'org.apache.poi:poi-scratchpad:3.10-FINAL'
compile 'org.apache.poi:poi-ooxml:3.13'
compile 'org.apache.poi:poi-scratchpad:3.13'

// JGoodies Looks for TODO (http://www.jgoodies.com/freeware/libraries/looks/)
compile 'com.jgoodies:looks:2.2.2'
Expand Down Expand Up @@ -109,7 +109,7 @@ dependencies {
compile 'org.antlr:antlr4-runtime:4.5'

// SLF4J API (http://www.slf4j.org)
compile 'org.slf4j:slf4j-api:1.7.12'
compile 'org.slf4j:slf4j-api:1.7.13'

// add testing suite
//TODO should be test compile but RapidMiner src/main contains code that references JUnit
Expand All @@ -126,9 +126,15 @@ dependencies {

// Apache Tika for file MIME type detection (https://tika.apache.org/)
compile 'org.apache.tika:tika-core:1.11'

// The xalan version used by the JRE for XML handling contains a bug which results in XSLT not working with an enabled SecurityManager
// Using this version manually to override the JRE fixes the problem. Otherwise all our operator documentation would not work at all
compile 'xalan:xalan:2.7.2'
compile 'xalan:serializer:2.7.2'
}

task wrapper(type: Wrapper) { gradleVersion = '2.12' }

apply from: 'gradle/wsimport.gradle'
apply from: 'gradle/props.gradle'
apply from: 'gradle/tutorial.gradle'
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=7.1.1
version=7.2.0
group=com.rapidminer.studio
21 changes: 21 additions & 0 deletions gradle/tutorial.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apply plugin: 'java'

def tutorialSrc = file('src/main/resources/com/rapidminer/resources/tutorial/src').absolutePath
// Generate .tutorial files task
task buildTutorials << {
new File(tutorialSrc).eachDir {
ant.zip(destfile: tutorialSrc+'/../'+it.name+'.tutorial', basedir: it.path){
}
}
}
buildTutorials.group = 'build'
buildTutorials.description = 'Assembles tutorial archives.'

//Run buildTutorials before the jar task
jar.dependsOn(buildTutorials)

//Exclude tutorial source files from build
sourceSets.main.resources{
exclude 'com/rapidminer/resources/tutorial/src/**'
exclude 'com/rapidminer/resources/tutorial/src'
}
122 changes: 115 additions & 7 deletions src/main/java/com/rapidminer/Process.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -70,6 +71,8 @@
import com.rapidminer.operator.ProcessStoppedException;
import com.rapidminer.operator.UnknownParameterInformation;
import com.rapidminer.operator.UserError;
import com.rapidminer.operator.execution.FlowData;
import com.rapidminer.operator.execution.ProcessFlowFilter;
import com.rapidminer.operator.nio.file.RepositoryBlobObject;
import com.rapidminer.operator.ports.InputPort;
import com.rapidminer.operator.ports.OutputPort;
Expand Down Expand Up @@ -166,6 +169,10 @@ public class Process extends AbstractObservable<Process> implements Cloneable {
/** The listeners for breakpoints. */
private final List<BreakpointListener> breakpointListeners = new LinkedList<>();

/** The list of filters called between each operator */
private final List<ProcessFlowFilter> processFlowFilters = Collections
.synchronizedList(new LinkedList<ProcessFlowFilter>());

/** The listeners for logging (data tables). */
private final List<LoggingListener> loggingListeners = new LinkedList<>();

Expand Down Expand Up @@ -699,6 +706,108 @@ public boolean shouldPause() {
return getProcessState() == PROCESS_STATE_PAUSED;
}

// --------------------
// Filters between operators handling
// --------------------

/**
* Add a new {@link ProcessFlowFilter} to this process. The filter will be called directly
* before and after each operator. Refer to {@link ProcessFlowFilter} for more information.
*
* @param filter
* the filter instance to add
*/
public void addProcessFlowFilter(ProcessFlowFilter filter) {
if (filter == null) {
throw new IllegalArgumentException("filter must not be null!");
}
processFlowFilters.add(filter);
}

/**
* Remove a {@link ProcessFlowFilter} from this process. Does nothing if the filter is unknown.
*
* @param filter
* the filter instance to remove
*/
public void removeProcessFlowFilter(ProcessFlowFilter filter) {
if (filter == null) {
throw new IllegalArgumentException("filter must not be null!");
}
processFlowFilters.remove(filter);
}

/**
* Notifies all registered {@link ProcessFlowFilter}s that the next operator in the process is
* about to be executed.
*
* @param previousOperator
* the previous operator; may be {@code null} for the first operator in a subprocess
* @param nextOperator
* the next operator to be called, never {@code null}
* @param input
* the list of all input data for the next operator. If {@code null}, an empty list
* will be used
*/
public void fireProcessFlowBeforeOperator(Operator previousOperator, Operator nextOperator, List<FlowData> input)
throws OperatorException {
if (nextOperator == null) {
throw new IllegalArgumentException("nextOperator must not be null!");
}
if (input == null) {
input = Collections.emptyList();
}
synchronized (processFlowFilters) {
for (ProcessFlowFilter filter : processFlowFilters) {
filter.preOperator(previousOperator, nextOperator, input);
}
}
}

/**
* Notifies all registered {@link ProcessFlowFilter}s that an operator in the process has just
* finished execution.
*
* @param previousOperator
* the operator which just finished, never {@code null}
* @param nextOperator
* the next operator to be called; may be {@code null} if this was the last operator
* in a subprocess
* @param output
* the list of all output data from the previous operator. If {@code null}, an empty
* list will be used
*/
public void fireProcessFlowAfterOperator(Operator previousOperator, Operator nextOperator, List<FlowData> output)
throws OperatorException {
if (previousOperator == null) {
throw new IllegalArgumentException("previousOperator must not be null!");
}
if (output == null) {
output = Collections.emptyList();
}
synchronized (processFlowFilters) {
for (ProcessFlowFilter filter : processFlowFilters) {
filter.postOperator(previousOperator, nextOperator, output);
}
}
}

/**
* Copies the registered {@link ProcessFlowFilter}s of this process to the given process
* instance.
*
* @param otherProcess
* the process who should get all process flow listeners which are registered to this
* process instance
*/
public void copyProcessFlowListenersToOtherProcess(Process otherProcess) {
synchronized (processFlowFilters) {
for (ProcessFlowFilter filter : processFlowFilters) {
otherProcess.addProcessFlowFilter(filter);
}
}
}

// --------------------
// Breakpoint Handling
// --------------------
Expand Down Expand Up @@ -843,8 +952,7 @@ protected void loadInitialData(final int firstPort) throws UserError {
port.deliver(new RepositoryBlobObject(loc));
}
} else {
getLogger().info(
"Cannot assigning " + loc + " to input port " + port.getSpec()
getLogger().info("Cannot assigning " + loc + " to input port " + port.getSpec()
+ ": Repository location does not reference an IOObject entry.");
throw new PortUserError(port, 312, loc, "Not an IOObject entry.");
}
Expand Down Expand Up @@ -1069,6 +1177,7 @@ public final IOContainer run(final IOContainer input, int logVerbosity, final Ma
rootOperator.deliverInput(Arrays.asList(input.getIOObjects()));
}
rootOperator.execute();
rootOperator.checkForStop();
if (storeOutput) {
saveResults();
}
Expand Down Expand Up @@ -1360,8 +1469,8 @@ public void setDebugMode(final DebugMode mode) {
}

/** Resolves a repository location relative to {@link #getRepositoryLocation()}. */
public RepositoryLocation resolveRepositoryLocation(final String loc) throws UserError,
MalformedRepositoryLocationException {
public RepositoryLocation resolveRepositoryLocation(final String loc)
throws UserError, MalformedRepositoryLocationException {
if (RepositoryLocation.isAbsolute(loc)) {
RepositoryLocation repositoryLocation = new RepositoryLocation(loc);
repositoryLocation.setAccessor(getRepositoryAccessor());
Expand Down Expand Up @@ -1477,9 +1586,8 @@ public void setProcessLocation(final ProcessLocation processLocation) {
// keep process file version if same file, otherwise overwrite
if (this.processLocation != null && !this.processLocation.equals(processLocation)) {
this.isProcessConverted = false;
getLogger().info(
"Decoupling process from location " + this.processLocation + ". Process is now associated with file "
+ processLocation + ".");
getLogger().info("Decoupling process from location " + this.processLocation
+ ". Process is now associated with file " + processLocation + ".");
}
this.processLocation = processLocation;
fireUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@

import com.rapidminer.license.License;
import com.rapidminer.license.LicenseEvent;
import com.rapidminer.license.LicenseManagerListener;
import com.rapidminer.license.LicenseEvent.LicenseEventType;
import com.rapidminer.license.LicenseManagerListener;
import com.rapidminer.license.annotation.LicenseLevel;
import com.rapidminer.license.product.Constraint;
import com.rapidminer.license.violation.LicenseConstraintViolation;
import com.rapidminer.license.violation.LicenseLevelViolation;
import com.rapidminer.license.violation.LicenseViolation;
Expand Down Expand Up @@ -101,11 +102,11 @@ private void licenseViolated(List<LicenseViolation> licenseViolations) {
private void logConstraintViolation(LicenseConstraintViolation<?, ?> constraintViolation) {

License license = constraintViolation.getLicense();
Constraint<?, ?> constraint = constraintViolation.getConstraint();

// only count violations for licenses that are not null
if (license != null) {
ActionStatisticsCollector.getInstance()
.log(ActionStatisticsCollector.TYPE_CONSTRAINT, constraintViolation.getConstraint().getKey(),
if (license != null && constraint != null) {
ActionStatisticsCollector.getInstance().log(ActionStatisticsCollector.TYPE_CONSTRAINT, constraint.getKey(),
license.getProductId() + ":" + license.getProductEdition());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.util.Collections;
import java.util.List;
import java.util.Objects;

import com.rapidminer.license.AlreadyRegisteredException;
import com.rapidminer.license.ConstraintNotRestrictedException;
Expand Down Expand Up @@ -55,10 +56,10 @@ public class OpenSourceLicenseManager implements LicenseManager {

@Override
public void registerProduct(Product newProduct)
throws AlreadyRegisteredException, LicenseLoadingException, InvalidProductException {
throws AlreadyRegisteredException, LicenseLoadingException, InvalidProductException {
if (!StudioLicenseConstants.PRODUCT_ID.equals(newProduct.getProductId())) {
throw new InvalidProductException("LicenseManager does not allow to register products.",
newProduct.getProductId());
newProduct.getProductId());
}
}

Expand All @@ -69,20 +70,20 @@ public List<LicenseViolation> checkAnnotationViolations(Object obj, boolean info

@Override
public <S, C> LicenseConstraintViolation<S, C> checkConstraintViolation(Product product, Constraint<S, C> constraint,
C checkedValue, boolean informListeners) {
C checkedValue, boolean informListeners) {
return checkConstraintViolation(product, constraint, checkedValue, null, informListeners);
}

@Override
public <S, C> LicenseConstraintViolation<S, C> checkConstraintViolation(Product product, Constraint<S, C> constraint,
C checkedValue, String i18nKey, boolean informListeners) {
C checkedValue, String i18nKey, boolean informListeners) {
if (StudioLicenseConstants.PRODUCT_ID.equals(product.getProductId())) {
return null; // ignore
} else {
// all other products are not allowed to be used
try {
return new LicenseConstraintViolation<S, C>(null, constraint, getConstraintValue(product, constraint), null,
i18nKey);
i18nKey);
} catch (ConstraintNotRestrictedException e) {
// cannot happen
return null;
Expand All @@ -102,7 +103,7 @@ public License getActiveLicense(Product product) {

@Override
public <S, C> S getConstraintValue(Product product, Constraint<S, C> constraint)
throws ConstraintNotRestrictedException {
throws ConstraintNotRestrictedException {
return constraint.getDefaultValue();
}

Expand All @@ -111,6 +112,11 @@ public List<License> getLicenses(Product product) {
return Collections.singletonList(license);
}

@Override
public License getUpcomingLicense(License license) throws UnknownProductException {
return null;
}

@Override
public License getUpcomingLicense(Product product) {
return null;
Expand All @@ -128,7 +134,8 @@ public boolean isAllowedByAnnotations(Object obj) {

@Override
public Pair<Product, License> validateLicense(Product product, String licenseText)
throws UnknownProductException, LicenseValidationException {
throws UnknownProductException, LicenseValidationException {
Objects.requireNonNull(product);
if (StudioLicenseConstants.PRODUCT_ID.equals(product.getProductId())) {
return new Pair<Product, License>(product, license);
} else {
Expand All @@ -139,7 +146,7 @@ public Pair<Product, License> validateLicense(Product product, String licenseTex

@Override
public License storeNewLicense(String licenseText)
throws LicenseStoringException, UnknownProductException, LicenseValidationException {
throws LicenseStoringException, UnknownProductException, LicenseValidationException {
throw new LicenseValidationException("Storing of licenses not supported by this LicenseManager.", null);
}

Expand All @@ -162,5 +169,4 @@ public void setLicenseLocation(LicenseLocation location) {
public List<License> getAllActiveLicenses() {
return Collections.singletonList(license);
}

}

0 comments on commit 165a1ce

Please sign in to comment.