Minor update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@101203 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2becb5c4d1
commit
a7107a39b9
|
@ -2052,14 +2052,17 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
tabResource.setValid(tr.isValid());
|
||||
tabResource.setFinalized(tr.isFinalized());
|
||||
tabResource.setLocked(tr.isLocked());
|
||||
tr.setMetadata(new NameMetadata(tabResource.getName()));
|
||||
tr.setMetadata(new DescriptionMetadata(tabResource.getDescription()));
|
||||
ArrayList<TabularResourceMetadata<?>> meta=new ArrayList<TabularResourceMetadata<?>>();
|
||||
|
||||
|
||||
meta.add(new NameMetadata(tabResource.getName()));
|
||||
meta.add(new DescriptionMetadata(tabResource.getDescription()));
|
||||
// tr.setMetadata(new CreationDateMetadata(date));
|
||||
if (tabResource.getAgency() != null
|
||||
&& !tabResource.getAgency().isEmpty()) {
|
||||
tr.setMetadata(new AgencyMetadata(tabResource.getAgency()));
|
||||
meta.add(new AgencyMetadata(tabResource.getAgency()));
|
||||
}
|
||||
tr.setMetadata(new RightsMetadata(tabResource.getRight()));
|
||||
meta.add(new RightsMetadata(tabResource.getRight()));
|
||||
|
||||
if (tabResource.getValidFrom() != null
|
||||
&& !tabResource.getValidFrom().isEmpty()) {
|
||||
|
@ -2069,7 +2072,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
validFromC.setTime(dateF);
|
||||
ValidSinceMetadata validSince = new ValidSinceMetadata();
|
||||
validSince.setValue(validFromC);
|
||||
tr.setMetadata(validSince);
|
||||
meta.add(validSince);
|
||||
} catch (ParseException e) {
|
||||
logger.info("ValidFromMetadata is not set, no valid calendar present");
|
||||
}
|
||||
|
@ -2083,7 +2086,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
validUntilToC.setTime(dateU);
|
||||
ValidUntilMetadata validUntil = new ValidUntilMetadata(
|
||||
validUntilToC);
|
||||
tr.setMetadata(validUntil);
|
||||
meta.add(validUntil);
|
||||
} catch (ParseException e) {
|
||||
logger.info("ValidUntilMetadata is not set, no valid calendar present");
|
||||
}
|
||||
|
@ -2095,13 +2098,16 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
Licence licence = LicenceMap.map(tabResource.getLicence());
|
||||
if (licence != null) {
|
||||
licenceMetadata.setValue(licence);
|
||||
tr.setMetadata(licenceMetadata);
|
||||
meta.add(licenceMetadata);
|
||||
} else {
|
||||
logger.error("Licence type not found: "
|
||||
+ tabResource.getLicence());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tr.setAllMetadata(meta);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.td.gwtservice.shared.csv;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.file.HeaderPresence;
|
||||
|
@ -10,11 +11,17 @@ import org.gcube.portlets.user.td.gwtservice.shared.file.HeaderPresence;
|
|||
|
||||
|
||||
/**
|
||||
* @author Federico De Faveri defaveri@isti.cnr.it
|
||||
*
|
||||
* @author giancarlo
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class CSVParserConfiguration {
|
||||
public class CSVParserConfiguration implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5585106307191211813L;
|
||||
protected Charset charset;
|
||||
protected char delimiter;
|
||||
protected char comment;
|
||||
|
|
|
@ -277,6 +277,45 @@ public class OperationMonitorCreator {
|
|||
|
||||
saveJSONExportInDestination(exportMetadata);
|
||||
break;
|
||||
case CSVImport:
|
||||
trId = new TRId();
|
||||
trId.setId(taskWrapper.getTrId().getId());
|
||||
trId = retrieveTabularResourceBasicData(trId);
|
||||
|
||||
operationMonitor.setTrId(trId);
|
||||
tabResource = SessionUtil.getCSVImportTabResource(session);
|
||||
logger.debug("CurrentTabResource :" + tabResource);
|
||||
if (tabResource != null) {
|
||||
tabResource.setTrId(trId);
|
||||
SessionUtil.setTabResource(session, tabResource);
|
||||
} else {
|
||||
tabResource = new TabResource();
|
||||
tabResource.setTrId(trId);
|
||||
SessionUtil.setTabResource(session, tabResource);
|
||||
}
|
||||
SessionUtil.setTRId(session, trId);
|
||||
SessionUtil.addToCurrentTabularResourcesOpen(session,tabResource);
|
||||
break;
|
||||
case SDMXImport:
|
||||
trId = new TRId();
|
||||
trId.setId(taskWrapper.getTrId().getId());
|
||||
trId = retrieveTabularResourceBasicData(trId);
|
||||
|
||||
operationMonitor.setTrId(trId);
|
||||
tabResource = SessionUtil.getSDMXImportTabResource(session);
|
||||
logger.debug("CurrentTabResource :" + tabResource);
|
||||
if (tabResource != null) {
|
||||
tabResource.setTrId(trId);
|
||||
SessionUtil.setTabResource(session, tabResource);
|
||||
} else {
|
||||
tabResource = new TabResource();
|
||||
tabResource.setTrId(trId);
|
||||
SessionUtil.setTabResource(session, tabResource);
|
||||
}
|
||||
SessionUtil.setTRId(session, trId);
|
||||
SessionUtil.addToCurrentTabularResourcesOpen(session,tabResource);
|
||||
break;
|
||||
|
||||
default:
|
||||
trId = new TRId();
|
||||
trId.setId(taskWrapper.getTrId().getId());
|
||||
|
|
Loading…
Reference in New Issue