#24515 First version implemented

This commit is contained in:
Francesco Mangiacrapa 2023-03-15 11:59:25 +01:00
parent c1802685b8
commit 77c41f2af2
18 changed files with 667 additions and 461 deletions

View File

@ -1,4 +1,5 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
lastWarOutDir=/home/francesco-mangiacrapa/git/metadata-profile-form-builder-widget/target/metadata-profile-form-builder-widget-0.1.0-SNAPSHOT jarsExcludedFromWebInfLib=
warSrcDir=src/main/webapp lastWarOutDir=/home/francesco-mangiacrapa/git/metadata-profile-form-builder-widget/target/metadata-profile-form-builder-widget-2.0.0
warSrcDir=
warSrcDirIsOutput=false warSrcDirIsOutput=false

View File

@ -1,11 +1,11 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.source=1.8

View File

@ -1,62 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="2.0.0">
<wb-module deploy-name="metadata-profile-form-builder-widget-0.1.0-SNAPSHOT">
<wb-module deploy-name="metadata-profile-form-builder-widget-2.0.0">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
<property name="context-root" value="metadata-profile-form-builder-widget"/> <property name="context-root" value="metadata-profile-form-builder-widget"/>
<property name="java-output-path" value="/metadata-profile-form-builder-widget/target/classes"/> <property name="java-output-path" value="/metadata-profile-form-builder-widget/target/classes"/>
</wb-module> </wb-module>

View File

@ -2,7 +2,6 @@
<faceted-project> <faceted-project>
<fixed facet="wst.jsdt.web"/> <fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.7"/> <installed facet="java" version="1.7"/>
<installed facet="jst.web" version="2.3"/>
<installed facet="com.gwtplugins.gwt.facet" version="1.0"/> <installed facet="com.gwtplugins.gwt.facet" version="1.0"/>
<installed facet="wst.jsdt.web" version="1.0"/> <installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="jst.jaxrs" version="2.0"/> <installed facet="jst.jaxrs" version="2.0"/>

View File

@ -4,6 +4,13 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.1.0-SNAPSHOT] - 2023-02-01
#### Enhancements
- [#23188] Improved Legend "is required field"
- [#24515] Managed the files already uploaded
## [v2.0.0] - 2022-11-14 ## [v2.0.0] - 2022-11-14
#### Enhancements #### Enhancements

View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.widgets</groupId> <groupId>org.gcube.portlets.widgets</groupId>
<artifactId>metadata-profile-form-builder-widget</artifactId> <artifactId>metadata-profile-form-builder-widget</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>2.0.0</version> <version>2.1.0-SNAPSHOT</version>
<name>Metadata Profile Form Builder</name> <name>Metadata Profile Form Builder</name>
<description> <description>
The Metadata Profile Form Builder is a widget able to build dynamically a web form by reading "gCube Metadata Profile/s" The Metadata Profile Form Builder is a widget able to build dynamically a web form by reading "gCube Metadata Profile/s"
@ -53,7 +53,7 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId> <artifactId>maven-portal-bom</artifactId>
<version>3.6.4</version> <version>3.7.0-SNAPSHOT</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -10,17 +10,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
public interface MetadataProfileFormBuilderServiceAsync { public interface MetadataProfileFormBuilderServiceAsync {
/**
* GWT-RPC service asynchronous (client-side) interface
*
* @see org.gcube.portlets.widgets.mpformbuilder.client.MetadataProfileFormBuilderService
*/
void getProfilesInTheScope(String scope, String genericResourceSecondaryType, AsyncCallback<List<MetaDataProfileBean>> callback);
void getProfileForMetadata(String metadata,
AsyncCallback<MetaDataProfileBean> callback);
/** /**
* Utility class to get the RPC Async interface from client-side code * Utility class to get the RPC Async interface from client-side code
*/ */
@ -39,6 +28,17 @@ public interface MetadataProfileFormBuilderServiceAsync {
} }
} }
/**
* GWT-RPC service asynchronous (client-side) interface
*
* @see org.gcube.portlets.widgets.mpformbuilder.client.MetadataProfileFormBuilderService
*/
void getProfilesInTheScope(String scope, String genericResourceSecondaryType,
AsyncCallback<List<MetaDataProfileBean>> callback);
void getProfileForMetadata(String metadata, AsyncCallback<MetaDataProfileBean> callback);
void getUploadStatus(String clientUploadKey, AsyncCallback<FileUploadingState> asyncCallback); void getUploadStatus(String clientUploadKey, AsyncCallback<FileUploadingState> asyncCallback);
void purgeFilesUploaded(AsyncCallback<Integer> callback); void purgeFilesUploaded(AsyncCallback<Integer> callback);

View File

@ -59,10 +59,6 @@
<b:Fieldset styleName="{style.fieldset-border-style}"> <b:Fieldset styleName="{style.fieldset-border-style}">
<b:Legend styleName="{style.legend-style}"> <b:Legend styleName="{style.legend-style}">
Choose a Profile Choose a Profile
<!-- <small> -->
<!-- <span style="color:red;">*</span> -->
<!-- is required -->
<!-- </small> -->
</b:Legend> </b:Legend>
<!-- Alert blocks for info/errors --> <!-- Alert blocks for info/errors -->
@ -91,18 +87,11 @@
</b:Controls> </b:Controls>
</b:ControlGroup> </b:ControlGroup>
<!-- TAGS Panel -->
<!-- <m:TagsPanel ui:field="tagsPanel"></m:TagsPanel> -->
<!-- Alert block on continue --> <!-- Alert block on continue -->
<b:AlertBlock type="INFO" close="false" <b:AlertBlock type="INFO" close="false"
animation="true" visible="false" ui:field="onContinueAlertBlock"> animation="true" visible="false" ui:field="onContinueAlertBlock">
</b:AlertBlock> </b:AlertBlock>
<!-- <b:Button title="Continue" ui:field="continueButton" type="PRIMARY" -->
<!-- block="true">Continue</b:Button> -->
<!-- <b:Button title="Reset" ui:field="resetButton" block="true">Reset</b:Button> -->
</b:Fieldset> </b:Fieldset>
</b:Form> </b:Form>
@ -112,14 +101,6 @@
<b:Form type="HORIZONTAL" styleName="{style.form-main-style}" <b:Form type="HORIZONTAL" styleName="{style.form-main-style}"
ui:field="formThirdStep" visible="false"> ui:field="formThirdStep" visible="false">
<b:Fieldset styleName="{style.fieldset-border-style}"> <b:Fieldset styleName="{style.fieldset-border-style}">
<!-- <b:Legend styleName="{style.legend-style}" -->
<!-- ui:field="legendInsertInformation"> -->
<!-- Insert Information -->
<!-- <small> -->
<!-- <span style="color:red;">*</span> -->
<!-- is required -->
<!-- </small> -->
<!-- </b:Legend> -->
<u:CustomLegend ui:field="customLegend"> <u:CustomLegend ui:field="customLegend">
Insert Information Insert Information
@ -135,6 +116,9 @@
<!-- Here will be placed the metadata fields formats --> <!-- Here will be placed the metadata fields formats -->
<g:VerticalPanel ui:field="metadataFieldsPanel" <g:VerticalPanel ui:field="metadataFieldsPanel"
visible="false" width="100%"></g:VerticalPanel> visible="false" width="100%"></g:VerticalPanel>
<g:VerticalPanel ui:field="filesUploadedPanel"
visible="false" width="100%"></g:VerticalPanel>
<!-- Custom fields can be dinamically added --> <!-- Custom fields can be dinamically added -->
<b:ControlGroup ui:field="customFields" <b:ControlGroup ui:field="customFields"
@ -165,27 +149,12 @@
styleName="{style.block-alert-style}"> styleName="{style.block-alert-style}">
</b:AlertBlock> </b:AlertBlock>
<!-- <g:HorizontalPanel ui:field="goToDatasetButtonPanel" visible="false"> -->
<!-- <g:Label>Go to the Item</g:Label> -->
<!-- <b:Button title="Go to the Item" ui:field="goToDatasetButton" -->
<!-- type="LINK" visible="false" styleName="{style.the-margin-left}"></b:Button> -->
<!-- </g:HorizontalPanel> -->
<!-- <b:Button title="Add resources to the just created item" -->
<!-- block="true" type="PRIMARY" visible="false" ui:field="addResourcesButton">Add
Resources</b:Button> -->
<b:Button title="Create Item" ui:field="createButton" <b:Button title="Create Item" ui:field="createButton"
type="PRIMARY" block="true">Create</b:Button> type="PRIMARY" block="true">Create</b:Button>
<b:Button title="Edit Item" ui:field="editButton" <b:Button title="Edit Item" ui:field="editButton"
type="PRIMARY" block="true" visible="false">Edit</b:Button> type="PRIMARY" block="true" visible="false">Edit</b:Button>
<!-- <b:Button title="Go Back" ui:field="goBackButtonSecondStep" -->
<!-- block="true">Go -->
<!-- Back</b:Button> -->
</b:Fieldset> </b:Fieldset>
</b:Form> </b:Form>
</g:HTMLPanel> </g:HTMLPanel>

View File

@ -0,0 +1,123 @@
package org.gcube.portlets.widgets.mpformbuilder.client.form.generic;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.constants.IconType;
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.FlexTable;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
public class UploadedFilesBrowse extends Composite {
private static UploadedFilesBrowseUiBinder uiBinder = GWT.create(UploadedFilesBrowseUiBinder.class);
interface UploadedFilesBrowseUiBinder extends UiBinder<Widget, UploadedFilesBrowse> {
}
private List<FileUploaded> listFileUploaded;
// private HashMap<Integer, FileUploaded> mapForCCUploading;
@UiField
HTMLPanel uploadFileContainer;
private FlexTable table = new FlexTable();
private List<Button> listButtonRemove = new ArrayList<Button>();
private HashMap<Integer, FileUploaded> mapPositionalFU = new HashMap<Integer, FileUploaded>();
public UploadedFilesBrowse(List<FileUploaded> fileUploaded) {
initWidget(uiBinder.createAndBindUi(this));
this.listFileUploaded = fileUploaded;
// Filling map of files uploaded
int i = 0;
for (FileUploaded file : listFileUploaded) {
mapPositionalFU.put(i, file);
i++;
}
showFileBrowseInteraction(fileUploaded);
}
private void showFileBrowseInteraction(List<FileUploaded> listFileUploaded) {
uploadFileContainer.clear();
// pathIndex = pathContentIndex;
// GWT.log("showing pathContentIndex: "+pathContentIndex);
GWT.log("showing files: " + listFileUploaded);
table.clear();
if (listFileUploaded.size() > 0) {
table.addStyleName("table-current-content");
table.setHTML(0, 0, "<span style='color:rgb(155, 80, 78); font-weight:bold;'>Current content:</span>");
table.setHTML(1, 0, "<span style='color:rgb(155, 80, 78);'>Filename</span>");
table.setHTML(1, 1, "<span style='color:rgb(155, 80, 78);'>MimeType<span>");
table.setHTML(1, 2, "<span style='color:rgb(155, 80, 78);'>Link</span>");
int i = 2;
int index = 0;
for (final FileUploaded file : listFileUploaded) {
final int filePointer = index;
table.setHTML(i, 0, file.getFileName());
table.setHTML(i, 1, file.getMimeType());
String link = "<a target=\"_blank\" href=" + file.getUrl() + ">View</a>";
table.setHTML(i, 2, link);
final int rowIndexToRem = i;
Button buttonRemoveFile = new Button();
buttonRemoveFile.setIcon(IconType.TRASH);
buttonRemoveFile.setTitle("Remove this file");
buttonRemoveFile.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
mapPositionalFU.remove(filePointer);
table.getRowFormatter().getElement(rowIndexToRem).setAttribute("hidden", "hidden");
}
});
listButtonRemove.add(buttonRemoveFile);
table.setWidget(i, 3, buttonRemoveFile);
i++;
index++;
}
uploadFileContainer.add(table);
}
}
public void enableManageOfContent(boolean bool) {
for (Button button : listButtonRemove) {
button.setEnabled(bool);
}
double opacity = bool?1:0.8;
uploadFileContainer.getElement().getStyle().setOpacity(opacity);
}
public List<FileUploaded> getListRemainingFileUploaded() {
Collection<FileUploaded> collFileUplaoded = mapPositionalFU.values();
if (collFileUplaoded != null)
return new ArrayList<FileUploaded>(collFileUplaoded);
return null;
}
}

View File

@ -0,0 +1,20 @@
<!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;
}
.padding-panel {
padding-left: 30px;
padding-right: 30px;
padding-bottom: 30px;
}
</ui:style>
<g:HTMLPanel>
<g:HTMLPanel ui:field="uploadFileContainer"
addStyleNames="{style.padding-panel}"></g:HTMLPanel>
</g:HTMLPanel>
</ui:UiBinder>

View File

@ -87,7 +87,7 @@ public class MultipleDilaogUpload extends DialogUpload {
FileUploaded fakeFile = new FileUploaded(); FileUploaded fakeFile = new FileUploaded();
fakeFile.setFileName(files[i]); fakeFile.setFileName(files[i]);
fakeItem.setFile(fakeFile); fakeItem.setFile(fakeFile);
fakeFile.setFilePaths(new FilePath(getFieldName())); // The Form Field Label is unique for single-multiple fakeFile.setFilePath(new FilePath(getFieldName())); // The Form Field Label is unique for single-multiple
// upload // upload
fakeUploaders.add(fakeItem); fakeUploaders.add(fakeItem);
} }

View File

@ -46,7 +46,7 @@ public class CustomLegend extends Legend {
String htmlToAdd = text; String htmlToAdd = text;
if (addIsRequiredTxt) if (addIsRequiredTxt)
htmlToAdd += "<small><span style='color:red;'>&nbsp*</span> is required</small>"; htmlToAdd += "<small><span style='color:red;'>&nbsp*</span> is required field</small>";
HTML toHMTL = new HTML(htmlToAdd); HTML toHMTL = new HTML(htmlToAdd);

View File

@ -3,6 +3,13 @@
.legend-style { .legend-style {
width: auto; width: auto;
padding: 10px; padding-left: 10px;
margin-bottom: 0px; margin-bottom: 0px;
border-bottom: 0px;
padding-right: 10px;
}
.legend-style small {
display: block;
font-size: 12px !important;
} }

View File

@ -7,44 +7,41 @@ import java.util.List;
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean; import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded; import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
/** /**
* The Class GenericDatasetBean. * The Class GenericDatasetBean.
* *
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* *
* Oct 19, 2020 * Oct 19, 2020
*/ */
public class GenericDatasetBean implements Serializable { public class GenericDatasetBean<T extends MetaDataProfileBean> implements Serializable {
/** The Constant serialVersionUID. */ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -5215392381589702647L; private static final long serialVersionUID = -5215392381589702647L;
/** The metadata profile list. */ /** The metadata profile list. */
private List<MetaDataProfileBean> metadataProfileList; private List<T> metadataProfileList;
/** The form data entry fields. */ /** The form data entry fields. */
private LinkedHashMap<String, List<String>> formDataEntryFields; private LinkedHashMap<String, List<String>> formDataEntryFields;
/** The files uploaded. */ /** The files uploaded. */
private List<FileUploaded> filesUploaded; private List<FileUploaded> filesUploaded;
/** /**
* Instantiates a new generic dataset bean. * Instantiates a new generic dataset bean.
*/ */
public GenericDatasetBean(){ public GenericDatasetBean() {
} }
/** /**
* Instantiates a new generic dataset bean. * Instantiates a new generic dataset bean.
* *
* @param metadataProfileList the metadata profile list * @param metadataProfileList the metadata profile list
* @param formDataEntryFields the form data entry fields * @param formDataEntryFields the form data entry fields
* @param filesUploaded the files uploaded * @param filesUploaded the files uploaded
*/ */
public GenericDatasetBean(List<MetaDataProfileBean> metadataProfileList, LinkedHashMap<String, List<String>> formDataEntryFields, public GenericDatasetBean(List<T> metadataProfileList, LinkedHashMap<String, List<String>> formDataEntryFields,
List<FileUploaded> filesUploaded) { List<FileUploaded> filesUploaded) {
super(); super();
this.metadataProfileList = metadataProfileList; this.metadataProfileList = metadataProfileList;
@ -52,27 +49,24 @@ public class GenericDatasetBean implements Serializable {
this.filesUploaded = filesUploaded; this.filesUploaded = filesUploaded;
} }
/** /**
* Gets the metadata profile list. * Gets the metadata profile list.
* *
* @return the metadata profile list * @return the metadata profile list
*/ */
public List<MetaDataProfileBean> getMetadataProfileList() { public List<T> getMetadataProfileList() {
return metadataProfileList; return metadataProfileList;
} }
/** /**
* Sets the metadata profile list. * Sets the metadata profile list.
* *
* @param metadataProfileList the new metadata profile list * @param metadataProfileList the new metadata profile list
*/ */
public void setMetadataProfileList(List<MetaDataProfileBean> metadataProfileList) { public void setMetadataProfileList(List<T> metadataProfileList) {
this.metadataProfileList = metadataProfileList; this.metadataProfileList = metadataProfileList;
} }
/** /**
* Gets the form data entry fields. * Gets the form data entry fields.
* *
@ -82,7 +76,6 @@ public class GenericDatasetBean implements Serializable {
return formDataEntryFields; return formDataEntryFields;
} }
/** /**
* Sets the form data entry fields. * Sets the form data entry fields.
* *
@ -92,7 +85,6 @@ public class GenericDatasetBean implements Serializable {
this.formDataEntryFields = formDataEntryFields; this.formDataEntryFields = formDataEntryFields;
} }
/** /**
* Gets the files uploaded. * Gets the files uploaded.
* *
@ -102,7 +94,6 @@ public class GenericDatasetBean implements Serializable {
return filesUploaded; return filesUploaded;
} }
/** /**
* Sets the files uploaded. * Sets the files uploaded.
* *
@ -112,7 +103,6 @@ public class GenericDatasetBean implements Serializable {
this.filesUploaded = filesUploaded; this.filesUploaded = filesUploaded;
} }
/** /**
* To string. * To string.
* *
@ -124,6 +114,4 @@ public class GenericDatasetBean implements Serializable {
+ formDataEntryFields + ", filesUploaded=" + filesUploaded + "]"; + formDataEntryFields + ", filesUploaded=" + filesUploaded + "]";
} }
} }

View File

@ -3,15 +3,14 @@ package org.gcube.portlets.widgets.mpformbuilder.shared.metadata;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* The Class MetaDataProfileBean. * The Class MetaDataProfileBean.
* *
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
* *
* Mar 3, 2022 * Mar 3, 2022
*/ */
public class MetaDataProfileBean implements Serializable{ public class MetaDataProfileBean implements Serializable {
/** /**
* *
@ -25,21 +24,19 @@ public class MetaDataProfileBean implements Serializable{
/** /**
* Instantiates a new meta data profile bean. * Instantiates a new meta data profile bean.
*/ */
public MetaDataProfileBean(){ public MetaDataProfileBean() {
super(); super();
} }
/** /**
* Instantiates a new meta data profile bean. * Instantiates a new meta data profile bean.
* *
* @param type the type * @param type the type
* @param title the title * @param title the title
* @param metadataFields the metadata fields * @param metadataFields the metadata fields
* @param categories the categories * @param categories the categories
*/ */
public MetaDataProfileBean(String type, public MetaDataProfileBean(String type, String title, List<MetadataFieldWrapper> metadataFields,
String title,
List<MetadataFieldWrapper> metadataFields,
List<CategoryWrapper> categories) { List<CategoryWrapper> categories) {
super(); super();
this.type = type; this.type = type;
@ -48,96 +45,51 @@ public class MetaDataProfileBean implements Serializable{
this.metadataFields = metadataFields; this.metadataFields = metadataFields;
} }
/**
* Gets the type.
*
* @return the type
*/
public String getType() { public String getType() {
return type; return type;
} }
/** public String getTitle() {
* Sets the type. return title;
*
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* Gets the metadata fields.
*
* @return the metadataFields
*/
public List<MetadataFieldWrapper> getMetadataFields() {
return metadataFields;
}
/**
* Sets the metadata fields.
*
* @param metadataFields the metadataFields to set
*/
public void setMetadataFields(List<MetadataFieldWrapper> metadataFields) {
this.metadataFields = metadataFields;
} }
/**
* Gets the categories.
*
* @return the categories
*/
public List<CategoryWrapper> getCategories() { public List<CategoryWrapper> getCategories() {
return categories; return categories;
} }
/** public List<MetadataFieldWrapper> getMetadataFields() {
* Sets the categories. return metadataFields;
*
* @param categories the new categories
*/
public void setCategories(List<CategoryWrapper> categories) {
this.categories = categories;
} }
/** public void setType(String type) {
* Gets the title. this.type = type;
*
* @return the title
*/
public String getTitle() {
return title;
} }
/**
* Sets the title.
*
* @param title the new title
*/
public void setTitle(String title) { public void setTitle(String title) {
this.title = title; this.title = title;
} }
/** public void setCategories(List<CategoryWrapper> categories) {
* To string. this.categories = categories;
* }
* @return the string
*/ public void setMetadataFields(List<MetadataFieldWrapper> metadataFields) {
this.metadataFields = metadataFields;
}
@Override @Override
public String toString() { public String toString() {
final int maxLen = 10; StringBuilder builder = new StringBuilder();
return "MetaDataProfileBean [type=" builder.append("MetaDataProfileBean [type=");
+ type builder.append(type);
+ ", title=" builder.append(", title=");
+ title builder.append(title);
+ ", categories=" builder.append(", categories=");
+ (categories != null ? categories.subList(0, builder.append(categories);
Math.min(categories.size(), maxLen)) : null) builder.append(", metadataFields=");
+ ", metadataFields=" builder.append(metadataFields);
+ (metadataFields != null ? metadataFields.subList(0, builder.append("]");
Math.min(metadataFields.size(), maxLen)) : null) + "]"; return builder.toString();
} }
} }

View File

@ -31,6 +31,10 @@ public class FileUploaded implements Serializable, IsSerializable {
private FilePath filePath; private FilePath filePath;
private String url;
private String mimeType;
/** /**
* Instantiates a new workspace upload file. * Instantiates a new workspace upload file.
*/ */
@ -117,19 +121,40 @@ public class FileUploaded implements Serializable, IsSerializable {
} }
/** /**
* Sets the file paths. * Sets the file path.
* *
* @param filePaths the new file paths * @param filePath the new file path
*/ */
public void setFilePaths(FilePath filePaths) { public void setFilePath(FilePath filePath) {
this.filePath = filePaths; this.filePath = filePath;
} }
/** /**
* To string. * Gets the url.
* *
* @return the string * @return the url
*/ */
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
public String getMimeType() {
return mimeType;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
@ -141,6 +166,10 @@ public class FileUploaded implements Serializable, IsSerializable {
builder.append(createdByUser); builder.append(createdByUser);
builder.append(", filePath="); builder.append(", filePath=");
builder.append(filePath); builder.append(filePath);
builder.append(", url=");
builder.append(url);
builder.append(", mimeType=");
builder.append(mimeType);
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
} }

View File

@ -0,0 +1,57 @@
package org.gcube.portlets.widgets.mpformbuilder.shared.upload;
/**
* The Class FileUploadedRemote.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Feb 1, 2023
*/
public class FileUploadedRemote extends FileUploaded {
/**
*
*/
private static final long serialVersionUID = -1700162549065345145L;
private String url;
/**
* Instantiates a new file uploaded remote.
*/
FileUploadedRemote() {
}
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("FileUploadedRemote [url=");
builder.append(url);
builder.append("]");
return builder.toString();
}
}