bug fixing resouces to publish
This commit is contained in:
parent
475d74228b
commit
b8b94a58e4
|
@ -1074,8 +1074,9 @@ public class CreateDatasetForm extends Composite{
|
||||||
receivedBean.setGroupsForceCreation(groupsToForceCreation);
|
receivedBean.setGroupsForceCreation(groupsToForceCreation);
|
||||||
|
|
||||||
|
|
||||||
if(resourcesSelectByWEMainPanel != null)
|
if(resourcesSelectByWEMainPanel != null) {
|
||||||
receivedBean.setResourceRoot(resourcesSelectByWEMainPanel.getResourcesToPublish());
|
receivedBean.setResourceRoot(resourcesSelectByWEMainPanel.getResourcesToPublish());
|
||||||
|
}
|
||||||
|
|
||||||
receivedBean.setCustomFields(customFieldsMap);
|
receivedBean.setCustomFields(customFieldsMap);
|
||||||
|
|
||||||
|
|
|
@ -279,12 +279,16 @@ public class SelectResourceByWEMainPanel extends Composite {
|
||||||
for (String wsItemId : mapSelectedResources.keySet()) {
|
for (String wsItemId : mapSelectedResources.keySet()) {
|
||||||
SelectedResourceWidget selecWC = mapSelectedResources.get(wsItemId);
|
SelectedResourceWidget selecWC = mapSelectedResources.get(wsItemId);
|
||||||
ResourceElementBean theResource = selecWC.getResourceBean();
|
ResourceElementBean theResource = selecWC.getResourceBean();
|
||||||
|
theResource.setToBeAdded(true);
|
||||||
|
|
||||||
if(!theResource.isFolder()){ // be sure ...
|
if(!theResource.isFolder()){ // be sure ...
|
||||||
children.add(theResource);
|
children.add(theResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toReturn.setToPublish(children);
|
||||||
|
GWT.log("resources to publish are: "+toReturn.getToPublish());
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,14 +341,24 @@ public class WorkspaceUtils {
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
public static List<ResourceBean> toResources(DatasetBean bean, Workspace workspace, String username) throws Exception{
|
public static List<ResourceBean> toResources(DatasetBean bean, Workspace workspace, String username) throws Exception{
|
||||||
|
logger.debug("Called to Resources...: ");
|
||||||
|
|
||||||
logger.debug("Request to copy onto catalogue area....");
|
|
||||||
List<ResourceBean> resources = new ArrayList<ResourceBean>();
|
List<ResourceBean> resources = new ArrayList<ResourceBean>();
|
||||||
ResourceElementBean rootResource = bean.getResourceRoot();
|
ResourceElementBean rootResource = bean.getResourceRoot();
|
||||||
|
|
||||||
|
if(rootResource==null) {
|
||||||
|
logger.info("No resource root, returning empty list of resources");
|
||||||
|
return resources;
|
||||||
|
}
|
||||||
|
|
||||||
// retrieve the children
|
// retrieve the children
|
||||||
List<ResourceElementBean> resourcesToAdd = rootResource.getToPublish();
|
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
|
// copy only the selected ones
|
||||||
for(ResourceElementBean resource : resourcesToAdd){
|
for(ResourceElementBean resource : resourcesToAdd){
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
|
||||||
/** The children size. */
|
/** The children size. */
|
||||||
private Integer childrenSize;
|
private Integer childrenSize;
|
||||||
|
|
||||||
/** The to publish. */
|
// /** The to publish. */
|
||||||
private List<ResourceElementBean> toPublish; //Resources that must be published
|
private List<ResourceElementBean> toPublish; //Resources that must be published
|
||||||
|
|
||||||
/** The next id. */
|
/** The next id. */
|
||||||
|
|
Loading…
Reference in New Issue