Skip to content

Commit

Permalink
Using system wide property for resource name
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Klempa committed Jul 14, 2015
1 parent c211bca commit 0547432
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
|Parameter |Description |
|---------------------------------|----------------------------------------|
|**dpu.uv-l-rdfToVirtuosoAndCkan.dataset.uri.pattern** |URL pattern to build RDF graph name in Virtuoso storage. |
|**dpu.uv-l-rdfToVirtuosoAndCkan.resource.name** | Name of the CKAN resource to be used, has precedence over distributionMetadata input |
|**org.opendatanode.CKAN.secret.token** |Token used to authenticate to CKAN, has to be set in backend.properties |
|**org.opendatanode.CKAN.api.url** | URL where CKAN api is located, has to be set in backend.properties |
|**org.opendatanode.CKAN.http.header.[key]** | Custom HTTP header added to requests on CKAN |
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>org.opendatanode.plugins</groupId>
<artifactId>uv-l-rdfToCkan</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Provided by Core. -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class RdfToVirtuosoAndCkan extends AbstractDpu<RdfToVirtuosoAndCkanConfig

public static final String CONFIGURATION_DATASET_URI_PATTERN = "dpu.uv-l-rdfToVirtuosoAndCkan.dataset.uri.pattern";

public static final String CONFIGURATION_RESOURCE_NAME = "dpu.uv-l-rdfToVirtuosoAndCkan.resource.name";

public RdfToVirtuosoAndCkan() {
super(RdfToVirtuosoAndCkanVaadinDialog.class, ConfigHistory.noHistory(RdfToVirtuosoAndCkanConfig_V1.class));
}
Expand Down Expand Up @@ -68,7 +70,9 @@ protected void innerExecute() throws DPUException {
throw ContextUtils.dpuException(ctx, "RdfToCkan.execute.exception.missingCatalogApiLocation");
}
String datasetUriPattern = environment.get(CONFIGURATION_DATASET_URI_PATTERN);


String resourceName = environment.get(CONFIGURATION_RESOURCE_NAME);

Map<String, String> additionalHttpHeaders = new HashMap<>();
for (Map.Entry<String, String> configEntry : environment.entrySet()) {
if (configEntry.getKey().startsWith(RdfToCkan.CONFIGURATION_HTTP_HEADER)) {
Expand Down Expand Up @@ -102,6 +106,8 @@ protected void innerExecute() throws DPUException {

rdfToCkan.rdfInput = rdfIntermediate;
rdfToCkan.distributionInput = distributionInput;
rdfToCkan.outerExecute(ctx, new RdfToCkanConfig_V1());
RdfToCkanConfig_V1 rdfToCkanConfig= new RdfToCkanConfig_V1();
rdfToCkanConfig.setResourceName(resourceName);
rdfToCkan.outerExecute(ctx, rdfToCkanConfig);
}
}

0 comments on commit 0547432

Please sign in to comment.