added properties for source version and target java version

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@148904 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-05-19 12:26:33 +00:00
parent 7e779c3cef
commit 13b24671a7
6 changed files with 49 additions and 14 deletions

View File

@ -952,9 +952,9 @@ public class CreateDatasetForm extends Composite{
if(groupsTitle != null){
for (String groupTitle : groupsTitle) {
if(field.isGroupToForce())
groupsToForceCreation.add(new OrganizationBean(groupTitle, groupTitle, false));
groupsToForceCreation.add(new OrganizationBean(groupTitle, groupTitle, false, field.isPropagateUp()));
else
groups.add(new OrganizationBean(groupTitle, groupTitle, false));
groups.add(new OrganizationBean(groupTitle, groupTitle, false, field.isPropagateUp()));
}
}
}

View File

@ -782,5 +782,17 @@ public class MetaDataFieldSkeleton extends Composite{
}
return false;
}
/**
* Check if the propagateUp is set
* @return
*/
public boolean isPropagateUp(){
FieldAsGroup asGroup = field.getAsGroup();
if(asGroup != null){
return asGroup.isPropagateUp();
}
return false;
}
}

View File

@ -119,7 +119,7 @@ public class AssociationToGroupAndNotifyThread extends Thread {
if(group == null)
logger.warn("Unable to retrieve or create group with name " + group);
else
groups.add(new OrganizationBean(group.getTitle(), group.getName(), false));
groups.add(new OrganizationBean(group.getTitle(), group.getName(), false, groupToForce.isPropagateUp()));
}
}
@ -128,9 +128,8 @@ public class AssociationToGroupAndNotifyThread extends Thread {
if(groups != null)
for (OrganizationBean groupBean : groups) {
boolean putIntoGroup = catalogue.assignDatasetToGroup(groupBean.getName(), datasetId, catalogue.getApiKeyFromUsername(username));
boolean putIntoGroup = catalogue.assignDatasetToGroup(groupBean.getName(), datasetId, catalogue.getApiKeyFromUsername(username), groupBean.isPropagateUp());
logger.info("Was product put into group" + groupBean.getTitle() + "? " + putIntoGroup);
if(putIntoGroup)
notifyGroupAdmins(catalogue, groupBean.getName() ,groupBean.getTitle(), username);
}

View File

@ -213,6 +213,7 @@ public class MetadataDiscovery {
FieldAsGroup group = new FieldAsGroup();
group.setCreate(grouping.getCreate());
group.setPropagateUp(grouping.getPropagateUp());
group.setGroupingValue(TaggingGroupingValue.valueOf(grouping.getGroupingValue().toString()));
wrapperObj.setAsGroup(group);
@ -272,8 +273,4 @@ public class MetadataDiscovery {
return beans;
}
// public static void main(String[] args) throws Exception {
// MetadataDiscovery.getMetadataProfilesList("/gcube/devsec/devVRE", null);
// }
}

View File

@ -12,6 +12,7 @@ public class OrganizationBean implements Serializable{
private String title;
private String name;
private boolean isOrganization;
private boolean propagateUp; // an item linked to this group has to be added on the whole hierarchy chain
public OrganizationBean(){
super();
@ -23,6 +24,14 @@ public class OrganizationBean implements Serializable{
this.name = name;
this.isOrganization = isOrganization;
}
public OrganizationBean(String title, String name, boolean isOrganization, boolean propagateUp) {
super();
this.title = title;
this.name = name;
this.isOrganization = isOrganization;
this.propagateUp = propagateUp;
}
public String getTitle() {
return title;
@ -48,10 +57,19 @@ public class OrganizationBean implements Serializable{
this.isOrganization = isOrganization;
}
public boolean isPropagateUp() {
return propagateUp;
}
public void setPropagateUp(boolean propagateUp) {
this.propagateUp = propagateUp;
}
@Override
public String toString() {
return "OrganizationBean [title=" + title + ", name=" + name
+ ", isOrganization=" + isOrganization + "]";
+ ", isOrganization=" + isOrganization + ", propagateUp="
+ propagateUp + "]";
}
}

View File

@ -14,14 +14,15 @@ public class FieldAsGroup implements Serializable{
private static final long serialVersionUID = 8096886403417944385L;
private boolean create;
private boolean isPropagateUp;
private TaggingGroupingValue groupingValue;
public FieldAsGroup() {
super();
}
public FieldAsGroup(boolean create, TaggingGroupingValue groupingValue) {
public FieldAsGroup(boolean create, TaggingGroupingValue groupingValue, boolean isPropagateUp) {
this.isPropagateUp = isPropagateUp;
this.create = create;
this.groupingValue = groupingValue;
}
@ -42,10 +43,18 @@ public class FieldAsGroup implements Serializable{
this.groupingValue = groupingValue;
}
public boolean isPropagateUp() {
return isPropagateUp;
}
public void setPropagateUp(boolean isPropagateUp) {
this.isPropagateUp = isPropagateUp;
}
@Override
public String toString() {
return "FieldAsGroup [create=" + create + ", groupingValue="
+ groupingValue + "]";
return "FieldAsGroup [create=" + create + ", isPropagateUp="
+ isPropagateUp + ", groupingValue=" + groupingValue + "]";
}
}