Skip to content

Commit

Permalink
Merge branch 'release/UV_Core_v1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Klempa committed Dec 16, 2014
2 parents 1ca5767 + 532cba2 commit a666ffb
Show file tree
Hide file tree
Showing 63 changed files with 2,076 additions and 599 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ bin/
!/frontend/src/main/webapp/VAADIN/themes/UnifiedViewsTheme/icons/arrow_bottom.svg
/frontend/src/main/webapp/VAADIN/
!/frontend/src/main/webapp/VAADIN/themes/UnifiedViewsTheme/
build.bat
eclipse.bat
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cz.cuni.mff.xrg.odcs</groupId>
<artifactId>odcs</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
</parent>
<artifactId>backend</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ public boolean preAction(Node node,
@SuppressWarnings("unchecked")
DPUConfigurable configurable = (DPUConfigurable) dpuInstance;
try {
configurable.configure(dpu.getRawConf());
String conf = dpu.isUseTemplateConfig() ? dpu.getTemplate().getRawConf() : dpu.getRawConf();
configurable.configure(conf);

LOG.debug("DPU {} hes been configured.", dpu.getName());
LOG.debug("DPU {} has been configured.", dpu.getName());
} catch (DPUConfigException e) {
eventPublisher.publishEvent(DPUEvent.createPreExecutorFailed(
context, this, "Failed to configure DPU.", e));
Expand Down
44 changes: 1 addition & 43 deletions commons-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cz.cuni.mff.xrg.odcs</groupId>
<artifactId>odcs</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
</parent>
<artifactId>commons-app</artifactId>
<name>commons-app</name>
Expand Down Expand Up @@ -265,11 +265,6 @@
<version>3.1</version>
</dependency>

<dependency>
<groupId>com.openlinksw</groupId>
<artifactId>virtjdbc</artifactId>
<version>4.1</version>
</dependency>

<dependency>
<groupId>mysql</groupId>
Expand Down Expand Up @@ -347,43 +342,6 @@
</executions>
</plugin>

<!-- copy common resource files -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/main/resources/sql</outputDirectory>
<resources>
<resource>
<!-- we need queries for fixing sequences in DB at runtime -->
<directory>../db/virtuoso/rdbms</directory>
<filtering>false</filtering>
<includes>
<include>sequences.sql</include>
</includes>
</resource>
<resource>
<directory>${basedir}</directory>
<!-- this is default dir -->
<includes>
<include>LICENSE.md</include>
</includes>
</resource>
</resources>
<!-- add license from LICENSE.md to the generated JAR file -->
</configuration>
</execution>
</executions>
</plugin>

<!-- AspecJ maven plugin used for compile-time bytecode weaving. Needed
for aspects to work. -->
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Recognized configuration properties.
*
*
* @author Jan Vojt
*/
public enum ConfigProperty {
Expand All @@ -17,17 +17,16 @@ public enum ConfigProperty {
BACKEND_DEFAULTRDF("backend.defaultRdf"),
BACKEND_LIMIT_OF_SCHEDULED_PIPELINES("backend.scheduledPipelines.limit"),


EXECUTION_LOG_HISTORY("exec.log.history"),
EXECUTION_LOG_SIZE_MAX("exec.log.msg.maxSize"),

/**
* Used to generate url for pipeline execution in emails.
*/
FRONTEND_URL("frontend.url"),

FRONTEND_RUN_NOW_PIPELINE_PRIORITY("run.now.pipeline.priority"),

/**
* string diplayed next to the UV logo in GUI
*/
Expand Down Expand Up @@ -65,14 +64,18 @@ public enum ConfigProperty {
EMAIL_AUTHORIZATION("email.authorization"),
EMAIL_USERNAME("email.username"),
EMAIL_PASSWORD("email.password"),
EMAIL_ADMIN("email.admin");
EMAIL_ADMIN("email.admin"),

CKAN_LOCATION("ckan.location"),
CKAN_API_KEY("ckan.api.key");

private final String property;

public final String springValue;

private ConfigProperty(final String property) {
this.property = property;
this.springValue ="${" + property + "}";
this.springValue = "${" + property + "}";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,24 @@ public List<MutablePair<Integer, Integer>> translate(String script,
*/
public void createDefaultMapping(DPUExplorer dpuExplorer, Edge edge,
DPUInstanceRecord from, DPUInstanceRecord to) {
List<DataUnitDescription> source = dpuExplorer.getOutputs(from);
List<DataUnitDescription> target = dpuExplorer.getInputs(to);
final List<DataUnitDescription> sourceList = dpuExplorer.getOutputs(from);
final List<DataUnitDescription> targetList = dpuExplorer.getInputs(to);

if (source.size() == 1 && target.size() == 1) {
final List<MutablePair<Integer, Integer>> mapping = new ArrayList<>();
mapping.add(new MutablePair<>(0, 0));
edge.setScript(translate(mapping, source, target, null));
} else if (source.isEmpty() || target.isEmpty()) {
if (sourceList.size() == 1 && targetList.size() == 1) {
final DataUnitDescription source = sourceList.get(0);
final DataUnitDescription target = targetList.get(0);
// Check for type.
if (source.getTypeName().compareTo(target.getTypeName()) == 0) {
final List<MutablePair<Integer, Integer>> mapping = new ArrayList<>();
mapping.add(new MutablePair<>(0, 0));
edge.setScript(translate(mapping, sourceList, targetList, null));
} else {
edge.setScript("");
}
} else if (sourceList.isEmpty() || targetList.isEmpty()) {
// no mapping
final List<MutablePair<Integer, Integer>> mapping = new ArrayList<>();
edge.setScript(translate(mapping, source, target, null));
edge.setScript(translate(mapping, sourceList, targetList, null));
} else {
edge.setScript("");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public DPUType getType(Object DPUInstance, String relativePath) {
return DPUType.TRANSFORMER;
} else if (objectClass.getAnnotation(DPU.AsLoader.class) != null) {
return DPUType.LOADER;
} else if (objectClass.getAnnotation(DPU.AsQuality.class) != null) {
return DPUType.QUALITY;
}

// we do not know
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cz.cuni.mff.xrg.odcs.commons.app.dpu;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
Expand All @@ -26,6 +27,12 @@ public class DPUInstanceRecord extends DPURecord {
@JoinColumn(name = "dpu_id")
private DPUTemplateRecord template;

/**
* If true then this instance use owner template configuration.
*/
@Column(name = "use_template_config")
private boolean useTemplateConfig;

/**
* Empty constructor because of JPA.
*/
Expand All @@ -43,6 +50,7 @@ public DPUInstanceRecord() {
public DPUInstanceRecord(DPUInstanceRecord dpuInstance) {
super(dpuInstance);
template = dpuInstance.getTemplate();
this.useTemplateConfig = dpuInstance.useTemplateConfig;
}

/**
Expand All @@ -52,6 +60,7 @@ public DPUInstanceRecord(DPUInstanceRecord dpuInstance) {
*/
public DPUInstanceRecord(String name) {
super(name);
this.useTemplateConfig = false;
}

/**
Expand All @@ -64,6 +73,7 @@ public DPUInstanceRecord(DPUTemplateRecord template) {
super(template);
// and set out variables
this.template = template;
this.useTemplateConfig = false;
}

/**
Expand All @@ -81,6 +91,21 @@ public void setTemplate(DPUTemplateRecord template) {
this.template = template;
}

/**
* @return true if dpu should use template configuration, false if dpu should use instance configuration
*/
public boolean isUseTemplateConfig() {
return useTemplateConfig;
}

/**
* @param useTemplateConfig
* true if dpu should use template configuration, false if dpu should use instance configuration
*/
public void setUseTemplateConfig(boolean useTemplateConfig) {
this.useTemplateConfig = useTemplateConfig;
}

@Override
public DPUType getType() {
return template.getType();
Expand All @@ -102,5 +127,4 @@ public void loadInstance(ModuleFacade moduleFacade) throws ModuleException {
public String getJarPath() {
return template.getJarPath();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ public enum DPUType {
/**
* Represents a loader.
*/
LOADER
LOADER,
/**
* Represents a quality verifier.
*/
QUALITY
}
Loading

0 comments on commit a666ffb

Please sign in to comment.