Skip to content

Commit

Permalink
Aggiornamenti
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaelepagano committed May 13, 2019
1 parent 1426109 commit 9b7086b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
Expand Up @@ -4,6 +4,7 @@
import java.util.StringJoiner;

import it.cnr.contab.util00.bulk.storage.AllegatoGenericoTypeBulk;
import it.cnr.jada.bulk.ValidationException;
import it.cnr.si.spring.storage.StorageObject;
import it.cnr.si.spring.storage.config.StoragePropertyNames;

Expand Down Expand Up @@ -57,31 +58,31 @@ public boolean isTypeEnabled(){
}

public boolean isProvvedimentoCostituzione() {
return Optional.ofNullable(getContentType()).map(el->el.equals(PROVV_COSTITUZIONE)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(PROVV_COSTITUZIONE)).orElse(Boolean.FALSE);
}

public boolean isRichiestaAnticipo() {
return Optional.ofNullable(getContentType()).map(el->el.equals(RICHIESTA_ANTICIPO)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(RICHIESTA_ANTICIPO)).orElse(Boolean.FALSE);
}

public boolean isRendicontazione() {
return Optional.ofNullable(getContentType()).map(el->el.equals(RENDICONTAZIONE)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(RENDICONTAZIONE)).orElse(Boolean.FALSE);
}

public boolean isStralcio() {
return Optional.ofNullable(getContentType()).map(el->el.equals(STRALCIO)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(STRALCIO)).orElse(Boolean.FALSE);
}

public boolean isControdeduzione() {
return Optional.ofNullable(getContentType()).map(el->el.equals(CONTRODEDUZIONE)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(CONTRODEDUZIONE)).orElse(Boolean.FALSE);
}

public boolean isFinalStatementPayment() {
return Optional.ofNullable(getContentType()).map(el->el.equals(FINAL_STATEMENT_PAYMENT)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(FINAL_STATEMENT_PAYMENT)).orElse(Boolean.FALSE);
}

public boolean isGenerico() {
return Optional.ofNullable(getContentType()).map(el->el.equals(GENERICO)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(GENERICO)).orElse(Boolean.FALSE);
}

public ProgettoBulk getProgetto() {
Expand Down Expand Up @@ -114,4 +115,13 @@ public String parseFilename(String file) {
name.add(super.parseFilename(file));
return name.toString();
}

@Override
public void validate() throws ValidationException {
super.validate();
if (getNome() == null ) {
if (getObjectType() == null)
throw new ValidationException("Attenzione: selezionare il tipo di File da caricare.");
}
}
}
Expand Up @@ -4,6 +4,7 @@
import java.util.StringJoiner;

import it.cnr.contab.util00.bulk.storage.AllegatoGenericoTypeBulk;
import it.cnr.jada.bulk.ValidationException;
import it.cnr.si.spring.storage.StorageObject;

public class AllegatoProgettoRimodulazioneBulk extends AllegatoGenericoTypeBulk {
Expand Down Expand Up @@ -48,15 +49,15 @@ public boolean isTypeEnabled(){
}

public boolean isRimodulazione() {
return Optional.ofNullable(getContentType()).map(el->el.equals(RIMODULAZIONE)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(RIMODULAZIONE)).orElse(Boolean.FALSE);
}

public boolean isProroga() {
return Optional.ofNullable(getContentType()).map(el->el.equals(PROROGA)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(PROROGA)).orElse(Boolean.FALSE);
}

public boolean isGenerico() {
return Optional.ofNullable(getContentType()).map(el->el.equals(GENERICO)).orElse(Boolean.FALSE);
return Optional.ofNullable(getObjectType()).map(el->el.equals(GENERICO)).orElse(Boolean.FALSE);
}

public Progetto_rimodulazioneBulk getRimodulazione() {
Expand Down Expand Up @@ -84,5 +85,14 @@ public String parseFilename(String file) {
name.add("GEN");
name.add(super.parseFilename(file));
return name.toString();
}
}

@Override
public void validate() throws ValidationException {
super.validate();
if (getNome() == null ) {
if (getObjectType() == null)
throw new ValidationException("Attenzione: selezionare il tipo di File da caricare.");
}
}
}

0 comments on commit 9b7086b

Please sign in to comment.