task_20210 #1

Closed
francesco.mangiacrapa wants to merge 11 commits from task_20210 into master
3 changed files with 66 additions and 33 deletions
Showing only changes of commit 96b7144070 - Show all commits

24
pom.xml
View File

@ -114,35 +114,11 @@
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<!-- END FWS -->
<!-- <dependency> -->
<!-- <groupId>org.gcube.application</groupId> -->
<!-- <artifactId>geoportal-logic</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<!-- <scope>compile</scope> -->
<!-- <exclusions> -->
<!-- <exclusion> -->
<!-- <groupId>javax.servlet</groupId> -->
<!-- <artifactId>servlet-api</artifactId> -->
<!-- </exclusion> -->
<!-- </exclusions> -->
<!-- </dependency> -->
<dependency>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-client</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.gcube.resources.discovery</groupId>
<artifactId>discovery-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>

View File

@ -1,40 +1,88 @@
package org.gcube.portlets.user.geoportaldataentry.client;
/**
* The Enum ConcessioniFormCardTitle.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 30, 2020
*/
public enum ConcessioniFormCardTitle {
INFORMAZIONI_DI_PROGETTO("Informazioni", "Informazioni di Progetto", 1, false),
RELAZIONE_DI_SCAVO("Relazione di Scavo", "Relazione di Scavo", 2, false),
IMMAGINI_RAPPRESENTATIVE("Immagini Rappresentative", "Immagini Rappresentative", 3, true),
POSIZIONAMENTO_DELL_AREA_DI_INDAGINE("Posizionamento", "Posizionamento dell'Area di Indagine", 4, false),
PIANTA_DI_FINE_SCAVO("Pianta di Fine Scavo", "Pianta di Fine Scavo", 5, true);
INFORMAZIONI_DI_PROGETTO("Informazioni", "Informazioni di Progetto", 1, false, null),
RELAZIONE_DI_SCAVO("Relazione di Scavo", "Relazione di Scavo", 2, false, null),
IMMAGINI_RAPPRESENTATIVE("Immagini Rappresentative", "Immagini Rappresentative", 3, true, 8),
POSIZIONAMENTO_DELL_AREA_DI_INDAGINE("Posizionamento", "Posizionamento dell'Area di Indagine", 4, false, null),
PIANTA_DI_FINE_SCAVO("Pianta di Fine Scavo", "Pianta di Fine Scavo", 5, true, null);
private String key;
private String title;
private Integer order;
private boolean internalRepeatibleForm;
private Integer maxFormRepeatability;
private ConcessioniFormCardTitle(String key, String title, int order, boolean internalRepeatibleForm) {
/**
* Instantiates a new concessioni form card title.
*
* @param key the key
* @param title the title
* @param order the order
* @param internalRepeatibleForm the internal repeatible form
* @param maxFormRepeatability the max form repeatability
*/
private ConcessioniFormCardTitle(String key, String title, int order, boolean internalRepeatibleForm, Integer maxFormRepeatability) {
this.key = key;
this.title = title;
this.order = order;
this.internalRepeatibleForm = internalRepeatibleForm;
this.maxFormRepeatability = maxFormRepeatability;
}
/**
* Gets the key.
*
* @return the key
*/
public String getKey() {
return key;
}
/**
* Gets the title.
*
* @return the title
*/
public String getTitle() {
return title;
}
/**
* Gets the order.
*
* @return the order
*/
public Integer getOrder() {
return order;
}
/**
* Checks if is internal repeatible form.
*
* @return true, if is internal repeatible form
*/
public boolean isInternalRepeatibleForm() {
return internalRepeatibleForm;
}
/**
* Gets the max form repeatability.
*
* @return the max form repeatability
*/
public Integer getMaxFormRepeatability() {
return maxFormRepeatability;
}
}

View File

@ -14,6 +14,7 @@ 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.event.shared.HandlerManager;
import com.google.gwt.user.client.Window;
/**
@ -45,6 +46,8 @@ public class MetadataFormCard {
private HandlerManager appManagerBus;
private Integer maxFormRepeatability;
/**
* The Class MetadataFormCardEventHandler.
*
@ -109,6 +112,7 @@ public class MetadataFormCard {
this.geonaFormModel = geonaFormModel;
this.appManagerBus = appManagerBus;
this.repeatible = geonaFormModel.getFormCardTitle().isInternalRepeatibleForm();
this.maxFormRepeatability = geonaFormModel.getFormCardTitle().getMaxFormRepeatability()!=null?geonaFormModel.getFormCardTitle().getMaxFormRepeatability():Integer.MAX_VALUE;
this.buildCard(geonaFormModel.getMetadataForm());
//geonaFormModel.getMetadataForm().addListener(formCardEventHandler);
}
@ -128,9 +132,14 @@ public class MetadataFormCard {
@Override
public void onClick(ClickEvent event) {
CreateMetadataForm newForm = new CreateMetadataForm(createMetadataForm.getMetadataProfiles(),appManagerBus);
//newForm.addListener(formCardEventHandler);
addNewForm(newForm);
if(listForms.size() < maxFormRepeatability) {
CreateMetadataForm newForm = new CreateMetadataForm(createMetadataForm.getMetadataProfiles(),appManagerBus);
//newForm.addListener(formCardEventHandler);
addNewForm(newForm);
}else
Window.alert("Maximun number of data reached for "+geonaFormModel.getFormCardTitle().getTitle());
//newForm.getCreateButton().setFocus(true);
}
});