Revisit the "Select Item Resources" step when publishing from Workspace
#26874
This commit is contained in:
parent
ff1500b991
commit
4a5ed9caa5
|
@ -24,7 +24,6 @@ import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.Ad
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.ManageResources;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.ManageResources;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.utils.InfoIconsLabels;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.utils.InfoIconsLabels;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.utils.WizardCreator;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.utils.WizardCreator;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.workspace.SelectResourceByWEMainPanel;
|
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.DatasetBean;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.DatasetBean;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.MetadataProfileBeanForUpdate;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.MetadataProfileBeanForUpdate;
|
||||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
|
||||||
|
@ -310,7 +309,7 @@ public class UpdateDatasetForm extends Composite {
|
||||||
private DatasetBean theDatasetBean;
|
private DatasetBean theDatasetBean;
|
||||||
|
|
||||||
// resource table
|
// resource table
|
||||||
private SelectResourceByWEMainPanel resourcesSelectByWEMainPanel;
|
//private SelectResourceByWEMainPanel resourcesSelectByWEMainPanel;
|
||||||
|
|
||||||
// List of opened popup'ids
|
// List of opened popup'ids
|
||||||
private List<String> popupOpenedIds = new ArrayList<String>();
|
private List<String> popupOpenedIds = new ArrayList<String>();
|
||||||
|
@ -515,11 +514,11 @@ public class UpdateDatasetForm extends Composite {
|
||||||
// set it as visible anyway
|
// set it as visible anyway
|
||||||
tagsPanel.setVisible(true);
|
tagsPanel.setVisible(true);
|
||||||
|
|
||||||
// The resource root is the folder id. Es. ID of the Workspace Root folder.
|
// // The resource root is the folder id. Es. ID of the Workspace Root folder.
|
||||||
if (datasetBean.getResourceRoot() != null) {
|
// if (datasetBean.getResourceRoot() != null) {
|
||||||
resourcesSelectByWEMainPanel = new SelectResourceByWEMainPanel(
|
// resourcesSelectByWEMainPanel = new SelectResourceByWEMainPanel(
|
||||||
datasetBean.getResourceRoot());
|
// datasetBean.getResourceRoot());
|
||||||
}
|
// }
|
||||||
|
|
||||||
// set organizations
|
// set organizations
|
||||||
List<OrganizationBean> organizations = datasetBean.getOrganizationList();
|
List<OrganizationBean> organizations = datasetBean.getOrganizationList();
|
||||||
|
@ -946,7 +945,7 @@ public class UpdateDatasetForm extends Composite {
|
||||||
// add the resources to the container panel
|
// add the resources to the container panel
|
||||||
if (workspaceResourcesContainer.getWidget() == null) {
|
if (workspaceResourcesContainer.getWidget() == null) {
|
||||||
workspaceResourcesContainer.getElement().getStyle().setMarginLeft(20, Unit.PX);
|
workspaceResourcesContainer.getElement().getStyle().setMarginLeft(20, Unit.PX);
|
||||||
workspaceResourcesContainer.add(resourcesSelectByWEMainPanel);
|
//workspaceResourcesContainer.add(resourcesSelectByWEMainPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -1156,9 +1155,9 @@ public class UpdateDatasetForm extends Composite {
|
||||||
theDatasetBean.setGroups(groups);
|
theDatasetBean.setGroups(groups);
|
||||||
theDatasetBean.setGroupsForceCreation(groupsToForceCreation);
|
theDatasetBean.setGroupsForceCreation(groupsToForceCreation);
|
||||||
|
|
||||||
if (resourcesSelectByWEMainPanel != null) {
|
// if (resourcesSelectByWEMainPanel != null) {
|
||||||
theDatasetBean.setResourceRoot(resourcesSelectByWEMainPanel.getResourcesToPublish());
|
// theDatasetBean.setResourceRoot(resourcesSelectByWEMainPanel.getResourcesToPublish());
|
||||||
}
|
// }
|
||||||
|
|
||||||
theDatasetBean.setCustomFields(customFieldsMap);
|
theDatasetBean.setCustomFields(customFieldsMap);
|
||||||
|
|
||||||
|
@ -1600,9 +1599,9 @@ public class UpdateDatasetForm extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// freeze table of resources
|
// // freeze table of resources
|
||||||
if (resourcesSelectByWEMainPanel != null)
|
// if (resourcesSelectByWEMainPanel != null)
|
||||||
resourcesSelectByWEMainPanel.freeze();
|
// resourcesSelectByWEMainPanel.freeze();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,14 +35,23 @@ import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form used to add resource(s) to a dataset
|
* The Class AddResourceToDataset.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
*
|
*
|
||||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
* Feb 23, 2024
|
||||||
*/
|
*/
|
||||||
public class AddResourceToDataset extends Composite {
|
public class AddResourceToDataset extends Composite {
|
||||||
|
|
||||||
private static AddResourceToDatasetUiBinder uiBinder = GWT.create(AddResourceToDatasetUiBinder.class);
|
private static AddResourceToDatasetUiBinder uiBinder = GWT.create(AddResourceToDatasetUiBinder.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface AddResourceToDatasetUiBinder.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Feb 23, 2024
|
||||||
|
*/
|
||||||
interface AddResourceToDatasetUiBinder extends UiBinder<Widget, AddResourceToDataset> {
|
interface AddResourceToDatasetUiBinder extends UiBinder<Widget, AddResourceToDataset> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,6 +91,15 @@ public class AddResourceToDataset extends Composite {
|
||||||
|
|
||||||
FlowPanel alertPanel = new FlowPanel();
|
FlowPanel alertPanel = new FlowPanel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new adds the resource to dataset.
|
||||||
|
*
|
||||||
|
* @param eventBus the event bus
|
||||||
|
* @param datasetId the dataset id
|
||||||
|
* @param datasetTitle the dataset title
|
||||||
|
* @param datasetOrg the dataset org
|
||||||
|
* @param datasetUrl the dataset url
|
||||||
|
*/
|
||||||
public AddResourceToDataset(HandlerManager eventBus, final String datasetId, String datasetTitle,
|
public AddResourceToDataset(HandlerManager eventBus, final String datasetId, String datasetTitle,
|
||||||
final String datasetOrg, final String datasetUrl) {
|
final String datasetOrg, final String datasetUrl) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
@ -115,6 +133,9 @@ public class AddResourceToDataset extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bind.
|
||||||
|
*/
|
||||||
private void bind() {
|
private void bind() {
|
||||||
|
|
||||||
eventBus.addHandler(WorkspaceItemSelectedEvent.TYPE, new WorkspaceItemSelectedEventHandler() {
|
eventBus.addHandler(WorkspaceItemSelectedEvent.TYPE, new WorkspaceItemSelectedEventHandler() {
|
||||||
|
@ -149,6 +170,11 @@ public class AddResourceToDataset extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On select from workspace click.
|
||||||
|
*
|
||||||
|
* @param e the e
|
||||||
|
*/
|
||||||
@UiHandler("buttoSelectFromWorkspace")
|
@UiHandler("buttoSelectFromWorkspace")
|
||||||
void onSelectFromWorkspaceClick(ClickEvent e) {
|
void onSelectFromWorkspaceClick(ClickEvent e) {
|
||||||
|
|
||||||
|
@ -165,6 +191,11 @@ public class AddResourceToDataset extends Composite {
|
||||||
dialog.center();
|
dialog.center();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On add button click.
|
||||||
|
*
|
||||||
|
* @param e the e
|
||||||
|
*/
|
||||||
@UiHandler("addResourceButton")
|
@UiHandler("addResourceButton")
|
||||||
void onAddButtonClick(ClickEvent e) {
|
void onAddButtonClick(ClickEvent e) {
|
||||||
|
|
||||||
|
@ -228,8 +259,7 @@ public class AddResourceToDataset extends Composite {
|
||||||
} else
|
} else
|
||||||
showAlert("Unable to add this resource. Check that the url is correct", null, AlertType.ERROR, true,
|
showAlert("Unable to add this resource. Check that the url is correct", null, AlertType.ERROR, true,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
|
||||||
addResourceButton.setEnabled(true);
|
addResourceButton.setEnabled(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -239,7 +269,7 @@ public class AddResourceToDataset extends Composite {
|
||||||
infoPanel.clear();
|
infoPanel.clear();
|
||||||
showAlert("Unable to add this resource, sorry. Error is: " + caught.getMessage(), null, AlertType.ERROR,
|
showAlert("Unable to add this resource, sorry. Error is: " + caught.getMessage(), null, AlertType.ERROR,
|
||||||
true, true);
|
true, true);
|
||||||
|
|
||||||
addResourceButton.setEnabled(true);
|
addResourceButton.setEnabled(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -249,9 +279,12 @@ public class AddResourceToDataset extends Composite {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show error/success after resource creation attempt.
|
* Show error/success after resource creation attempt.
|
||||||
*
|
*
|
||||||
* @param text
|
* @param text the text
|
||||||
* @param type
|
* @param loader the loader
|
||||||
|
* @param type the type
|
||||||
|
* @param scheduleHide the schedule hide
|
||||||
|
* @param setVisible the set visible
|
||||||
*/
|
*/
|
||||||
protected void showAlert(String text, LoaderIcon loader, AlertType type, boolean scheduleHide, boolean setVisible) {
|
protected void showAlert(String text, LoaderIcon loader, AlertType type, boolean scheduleHide, boolean setVisible) {
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
|
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
@ -62,7 +61,7 @@ public class ResourceInfoForm extends Composite{
|
||||||
resourcePath.setText(resource.getFullPath());
|
resourcePath.setText(resource.getFullPath());
|
||||||
closeButton.getElement().getStyle().setFloat(Float.RIGHT);
|
closeButton.getElement().getStyle().setFloat(Float.RIGHT);
|
||||||
closeButton.setIcon(IconType.REMOVE_CIRCLE);
|
closeButton.setIcon(IconType.REMOVE_CIRCLE);
|
||||||
commandPanel.setCellHorizontalAlignment(updateResourceButton, HasHorizontalAlignment.ALIGN_RIGHT);
|
//commandPanel.setCellHorizontalAlignment(updateResourceButton, HasHorizontalAlignment.ALIGN_RIGHT);
|
||||||
commandPanel.getElement().getStyle().setMarginTop(10, Unit.PX);
|
commandPanel.getElement().getStyle().setMarginTop(10, Unit.PX);
|
||||||
updateResourceButton.addClickHandler(new ClickHandler() {
|
updateResourceButton.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border: 1px solid #bbb;
|
border: 1px solid #bbb;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
height: 320px;
|
height: 300px;
|
||||||
width: 700px;
|
/*width: 700px;*/
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,11 +32,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-input input {
|
.custom-input input {
|
||||||
width: 350px;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-input textarea {
|
.custom-input textarea {
|
||||||
width: 355px;
|
width: 81%;
|
||||||
}
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel addStyleNames="{style.panel-style}">
|
<g:HTMLPanel addStyleNames="{style.panel-style}">
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<b:Legend addStyleNames="{style.legend-style}">
|
<b:Legend addStyleNames="{style.legend-style}">
|
||||||
<b>Resource Information</b>
|
<b>Resource Information</b>
|
||||||
<b:Button ui:field="closeButton" type="LINK"
|
<b:Button ui:field="closeButton" type="LINK"
|
||||||
title="Close details"></b:Button>
|
title="Close details" visible="false"></b:Button>
|
||||||
</b:Legend>
|
</b:Legend>
|
||||||
<b:ControlGroup ui:field="controlName">
|
<b:ControlGroup ui:field="controlName">
|
||||||
<b:ControlLabel for="name"
|
<b:ControlLabel for="name"
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
<g:HorizontalPanel width="100%"
|
<g:HorizontalPanel width="100%"
|
||||||
ui:field="commandPanel">
|
ui:field="commandPanel">
|
||||||
<!-- <b:Button ui:field="cancelButton">Cancel</b:Button> -->
|
<!-- <b:Button ui:field="cancelButton">Cancel</b:Button> -->
|
||||||
<b:Button ui:field="updateResourceButton" type="PRIMARY">Update</b:Button>
|
<b:Button ui:field="updateResourceButton" type="INFO">Update</b:Button>
|
||||||
</g:HorizontalPanel>
|
</g:HorizontalPanel>
|
||||||
</b:Fieldset>
|
</b:Fieldset>
|
||||||
</b:Form>
|
</b:Form>
|
||||||
|
|
|
@ -40,14 +40,14 @@
|
||||||
<g:HTMLPanel ui:field="containerPickResources"
|
<g:HTMLPanel ui:field="containerPickResources"
|
||||||
addStyleNames="{style.margin-top-30}">
|
addStyleNames="{style.margin-top-30}">
|
||||||
<b:AccordionGroup ui:field="buttPickResources"
|
<b:AccordionGroup ui:field="buttPickResources"
|
||||||
heading="Add files from..." defaultOpen="false"
|
heading="Select from Workspace..." defaultOpen="false"
|
||||||
addStyleNames="accordion-no-border-inner">
|
addStyleNames="accordion-no-border-inner">
|
||||||
<b:FluidRow addStyleNames="{style.max-height-250}">
|
<b:FluidRow addStyleNames="{style.max-height-250}">
|
||||||
<g:VerticalPanel ui:field="wsContainer">
|
<g:VerticalPanel ui:field="wsContainer">
|
||||||
</g:VerticalPanel>
|
</g:VerticalPanel>
|
||||||
</b:FluidRow>
|
</b:FluidRow>
|
||||||
<b:Button ui:field="buttSelectResource"
|
<b:Button ui:field="buttSelectResource"
|
||||||
addStyleNames="{style.margin-top-10}">Select</b:Button>
|
type="INFO" addStyleNames="{style.margin-top-10}">Select</b:Button>
|
||||||
</b:AccordionGroup>
|
</b:AccordionGroup>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
|
|
|
@ -7,9 +7,12 @@ import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
import com.google.gwt.event.dom.client.MouseDownEvent;
|
||||||
|
import com.google.gwt.event.dom.client.MouseDownHandler;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
import com.google.gwt.user.client.ui.Label;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
@ -19,7 +22,7 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
*
|
*
|
||||||
* Mar 12, 2021
|
* Mar 12, 2021
|
||||||
*/
|
*/
|
||||||
public class SelectedResourceWidget extends Composite {
|
public class SelectedResourceWidget extends Composite {
|
||||||
|
|
||||||
|
@ -31,7 +34,7 @@ public class SelectedResourceWidget extends Composite {
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||||
*
|
*
|
||||||
* Mar 12, 2021
|
* Mar 12, 2021
|
||||||
*/
|
*/
|
||||||
interface SelectedResourceWidgetUiBinder extends UiBinder<Widget, SelectedResourceWidget> {
|
interface SelectedResourceWidgetUiBinder extends UiBinder<Widget, SelectedResourceWidget> {
|
||||||
}
|
}
|
||||||
|
@ -54,14 +57,22 @@ public class SelectedResourceWidget extends Composite {
|
||||||
/** The field name. */
|
/** The field name. */
|
||||||
@UiField
|
@UiField
|
||||||
Label fieldName;
|
Label fieldName;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
Label fieldDescription;
|
Label fieldDescription;
|
||||||
|
|
||||||
/** The edit panel. */
|
/** The edit panel. */
|
||||||
@UiField
|
@UiField
|
||||||
HTMLPanel editPanel;
|
HTMLPanel editPanel;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
FlowPanel resourcePanel;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
FlowPanel selectedResourcesPanelTitle;
|
||||||
|
|
||||||
|
private boolean selectetResource = false;
|
||||||
|
|
||||||
/** The resource bean. */
|
/** The resource bean. */
|
||||||
private ResourceElementBean resourceBean;
|
private ResourceElementBean resourceBean;
|
||||||
|
|
||||||
|
@ -79,46 +90,66 @@ public class SelectedResourceWidget extends Composite {
|
||||||
addHandlers();
|
addHandlers();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateFields() {
|
private void updateFields() {
|
||||||
this.fieldName.setText(resourceBean.getEditableName());
|
this.fieldName.setText(resourceBean.getEditableName());
|
||||||
|
|
||||||
if(resourceBean.getDescription()!=null && !resourceBean.getDescription().isEmpty()) {
|
if (resourceBean.getDescription() != null && !resourceBean.getDescription().isEmpty()) {
|
||||||
this.fieldDescription.setVisible(true);
|
this.fieldDescription.setVisible(true);
|
||||||
this.fieldDescription.setText(resourceBean.getDescription());
|
this.fieldDescription.setText(resourceBean.getDescription());
|
||||||
}else
|
} else
|
||||||
this.fieldDescription.setVisible(false);
|
this.fieldDescription.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the handlers.
|
* Adds the handlers.
|
||||||
*/
|
*/
|
||||||
private void addHandlers() {
|
private void addHandlers() {
|
||||||
|
|
||||||
buttonEdit.addClickHandler(new ClickHandler() {
|
buttonEdit.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
editPanel.clear();
|
manageEditOpenResource();
|
||||||
ResourceInfoForm resourceInformationInfo = new ResourceInfoForm(resourceBean) {
|
|
||||||
protected void onUnload() {
|
|
||||||
super.onUnload();
|
|
||||||
updateFields();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
editPanel.add(resourceInformationInfo);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonDelete.addClickHandler(new ClickHandler() {
|
buttonDelete.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
SelectResourceByWEMainPanel.eventBus.fireEvent(new RemovePublishingResourceEvent(resourceBean));
|
SelectResourceByWEMainPanel.eventBus.fireEvent(new RemovePublishingResourceEvent(resourceBean));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
MouseDownHandler handler = new MouseDownHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMouseDown(MouseDownEvent event) {
|
||||||
|
manageEditOpenResource();
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
selectedResourcesPanelTitle.addDomHandler(handler, MouseDownEvent.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void manageEditOpenResource() {
|
||||||
|
|
||||||
|
editPanel.clear();
|
||||||
|
if (selectetResource) {
|
||||||
|
selectetResource = false;
|
||||||
|
} else {
|
||||||
|
ResourceInfoForm resourceInformationInfo = new ResourceInfoForm(resourceBean) {
|
||||||
|
protected void onUnload() {
|
||||||
|
super.onUnload();
|
||||||
|
updateFields();
|
||||||
|
};
|
||||||
|
};
|
||||||
|
editPanel.add(resourceInformationInfo);
|
||||||
|
selectetResource = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,14 +7,6 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected-resources {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected-resources td {
|
|
||||||
vertical-align: middle !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin-bottom-8 {
|
.margin-bottom-8 {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +18,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-text {
|
.title-text {
|
||||||
font-weight: bold;
|
/*font-weight: bold;*/
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
display: inline;
|
display: inline;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
@ -41,14 +33,18 @@
|
||||||
}
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel addStyleNames="{style.margin-bottom-8}">
|
<g:HTMLPanel addStyleNames="{style.margin-bottom-8}">
|
||||||
<g:FlowPanel addStyleNames="{style.selected-resources}">
|
<g:FlowPanel addStyleNames="selected-resources-ws"
|
||||||
|
ui:field="resourcePanel">
|
||||||
<!-- <b:Icon type="PUSHPIN" addStyleNames="{style.icon-my-style}"></b:Icon> -->
|
<!-- <b:Icon type="PUSHPIN" addStyleNames="{style.icon-my-style}"></b:Icon> -->
|
||||||
<b:Button ui:field="buttonEdit" icon="PENCIL"
|
<b:Button ui:field="buttonEdit" icon="PENCIL"
|
||||||
title="Edit the resource information" />
|
title="Edit the resource information" />
|
||||||
<b:Button ui:field="buttonDelete" icon="TRASH"
|
<b:Button ui:field="buttonDelete" icon="TRASH"
|
||||||
title="Remove this resource" />
|
title="Remove this resource" />
|
||||||
<g:Label ui:field="fieldName"
|
<g:FlowPanel ui:field="selectedResourcesPanelTitle"
|
||||||
addStyleNames="{style.title-text}"></g:Label>
|
addStyleNames="selected-resources-ws-title">
|
||||||
|
<g:Label ui:field="fieldName"
|
||||||
|
addStyleNames="{style.title-text}"></g:Label>
|
||||||
|
</g:FlowPanel>
|
||||||
<g:Label ui:field="fieldDescription" visible="false"
|
<g:Label ui:field="fieldDescription" visible="false"
|
||||||
addStyleNames="{style.descr-text}"></g:Label>
|
addStyleNames="{style.descr-text}"></g:Label>
|
||||||
</g:FlowPanel>
|
</g:FlowPanel>
|
||||||
|
|
|
@ -62,6 +62,24 @@
|
||||||
padding: 4px 4px !important;
|
padding: 4px 4px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.selected-resources-ws {
|
||||||
|
background-color: #f1f3f9 !important;
|
||||||
|
padding: 5px;
|
||||||
|
box-shadow: 0px 3px #888;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected-resources-ws td {
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected-resources-ws-title {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
.selected-resources-ws-title:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
/* WIZARD-CREATOR CLASSES */
|
/* WIZARD-CREATOR CLASSES */
|
||||||
.wizard-creator {
|
.wizard-creator {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -1187,8 +1187,9 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
logger.info("Checking if the user " + username + " can publish or not on the catalogue");
|
logger.info("Checking if the user " + username + " can publish or not on the catalogue");
|
||||||
|
|
||||||
if (!isWithinPortal()) {
|
if (!isWithinPortal()) {
|
||||||
logger.warn("OUT FROM PORTAL DETECTED RETURNING TRUE");
|
boolean isPublisherFunny = true;
|
||||||
return true;
|
logger.warn("OUT FROM PORTAL DETECTED RETURNING: "+isPublisherFunny);
|
||||||
|
return isPublisherFunny;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -73,7 +73,8 @@ public class CatalogueRoleManager {
|
||||||
List<GCubeGroup> listGroups = groupManager.listGroupsByUser(userid);
|
List<GCubeGroup> listGroups = groupManager.listGroupsByUser(userid);
|
||||||
groups = new HashSet<GCubeGroup>(listGroups);
|
groups = new HashSet<GCubeGroup>(listGroups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Used by Workspace?
|
||||||
// root (so check into the root, the VOs and the VRES)
|
// root (so check into the root, the VOs and the VRES)
|
||||||
if(groupManager.isRootVO(currentGroupId)){
|
if(groupManager.isRootVO(currentGroupId)){
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue