Compare commits

...

2 Commits

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -14,7 +15,8 @@
<wb-module deploy-name="geoportal-data-entry-app-2.0.0-SNAPSHOT">
@ -29,7 +31,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -44,7 +47,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -59,7 +63,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -74,10 +79,11 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="geoportal-data-common-1.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependent-module archiveName="geoportal-data-common-1.2.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -92,7 +98,8 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -107,7 +114,8 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -122,7 +130,8 @@
</wb-module>

@ -24,9 +24,9 @@
<b:Tab icon="PENCIL" active="true" heading="Edit the Project"
ui:field="tabRawUpdate">
<b:Heading size="3">Source Project Editor</b:Heading>
<b:Label type="INFO">You can update the Source Project by editing
its model
data displayed in the following Editor.</b:Label>
<b:Label type="INFO">You can update the project by editing
the
model data displayed in the following editor.</b:Label>
<g:HTML addStyleNames="{style.info-panel}">
<p style='color: #585858'>
Be careful not to change the

@ -21,6 +21,7 @@ import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServi
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEvent;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogConfirm;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.StringUtil;
import org.gcube.portlets.widgets.mpformbuilder.client.form.MetaDataField;
import org.gcube.portlets.widgets.mpformbuilder.client.ui.metadata.MetaDataFieldSkeleton;
import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.DialogUpload;
@ -326,7 +327,7 @@ public class UpdateFileset extends Composite {
}
for (UploadedImageDV uploadedImageDV : listImmagini) {
fillListBoxToBeReplaced(listBoxContentIndex, section, posizIndex, uploadedImageDV.getTitolo(),
fillListBoxToBeReplaced(listBoxContentIndex, section, posizIndex, StringUtil.ellipsize(uploadedImageDV.getDidascalia(),30),
uploadedImageDV.getListWsContent());
posizIndex++;
}
@ -390,13 +391,6 @@ public class UpdateFileset extends Composite {
List<WorkspaceContentDV> listWSC) {
GWT.log("fillListBoxToBeReplaced called, posizIndex: "+posizIndex+", listWSC: "+listWSC);
if (listWSC == null || listWSC.isEmpty()) {
showMessage(section + " does not contain file!", LabelType.WARNING);
pathIndex = posizIndex;
showNewFileUpload();
return;
}
if(mapWSContentListBox==null) {
mapWSContentListBox = new HashMap<Integer, List<WorkspaceContentDV>>();
}
@ -411,7 +405,7 @@ public class UpdateFileset extends Composite {
@Override
public void onChange(ChangeEvent event) {
GWT.log("listBoxContentIndex changed, posizIndex: "+posizIndex);
GWT.log("listBoxContentIndex changed, value: "+listBoxContentIndex.getSelectedValue());
if (placeholderListBoxIndex) {
listBoxContentIndex.removeItem(0); // this is the placeholder, removing it once
@ -419,6 +413,16 @@ public class UpdateFileset extends Composite {
}
int selectedIndex = listBoxContentIndex.getSelectedIndex();
GWT.log("selected index: "+selectedIndex);
List<WorkspaceContentDV> theListWC = mapWSContentListBox.get(selectedIndex);
if (theListWC == null || theListWC.isEmpty()) {
uploadFileContainer.clear();
showMessage(section + " does not contain file!", LabelType.WARNING);
pathIndex = posizIndex;
showNewFileUpload();
return;
}
showFileBrowseInteraction(selectedIndex, mapWSContentListBox.get(selectedIndex));
}
});

@ -0,0 +1,34 @@
/**
*
*/
package org.gcube.portlets.user.geoportaldataentry.client.ui.utils;
/**
* The Class StringUtil.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 12, 2021
*/
public class StringUtil {
/**
* Ellipsize.
*
* @param input the input string that may be subjected to shortening
* @param maxCharacters the maximum characters that must be returned for the
* input string
* @return the string
*/
public static String ellipsize(String input, int maxCharacters) {
if (input == null)
return "";
if (input.length() < maxCharacters)
return input;
return input.substring(0, maxCharacters) + "...";
}
}
Loading…
Cancel
Save