use of it.cnr.si.opencmis.criteria.Criteria in project cool-jconon by consiglionazionaledellericerche.
the class PrintService method extractionApplication.
public String extractionApplication(Session session, List<String> ids, String type, String queryType, String contexURL, String userId) {
HSSFWorkbook wb = null;
if (Optional.ofNullable(type).isPresent()) {
if (queryType.equalsIgnoreCase("call")) {
if (type.equalsIgnoreCase("application")) {
wb = createHSSFWorkbook(headCSVApplication);
HSSFSheet sheet = wb.getSheet(SHEET_DOMANDE);
final int[] index = { 1 };
for (String callId : ids) {
Folder call = Optional.ofNullable(session.getObject(callId)).filter(Folder.class::isInstance).map(Folder.class::cast).orElseThrow(() -> new RuntimeException("Cannot find call"));
StreamSupport.stream(call.getChildren().spliterator(), false).filter(cmisObject -> cmisObject.getType().getId().equals(JCONONFolderType.JCONON_APPLICATION.value())).filter(cmisObject -> cmisObject.getPropertyValue(JCONONPropertyIds.APPLICATION_STATO_DOMANDA.value()).equals(ApplicationService.StatoDomanda.CONFERMATA.getValue())).filter(Folder.class::isInstance).map(Folder.class::cast).forEach(applicationObject -> {
CMISUser user = null;
try {
user = userService.loadUserForConfirm(applicationObject.getPropertyValue("jconon_application:user"));
} catch (CoolUserFactoryException _ex) {
LOGGER.error("USER {} not found", userId, _ex);
user = new CMISUser(applicationObject.getPropertyValue("jconon_application:user"));
}
LOGGER.info("XLS application index {}", index);
getRecordCSV(session, applicationObject.getFolderParent(), applicationObject, user, contexURL, sheet, index[0]++);
});
}
} else if (type.equalsIgnoreCase("call")) {
wb = createHSSFWorkbook(headCSVCall, "Bandi");
HSSFSheet sheet = wb.getSheetAt(0);
int index = 1;
for (String callId : ids) {
Folder callObject = (Folder) session.getObject(callId);
CMISUser user = userService.loadUserForConfirm(callObject.getPropertyValue(PropertyIds.CREATED_BY));
getRecordCSVCall(session, callObject, user, contexURL, sheet, index++);
}
} else if (type.equalsIgnoreCase("commission")) {
wb = createHSSFWorkbook(headCSVCommission, "Commissioni");
HSSFSheet sheet = wb.getSheetAt(0);
int index = 1;
for (String callId : ids) {
Folder callObject = (Folder) session.getObject(callId);
Criteria criteriaCommissions = CriteriaFactory.createCriteria(JCONONDocumentType.JCONON_COMMISSIONE_METADATA.queryName());
criteriaCommissions.addColumn(PropertyIds.OBJECT_ID);
criteriaCommissions.add(Restrictions.inFolder(callId));
ItemIterable<QueryResult> commissions = criteriaCommissions.executeQuery(session, false, session.getDefaultContext());
for (QueryResult commission : commissions.getPage(Integer.MAX_VALUE)) {
Document commissionObject = (Document) session.getObject(commission.<String>getPropertyValueById(PropertyIds.OBJECT_ID));
getRecordCSVCommission(session, callObject, commissionObject, sheet, index++);
}
}
} else if (type.equalsIgnoreCase("score")) {
wb = createHSSFWorkbook(headCSVApplicationPunteggi, "Punteggi");
HSSFSheet sheet = wb.getSheetAt(0);
int[] index = { 1 };
for (String callId : ids) {
Folder call = Optional.ofNullable(session.getObject(callId)).filter(Folder.class::isInstance).map(Folder.class::cast).orElseThrow(() -> new RuntimeException("Cannot find call"));
StreamSupport.stream(call.getChildren().spliterator(), false).filter(cmisObject -> cmisObject.getType().getId().equals(JCONONFolderType.JCONON_APPLICATION.value())).filter(cmisObject -> cmisObject.getPropertyValue(JCONONPropertyIds.APPLICATION_STATO_DOMANDA.value()).equals(ApplicationService.StatoDomanda.CONFERMATA.getValue())).filter(cmisObject -> cmisObject.<String>getPropertyValue(JCONONPropertyIds.APPLICATION_ESCLUSIONE_RINUNCIA.value()) == null).filter(Folder.class::isInstance).map(Folder.class::cast).forEach(applicationObject -> {
CMISUser user = null;
try {
user = userService.loadUserForConfirm(applicationObject.getPropertyValue("jconon_application:user"));
} catch (CoolUserFactoryException _ex) {
LOGGER.error("USER {} not found", userId, _ex);
user = new CMISUser(applicationObject.getPropertyValue("jconon_application:user"));
}
LOGGER.info("XLS score index {}", index[0]);
getRecordCSVPunteggi(session, applicationObject.getFolderParent(), applicationObject, user, contexURL, sheet, index[0]++);
});
}
} else if (type.equalsIgnoreCase("istruttoria")) {
wb = new HSSFWorkbook();
for (String callId : ids) {
Folder callObject = (Folder) session.getObject(callId);
Locale locale = Locale.ITALY;
Properties props = i18nService.loadLabels(locale);
props.putAll(competitionService.getDynamicLabels(callObject, session));
List<PropertyDefinition<?>> headPropertyDefinition = createHeadApplicationAll(session, callObject, JCONONPropertyIds.CALL_ELENCO_ASPECTS);
headPropertyDefinition.addAll(createHeadApplicationAll(session, callObject, JCONONPropertyIds.CALL_ELENCO_ASPECTS_SEZIONE_CNR));
headPropertyDefinition.addAll(createHeadApplicationAll(session, callObject, JCONONPropertyIds.CALL_ELENCO_ASPECTS_ULTERIORI_DATI));
Stream<String> concat = headCSVApplicationIstruttoria.stream();
if (Optional.ofNullable(siperService).isPresent()) {
concat = Stream.concat(headCSVApplicationIstruttoria.stream(), Arrays.asList("Codice Sede", "Descrizione Sede", "Livello Profilo", "Profilo", "Tipo Contratto").stream());
}
final HSSFSheet sheet = createSheet(wb, callObject.getPropertyValue(JCONONPropertyIds.CALL_CODICE.value()), Stream.concat(concat, headPropertyDefinition.stream().map(propertyDefinition -> {
return Optional.ofNullable(props.getProperty("label.".concat(propertyDefinition.getId().replace(":", ".")))).filter(s -> s.length() > 0).orElse(Optional.ofNullable(propertyDefinition.getDisplayName()).filter(s -> s.length() > 0).orElse(TESTO));
})).collect(Collectors.toList()));
final int[] index = { 1 };
StreamSupport.stream(callObject.getChildren().spliterator(), false).filter(cmisObject -> cmisObject.getType().getId().equals(JCONONFolderType.JCONON_APPLICATION.value())).filter(cmisObject -> cmisObject.getPropertyValue(JCONONPropertyIds.APPLICATION_STATO_DOMANDA.value()).equals(ApplicationService.StatoDomanda.CONFERMATA.getValue())).filter(Folder.class::isInstance).map(Folder.class::cast).forEach(applicationObject -> {
CMISUser user = null;
try {
user = userService.loadUserForConfirm(applicationObject.getPropertyValue("jconon_application:user"));
} catch (CoolUserFactoryException _ex) {
LOGGER.error("USER {} not found", userId, _ex);
user = new CMISUser(applicationObject.getPropertyValue("jconon_application:user"));
}
LOGGER.info("XLS Istruttoria index {}", index[0]);
getRecordCSVIstruttoria(session, callObject, applicationObject, user, contexURL, sheet, headPropertyDefinition, index[0]++);
});
}
}
} else if (queryType.equalsIgnoreCase("application")) {
if (type.equalsIgnoreCase("application")) {
wb = createHSSFWorkbook(headCSVApplication);
HSSFSheet sheet = wb.getSheet(SHEET_DOMANDE);
int index = 1;
for (String applicationId : ids) {
Folder applicationObject = (Folder) session.getObject(applicationId);
CMISUser user = null;
try {
user = userService.loadUserForConfirm(applicationObject.getPropertyValue("jconon_application:user"));
} catch (CoolUserFactoryException _ex) {
LOGGER.error("USER {} not found", userId, _ex);
user = new CMISUser(applicationObject.getPropertyValue("jconon_application:user"));
}
getRecordCSV(session, applicationObject.getFolderParent(), applicationObject, user, contexURL, sheet, index++);
}
} else if (type.equalsIgnoreCase("score")) {
wb = createHSSFWorkbook(headCSVApplicationPunteggi, "Punteggi");
HSSFSheet sheet = wb.getSheetAt(0);
int index = 1;
for (String applicationId : ids) {
Folder applicationObject = (Folder) session.getObject(applicationId);
CMISUser user = null;
try {
user = userService.loadUserForConfirm(applicationObject.getPropertyValue("jconon_application:user"));
} catch (CoolUserFactoryException _ex) {
LOGGER.error("USER {} not found", userId, _ex);
user = new CMISUser(applicationObject.getPropertyValue("jconon_application:user"));
}
getRecordCSVPunteggi(session, applicationObject.getFolderParent(), applicationObject, user, contexURL, sheet, index++);
}
} else if (type.equalsIgnoreCase("istruttoria")) {
wb = new HSSFWorkbook();
final List<Folder> applications = Optional.ofNullable(ids).map(List::stream).orElse(Stream.empty()).map(s -> session.getObject(s)).filter(Folder.class::isInstance).map(Folder.class::cast).collect(Collectors.toList());
final Map<String, List<Folder>> bandi = applications.stream().collect(Collectors.groupingBy(folder -> folder.getParentId()));
for (String callId : bandi.keySet()) {
Folder callObject = Optional.ofNullable(callId).map(s -> session.getObject(s)).filter(Folder.class::isInstance).map(Folder.class::cast).orElseThrow(() -> new ClientMessageException("Estrazione excel Bando non trovato: " + callId));
Locale locale = Locale.ITALY;
Properties props = i18nService.loadLabels(locale);
props.putAll(competitionService.getDynamicLabels(callObject, session));
List<PropertyDefinition<?>> headPropertyDefinition = createHeadApplicationAll(session, callObject, JCONONPropertyIds.CALL_ELENCO_ASPECTS);
headPropertyDefinition.addAll(createHeadApplicationAll(session, callObject, JCONONPropertyIds.CALL_ELENCO_ASPECTS_SEZIONE_CNR));
headPropertyDefinition.addAll(createHeadApplicationAll(session, callObject, JCONONPropertyIds.CALL_ELENCO_ASPECTS_ULTERIORI_DATI));
Stream<String> concat = headCSVApplicationIstruttoria.stream();
if (Optional.ofNullable(siperService).isPresent()) {
concat = Stream.concat(headCSVApplicationIstruttoria.stream(), Arrays.asList("Codice Sede", "Descrizione Sede", "Livello Profilo", "Profilo", "Tipo Contratto").stream());
}
final HSSFSheet sheet = createSheet(wb, callObject.getPropertyValue(JCONONPropertyIds.CALL_CODICE.value()), Stream.concat(concat, headPropertyDefinition.stream().map(propertyDefinition -> {
return Optional.ofNullable(props.getProperty("label.".concat(propertyDefinition.getId().replace(":", ".")))).filter(s -> s.length() > 0).orElse(Optional.ofNullable(propertyDefinition.getDisplayName()).filter(s -> s.length() > 0).orElse(TESTO));
})).collect(Collectors.toList()));
int index = 1;
for (Folder applicationObject : bandi.get(callId)) {
CMISUser user = null;
try {
user = userService.loadUserForConfirm(applicationObject.getPropertyValue("jconon_application:user"));
} catch (CoolUserFactoryException _ex) {
LOGGER.error("USER {} not found", userId, _ex);
user = new CMISUser(applicationObject.getPropertyValue("jconon_application:user"));
}
LOGGER.info("XLS Istruttoria index {}", index);
getRecordCSVIstruttoria(session, callObject, applicationObject, user, contexURL, sheet, headPropertyDefinition, index++);
}
}
}
}
} else {
wb = createHSSFWorkbook(headCSVApplication);
HSSFSheet sheet = wb.getSheet(SHEET_DOMANDE);
int index = 1;
for (String application : ids) {
Folder applicationObject = (Folder) session.getObject(application);
CMISUser user = userService.loadUserForConfirm(applicationObject.getPropertyValue("jconon_application:user"));
getRecordCSV(session, applicationObject.getFolderParent(), applicationObject, user, contexURL, sheet, index++);
}
}
autoSizeColumns(wb);
try {
return createXLSDocument(session, wb, userId).getId();
} catch (IOException e) {
LOGGER.error("Error while extractionApplication", e);
return null;
}
}
use of it.cnr.si.opencmis.criteria.Criteria in project cool-jconon by consiglionazionaledellericerche.
the class PrintService method generaSchedeValutazione.
private void generaSchedeValutazione(String nodeRef, final String contextURL, final Locale locale, final String indirizzoEmail, final String userId) {
try {
Session adminCMISSession = cmisService.createAdminSession();
Folder bando = (Folder) adminCMISSession.getObject(nodeRef);
Criteria criteriaDomande = CriteriaFactory.createCriteria(JCONONFolderType.JCONON_APPLICATION.queryName());
criteriaDomande.add(Restrictions.inTree(nodeRef));
criteriaDomande.add(Restrictions.eq(JCONONPropertyIds.APPLICATION_STATO_DOMANDA.value(), ApplicationService.StatoDomanda.CONFERMATA.getValue()));
criteriaDomande.add(Restrictions.isNull(JCONONPropertyIds.APPLICATION_ESCLUSIONE_RINUNCIA.value()));
OperationContext context = adminCMISSession.getDefaultContext();
context.setMaxItemsPerPage(10000);
ItemIterable<QueryResult> domande = criteriaDomande.executeQuery(adminCMISSession, false, context);
int domandeEstratte = 0;
for (QueryResult queryResultDomande : domande) {
String applicationAttach = competitionService.findAttachmentId(adminCMISSession, (String) queryResultDomande.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue(), JCONONDocumentType.JCONON_ATTACHMENT_SCHEDA_VALUTAZIONE);
if (applicationAttach != null) {
Document scheda = (Document) adminCMISSession.getObject(applicationAttach);
if (scheda.getVersionLabel().equalsIgnoreCase("1.0")) {
scheda.deleteAllVersions();
} else {
continue;
}
}
try {
printSchedaValutazione(adminCMISSession, (String) queryResultDomande.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue(), contextURL, userId, locale);
domandeEstratte++;
} catch (IOException e) {
LOGGER.error("Error while generaSchedeValutazione", e);
}
}
EmailMessage message = new EmailMessage();
message.setBody("Il processo di estrazione delle schede relative bando " + bando.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString() + " è terminato.<br>Sono state estratte " + domandeEstratte + " schede.");
message.setHtmlBody(true);
message.setSubject(i18nService.getLabel("subject-info", locale) + "Schede di valutazione");
message.setRecipients(Arrays.asList(indirizzoEmail));
mailService.send(message);
} catch (Exception e) {
LOGGER.error("Error on Message for generaSchedeValutazione with id:" + nodeRef, e);
}
}
use of it.cnr.si.opencmis.criteria.Criteria in project cool-jconon by consiglionazionaledellericerche.
the class PrintService method generaSchedeAnonima.
private void generaSchedeAnonima(String nodeRef, final String contextURL, final Locale locale, final String indirizzoEmail, final String userId) {
try {
Session adminCMISSession = cmisService.createAdminSession();
Folder bando = (Folder) adminCMISSession.getObject(nodeRef);
Criteria criteriaDomande = CriteriaFactory.createCriteria(JCONONFolderType.JCONON_APPLICATION.queryName());
criteriaDomande.add(Restrictions.inTree(nodeRef));
criteriaDomande.add(Restrictions.eq(JCONONPropertyIds.APPLICATION_STATO_DOMANDA.value(), ApplicationService.StatoDomanda.CONFERMATA.getValue()));
OperationContext context = adminCMISSession.getDefaultContext();
context.setMaxItemsPerPage(10000);
ItemIterable<QueryResult> domande = criteriaDomande.executeQuery(adminCMISSession, false, context);
int schedeEstratte = 0, numeroScheda = getNumberOfSchedeAnonime(nodeRef, adminCMISSession).intValue();
String messaggio = "";
for (QueryResult queryResultDomande : domande) {
String applicationAttach = competitionService.findAttachmentId(adminCMISSession, (String) queryResultDomande.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue(), JCONONDocumentType.JCONON_ATTACHMENT_SCHEDA_ANONIMA_SINTETICA_GENERATED);
if (queryResultDomande.getPropertyById(JCONONPropertyIds.APPLICATION_ESCLUSIONE_RINUNCIA.value()) != null && queryResultDomande.getPropertyById(JCONONPropertyIds.APPLICATION_ESCLUSIONE_RINUNCIA.value()).getFirstValue() != null) {
if (applicationAttach != null)
adminCMISSession.getObject(applicationAttach).delete();
continue;
}
if (applicationAttach != null) {
if (adminCMISSession.getObject(applicationAttach).getPropertyValue(JCONONPropertyIds.SCHEDA_ANONIMA_VALUTAZIONE_ESITO.value()) != null) {
messaggio = "<BR><b>Alcune schede risultano già valutate, pertanto non sono state estratte nuovamente.</b>";
continue;
} else {
adminCMISSession.getObject(applicationAttach).delete();
}
}
try {
numeroScheda++;
printSchedaAnonimaDiValutazione(adminCMISSession, (String) queryResultDomande.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue(), contextURL, userId, locale, numeroScheda);
schedeEstratte++;
} catch (IOException e) {
LOGGER.error("Error while generaSchedeValutazione", e);
}
}
EmailMessage message = new EmailMessage();
message.setBody("Il processo di estrazione delle schede sintetiche anonime relative bando " + bando.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString() + " è terminato.<br>Sono state estratte " + schedeEstratte + " schede." + messaggio);
message.setHtmlBody(true);
message.setSubject(i18nService.getLabel("subject-info", locale) + "Schede Sintetiche Anonime");
message.setRecipients(Arrays.asList(indirizzoEmail));
mailService.send(message);
} catch (Exception e) {
LOGGER.error("Error on Message for generaSchedeValutazione with id:" + nodeRef, e);
}
}
use of it.cnr.si.opencmis.criteria.Criteria in project cool-jconon by consiglionazionaledellericerche.
the class PrintService method schedeNonAnonime.
public String schedeNonAnonime(Session adminSession, String idCall, String contextURL) {
final StringBuffer message = new StringBuffer();
Criteria criteriaApplications = CriteriaFactory.createCriteria(JCONONFolderType.JCONON_APPLICATION.queryName());
criteriaApplications.add(Restrictions.inFolder(idCall));
criteriaApplications.add(Restrictions.eq(JCONONPropertyIds.APPLICATION_STATO_DOMANDA.value(), StatoDomanda.CONFERMATA.getValue()));
criteriaApplications.add(Restrictions.isNull(JCONONPropertyIds.APPLICATION_ESCLUSIONE_RINUNCIA.value()));
ItemIterable<QueryResult> attive = criteriaApplications.executeQuery(adminSession, false, adminSession.getDefaultContext());
for (QueryResult domanda : attive.getPage(Integer.MAX_VALUE)) {
Folder applicationFolder = Optional.ofNullable(adminSession.getObject(domanda.<String>getPropertyValueById(PropertyIds.OBJECT_ID))).filter(Folder.class::isInstance).map(Folder.class::cast).orElse(null);
if (Optional.ofNullable(applicationFolder).isPresent()) {
StreamSupport.stream(applicationFolder.getChildren().spliterator(), false).filter(cmisObject -> cmisObject.getType().getParentType().getId().equalsIgnoreCase(JCONONDocumentType.JCONON_ATTACHMENT_SCHEDA_ANONIMA.value())).filter(Document.class::isInstance).map(Document.class::cast).forEach(document -> {
PDDocument pdDocument = null;
try {
final Optional<InputStream> inputStream = Optional.ofNullable(document).flatMap(document1 -> Optional.ofNullable(document1.getContentStream())).flatMap(contentStream -> Optional.ofNullable(contentStream.getStream()));
if (inputStream.isPresent()) {
pdDocument = PDDocument.load(inputStream.get());
PDFTextStripper printer = new PDFTextStripper();
final Optional<String> text = Optional.ofNullable(printer.getText(pdDocument));
if (text.isPresent()) {
final String cognome = applicationFolder.<String>getPropertyValue(JCONONPropertyIds.APPLICATION_COGNOME.value()).toLowerCase();
final String nome = applicationFolder.<String>getPropertyValue(JCONONPropertyIds.APPLICATION_NOME.value()).toLowerCase();
final int indiceCognome = text.get().toLowerCase().indexOf(cognome);
final int indiceNome = text.get().toLowerCase().indexOf(nome);
if (indiceCognome != -1 || indiceNome != -1) {
if (message.length() == 0) {
message.append("<ol>");
}
message.append("<li>");
message.append("<p><b>" + applicationFolder.<String>getPropertyValue(PropertyIds.NAME) + "</b></p>");
message.append("<p><b style=\"color:red\">[" + getTextFragment(text.get(), indiceCognome, indiceNome, cognome.length(), nome.length(), 40) + "]</b></p>");
message.append("<p>È possibile scaricare il file dal seguente <a href=\"" + contextURL + "/rest/content?fileName=scheda-anonima.pdf&nodeRef=" + document.getId() + "\">link</a></p>");
message.append("</li>");
LOGGER.info("Testo cercato {} {} in {}", cognome, nome, text.get());
}
}
} else {
LOGGER.error("SCHEDE NON ANONIME STREAM NUll id:{} name:{}", document.getId(), document.getName());
}
} catch (IOException e) {
LOGGER.error("SCHEDE NON ANONIME CANNOT LOAD PDF DOCUMENT", e);
} finally {
Optional.ofNullable(pdDocument).ifPresent(pdDocument1 -> {
try {
pdDocument1.close();
} catch (IOException e) {
LOGGER.error("SCHEDE NON ANONIME CANNOT LOAD PDF DOCUMENT", e);
}
});
}
});
}
}
return Optional.ofNullable(message).filter(stringBuffer -> stringBuffer.length() > 0).map(StringBuffer::toString).map(s -> s.concat("</ol>")).orElse("<p><b>Nessun risultato trovato.</b></p>");
}
use of it.cnr.si.opencmis.criteria.Criteria in project cool-jconon by consiglionazionaledellericerche.
the class PrintService method getCurriculum.
private List<PrintDetailBulk> getCurriculum(List<String> propertyValue, Folder application, Session cmisSession, ApplicationModel applicationModel, boolean printDetail) {
List<PrintDetailBulk> result = new ArrayList<PrintDetailBulk>();
Map<String, List<Pair<String, String>>> sezioni = getSezioni(propertyValue, cmisSession);
for (String key : sezioni.keySet()) {
for (Pair<String, String> pair : sezioni.get(key)) {
Criteria criteria = CriteriaFactory.createCriteria(pair.getSecond());
criteria.addColumn(PropertyIds.OBJECT_ID);
criteria.add(Restrictions.inFolder(application.getId()));
addOrderCurriculum(cmisSession, pair.getSecond(), criteria);
ItemIterable<QueryResult> queryResults = criteria.executeQuery(cmisSession, false, cmisSession.getDefaultContext());
if (queryResults.getTotalNumItems() > 0) {
for (QueryResult queryResult : queryResults.getPage(Integer.MAX_VALUE)) {
CmisObject riga = cmisSession.getObject((String) queryResult.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue());
if (!riga.getType().getQueryName().equalsIgnoreCase(pair.getSecond()))
continue;
if (printDetail) {
result.add(new PrintDetailBulk(key, pair.getFirst(), null, getFields(riga, applicationModel), null));
} else {
String link = null;
if (Optional.ofNullable(riga.<BigInteger>getPropertyValue(PropertyIds.CONTENT_STREAM_LENGTH)).orElse(BigInteger.ZERO).compareTo(BigInteger.ZERO) > 0) {
link = applicationModel.getContextURL() + "/search/content?nodeRef=" + riga.getId() + "&fileName=" + riga.getName() + ".pdf";
}
String ruolo = riga.getPropertyValue("cvelement:altroRuoloProgetto");
if (ruolo == null)
ruolo = riga.getPropertyValue("cvelement:ruoloProgetto");
if (ruolo == null)
ruolo = riga.getPropertyValue("cvelement:altroRuoloIncarico");
if (ruolo == null)
ruolo = riga.getPropertyValue("cvelement:ruoloIncarico");
if (ruolo != null) {
ruolo = ruolo.replace("_", " ");
ruolo += " - ";
} else {
ruolo = "";
}
String title = riga.getPropertyValue("cvelement:denominazioneIncarico");
if (title == null)
title = riga.getPropertyValue("cvelement:denominazioneIstituto");
if (title == null)
title = riga.getPropertyValue("cvelement:titoloProgetto");
if (title == null)
title = riga.getPropertyValue("cvelement:denominazioneStruttura");
if (title == null)
title = riga.getPropertyValue("cvelement:rivista");
if (title == null)
title = riga.getPropertyValue("cvelement:tipologiaOrganismo");
if (title == null)
title = riga.getPropertyValue("cvelement:titoloEvento");
if (title == null)
title = riga.getPropertyValue("cvelement:descrizionePremio");
if (title == null)
title = riga.getPropertyValue("cvelement:commonAltroEnteCodice");
if (riga.getPropertyValue("cvelement:attivitaSvolta") != null)
title += " - " + riga.getPropertyValue("cvelement:attivitaSvolta");
if (riga.getPropertyValue("cvelement:descrizionePartecipazione") != null)
title += " - " + riga.getPropertyValue("cvelement:descrizionePartecipazione");
PrintDetailBulk detail = new PrintDetailBulk(null, pair.getFirst(), link, ruolo + title, null);
String periodo = "";
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
if (riga.getPropertyValue("cvelement:periodAttivitaDal") != null)
periodo += "Dal " + dateFormat.format(((Calendar) riga.getPropertyValue("cvelement:periodAttivitaDal")).getTime());
if (riga.getPropertyValue("cvelement:periodAttivitaAl") != null)
periodo += " Al " + dateFormat.format(((Calendar) riga.getPropertyValue("cvelement:periodAttivitaAl")).getTime());
if (riga.getPropertyValue("cvelement:attivitainCorso") != null)
periodo += " attivita in corso";
if (riga.getPropertyValue("cvelement:oreComplessive") != null)
periodo += " Ore complessive " + ((BigDecimal) (riga.getPropertyValue("cvelement:oreComplessive"))).setScale(0, BigDecimal.ROUND_DOWN);
detail.setPeriodo(periodo);
result.add(detail);
}
}
}
}
}
return result;
}
Aggregations