Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7125d62
commit 1426109
Showing
17 changed files
with
430 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...rc/main/java/it/cnr/contab/progettiric00/core/bulk/AllegatoProgettoRimodulazioneBulk.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package it.cnr.contab.progettiric00.core.bulk; | ||
|
||
import java.util.Optional; | ||
import java.util.StringJoiner; | ||
|
||
import it.cnr.contab.util00.bulk.storage.AllegatoGenericoTypeBulk; | ||
import it.cnr.si.spring.storage.StorageObject; | ||
|
||
public class AllegatoProgettoRimodulazioneBulk extends AllegatoGenericoTypeBulk { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private Progetto_rimodulazioneBulk rimodulazione; | ||
|
||
private static final java.util.Dictionary ti_allegatoKeys = new it.cnr.jada.util.OrderedHashtable(); | ||
|
||
final public static String RIMODULAZIONE = "D:sigla_progetti_attachment:rimodulazione_attestato"; | ||
final public static String PROROGA = "D:sigla_progetti_attachment:rimodulazione_proroga"; | ||
final public static String GENERICO = "D:sigla_progetti_attachment:rimodulazione_allegato_generico"; | ||
|
||
static { | ||
ti_allegatoKeys.put(RIMODULAZIONE,"Rimodulazione"); | ||
ti_allegatoKeys.put(PROROGA,"Proroga"); | ||
ti_allegatoKeys.put(GENERICO,"Allegato Generico"); | ||
} | ||
|
||
public final java.util.Dictionary getTi_allegatoKeys() { | ||
return ti_allegatoKeys; | ||
} | ||
|
||
public AllegatoProgettoRimodulazioneBulk() { | ||
super(); | ||
} | ||
|
||
public static AllegatoProgettoRimodulazioneBulk construct(StorageObject storageObject) { | ||
return new AllegatoProgettoRimodulazioneBulk(storageObject); | ||
} | ||
|
||
public AllegatoProgettoRimodulazioneBulk(String storageKey) { | ||
super(storageKey); | ||
} | ||
|
||
public AllegatoProgettoRimodulazioneBulk(StorageObject storageObject){ | ||
super(storageObject); | ||
} | ||
|
||
public boolean isTypeEnabled(){ | ||
return !isToBeCreated(); | ||
} | ||
|
||
public boolean isRimodulazione() { | ||
return Optional.ofNullable(getContentType()).map(el->el.equals(RIMODULAZIONE)).orElse(Boolean.FALSE); | ||
} | ||
|
||
public boolean isProroga() { | ||
return Optional.ofNullable(getContentType()).map(el->el.equals(PROROGA)).orElse(Boolean.FALSE); | ||
} | ||
|
||
public boolean isGenerico() { | ||
return Optional.ofNullable(getContentType()).map(el->el.equals(GENERICO)).orElse(Boolean.FALSE); | ||
} | ||
|
||
public Progetto_rimodulazioneBulk getRimodulazione() { | ||
return rimodulazione; | ||
} | ||
|
||
public void setRimodulazione(Progetto_rimodulazioneBulk rimodulazione) { | ||
this.rimodulazione = rimodulazione; | ||
} | ||
|
||
@Override | ||
public String parseFilename(String file) { | ||
StringJoiner name = new StringJoiner("-"); | ||
Optional.ofNullable(this.getRimodulazione()) | ||
.flatMap(el->Optional.ofNullable(el.getProgetto())) | ||
.flatMap(el->Optional.ofNullable(el.getPg_progetto())) | ||
.ifPresent(el->name.add("PRG" + el)); | ||
Optional.ofNullable(this.getRimodulazione()).flatMap(el->Optional.ofNullable(el.getPg_rimodulazione())) | ||
.ifPresent(el->name.add("RIM" + el)); | ||
if (this.isRimodulazione()) | ||
name.add("ATT"); | ||
if (this.isProroga()) | ||
name.add("PRG"); | ||
if (this.isGenerico()) | ||
name.add("GEN"); | ||
name.add(super.parseFilename(file)); | ||
return name.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.