Improvements
This commit is contained in:
parent
63e2191c0b
commit
20eee57584
|
@ -1,11 +1,9 @@
|
|||
package org.gcube.portlets.widgets.ckan2zenodopublisher.client;
|
||||
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.TabPanelBasicPanel;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.Ckan2ZenodoViewManager;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.CatalogueItem;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Modal;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
/**
|
||||
|
@ -42,29 +40,9 @@ public class CkanToZendoPublisherWidget {
|
|||
|
||||
@Override
|
||||
public void onSuccess(ZenodoItem result) {
|
||||
Modal modal = new Modal(true);
|
||||
|
||||
Ckan2ZenodoViewManager manager = new Ckan2ZenodoViewManager();
|
||||
TabPanelBasicPanel theForm = manager.viewForPublishing(result);
|
||||
// BasicInformationView form = new BasicInformationView(result) {
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void submitHandler() {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setError(boolean visible, String error) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setConfirm(boolean visible, String msg) {
|
||||
// }
|
||||
// };
|
||||
modal.setTitle("Publishing on Zenodo...");
|
||||
modal.addStyleName("ckan2zenodo-modal-style");
|
||||
modal.setCloseVisible(true);
|
||||
modal.add(theForm);
|
||||
modal.show();
|
||||
manager.viewForPublishing(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,15 +5,30 @@ import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.authors.Creator
|
|||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
|
||||
/**
|
||||
* The Class RemoveCreatorEvent.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Dec 19, 2019
|
||||
*/
|
||||
public class RemoveCreatorEvent extends GwtEvent<RemoveCreatorEventHandler> {
|
||||
public static Type<RemoveCreatorEventHandler> TYPE = new Type<RemoveCreatorEventHandler>();
|
||||
|
||||
private CreatorView creatorView;
|
||||
|
||||
/**
|
||||
* Instantiates a new removes the creator event.
|
||||
*
|
||||
* @param view the view
|
||||
*/
|
||||
public RemoveCreatorEvent(CreatorView view) {
|
||||
this.creatorView = view;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||
*/
|
||||
@Override
|
||||
public Type<RemoveCreatorEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
|
@ -27,6 +42,11 @@ public class RemoveCreatorEvent extends GwtEvent<RemoveCreatorEventHandler> {
|
|||
handler.onAddedResource(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the creator view.
|
||||
*
|
||||
* @return the creator view
|
||||
*/
|
||||
public CreatorView getCreatorView() {
|
||||
return creatorView;
|
||||
}
|
||||
|
|
|
@ -2,10 +2,20 @@ package org.gcube.portlets.widgets.ckan2zenodopublisher.client.events;
|
|||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
|
||||
/**
|
||||
* Added resource handler interface
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
* The Interface RemoveCreatorEventHandler.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Dec 19, 2019
|
||||
*/
|
||||
public interface RemoveCreatorEventHandler extends EventHandler {
|
||||
|
||||
/**
|
||||
* On added resource.
|
||||
*
|
||||
* @param addResourceEvent the add resource event
|
||||
*/
|
||||
void onAddedResource(RemoveCreatorEvent addResourceEvent);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Pager;
|
||||
import com.github.gwtbootstrap.client.ui.Tab;
|
||||
import com.github.gwtbootstrap.client.ui.TabPanel;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public abstract class BasicTabPanel extends Composite {
|
||||
|
||||
private static BasicTabPanelUiBinder uiBinder = GWT.create(BasicTabPanelUiBinder.class);
|
||||
|
||||
interface BasicTabPanelUiBinder extends UiBinder<Widget, BasicTabPanel> {
|
||||
}
|
||||
|
||||
public abstract void checkTabVisited();
|
||||
|
||||
@UiField
|
||||
Tab acc_basic_info;
|
||||
|
||||
@UiField
|
||||
Tab acc_files;
|
||||
|
||||
@UiField
|
||||
TabPanel tabPanel;
|
||||
|
||||
@UiField
|
||||
Pager pager;
|
||||
|
||||
private List<Boolean> listActivatedTab = new ArrayList<>();
|
||||
|
||||
public static enum PAGER {BACK, NEXT}
|
||||
|
||||
public BasicTabPanel() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
listActivatedTab = new ArrayList<>();
|
||||
listActivatedTab.add(acc_basic_info.isActive());
|
||||
listActivatedTab.add(acc_files.isActive());
|
||||
|
||||
acc_basic_info.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
listActivatedTab.set(0, true);
|
||||
checkTabVisited();
|
||||
}
|
||||
});
|
||||
|
||||
acc_files.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
listActivatedTab.set(1, true);
|
||||
checkTabVisited();
|
||||
}
|
||||
});
|
||||
|
||||
pager.getRight().addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
managePager(PAGER.NEXT);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
pager.getLeft().addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
managePager(PAGER.BACK);
|
||||
}
|
||||
});
|
||||
|
||||
managePager(null);
|
||||
}
|
||||
|
||||
public Tab getAcc_basic_info() {
|
||||
return acc_basic_info;
|
||||
}
|
||||
|
||||
public Tab getAcc_files() {
|
||||
return acc_files;
|
||||
}
|
||||
|
||||
// public Tab getAcc_license() {
|
||||
// return acc_license;
|
||||
// }
|
||||
|
||||
public boolean allTabVisited() {
|
||||
for (Boolean value : listActivatedTab) {
|
||||
if (!value)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public TabPanel getTabPanel() {
|
||||
return tabPanel;
|
||||
}
|
||||
|
||||
private void managePager(PAGER direction){
|
||||
int selectTab = tabPanel.getSelectedTab();
|
||||
pager.getLeft().setVisible(true);
|
||||
pager.getRight().setVisible(true);
|
||||
|
||||
if(selectTab==0) {
|
||||
pager.getLeft().setVisible(false);
|
||||
}
|
||||
|
||||
if(selectTab==tabPanel.getWidgetCount()) {
|
||||
pager.getRight().setVisible(false);
|
||||
}
|
||||
|
||||
if(direction!=null) {
|
||||
int newSelectTabIndex = direction.equals(PAGER.BACK)?selectTab-1:selectTab+1;
|
||||
GWT.log("selecting index: "+newSelectTabIndex);
|
||||
|
||||
tabPanel.selectTab(newSelectTabIndex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
</ui:style>
|
||||
<g:HTMLPanel addStyleNames="form-font-size">
|
||||
<b:TabPanel tabPosition="left" ui:field="tabPanel">
|
||||
<b:Tab heading="The Item Information" icon="BOOK" active="true"
|
||||
<b:Tab heading="The Item" icon="BOOK" active="true"
|
||||
ui:field="acc_basic_info">
|
||||
</b:Tab>
|
||||
<!-- <b:AccordionGroup heading="Upload as type" -->
|
||||
|
@ -21,11 +21,13 @@
|
|||
<!-- </b:AccordionGroup> -->
|
||||
<b:Tab heading="Files" icon="UPLOAD" ui:field="acc_files">
|
||||
</b:Tab>
|
||||
<b:Tab heading="License" icon="STAR" ui:field="acc_license">
|
||||
</b:Tab>
|
||||
<!-- <b:Tab heading="License" icon="STAR" ui:field="acc_license"> -->
|
||||
<!-- </b:Tab> -->
|
||||
<!-- <b:AccordionGroup defaultOpen="true" -->
|
||||
<!-- heading="License" icon="STAR" ui:field="acc_license"> -->
|
||||
<!-- </b:AccordionGroup> -->
|
||||
</b:TabPanel>
|
||||
<b:Pager left="Go Back" right="Go Next" aligned="true"
|
||||
ui:field="pager" />
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -1,42 +0,0 @@
|
|||
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Tab;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class TabPanelBasicPanel extends Composite {
|
||||
|
||||
private static TabPanelBasicPanelUiBinder uiBinder = GWT.create(TabPanelBasicPanelUiBinder.class);
|
||||
|
||||
interface TabPanelBasicPanelUiBinder extends UiBinder<Widget, TabPanelBasicPanel> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
Tab acc_basic_info;
|
||||
|
||||
@UiField
|
||||
Tab acc_files;
|
||||
|
||||
@UiField
|
||||
Tab acc_license;
|
||||
|
||||
public TabPanelBasicPanel() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
public Tab getAcc_basic_info() {
|
||||
return acc_basic_info;
|
||||
}
|
||||
|
||||
public Tab getAcc_files() {
|
||||
return acc_files;
|
||||
}
|
||||
|
||||
public Tab getAcc_license() {
|
||||
return acc_license;
|
||||
}
|
||||
|
||||
}
|
|
@ -14,7 +14,6 @@ import com.github.gwtbootstrap.client.ui.TextArea;
|
|||
import com.github.gwtbootstrap.client.ui.TextBox;
|
||||
import com.github.gwtbootstrap.datepicker.client.ui.DateBox;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
|
@ -55,13 +54,22 @@ public abstract class BasicInformationView extends Composite {
|
|||
@UiField
|
||||
ListBox field_upload_type;
|
||||
|
||||
@UiField
|
||||
ListBox field_access_right;
|
||||
|
||||
@UiField
|
||||
ListBox field_license;
|
||||
|
||||
@UiField
|
||||
ListBox field_publication_type;
|
||||
|
||||
@UiField
|
||||
DateBox field_publication_date;
|
||||
|
||||
// @UiField
|
||||
// Pager pager;
|
||||
|
||||
public final static HandlerManager eventBus = new HandlerManager(null);
|
||||
//public final static HandlerManager eventBus = new HandlerManager(null);
|
||||
|
||||
|
||||
private boolean isEditConfiguration;
|
||||
|
@ -101,17 +109,27 @@ public abstract class BasicInformationView extends Composite {
|
|||
* @param zenodoItem the zenodo item
|
||||
* @param isUpdate the is update
|
||||
*/
|
||||
public BasicInformationView(final ZenodoItem zenodoItem, boolean isUpdate) {
|
||||
public BasicInformationView(final ZenodoItem zenodoItem, boolean isUpdate, final int tabIndex) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
this.zenodoItem = zenodoItem;
|
||||
fillForm();
|
||||
setVisibleFieldsForUpdate(isUpdate);
|
||||
//
|
||||
// pager.getRight().addClickHandler(new ClickHandler() {
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(ClickEvent event) {
|
||||
//
|
||||
// Ckan2ZenodoViewManager.eventBus.fireEvent(new TabPagerClickedEvent(TabPagerClickedEvent.PAGER.NEXT));
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// if(conf!=null)
|
||||
// this.isEditConfiguration = true;
|
||||
// this.editConfiguration = conf;
|
||||
|
||||
//bindEvents();
|
||||
//pager.getLeft().setVisible(false);
|
||||
fillForm();
|
||||
setVisibleFieldsForUpdate(isUpdate);
|
||||
|
||||
|
||||
// if (isEditConfiguration) {
|
||||
// pager.getRight().setText("Update Configuration");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
|
||||
xmlns:citem="urn:import:org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.authors"
|
||||
xmlns:ctag="urn:import:org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.tags"
|
||||
xmlns:b2="urn:import:com.github.gwtbootstrap.datepicker.client.ui">
|
||||
<ui:style>
|
||||
.noBorder {
|
||||
|
@ -19,7 +19,7 @@
|
|||
<b:Fieldset styleName="{style.noBorder}"
|
||||
ui:field="fieldset_basic_informations">
|
||||
<b:Legend addStyleNames="legend-style">
|
||||
Basic Information
|
||||
Item Information
|
||||
<small>
|
||||
<span style="color:red;">*</span>
|
||||
is required
|
||||
|
@ -62,6 +62,9 @@
|
|||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
|
||||
<ctag:TagsPanel></ctag:TagsPanel>
|
||||
|
||||
|
||||
<b:ControlGroup ui:field="cg_upload_type">
|
||||
<b:ControlLabel for="cg_upload_type">
|
||||
Upload type
|
||||
|
@ -88,6 +91,31 @@
|
|||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
|
||||
<b:ControlGroup ui:field="cg_access_right">
|
||||
<b:ControlLabel for="cl_access_right">
|
||||
Access right
|
||||
</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<!-- <b:InputAddOn prependIcon="BOOK"> -->
|
||||
<b:ListBox name="Access right"
|
||||
ui:field="field_access_right">
|
||||
</b:ListBox>
|
||||
<!-- </b:InputAddOn> -->
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
|
||||
<b:ControlGroup ui:field="cg_license">
|
||||
<b:ControlLabel for="cl_license">
|
||||
License
|
||||
</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<!-- <b:InputAddOn prependIcon="BOOK"> -->
|
||||
<b:ListBox name="License" ui:field="field_license">
|
||||
</b:ListBox>
|
||||
<!-- </b:InputAddOn> -->
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
|
||||
<b:ControlGroup ui:field="cg_publication_date">
|
||||
<b:ControlLabel for="cl_publication_date">
|
||||
Publication date
|
||||
|
@ -102,7 +130,7 @@
|
|||
</b:Fieldset>
|
||||
</b:Form>
|
||||
</g:HTMLPanel>
|
||||
<!-- <b:Pager left="Go back" right="Publish on Zenodo" -->
|
||||
<!-- aligned="true" ui:field="pager" /> -->
|
||||
<!-- <b:Pager left="Back" right="Next" -->
|
||||
<!-- aligned="true" ui:field="pager" /> -->
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -31,6 +31,7 @@ public class PublishFileView extends Composite {
|
|||
initWidget(uiBinder.createAndBindUi(this));
|
||||
this.file = file;
|
||||
|
||||
|
||||
switchButton.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,6 +24,9 @@ public class PublishFilesFormView extends Composite {
|
|||
@UiField
|
||||
Fieldset field_form_files;
|
||||
|
||||
// @UiField
|
||||
// Pager pager;
|
||||
|
||||
private List<PublishFileView> lstPFV = new ArrayList<PublishFileView>();
|
||||
|
||||
/**
|
||||
|
@ -38,9 +41,25 @@ public class PublishFilesFormView extends Composite {
|
|||
|
||||
/**
|
||||
* Instantiates a new publish files form view.
|
||||
* @param tabIndex
|
||||
*/
|
||||
public PublishFilesFormView() {
|
||||
public PublishFilesFormView(int tabIndex) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
// pager.getLeft().setVisible(tabIndex>0);
|
||||
//
|
||||
// pager.getRight().setVisible(false);
|
||||
//
|
||||
// pager.getLeft().addClickHandler(new ClickHandler() {
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(ClickEvent event) {
|
||||
//
|
||||
// Ckan2ZenodoViewManager.eventBus.fireEvent(new TabPagerClickedEvent(TabPagerClickedEvent.PAGER.BACK));
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,9 +15,11 @@
|
|||
<b:Form type="HORIZONTAL">
|
||||
<b:Fieldset styleName="{style.noBorder}"
|
||||
ui:field="field_form_files">
|
||||
<!-- <b:Legend addStyleNames="legend-style"> -->
|
||||
<!-- </b:Legend> -->
|
||||
<b:Legend addStyleNames="legend-style"> Choose the file/s to publish...
|
||||
</b:Legend>
|
||||
</b:Fieldset>
|
||||
</b:Form>
|
||||
<!-- <b:Pager left="Back" right="Next" aligned="true" -->
|
||||
<!-- ui:field="pager" /> -->
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -5,12 +5,9 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.gcubewidgets.client.elements.Span;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.utils.InfoTextAndLabels;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
||||
import com.github.gwtbootstrap.client.ui.Icon;
|
||||
import com.github.gwtbootstrap.client.ui.ListBox;
|
||||
import com.github.gwtbootstrap.client.ui.Popover;
|
||||
import com.github.gwtbootstrap.client.ui.TextBox;
|
||||
import com.github.gwtbootstrap.client.ui.base.ListItem;
|
||||
import com.github.gwtbootstrap.client.ui.constants.ControlGroupType;
|
||||
|
@ -24,7 +21,6 @@ import com.google.gwt.uibinder.client.UiField;
|
|||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.FocusPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
/**
|
||||
|
@ -41,9 +37,9 @@ public class TagsPanel extends Composite{
|
|||
|
||||
@UiField TextBox tagsEnterTextBox;
|
||||
@UiField FlowPanel tagsPanel;
|
||||
@UiField Icon infoIconTags;
|
||||
@UiField FocusPanel focusPanelTags;
|
||||
@UiField Popover popoverTags;
|
||||
// @UiField Icon infoIconTags;
|
||||
// @UiField FocusPanel focusPanelTags;
|
||||
// @UiField Popover popoverTags;
|
||||
@UiField ControlGroup tagsInsertGroup;
|
||||
@UiField ListBox tagsEnterListBox;
|
||||
|
||||
|
@ -91,21 +87,21 @@ public class TagsPanel extends Composite{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare icons
|
||||
* @param popupOpenedIds
|
||||
*/
|
||||
public void prepareIcon(List<String> popupOpenedIds) {
|
||||
InfoTextAndLabels.preparePopupPanelAndPopover(
|
||||
InfoTextAndLabels.TAGS_INFO_ID_POPUP,
|
||||
InfoTextAndLabels.TAGS_INFO_TEXT,
|
||||
InfoTextAndLabels.TAGS_INFO_CAPTION,
|
||||
infoIconTags,
|
||||
popoverTags,
|
||||
focusPanelTags,
|
||||
popupOpenedIds
|
||||
);
|
||||
}
|
||||
// /**
|
||||
// * Prepare icons
|
||||
// * @param popupOpenedIds
|
||||
// */
|
||||
// public void prepareIcon(List<String> popupOpenedIds) {
|
||||
// InfoTextAndLabels.preparePopupPanelAndPopover(
|
||||
// InfoTextAndLabels.TAGS_INFO_ID_POPUP,
|
||||
// InfoTextAndLabels.TAGS_INFO_TEXT,
|
||||
// InfoTextAndLabels.TAGS_INFO_CAPTION,
|
||||
// infoIconTags,
|
||||
// popoverTags,
|
||||
// focusPanelTags,
|
||||
// popupOpenedIds
|
||||
// );
|
||||
// }
|
||||
|
||||
@UiHandler("tagsEnterTextBox")
|
||||
void onAddTag(KeyDownEvent event){
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
<ui:style>
|
||||
.tagsPanelStyle {
|
||||
display: inline-block;
|
||||
|
@ -10,26 +11,30 @@
|
|||
<b:ControlGroup ui:field="tagsInsertGroup">
|
||||
<b:ControlLabel for="tags" title="Item tag">
|
||||
<font color="red">*</font>
|
||||
Tag:
|
||||
Keywords
|
||||
</b:ControlLabel>
|
||||
<b:Controls ui:field="controlAsTextBox">
|
||||
<b:TextBox width="90%" placeholder="Write a tag here (push ENTER to attach it to the Item)"
|
||||
b:id="tags" ui:field="tagsEnterTextBox" maxLength="100"/>
|
||||
<b:ListBox width="91%" title="HOLD CTRL or CMD for multiple selection"
|
||||
b:id="tags" ui:field="tagsEnterListBox" multipleSelect="true"/>
|
||||
<span style="float:right; width:5%; color: #aaaaaa;">
|
||||
<b:Popover ui:field="popoverTags" html="true" animation="true"
|
||||
placement="LEFT">
|
||||
<g:FocusPanel ui:field="focusPanelTags">
|
||||
<b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconTags" />
|
||||
</g:FocusPanel>
|
||||
</b:Popover>
|
||||
</span>
|
||||
<b:TextBox width="90%"
|
||||
placeholder="Write a keyword here (push ENTER to attach it to the Item)"
|
||||
b:id="tags" ui:field="tagsEnterTextBox" maxLength="100" />
|
||||
<b:ListBox width="91%"
|
||||
title="HOLD CTRL or CMD for multiple selection" b:id="tags"
|
||||
ui:field="tagsEnterListBox" multipleSelect="true" />
|
||||
<!-- <span style="float:right; width:5%; color: #aaaaaa;"> -->
|
||||
<!-- <b:Popover ui:field="popoverTags" html="true" animation="true" -->
|
||||
<!-- placement="LEFT"> -->
|
||||
<!-- <g:FocusPanel ui:field="focusPanelTags"> -->
|
||||
<!-- <b:Icon type="INFO_SIGN" size="TWO_TIMES" ui:field="infoIconTags"
|
||||
/> -->
|
||||
<!-- </g:FocusPanel> -->
|
||||
<!-- </b:Popover> -->
|
||||
<!-- </span> -->
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup>
|
||||
<b:Controls>
|
||||
<g:FlowPanel ui:field="tagsPanel" styleName="{style.tagsPanelStyle}"></g:FlowPanel>
|
||||
<g:FlowPanel ui:field="tagsPanel"
|
||||
styleName="{style.tagsPanelStyle}"></g:FlowPanel>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
</g:HTMLPanel>
|
||||
|
|
|
@ -1,28 +1,63 @@
|
|||
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.view;
|
||||
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.TabPanelBasicPanel;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.BasicTabPanel;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.basicinformation.BasicInformationView;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
import com.github.gwtbootstrap.client.ui.Modal;
|
||||
import com.github.gwtbootstrap.client.ui.ModalFooter;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
|
||||
/**
|
||||
* The Class Ckan2ZenodoViewManager.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Dec 19, 2019
|
||||
*/
|
||||
public class Ckan2ZenodoViewManager {
|
||||
|
||||
|
||||
private TabPanelBasicPanel basePanel;
|
||||
private BasicTabPanel basicTabPanel;
|
||||
private Button buttonPublish = new Button("Publish on Zenodo");
|
||||
|
||||
public final static HandlerManager eventBus = new HandlerManager(null);
|
||||
|
||||
/**
|
||||
* Instantiates a new ckan 2 zenodo view manager.
|
||||
*/
|
||||
public Ckan2ZenodoViewManager() {
|
||||
}
|
||||
|
||||
|
||||
public TabPanelBasicPanel viewForPublishing(final ZenodoItem zenodoItem){
|
||||
basePanel = new TabPanelBasicPanel();
|
||||
/**
|
||||
* View for publishing.
|
||||
*
|
||||
* @param zenodoItem the zenodo item
|
||||
*/
|
||||
public void viewForPublishing(final ZenodoItem zenodoItem){
|
||||
|
||||
Modal modal = new Modal(true);
|
||||
|
||||
basicTabPanel = new BasicTabPanel() {
|
||||
|
||||
@Override
|
||||
public void checkTabVisited() {
|
||||
buttonPublish.setEnabled(basicTabPanel.allTabVisited());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
boolean isUpdate = false;
|
||||
if(zenodoItem.getMetadata()!=null) {
|
||||
isUpdate = zenodoItem.getMetadata().getDoi()!=null?true:false;
|
||||
}
|
||||
//Basic Information
|
||||
BasicInformationView basicForm = new BasicInformationView(zenodoItem, isUpdate) {
|
||||
int tabIndex = 0;
|
||||
BasicInformationView basicForm = new BasicInformationView(zenodoItem, isUpdate, tabIndex) {
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -38,13 +73,35 @@ public class Ckan2ZenodoViewManager {
|
|||
}
|
||||
};
|
||||
|
||||
basePanel.getAcc_basic_info().add(basicForm);
|
||||
basicTabPanel.getAcc_basic_info().add(basicForm);
|
||||
basicTabPanel.getTabPanel().getSelectedTab();
|
||||
|
||||
//Files
|
||||
PublishFileViewManager vm = new PublishFileViewManager(zenodoItem.getFiles());
|
||||
basePanel.getAcc_files().add(vm.getView());
|
||||
tabIndex = 1;
|
||||
PublishFileViewManager vm = new PublishFileViewManager(zenodoItem.getFiles(), tabIndex);
|
||||
basicTabPanel.getAcc_files().add(vm.getView());
|
||||
|
||||
return basePanel;
|
||||
//return basePanel;
|
||||
|
||||
modal.setTitle("Publishing on Zenodo...");
|
||||
modal.addStyleName("ckan2zenodo-modal-style");
|
||||
modal.setCloseVisible(true);
|
||||
modal.add(basicTabPanel);
|
||||
|
||||
|
||||
buttonPublish.setEnabled(false);
|
||||
|
||||
buttonPublish.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
}
|
||||
});
|
||||
|
||||
ModalFooter modalFooter = new ModalFooter(buttonPublish);
|
||||
modal.add(modalFooter);
|
||||
|
||||
modal.show();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -11,10 +11,12 @@ import com.google.gwt.user.client.ui.Composite;
|
|||
public class PublishFileViewManager {
|
||||
|
||||
private List<ZenodoFile> listFiles;
|
||||
private PublishFilesFormView publishFileFormView = new PublishFilesFormView();
|
||||
private PublishFilesFormView publishFileFormView;
|
||||
private int tabIndex;
|
||||
|
||||
public PublishFileViewManager(List<ZenodoFile> listFiles) {
|
||||
public PublishFileViewManager(List<ZenodoFile> listFiles, int tabIndex) {
|
||||
this.listFiles = listFiles;
|
||||
this.publishFileFormView = new PublishFilesFormView(tabIndex);
|
||||
addFilesToView();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,17 @@
|
|||
}
|
||||
|
||||
.ckan2zenodo-modal-style .modal-body {
|
||||
max-height: 800px;
|
||||
height: 730px;
|
||||
max-height: 730px;
|
||||
}
|
||||
|
||||
.ckan2zenodo-modal-style .form-horizontal {
|
||||
height: 645px;
|
||||
}
|
||||
|
||||
.ckan2zenodo-modal-style .pager {
|
||||
margin-right: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.legend-style {
|
||||
|
@ -32,7 +42,7 @@
|
|||
font-size: 16px;
|
||||
}
|
||||
|
||||
.form-font-size {
|
||||
.form-font-size {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
|
@ -40,7 +50,6 @@
|
|||
font-size: 15px;
|
||||
}
|
||||
|
||||
|
||||
.authors-table-spacing td{
|
||||
.authors-table-spacing td {
|
||||
padding-bottom: 5px;
|
||||
}
|
Loading…
Reference in New Issue