Only added javadoc

This commit is contained in:
francesco 2020-10-07 14:28:10 +02:00
parent dee4709750
commit beedadb51a
2 changed files with 108 additions and 13 deletions

View File

@ -56,12 +56,14 @@ import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
// TODO: Auto-generated Javadoc
/**
* Create metadata form for ckan product.
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class CreateMetadataForm extends Composite{
/** The ui binder. */
private static EditMetadataFormUiBinder uiBinder = GWT
.create(EditMetadataFormUiBinder.class);
@ -77,80 +79,148 @@ public class CreateMetadataForm extends Composite{
UiBinder<Widget, CreateMetadataForm> {
}
/** The create dataset main panel. */
@UiField HTMLPanel createDatasetMainPanel;
/** The custom fields. */
@UiField ControlGroup customFields;
/** The custom fields group. */
@UiField ControlGroup customFieldsGroup;
/** The add custom field button. */
@UiField Button addCustomFieldButton;
/** The create button. */
@UiField Button createButton;
/** The info block. */
// @UiField Button resetButton;
@UiField AlertBlock infoBlock;
/** The on continue alert block. */
@UiField AlertBlock onContinueAlertBlock;
/** The on create alert block. */
@UiField AlertBlock onCreateAlertBlock;
/** The metadata fields panel. */
@UiField VerticalPanel metadataFieldsPanel;
/** The metadata type listbox. */
@UiField ListBox metadataTypeListbox;
/** The form first step. */
@UiField Form formFirstStep;
/** The form third step. */
@UiField Form formThirdStep;
/** The selected profile. */
// @UiField Button continueButton;
@UiField Paragraph selectedProfile;
/** The loader profiles. */
@UiField LoaderIcon loaderProfiles;
/** The loader profile information. */
@UiField LoaderIcon loaderProfileInformation;
//@UiField TagsPanel tagsPanel;
/** The info icon types. */
// info panels
@UiField Icon infoIconTypes;
/** The focus panel types. */
@UiField FocusPanel focusPanelTypes;
/** The popover types. */
@UiField Popover popoverTypes;
/** The info icon custom fields. */
@UiField Icon infoIconCustomFields;
/** The focus panel custom fields. */
@UiField FocusPanel focusPanelCustomFields;
/** The popover custom fields. */
@UiField Popover popoverCustomFields;
/** The metadata types control group. */
@UiField ControlGroup metadataTypesControlGroup;
/** The form builder service. */
private final MetadataProfileFormBuilderServiceAsync formBuilderService = GWT.create(MetadataProfileFormBuilderService.class);
/** The Constant REGEX_TITLE_PRODUCT_SUBWORD. */
private static final String REGEX_TITLE_PRODUCT_SUBWORD = "[^a-zA-Z0-9_.-]";
/** The Constant REGEX_MAIL. */
private static final String REGEX_MAIL = "\\b[\\w.%-]+@[-.\\w]+\\.[A-Za-z]{2,4}\\b";
/** The Constant NONE_PROFILE. */
private static final String NONE_PROFILE = "none";
/** The Constant ERROR_PRODUCT_CREATION. */
// error/info messages
protected static final String ERROR_PRODUCT_CREATION = "There was an error while trying to publish your item.";
/** The Constant PRODUCT_CREATED_OK. */
protected static final String PRODUCT_CREATED_OK = "Item correctly published!";
/** The Constant TRYING_TO_CREATE_PRODUCT. */
private static final String TRYING_TO_CREATE_PRODUCT = "Trying to publish the item, please wait...";
/** The Constant MISSING_PUBLISH_RIGHTS. */
protected static final String MISSING_PUBLISH_RIGHTS = "It seems you are not authorized to publish on catalogue. Request it to the VRE manager or the portal administrator.";
/** The tab panel. */
// tab panel
private TabPanel tabPanel;
/** The resource form. */
// add resource form
private AddResourceToDataset resourceForm;
/** The license bean. */
// the licenses
private List<LicenseBean> licenseBean;
/** The event bus. */
// event bus
private HandlerManager eventBus;
/** The custom field entries list. */
// added custom field entries (by the user)
private List<CustomFieldEntry> customFieldEntriesList = new ArrayList<CustomFieldEntry>();
/** The list of metadata fields. */
// the list of MetaDataField added
private List<MetaDataField> listOfMetadataFields = new ArrayList<MetaDataField>();
// dataset metadata bean
//private DatasetBean receivedBean;
/** The owner. */
// the owner
private String owner;
/** The resources twin panel. */
// resource table
private TwinColumnSelectionMainPanel resourcesTwinPanel;
/** The popup opened ids. */
// List of opened popup'ids
private List<String> popupOpenedIds = new ArrayList<String>();
/** The name title organization map. */
// map of organization name title
private Map<String, String> nameTitleOrganizationMap = new HashMap<String, String>();
/** The scope. */
private String scope;
/** The generic resource secondary type. */
private String genericResourceSecondaryType;
/**
@ -205,13 +275,25 @@ public class CreateMetadataForm extends Composite{
this.eventBus = eventBus;
bind();
prepareInfoIcons();
showSelectedProfiles(false);
showCustomFieldsEntries(false);
}
/**
* Show loading profiles.
*
* @param bool the bool
*/
private void showLoadingProfiles(boolean bool) {
loaderProfiles.setText("Loading Profiles...");
loaderProfiles.setVisible(bool);
}
/**
* Show loading profile information.
*
* @param bool the bool
*/
private void showLoadingProfileInformation(boolean bool) {
loaderProfileInformation.setText("Loading Profile Information...");
loaderProfileInformation.setVisible(bool);
@ -434,8 +516,6 @@ public class CreateMetadataForm extends Composite{
/**
* On continue button.
*
* @param e the e
*/
/*@UiHandler("continueButton")
void onContinueButton(ClickEvent e){
@ -688,8 +768,6 @@ public class CreateMetadataForm extends Composite{
/**
* Reset form event.
*
* @param e the e
*/
/*@UiHandler("resetButton")
void resetFormEvent(ClickEvent e){
@ -740,12 +818,7 @@ public class CreateMetadataForm extends Composite{
infoBlock.setVisible(visible);
}
public void showCustomFieldsEntries(boolean show) {
this.customFields.setVisible(show);
this.customFieldsGroup.setVisible(show);
}
// /**
// * On selected license change.
@ -766,5 +839,25 @@ public class CreateMetadataForm extends Composite{
Window.alert("Called showLicenseUrl");
}
/**
* Show custom fields entries.
*
* @param show the show
*/
public void showCustomFieldsEntries(boolean show) {
this.customFields.setVisible(show);
this.customFieldsGroup.setVisible(show);
}
/**
* Show selected profiles.
*
* @param show the show
*/
public void showSelectedProfiles(boolean show) {
this.selectedProfile.setVisible(show);
}
}

View File

@ -114,7 +114,7 @@
ui:field="formThirdStep" visible="false">
<b:Fieldset styleName="{style.fieldset-border-style}">
<b:Legend styleName="{style.legend-style}">
Insert Item Profile Information
Insert Information
<small>
<span style="color:red;">*</span>
is required
@ -129,11 +129,13 @@
visible="false" width="100%"></g:VerticalPanel>
<!-- Custom fields can be dinamically added -->
<b:ControlGroup ui:field="customFields" visible="false">
<b:ControlGroup ui:field="customFields"
visible="false">
<b:ControlLabel>Custom Field(s):</b:ControlLabel>
</b:ControlGroup>
<b:ControlGroup ui:field="customFieldsGroup" visible="false">
<b:ControlGroup ui:field="customFieldsGroup"
visible="false">
<b:Controls>
<span style="float:right; width:5%; color: #aaaaaa;">
<b:Popover ui:field="popoverCustomFields" html="true"