Item Corrections
This commit is contained in:
parent
44e057797c
commit
f2ba354915
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.data.publishing.gCatFeeder.collectors.dm;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Month;
|
||||
import java.time.ZoneId;
|
||||
import java.time.chrono.IsoChronology;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
@ -143,8 +144,8 @@ public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorith
|
|||
try{
|
||||
toSetCreationDate=LocalDateTime.parse(desc.getVersion(),versionDateParser);
|
||||
}catch(Throwable t){
|
||||
log.debug("Version {} is not a date. Using Now as Creation date..",desc.getVersion());
|
||||
toSetCreationDate = LocalDateTime.now();
|
||||
log.debug("Version {} is not a date. Using 1900-01-01 as Creation date..",desc.getVersion());
|
||||
toSetCreationDate = LocalDateTime.of(1900, Month.JANUARY,1,0,0);
|
||||
}
|
||||
|
||||
desc.setCreationDate(toSetCreationDate);
|
||||
|
@ -257,7 +258,7 @@ public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorith
|
|||
Matcher m=descriptionPattern.matcher(description);
|
||||
if(m.find())
|
||||
return m.group(4); // group 0 == {...}, group 1 == Giancarlo Panichi, group 2 == giancarlo.panichi, group 4 == 2018/07/20 10:24 GMT
|
||||
else return "n/a";
|
||||
else return "n.d.";
|
||||
}
|
||||
|
||||
static final String getWPSBasePath() {
|
||||
|
|
|
@ -60,11 +60,12 @@ public class GCatModel implements CatalogueFormatData {
|
|||
|
||||
public GCatModel(InternalAlgorithmDescriptor desc) {
|
||||
item=new CkanItem();
|
||||
// item.setAuthor(desc.getAuthor());
|
||||
item.setAuthor(desc.getAuthor().getFirstName()+" "+desc.getAuthor().getLastName());
|
||||
|
||||
item.setTitle(desc.getName()+" in "+ContextUtils.getCurrentScopeName());
|
||||
item.setLicense_id("CC-BY-NC-SA-4.0");
|
||||
// item.setMaintainer(desc.getMaintainer());
|
||||
item.setMaintainer(desc.getMaintainer().getFirstName()+" "+desc.getMaintainer().getLastName());
|
||||
|
||||
item.setName(item.getTitle().toLowerCase().toLowerCase().replaceAll(" ", "_"));
|
||||
for(String tag:desc.getTags()) {
|
||||
item.getTags().add(new CkanItem.Tag(fixTag(tag)));
|
||||
|
|
|
@ -75,8 +75,8 @@ public class TranslationTest extends BaseCollectorTest{
|
|||
@Test
|
||||
public void testEnvironment(){
|
||||
Assume.assumeTrue(isTestInfrastructureEnabled());
|
||||
assertNotNull(DMAlgorithmsInfoCollector.getWPSBasePath());
|
||||
assertNotNull(GCatModel.getItemUrl("fake"));
|
||||
//assertNotNull(DMAlgorithmsInfoCollector.getWPSBasePath());
|
||||
//assertNotNull(GCatModel.getItemUrl("fake"));
|
||||
System.out.println(getEnvironmentConfiguration().getCurrentConfiguration());
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue