implementing publisher on zenodo
This commit is contained in:
parent
427cf8bd13
commit
ed39d4eb1a
|
@ -1,8 +1,7 @@
|
||||||
package org.gcube.portlets.widgets.ckan2zenodopublisher.client;
|
package org.gcube.portlets.widgets.ckan2zenodopublisher.client;
|
||||||
|
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.Ckan2ZenodoViewManager;
|
||||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder.AccordionBasicPanel;
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder.AccordionBasicPanel;
|
||||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder.BasicInformationView;
|
|
||||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder.Ckan2ZenodoViewManager;
|
|
||||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.CatalogueItem;
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.CatalogueItem;
|
||||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.view;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder.AccordionBasicPanel;
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder.BasicInformationView;
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder.PublishFileView;
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoFile;
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
|
||||||
|
|
||||||
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
|
|
||||||
|
public class Ckan2ZenodoViewManager {
|
||||||
|
|
||||||
|
|
||||||
|
AccordionBasicPanel basePanel;
|
||||||
|
|
||||||
|
|
||||||
|
public Ckan2ZenodoViewManager() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AccordionBasicPanel viewForPublishing(final ZenodoItem zenodoItem){
|
||||||
|
basePanel = new AccordionBasicPanel();
|
||||||
|
|
||||||
|
BasicInformationView basicForm = new BasicInformationView(zenodoItem) {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void submitHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setError(boolean visible, String error) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setConfirm(boolean visible, String msg) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
basePanel.getAcc_basic_info().add(basicForm);
|
||||||
|
|
||||||
|
|
||||||
|
if(zenodoItem.getFiles()!=null) {
|
||||||
|
List<PublishFileView> lstPFV = new ArrayList<PublishFileView>();
|
||||||
|
VerticalPanel fileVP = new VerticalPanel();
|
||||||
|
for (ZenodoFile file : zenodoItem.getFiles()) {
|
||||||
|
PublishFileView pfv = addFileForPublishing(file);
|
||||||
|
lstPFV.add(pfv);
|
||||||
|
fileVP.add(pfv);
|
||||||
|
}
|
||||||
|
basePanel.getAcc_files().add(fileVP);
|
||||||
|
}
|
||||||
|
return basePanel;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private PublishFileView addFileForPublishing(ZenodoFile file) {
|
||||||
|
PublishFileView pv = new PublishFileView(file);
|
||||||
|
pv.getField_file_name().setValue(file.getFilename());
|
||||||
|
pv.getSwitchButton().setValue(true);
|
||||||
|
return pv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder;
|
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder;
|
||||||
|
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.AccordionGroup;
|
import com.github.gwtbootstrap.client.ui.AccordionGroup;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
|
@ -27,12 +29,6 @@ public class AccordionBasicPanel extends Composite {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AccordionBasicPanel(String firstName) {
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public AccordionGroup getAcc_basic_info() {
|
public AccordionGroup getAcc_basic_info() {
|
||||||
return acc_basic_info;
|
return acc_basic_info;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,9 @@ public abstract class BasicInformationView extends Composite {
|
||||||
interface BasicInformationViewUiBinder extends UiBinder<Widget, BasicInformationView> {
|
interface BasicInformationViewUiBinder extends UiBinder<Widget, BasicInformationView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The pager. */
|
// /** The pager. */
|
||||||
@UiField
|
// @UiField
|
||||||
Pager pager;
|
// Pager pager;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
TextBox field_title;
|
TextBox field_title;
|
||||||
|
@ -54,8 +54,8 @@ public abstract class BasicInformationView extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
Fieldset to_zenodo_form_unit_fields;
|
Fieldset to_zenodo_form_unit_fields;
|
||||||
|
|
||||||
@UiField
|
//@UiField
|
||||||
Label label_files;
|
//Label label_files;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
TextArea field_description;
|
TextArea field_description;
|
||||||
|
@ -106,15 +106,15 @@ public abstract class BasicInformationView extends Composite {
|
||||||
// this.isEditConfiguration = true;
|
// this.isEditConfiguration = true;
|
||||||
// this.editConfiguration = conf;
|
// this.editConfiguration = conf;
|
||||||
|
|
||||||
bindEvents();
|
//bindEvents();
|
||||||
pager.getLeft().setVisible(false);
|
//pager.getLeft().setVisible(false);
|
||||||
fillForm();
|
fillForm();
|
||||||
|
|
||||||
if (isEditConfiguration) {
|
// if (isEditConfiguration) {
|
||||||
pager.getRight().setText("Update Configuration");
|
// pager.getRight().setText("Update Configuration");
|
||||||
} else {
|
// } else {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,46 +129,46 @@ public abstract class BasicInformationView extends Composite {
|
||||||
field_description.setValue(zenodoItem.getMetadata().getDescription());
|
field_description.setValue(zenodoItem.getMetadata().getDescription());
|
||||||
field_record_url.setValue(zenodoItem.getRecord_url().toString());
|
field_record_url.setValue(zenodoItem.getRecord_url().toString());
|
||||||
|
|
||||||
if(zenodoItem.getFiles()!=null) {
|
// if(zenodoItem.getFiles()!=null) {
|
||||||
label_files.setVisible(true);
|
// label_files.setVisible(true);
|
||||||
for (ZenodoFile file : zenodoItem.getFiles()) {
|
// for (ZenodoFile file : zenodoItem.getFiles()) {
|
||||||
addFileForPublishing(file);
|
// addFileForPublishing(file);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addFileForPublishing(ZenodoFile file) {
|
// private void addFileForPublishing(ZenodoFile file) {
|
||||||
PublishFileView pv = new PublishFileView();
|
// PublishFileView pv = new PublishFileView();
|
||||||
pv.getField_file_name().setValue(file.getFilename());
|
// pv.getField_file_name().setValue(file.getFilename());
|
||||||
pv.getSwitchButton().setValue(true);
|
// pv.getSwitchButton().setValue(true);
|
||||||
to_zenodo_form_unit_fields.add(pv);
|
// to_zenodo_form_unit_fields.add(pv);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Bind events.
|
// * Bind events.
|
||||||
*/
|
// */
|
||||||
private void bindEvents() {
|
// private void bindEvents() {
|
||||||
|
//
|
||||||
pager.getLeft().addClickHandler(new ClickHandler() {
|
// pager.getLeft().addClickHandler(new ClickHandler() {
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onClick(ClickEvent event) {
|
// public void onClick(ClickEvent event) {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
pager.getRight().addClickHandler(new ClickHandler() {
|
// pager.getRight().addClickHandler(new ClickHandler() {
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onClick(ClickEvent event) {
|
// public void onClick(ClickEvent event) {
|
||||||
setError(false, "");
|
// setError(false, "");
|
||||||
boolean isValid = validateSubmit();
|
// boolean isValid = validateSubmit();
|
||||||
if (isValid)
|
// if (isValid)
|
||||||
submitHandler();
|
// submitHandler();
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate submit.
|
* Validate submit.
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
|
||||||
|
xmlns:citem="urn:import:org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder">
|
||||||
<ui:style>
|
<ui:style>
|
||||||
.noBorder {
|
.noBorder {
|
||||||
border: 0px;
|
border: 0px;
|
||||||
|
@ -16,40 +17,55 @@
|
||||||
<b:Form type="HORIZONTAL">
|
<b:Form type="HORIZONTAL">
|
||||||
<b:Fieldset styleName="{style.noBorder}"
|
<b:Fieldset styleName="{style.noBorder}"
|
||||||
ui:field="to_zenodo_form_unit_fields">
|
ui:field="to_zenodo_form_unit_fields">
|
||||||
|
<!-- <b:Label type="INFO" -->
|
||||||
|
<!-- addStyleNames="{style.margin-left-100}">Basic Information</b:Label> -->
|
||||||
|
<b:ControlGroup ui:field="cg_record_url">
|
||||||
|
<b:ControlLabel for="cl_record_url">Digital Object Identifier
|
||||||
|
(DOI)</b:ControlLabel>
|
||||||
|
<b:Controls>
|
||||||
|
|
||||||
<b:Label type="INFO"
|
<b:TextBox name="DOI" b:id="field_doi"
|
||||||
addStyleNames="{style.margin-left-100}">The Item</b:Label>
|
ui:field="field_record_url"
|
||||||
|
addStyleNames="my-external-select-width" readOnly="true">
|
||||||
|
</b:TextBox>
|
||||||
|
|
||||||
|
</b:Controls>
|
||||||
|
</b:ControlGroup>
|
||||||
<b:ControlGroup ui:field="cg_title">
|
<b:ControlGroup ui:field="cg_title">
|
||||||
<b:ControlLabel for="cl_title">Title</b:ControlLabel>
|
<b:ControlLabel for="cl_title">Title</b:ControlLabel>
|
||||||
<b:Controls>
|
<b:Controls>
|
||||||
<b:TextBox name="Title" b:id="field_title"
|
<b:InputAddOn prependIcon="BOOK">
|
||||||
ui:field="field_title" addStyleNames="my-external-select-width">
|
<b:TextBox name="Title" b:id="field_title"
|
||||||
</b:TextBox>
|
ui:field="field_title" addStyleNames="my-external-select-width">
|
||||||
|
</b:TextBox>
|
||||||
|
</b:InputAddOn>
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
<b:ControlGroup ui:field="cg_description">
|
<b:ControlGroup ui:field="cg_description">
|
||||||
<b:ControlLabel for="cl_description">Description</b:ControlLabel>
|
<b:ControlLabel for="cl_description">Description</b:ControlLabel>
|
||||||
<b:Controls>
|
<b:Controls>
|
||||||
<b:TextArea name="Description"
|
<b:InputAddOn prependIcon="PENCIL">
|
||||||
ui:field="field_description"
|
<b:TextArea name="Description"
|
||||||
addStyleNames="my-external-select-width"></b:TextArea>
|
ui:field="field_description"
|
||||||
|
addStyleNames="my-external-select-width"></b:TextArea>
|
||||||
|
</b:InputAddOn>
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
<b:ControlGroup ui:field="cg_record_url">
|
<b:ControlGroup ui:field="cg_authors">
|
||||||
<b:ControlLabel for="cl_record_url">URL</b:ControlLabel>
|
<b:ControlLabel for="cl_authors">Authors</b:ControlLabel>
|
||||||
<b:Controls>
|
<b:Controls>
|
||||||
<b:TextBox name="Record URL" b:id="field_record_url"
|
<b:InputAddOn prependIcon="USER">
|
||||||
ui:field="field_record_url"
|
<citem:CreatorView ui:field="field_authors"></citem:CreatorView>
|
||||||
addStyleNames="my-external-select-width" readOnly="true">
|
</b:InputAddOn>
|
||||||
</b:TextBox>
|
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
|
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
<b:Label type="INFO" ui:field="label_files"
|
<!-- <b:Label type="INFO" ui:field="label_files" -->
|
||||||
addStyleNames="{style.margin-left-100}" visible="false">File/s</b:Label>
|
<!-- addStyleNames="{style.margin-left-100}" visible="false">File/s</b:Label> -->
|
||||||
</b:Fieldset>
|
</b:Fieldset>
|
||||||
</b:Form>
|
</b:Form>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
<b:Pager left="Go back" right="Publish on Zenodo"
|
<!-- <b:Pager left="Go back" right="Publish on Zenodo" -->
|
||||||
aligned="true" ui:field="pager" />
|
<!-- aligned="true" ui:field="pager" /> -->
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</ui:UiBinder>
|
</ui:UiBinder>
|
|
@ -1,39 +0,0 @@
|
||||||
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder;
|
|
||||||
|
|
||||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
|
|
||||||
|
|
||||||
public class Ckan2ZenodoViewManager {
|
|
||||||
|
|
||||||
|
|
||||||
AccordionBasicPanel basePanel;
|
|
||||||
|
|
||||||
|
|
||||||
public Ckan2ZenodoViewManager() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public AccordionBasicPanel viewForPublishing(final ZenodoItem zenodoItem){
|
|
||||||
basePanel = new AccordionBasicPanel();
|
|
||||||
|
|
||||||
BasicInformationView form = new BasicInformationView(zenodoItem) {
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void submitHandler() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setError(boolean visible, String error) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setConfirm(boolean visible, String msg) {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
basePanel.getAcc_basic_info().add(form);
|
|
||||||
return basePanel;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder;
|
||||||
|
|
||||||
|
import com.github.gwtbootstrap.client.ui.TextBox;
|
||||||
|
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 CreatorView extends Composite {
|
||||||
|
|
||||||
|
private static CreatorViewUiBinder uiBinder = GWT.create(CreatorViewUiBinder.class);
|
||||||
|
|
||||||
|
interface CreatorViewUiBinder extends UiBinder<Widget, CreatorView> {
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreatorView() {
|
||||||
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
TextBox field_name;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
TextBox field_affiliation;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
TextBox field_orcid;
|
||||||
|
|
||||||
|
public TextBox getField_name() {
|
||||||
|
return field_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField_name(TextBox field_name) {
|
||||||
|
this.field_name = field_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextBox getField_affiliation() {
|
||||||
|
return field_affiliation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField_affiliation(TextBox field_affiliation) {
|
||||||
|
this.field_affiliation = field_affiliation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextBox getField_orcid() {
|
||||||
|
return field_orcid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField_orcid(TextBox field_orcid) {
|
||||||
|
this.field_orcid = field_orcid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!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">
|
||||||
|
<ui:style>
|
||||||
|
.important {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</ui:style>
|
||||||
|
<g:VerticalPanel>
|
||||||
|
<b:TextBox alternateSize="SMALL" placeholder="Name"
|
||||||
|
ui:field="field_name" />
|
||||||
|
<b:TextBox alternateSize="SMALL" placeholder="Affiliation"
|
||||||
|
ui:field="field_affiliation" />
|
||||||
|
<b:TextBox alternateSize="SMALL" placeholder="ORCID"
|
||||||
|
ui:field="field_orcid" />
|
||||||
|
</g:VerticalPanel>
|
||||||
|
</ui:UiBinder>
|
|
@ -1,5 +1,9 @@
|
||||||
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder;
|
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.uibinder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoFile;
|
||||||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
|
||||||
import org.gcube.portlets.widgets.switchbutton.client.SwitchButton;
|
import org.gcube.portlets.widgets.switchbutton.client.SwitchButton;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.TextBox;
|
import com.github.gwtbootstrap.client.ui.TextBox;
|
||||||
|
@ -20,12 +24,15 @@ public class PublishFileView extends Composite {
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
TextBox field_file_name;
|
TextBox field_file_name;
|
||||||
|
|
||||||
|
private ZenodoFile file;
|
||||||
|
|
||||||
interface PublishFileViewUiBinder extends UiBinder<Widget, PublishFileView> {
|
interface PublishFileViewUiBinder extends UiBinder<Widget, PublishFileView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PublishFileView() {
|
public PublishFileView(ZenodoFile file) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
this.file = file;
|
||||||
|
|
||||||
switchButton.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
switchButton.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
||||||
|
|
||||||
|
@ -40,6 +47,8 @@ public class PublishFileView extends Composite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setFieldName(file.getFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
public SwitchButton getSwitchButton() {
|
public SwitchButton getSwitchButton() {
|
||||||
|
@ -53,9 +62,11 @@ public class PublishFileView extends Composite {
|
||||||
this.switchButton = switchButton;
|
this.switchButton = switchButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setField_file_name(TextBox field_file_name) {
|
public void setFieldName(String value) {
|
||||||
this.field_file_name = field_file_name;
|
this.field_file_name.setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package org.gcube.portlets.widgets.ckan2zenodopublisher.client;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class Tester {
|
||||||
|
|
||||||
|
public static String expression = "^\\/dataset(\\?([a-zA-Z0-9_.-]*.+))*";
|
||||||
|
public static String toMatch = "/dataset?systemtype=E39_Actor&groups=huma_num___nakala";
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Pattern p = Pattern.compile(expression);
|
||||||
|
Matcher m = p.matcher(toMatch);
|
||||||
|
boolean b = m.matches();
|
||||||
|
|
||||||
|
System.out.println(b);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue