minor fixes
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@158889 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2b0ac8c0a0
commit
10bd220c53
|
@ -3,6 +3,9 @@
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
|
<dependent-module archiveName="grsf-common-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/grsf-common-library/grsf-common-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<property name="context-root" value="grsf-publisher-ws"/>
|
<property name="context-root" value="grsf-publisher-ws"/>
|
||||||
<property name="java-output-path" value="/grsf-publisher-ws/target/classes"/>
|
<property name="java-output-path" value="/grsf-publisher-ws/target/classes"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -433,20 +433,22 @@ public class CommonServiceUtils {
|
||||||
CommonServiceUtils.validateAggregatedRecord(record);
|
CommonServiceUtils.validateAggregatedRecord(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the domain
|
||||||
|
record.setDomain(productType.getOrigName());
|
||||||
|
|
||||||
|
// set system type (it is equal to the GRSF Type for GRSF records, "Legacy" for source records)
|
||||||
|
record.setSystemType(sourceInPath.equals(Sources.GRSF) ?
|
||||||
|
productType.equals(Product_Type.FISHERY) ? ((FisheryRecord)record).getType().getOrigName() : ((StockRecord)record).getType().getOrigName()
|
||||||
|
: Constants.SYSTEM_TYPE_FOR_SOURCES_VALUE);
|
||||||
|
|
||||||
|
logger.debug("Domain is " + productType.getOrigName() + " and system type " + record.getSystemType());
|
||||||
|
|
||||||
// evaluate the custom fields/tags, resources and groups
|
// evaluate the custom fields/tags, resources and groups
|
||||||
groups.add(sourceInPath.getOrigName().toLowerCase() + "-" + productType.getOrigName().toLowerCase()); //e.g. grsf-fishery
|
groups.add(sourceInPath.getOrigName().toLowerCase() + "-" + productType.getOrigName().toLowerCase()); //e.g. grsf-fishery
|
||||||
boolean skipTags = !sourceInPath.equals(Sources.GRSF); // no tags for the Original records
|
boolean skipTags = !sourceInPath.equals(Sources.GRSF); // no tags for the Original records
|
||||||
CommonServiceUtils.getTagsGroupsResourcesExtrasByRecord(tags, skipTags, groups, false, resources, false, customFields, record, username, sourceInPath);
|
CommonServiceUtils.getTagsGroupsResourcesExtrasByRecord(tags, skipTags, groups, false, resources, false, customFields, record, username, sourceInPath);
|
||||||
|
|
||||||
// set the domain
|
|
||||||
record.setDomain(productType.getOrigName());
|
|
||||||
|
|
||||||
// set system type (it is equal to the GRSF Type for GRSF records, "Source" for source records)
|
|
||||||
record.setSystemType(sourceInPath.equals(Sources.GRSF) ?
|
|
||||||
productType.equals(Product_Type.FISHERY) ? ((FisheryRecord)record).getType().getOrigName() : ((StockRecord)record).getType().getOrigName()
|
|
||||||
: Constants.SYSTEM_TYPE_FOR_SOURCES_VALUE);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -145,17 +145,21 @@ public class CSVUtils {
|
||||||
bw.close();
|
bw.close();
|
||||||
|
|
||||||
// Add names of the sources to the file's name
|
// Add names of the sources to the file's name
|
||||||
for (String source : sources) {
|
if(sources.isEmpty()){
|
||||||
relevantSources[0] += source + "_";
|
relevantSources[0] = "";
|
||||||
|
}else{
|
||||||
|
for (String source : sources) {
|
||||||
|
relevantSources[0] += source + "_";
|
||||||
|
}
|
||||||
|
relevantSources[0] = relevantSources[0].substring(0, relevantSources[0].length() - 1);
|
||||||
}
|
}
|
||||||
relevantSources[0] = relevantSources[0].substring(0, relevantSources[0].length() - 1);
|
|
||||||
|
|
||||||
// on exit delete it...
|
// on exit delete it...
|
||||||
file.deleteOnExit();
|
file.deleteOnExit();
|
||||||
|
|
||||||
// file created
|
// file created
|
||||||
logger.debug("CSV file created correctly on this machine!");
|
logger.debug("CSV file created correctly on this machine!");
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
catch(Exception e){
|
catch(Exception e){
|
||||||
|
|
Loading…
Reference in New Issue