ckan2zenodo-publisher-widget/src/main/java/org/gcube/portlets/widgets/ckan2zenodopublisher/client/ui/basicinformation/BasicInformationView.java

735 lines
20 KiB
Java
Raw Normal View History

2019-12-17 11:37:56 +01:00
package org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.basicinformation;
2019-12-09 17:17:05 +01:00
2019-12-18 18:08:05 +01:00
import java.util.ArrayList;
import java.util.Date;
2019-12-18 18:08:05 +01:00
import java.util.List;
2019-12-18 11:58:49 +01:00
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.authors.CreatorsFormView;
2020-01-13 17:48:41 +01:00
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.tags.TagsPanel;
2020-01-17 12:46:32 +01:00
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.ui.utils.InfoTextAndLabels;
2020-01-09 16:00:46 +01:00
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.FieldUtil;
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.FormValidator;
2020-01-15 17:51:22 +01:00
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoAuthor;
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoContributor;
2020-01-13 17:48:41 +01:00
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoCreator;
2019-12-09 17:17:05 +01:00
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoItem;
2019-12-18 18:08:05 +01:00
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoMetadata;
2019-12-09 17:17:05 +01:00
2020-01-09 16:00:46 +01:00
import com.github.gwtbootstrap.client.ui.Alert;
2019-12-18 18:08:05 +01:00
import com.github.gwtbootstrap.client.ui.ControlGroup;
2020-01-17 12:46:32 +01:00
import com.github.gwtbootstrap.client.ui.ControlLabel;
2019-12-12 18:32:30 +01:00
import com.github.gwtbootstrap.client.ui.Fieldset;
2019-12-18 18:08:05 +01:00
import com.github.gwtbootstrap.client.ui.ListBox;
2019-12-12 18:32:30 +01:00
import com.github.gwtbootstrap.client.ui.TextArea;
2019-12-09 17:17:05 +01:00
import com.github.gwtbootstrap.client.ui.TextBox;
2020-01-09 16:00:46 +01:00
import com.github.gwtbootstrap.client.ui.constants.ControlGroupType;
2019-12-18 18:08:05 +01:00
import com.github.gwtbootstrap.datepicker.client.ui.DateBox;
2019-12-09 17:17:05 +01:00
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
2019-12-09 17:17:05 +01:00
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;
/**
* The Class CreateTaskConfigurationView.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it May 4, 2018
*/
2020-01-09 16:00:46 +01:00
public class BasicInformationView extends Composite implements FormValidator {
2019-12-09 17:17:05 +01:00
/** The ui binder. */
2019-12-12 18:32:30 +01:00
private static BasicInformationViewUiBinder uiBinder = GWT.create(BasicInformationViewUiBinder.class);
2020-01-09 16:00:46 +01:00
2020-01-15 17:51:22 +01:00
private List<CreatorsFormView> listOfCreatorsView;
private List<CreatorsFormView> listOfContributorsView;
2019-12-09 17:17:05 +01:00
/**
* The Interface CreateTaskConfigurationViewUiBinder.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it May 4, 2018
*/
2019-12-12 18:32:30 +01:00
interface BasicInformationViewUiBinder extends UiBinder<Widget, BasicInformationView> {
2019-12-09 17:17:05 +01:00
}
@UiField
TextBox field_title;
2020-01-17 12:46:32 +01:00
@UiField
ControlLabel cl_title;
2019-12-09 17:17:05 +01:00
@UiField
2019-12-18 18:08:05 +01:00
TextBox field_doi;
2020-01-09 16:00:46 +01:00
2019-12-12 18:32:30 +01:00
@UiField
2019-12-18 11:58:49 +01:00
Fieldset fieldset_basic_informations;
2020-01-09 16:00:46 +01:00
2019-12-12 18:32:30 +01:00
@UiField
TextArea field_description;
2020-01-09 16:00:46 +01:00
2020-01-17 12:46:32 +01:00
@UiField
ControlLabel cl_description;
2019-12-18 18:08:05 +01:00
@UiField
ListBox field_upload_type;
2020-01-09 16:00:46 +01:00
@UiField
ListBox field_image_type;
@UiField
2020-01-21 17:07:05 +01:00
ControlGroup cg_access_conditions;
@UiField
2020-01-21 17:07:05 +01:00
TextArea field_access_conditions;
@UiField
ControlGroup cg_publication_type;
@UiField
ControlGroup cg_image_type;
@UiField
ControlGroup cg_embargo_date;
2020-01-17 12:46:32 +01:00
@UiField
ControlLabel cl_upload_type;
2019-12-19 17:41:50 +01:00
@UiField
ListBox field_access_right;
2020-01-09 16:00:46 +01:00
2020-01-17 12:46:32 +01:00
@UiField
ControlLabel cl_access_right;
2019-12-19 17:41:50 +01:00
@UiField
ListBox field_license;
2020-01-09 16:00:46 +01:00
2020-01-17 12:46:32 +01:00
@UiField
ControlLabel cl_license;
2019-12-18 18:08:05 +01:00
@UiField
ListBox field_publication_type;
2020-01-17 12:46:32 +01:00
@UiField
ControlLabel cl_publication_type;
2020-01-09 16:00:46 +01:00
2019-12-18 18:08:05 +01:00
@UiField
DateBox field_publication_date;
2020-01-17 12:46:32 +01:00
@UiField
ControlLabel cl_publication_date;
2020-01-09 16:00:46 +01:00
@UiField
Alert error_alert;
2020-01-17 12:46:32 +01:00
2020-01-13 17:48:41 +01:00
@UiField
TagsPanel the_tags_panel;
@UiField
DateBox embargoDate;
2020-01-21 17:07:05 +01:00
@UiField
ControlLabel cl_embargo_date;
@UiField
ControlLabel cl_access_conditions;
2020-01-09 16:00:46 +01:00
2019-12-19 17:41:50 +01:00
// @UiField
// Pager pager;
2019-12-09 17:17:05 +01:00
2020-01-09 16:00:46 +01:00
// public final static HandlerManager eventBus = new HandlerManager(null);
2019-12-09 17:17:05 +01:00
private boolean isEditConfiguration;
private ZenodoItem zenodoItem;
/**
* Because this class has a default constructor, it can be used as a binder
* template. In other words, it can be used in other *.ui.xml files as follows:
* <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g=
* "urn:import:**user's package**">
* <g:**UserClassName**>Hello!</g:**UserClassName> </ui:UiBinder> Note that
* depending on the widget that is used, it may be necessary to implement
* HasHTML instead of HasText.
*
* @param zenodoItem the zenodo item
2020-01-09 16:00:46 +01:00
* @param isUpdate the is update
* @param tabIndex the tab index
2019-12-09 17:17:05 +01:00
*/
2019-12-19 17:41:50 +01:00
public BasicInformationView(final ZenodoItem zenodoItem, boolean isUpdate, final int tabIndex) {
2019-12-09 17:17:05 +01:00
initWidget(uiBinder.createAndBindUi(this));
this.zenodoItem = zenodoItem;
2019-12-19 17:41:50 +01:00
fillForm();
setVisibleFieldsForUpdate(isUpdate);
field_upload_type.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
cg_publication_type.setVisible(false);
cg_image_type.setVisible(false);
if(zenodoItem.getMetadata().getPublication_type()!=null) {
List<String> publicationTypeSelected = zenodoItem.getMetadata().getPublication_type().getSelectedValues();
boolean selectedFromServerModel = publicationTypeSelected!=null;
cg_publication_type.setVisible(selectedFromServerModel);
}
String selectedLower = field_upload_type.getSelectedValue().toLowerCase();
if (selectedLower.compareTo("publication") == 0) {
cg_publication_type.setVisible(true);
GWT.log("Upload type selected: publication");
}else if(selectedLower.compareTo("image")==0) {
GWT.log("Upload type selected: image");
cg_image_type.setVisible(true);
}
}
});
field_access_right.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
cg_embargo_date.setVisible(false);
2020-01-21 17:07:05 +01:00
cg_access_conditions.setVisible(false);
if(zenodoItem.getMetadata().getEmbargo_date()!=null) {
Date embDate = zenodoItem.getMetadata().getEmbargo_date();
boolean insertedFromModel = embDate!=null;
cg_embargo_date.setVisible(insertedFromModel);
}
if(zenodoItem.getMetadata().getAccess_conditions()!=null) {
2020-01-21 17:07:05 +01:00
cg_access_conditions.setVisible(true);
}
String selectedLower = field_access_right.getSelectedValue().toLowerCase();
if(selectedLower.compareTo("open")==0 || selectedLower.compareTo("embargoed")==0) {
cg_embargo_date.setVisible(true);
}else if(selectedLower.compareTo("restricted")==0) {
2020-01-21 17:07:05 +01:00
cg_access_conditions.setVisible(true);
}
}
});
embargoDate.setPlaceholder("Insert Embargo Date");
embargoDate.setValue(null);
}
2019-12-09 17:17:05 +01:00
/**
* Gets the embargo date.
*
* @return the embargo date
*/
public Date getEmbargoDate(){
return embargoDate.getValue();
2019-12-09 17:17:05 +01:00
}
2020-01-09 16:00:46 +01:00
2019-12-18 18:08:05 +01:00
/**
* Sets the visible fields for update.
*
* @param isUpdate the new visible fields for update
*/
protected void setVisibleFieldsForUpdate(boolean isUpdate) {
List<Widget> listWidgtes = new ArrayList<Widget>();
listWidgtes.add(field_doi);
listWidgtes.add(field_publication_date);
2020-01-09 16:00:46 +01:00
2019-12-18 18:08:05 +01:00
for (Widget widget : listWidgtes) {
2020-01-10 17:07:03 +01:00
Widget parent = FieldUtil.getParentControlGroupOfWidget(widget); // It should be the 'ControlGroup'
2020-01-09 16:00:46 +01:00
if (parent instanceof ControlGroup) {
2019-12-18 18:08:05 +01:00
parent.setVisible(isUpdate);
}
}
}
2019-12-09 17:17:05 +01:00
/**
* Fill parameters to operator.
*/
private void fillForm() {
field_title.setValue(zenodoItem.getTitle());
2020-01-27 17:56:16 +01:00
InfoTextAndLabels.addTooltipForFieldKey("title", cl_title);
2019-12-12 18:32:30 +01:00
field_description.setValue(zenodoItem.getMetadata().getDescription());
2020-01-27 17:56:16 +01:00
InfoTextAndLabels.addTooltipForFieldKey("description", cl_description);
field_doi.setValue(zenodoItem.getDoi());
GWT.log("Filling form with: "+zenodoItem.getMetadata());
2020-01-09 16:00:46 +01:00
2019-12-18 18:08:05 +01:00
ZenodoMetadata zMeta = zenodoItem.getMetadata();
2020-01-09 16:00:46 +01:00
if (zMeta != null) {
2020-01-27 17:56:16 +01:00
2020-01-17 12:46:32 +01:00
String title = zenodoItem.getTitle() != null ? zenodoItem.getTitle() : zMeta.getTitle();
field_title.setValue(title); // Re.fill title to be sure
2020-01-27 17:56:16 +01:00
if(zMeta.getPublication_date()!=null) {
field_publication_date.setValue(zenodoItem.getMetadata().getPublication_date());
}
2020-01-17 12:46:32 +01:00
// Upload type
if (zMeta.getUpload_type() != null) {
2020-01-15 17:51:22 +01:00
FieldUtil.addValuesToListBox(field_upload_type, zMeta.getUpload_type().getSelectableValues());
FieldUtil.selectValueToListBox(field_upload_type, zMeta.getUpload_type().getSelectedValues());
2020-01-17 12:46:32 +01:00
} else
2020-01-14 12:28:20 +01:00
field_upload_type.setEnabled(false);
2020-01-27 17:56:16 +01:00
InfoTextAndLabels.addTooltipForFieldKey("upload_type", cl_upload_type);
2020-01-17 12:46:32 +01:00
// Publication Type
if (zMeta.getPublication_type() != null) {
2020-01-15 17:51:22 +01:00
FieldUtil.addValuesToListBox(field_publication_type, zMeta.getPublication_type().getSelectableValues());
if (zMeta.getPublication_type().getSelectedValues() != null) {
FieldUtil.selectValueToListBox(field_publication_type,
zMeta.getPublication_type().getSelectedValues());
} else
cg_publication_type.setVisible(false);
2020-01-17 12:46:32 +01:00
} else
cg_publication_type.setVisible(false);
2020-01-27 17:56:16 +01:00
InfoTextAndLabels.addTooltipForFieldKey("publication_type", cl_publication_type);
if(zMeta.getImage_type() != null) {
FieldUtil.addValuesToListBox(field_image_type, zMeta.getImage_type().getSelectableValues());
if (zMeta.getImage_type().getSelectedValues() != null) {
FieldUtil.selectValueToListBox(field_image_type,
zMeta.getImage_type().getSelectedValues());
} else
cg_image_type.setVisible(false);
}else
cg_image_type.setVisible(false);
// Access Right
if (zMeta.getAccess_right().getSelectedValues() != null) {
2020-01-15 17:51:22 +01:00
FieldUtil.addValuesToListBox(field_access_right, zMeta.getAccess_right().getSelectableValues());
FieldUtil.selectValueToListBox(field_access_right, zMeta.getAccess_right().getSelectedValues());
2020-01-17 12:46:32 +01:00
} else
2020-01-14 12:28:20 +01:00
field_access_right.setEnabled(false);
2020-01-17 12:46:32 +01:00
2020-01-27 17:56:16 +01:00
InfoTextAndLabels.addTooltipForFieldKey("access_right", cl_access_right);
if(zMeta.getEmbargo_date()!=null) {
embargoDate.setValue(zMeta.getEmbargo_date());
cg_embargo_date.setVisible(true);
}else
cg_embargo_date.setVisible(false);
2020-01-27 17:56:16 +01:00
InfoTextAndLabels.addTooltipForFieldKey("embargo_date", cl_embargo_date);
2020-01-21 17:07:05 +01:00
if(zMeta.getAccess_conditions()!=null) {
2020-01-21 17:07:05 +01:00
field_access_conditions.setValue(zMeta.getAccess_conditions());
}else
2020-01-21 17:07:05 +01:00
cg_access_conditions.setVisible(false);
2020-01-27 17:56:16 +01:00
InfoTextAndLabels.addTooltipForFieldKey("access_conditions", cl_access_conditions);
2020-01-17 12:46:32 +01:00
// License
2023-07-28 11:16:23 +02:00
if (zMeta.getLicenseIDs() != null) {
//List<String> listLicensesIds = null;
List<String> selectedLicensesId = FieldUtil.toZenodoIds(zMeta.getLicenseIDs());
if(selectedLicensesId!=null) {
FieldUtil.addValuesToListBox(field_license, selectedLicensesId);
field_license.setEnabled(true);
}else {
//Exception case on missing list of selectable license ids
2023-07-28 11:16:23 +02:00
//FieldUtil.addValuesToListBox(field_license, selectedLicensesId);
field_license.setEnabled(false); //only one license id is available
}
2023-07-28 11:16:23 +02:00
//FieldUtil.selectValueToListBox(field_license, selectedLicensesId);
}else
field_license.setEnabled(false);
2020-01-17 12:46:32 +01:00
2020-01-27 17:56:16 +01:00
InfoTextAndLabels.addTooltipForFieldKey("license", cl_license);
2020-01-17 12:46:32 +01:00
// Keywords
2020-01-17 12:46:32 +01:00
if (zMeta.getKeywords() != null && zMeta.getKeywords().size() > 0) {
2020-01-14 12:28:20 +01:00
for (String keyword : zMeta.getKeywords()) {
the_tags_panel.addTagElement(keyword);
}
}
2020-01-17 12:46:32 +01:00
if (listOfCreatorsView == null)
2020-01-15 17:51:22 +01:00
listOfCreatorsView = new ArrayList<CreatorsFormView>();
2020-01-17 12:46:32 +01:00
if (listOfContributorsView == null)
2020-01-15 17:51:22 +01:00
listOfContributorsView = new ArrayList<CreatorsFormView>();
2020-01-09 16:00:46 +01:00
// ADDING AUTHORS
try {
List<? extends ZenodoAuthor> authors = zenodoItem.getMetadata().getCreators();
GWT.log("Adding creators: " + authors);
CreatorsFormView authorView = new CreatorsFormView(authors, ZenodoCreator.class, zenodoItem.getMetadata().getContributorsTypes());
listOfCreatorsView.add(authorView);
}catch (Exception e) {
//silent
e.printStackTrace();
}
try {
List<? extends ZenodoAuthor> contributors = zenodoItem.getMetadata().getContributors();
GWT.log("Adding contributors: " + contributors);
CreatorsFormView contributorView = new CreatorsFormView(contributors, ZenodoContributor.class, zenodoItem.getMetadata().getContributorsTypes());
listOfContributorsView.add(contributorView);
}catch (Exception e) {
e.printStackTrace();
}
2020-01-17 12:46:32 +01:00
2020-01-15 17:51:22 +01:00
for (CreatorsFormView cfv : listOfCreatorsView) {
fieldset_basic_informations.add(cfv);
}
2020-01-17 12:46:32 +01:00
2020-01-15 17:51:22 +01:00
for (CreatorsFormView cfv : listOfContributorsView) {
fieldset_basic_informations.add(cfv);
}
2019-12-09 17:17:05 +01:00
2020-01-17 12:46:32 +01:00
}
2019-12-09 17:17:05 +01:00
}
/**
* Checks if is edits the configuration.
*
* @return the isEditConfiguration
*/
public boolean isEditConfiguration() {
return isEditConfiguration;
}
2020-01-09 16:00:46 +01:00
/*
* (non-Javadoc)
*
* @see
* org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.FormValidator#
* validateForm()
*/
@Override
public String validateFormFields() {
2020-01-17 12:46:32 +01:00
2020-01-09 16:00:46 +01:00
error_alert.setVisible(false);
2020-01-10 17:07:03 +01:00
ControlGroup cgDOI = FieldUtil.getParentControlGroupOfWidget(field_doi);
ControlGroup cgTitle = FieldUtil.getParentControlGroupOfWidget(field_title);
2020-01-17 12:46:32 +01:00
2020-01-10 17:07:03 +01:00
FieldUtil.setControlGroup(cgDOI, ControlGroupType.NONE);
FieldUtil.setControlGroup(cgTitle, ControlGroupType.NONE);
2020-01-21 17:07:05 +01:00
FieldUtil.setControlGroup(cg_embargo_date, ControlGroupType.NONE);
FieldUtil.setControlGroup(cg_access_conditions, ControlGroupType.NONE);
2020-01-10 17:07:03 +01:00
2020-01-17 12:46:32 +01:00
// Validating DOI
2020-01-10 17:07:03 +01:00
if (cgDOI.isVisible()) {
GWT.log("Checking doi---");
2020-01-09 16:00:46 +01:00
String value = getTextValue(field_doi);
boolean isValid = FieldUtil.isValidValue(value);
2020-01-17 12:46:32 +01:00
if (!isValid) {
2020-01-10 17:07:03 +01:00
FieldUtil.setControlGroup(cgDOI, ControlGroupType.ERROR);
2020-01-27 17:56:16 +01:00
showErrorAlert(true, "The field DOI is required");
// error_alert.setVisible(true);
// error_alert.setText("This field DOI is required");
2020-01-09 16:00:46 +01:00
return "This field is required";
}
}
2020-01-17 12:46:32 +01:00
// Validating Title
2020-01-10 17:07:03 +01:00
if (cgTitle.isVisible()) {
GWT.log("Checking title---");
2020-01-09 16:00:46 +01:00
String value = getTextValue(field_title);
boolean isValid = FieldUtil.isValidValue(value);
2020-01-17 12:46:32 +01:00
GWT.log("isValid: " + isValid);
if (!isValid) {
2020-01-10 17:07:03 +01:00
FieldUtil.setControlGroup(cgTitle, ControlGroupType.ERROR);
2020-01-27 17:56:16 +01:00
showErrorAlert(true, "The field Title is required");
// error_alert.setVisible(true);
// error_alert.setText("The field Title is required");
2020-01-09 16:00:46 +01:00
return "This field is required";
}
}
2020-01-21 17:07:05 +01:00
if(cg_embargo_date.isVisible()) {
boolean isValid = embargoDate.getValue()!=null;
if(!isValid) {
FieldUtil.setControlGroup(cg_embargo_date, ControlGroupType.ERROR);
2020-01-27 17:56:16 +01:00
showErrorAlert(true, "The field Embargo Date is required");
// error_alert.setVisible(true);
// error_alert.setText("The field Embargo Date is required");
2020-01-21 17:07:05 +01:00
return "This field is required";
}
}
if(cg_access_conditions.isVisible()) {
boolean isValid = field_access_conditions.getValue()!= null && !field_access_conditions.getValue().isEmpty();
if(!isValid) {
FieldUtil.setControlGroup(cg_access_conditions, ControlGroupType.ERROR);
2020-01-27 17:56:16 +01:00
showErrorAlert(true, "The field Access Condition is required");
// error_alert.setVisible(true);
// error_alert.setText("The field Access Condition is required");
2020-01-21 17:07:05 +01:00
return "This field is required";
}
}
2020-01-17 12:46:32 +01:00
// Validating Creators
2020-01-15 17:51:22 +01:00
for (CreatorsFormView cfv : listOfCreatorsView) {
String error = cfv.validateFormFields();
2020-01-17 12:46:32 +01:00
if (error != null) {
2020-01-27 17:56:16 +01:00
// error_alert.setVisible(true);
// error_alert.setText(error);
showErrorAlert(true, error);
2020-01-13 17:48:41 +01:00
return error;
}
}
2020-01-17 12:46:32 +01:00
// Validating Contributors
2020-01-15 17:51:22 +01:00
for (CreatorsFormView cfv : listOfContributorsView) {
String error = cfv.validateFormFields();
2020-01-17 12:46:32 +01:00
if (error != null) {
2020-01-27 17:56:16 +01:00
showErrorAlert(true, error);
// error_alert.setVisible(true);
// error_alert.setText(error);
2020-01-15 17:51:22 +01:00
return error;
}
}
2020-01-17 12:46:32 +01:00
2020-01-09 16:00:46 +01:00
return null;
}
2020-01-27 17:56:16 +01:00
private void showErrorAlert(boolean visible, String message) {
error_alert.setText(message);
error_alert.setVisible(visible);
try {
error_alert.getElement().focus();
} catch (Exception e) {
// TODO: handle exception
}
}
2020-01-09 16:00:46 +01:00
2020-01-17 12:46:32 +01:00
/*
* (non-Javadoc)
*
* @see
* org.gcube.portlets.widgets.ckan2zenodopublisher.client.view.FormValidator#
* isValidForm()
2020-01-09 16:00:46 +01:00
*/
@Override
public boolean isValidForm() {
2020-01-17 12:46:32 +01:00
return validateFormFields() == null;
2020-01-09 16:00:46 +01:00
}
/**
* Gets the text value.
*
* @param box the box
* @return the text value
*/
private String getTextValue(TextBox box) {
return box.getText();
}
2020-01-13 17:48:41 +01:00
2020-01-15 17:51:22 +01:00
/**
* Gets the list of contributors view.
*
* @return the list of contributors view
*/
public List<CreatorsFormView> getListOfContributorsView() {
return listOfContributorsView;
2020-01-13 17:48:41 +01:00
}
2020-01-17 12:46:32 +01:00
2020-01-15 17:51:22 +01:00
/**
* Gets the list of creators view.
*
* @return the list of creators view
*/
public List<CreatorsFormView> getListOfCreatorsView() {
return listOfCreatorsView;
}
2020-01-17 12:46:32 +01:00
2020-01-13 17:48:41 +01:00
/**
2020-01-15 17:51:22 +01:00
* Gets the list of authors.
2020-01-13 17:48:41 +01:00
*
2020-01-15 17:51:22 +01:00
* @return the list of authors
2020-01-13 17:48:41 +01:00
*/
public List<ZenodoCreator> getListOfCreators() {
2020-01-15 17:51:22 +01:00
List<ZenodoCreator> listOfCreators = new ArrayList<>();
2021-04-26 17:05:09 +02:00
if(listOfCreatorsView==null) {
return listOfCreators;
}
2020-01-15 17:51:22 +01:00
for (CreatorsFormView cfv : listOfCreatorsView) {
List<? extends ZenodoAuthor> listOfUsers = cfv.readListOfCreatorsFromView();
for (ZenodoAuthor zenodoAuthor : listOfUsers) {
listOfCreators.add((ZenodoCreator) zenodoAuthor);
}
}
return listOfCreators;
}
2020-01-17 12:46:32 +01:00
2020-01-15 17:51:22 +01:00
/**
* Gets the list of contributors.
*
* @return the list of contributors
*/
public List<ZenodoContributor> getListOfContributors() {
List<ZenodoContributor> listOfContributors = new ArrayList<>();
2021-04-26 17:05:09 +02:00
if(listOfContributorsView==null) {
return listOfContributors;
}
2020-01-15 17:51:22 +01:00
for (CreatorsFormView cfv : listOfContributorsView) {
List<? extends ZenodoAuthor> listOfUsers = cfv.readListOfCreatorsFromView();
for (ZenodoAuthor zenodoAuthor : listOfUsers) {
listOfContributors.add((ZenodoContributor) zenodoAuthor);
}
2021-04-26 17:05:09 +02:00
2020-01-15 17:51:22 +01:00
}
return listOfContributors;
2020-01-13 17:48:41 +01:00
}
2020-01-15 17:51:22 +01:00
/**
* Gets the field title.
*
* @return the field title
*/
2020-01-13 17:48:41 +01:00
public TextBox getField_title() {
return field_title;
}
2020-01-15 17:51:22 +01:00
/**
* Gets the field doi.
*
* @return the field doi
*/
2020-01-13 17:48:41 +01:00
public TextBox getField_doi() {
return field_doi;
}
2020-01-15 17:51:22 +01:00
/**
* Gets the fieldset basic informations.
*
* @return the fieldset basic informations
*/
2020-01-13 17:48:41 +01:00
public Fieldset getFieldset_basic_informations() {
return fieldset_basic_informations;
}
2020-01-15 17:51:22 +01:00
/**
* Gets the field description.
*
* @return the field description
*/
2020-01-13 17:48:41 +01:00
public TextArea getField_description() {
return field_description;
}
2020-01-15 17:51:22 +01:00
/**
* Gets the field upload type.
*
* @return the field upload type
*/
2020-01-13 17:48:41 +01:00
public ListBox getField_upload_type() {
return field_upload_type;
}
2020-01-15 17:51:22 +01:00
/**
* Gets the field access right.
*
* @return the field access right
*/
2020-01-13 17:48:41 +01:00
public ListBox getField_access_right() {
return field_access_right;
}
2020-01-21 17:07:05 +01:00
/**
* Gets the field access conditions.
*
* @return the field access conditions
*/
public TextArea getField_access_conditions() {
return field_access_conditions;
}
/**
* Gets the field image type.
*
* @return the field image type
*/
public ListBox getField_image_type() {
return field_image_type;
}
2020-01-13 17:48:41 +01:00
2020-01-15 17:51:22 +01:00
/**
* Gets the field license.
*
* @return the field license
*/
2020-01-13 17:48:41 +01:00
public ListBox getField_license() {
return field_license;
}
2020-01-15 17:51:22 +01:00
/**
* Gets the field publication type.
*
* @return the field publication type
*/
2020-01-13 17:48:41 +01:00
public ListBox getField_publication_type() {
return field_publication_type;
}
/**
* Gets the cg publication type.
*
* @return the cg publication type
*/
public ControlGroup getCg_publication_type() {
return cg_publication_type;
}
/**
* Gets the cg image type.
*
* @return the cg image type
*/
public ControlGroup getCg_image_type() {
return cg_image_type;
}
2020-01-13 17:48:41 +01:00
2020-01-15 17:51:22 +01:00
/**
* Gets the field publication date.
*
* @return the field publication date
*/
2020-01-13 17:48:41 +01:00
public DateBox getField_publication_date() {
return field_publication_date;
}
2020-01-15 17:51:22 +01:00
/**
* Gets the error alert.
*
* @return the error alert
*/
2020-01-13 17:48:41 +01:00
public Alert getError_alert() {
return error_alert;
}
2020-01-17 12:46:32 +01:00
2020-01-15 17:51:22 +01:00
/**
* Gets the tags.
*
* @return the tags
*/
2020-01-13 17:48:41 +01:00
public List<String> getTags() {
return the_tags_panel.getTags();
}
2020-01-17 12:46:32 +01:00
2020-01-14 12:28:20 +01:00
/**
* Gets the list of keywords.
*
* @return the list of keywords
*/
2020-01-17 12:46:32 +01:00
public List<String> getListOfKeywords() {
2020-01-14 12:28:20 +01:00
return the_tags_panel.getTags();
}
2020-01-17 12:46:32 +01:00
2019-12-09 17:17:05 +01:00
}