bug fixing resouces to publish

This commit is contained in:
Francesco Mangiacrapa 2021-03-19 17:39:48 +01:00
parent 475d74228b
commit b8b94a58e4
4 changed files with 20 additions and 5 deletions

View File

@ -1074,8 +1074,9 @@ public class CreateDatasetForm extends Composite{
receivedBean.setGroupsForceCreation(groupsToForceCreation);
if(resourcesSelectByWEMainPanel != null)
if(resourcesSelectByWEMainPanel != null) {
receivedBean.setResourceRoot(resourcesSelectByWEMainPanel.getResourcesToPublish());
}
receivedBean.setCustomFields(customFieldsMap);

View File

@ -279,15 +279,19 @@ public class SelectResourceByWEMainPanel extends Composite {
for (String wsItemId : mapSelectedResources.keySet()) {
SelectedResourceWidget selecWC = mapSelectedResources.get(wsItemId);
ResourceElementBean theResource = selecWC.getResourceBean();
theResource.setToBeAdded(true);
if(!theResource.isFolder()){ // be sure ...
children.add(theResource);
}
}
toReturn.setToPublish(children);
GWT.log("resources to publish are: "+toReturn.getToPublish());
return toReturn;
}
/**
* @return the freezed

View File

@ -341,13 +341,23 @@ public class WorkspaceUtils {
* @throws Exception the exception
*/
public static List<ResourceBean> toResources(DatasetBean bean, Workspace workspace, String username) throws Exception{
logger.debug("Request to copy onto catalogue area....");
logger.debug("Called to Resources...: ");
List<ResourceBean> resources = new ArrayList<ResourceBean>();
ResourceElementBean rootResource = bean.getResourceRoot();
if(rootResource==null) {
logger.info("No resource root, returning empty list of resources");
return resources;
}
// retrieve the children
List<ResourceElementBean> resourcesToAdd = rootResource.getToPublish();
if(resourcesToAdd==null) {
logger.info("No resource to add, returning empty list of resources");
return resources;
}
// copy only the selected ones
for(ResourceElementBean resource : resourcesToAdd){

View File

@ -54,7 +54,7 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
/** The children size. */
private Integer childrenSize;
/** The to publish. */
// /** The to publish. */
private List<ResourceElementBean> toPublish; //Resources that must be published
/** The next id. */