use of eu.esdihumboldt.hale.io.haleconnect.HaleConnectProjectInfo in project hale by halestudio.
the class ChooseHaleConnectProjectWizardPage method updateConfiguration.
/**
* @see eu.esdihumboldt.hale.ui.util.wizard.ConfigurationWizardPage#updateConfiguration(java.lang.Object)
*/
@Override
public boolean updateConfiguration(HaleConnectProjectConfig configuration) {
if (projects.getSelection().isEmpty()) {
return false;
}
StructuredSelection selection = (StructuredSelection) projects.getSelection();
if (!(selection.getFirstElement() instanceof HaleConnectProjectInfo)) {
return false;
}
HaleConnectProjectInfo pi = (HaleConnectProjectInfo) selection.getFirstElement();
configuration.setProjectId(pi.getId());
configuration.setProjectName(pi.getName());
configuration.setOwner(pi.getOwner());
configuration.setLastModified(pi.getLastModified());
return true;
}
use of eu.esdihumboldt.hale.io.haleconnect.HaleConnectProjectInfo in project hale by halestudio.
the class HaleConnectServiceImpl method processBucketDetail.
@SuppressWarnings("unchecked")
private HaleConnectProjectInfo processBucketDetail(BucketDetail bucket) {
String author = null;
Long lastModified = bucket.getLastModified();
if (bucket.getProperties() instanceof Map<?, ?>) {
Map<Object, Object> properties = (Map<Object, Object>) bucket.getProperties();
if (properties.containsKey("author")) {
author = properties.get("author").toString();
}
}
HaleConnectUserInfo user = null;
HaleConnectOrganisationInfo org = null;
try {
if (!StringUtils.isEmpty(bucket.getId().getUserId())) {
user = this.getUserInfo(bucket.getId().getUserId());
}
if (!StringUtils.isEmpty(bucket.getId().getOrgId())) {
org = this.getOrganisationInfo(bucket.getId().getOrgId());
}
} catch (HaleConnectException e) {
log.error(e.getMessage(), e);
}
return new HaleConnectProjectInfo(bucket.getId().getTransformationproject(), user, org, bucket.getName(), author, lastModified);
}
Aggregations