Search in sources :

Example 1 with InlineResponse201

use of it.cnr.si.cool.jconon.io.model.InlineResponse201 in project cool-jconon by consiglionazionaledellericerche.

the class CallService method inviaEsclusioni.

public Long inviaEsclusioni(Session session, BindingSession bindingSession, String query, String contexURL, String userId, String callId, String userName, String password, AddressType addressFromApplication) throws IOException {
    Folder call = (Folder) session.getObject(callId);
    ItemIterable<QueryResult> esclusioni = session.query(query, false);
    String subject = i18NService.getLabel("subject-info", Locale.ITALIAN) + i18NService.getLabel("subject-confirm-esclusione", Locale.ITALIAN, call.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString());
    long index = 0;
    for (QueryResult esclusione : esclusioni.getPage(Integer.MAX_VALUE)) {
        Document esclusioneObject = (Document) session.getObject((String) esclusione.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue());
        final Optional<Folder> application = esclusioneObject.getParents().stream().findFirst();
        if (application.isPresent() && !Optional.ofNullable(application.get().getPropertyValue(JCONONPropertyIds.APPLICATION_ESCLUSIONE_RINUNCIA.value())).isPresent()) {
            Map<String, Serializable> properties = new HashMap<String, Serializable>();
            properties.put(JCONONPropertyIds.APPLICATION_ESCLUSIONE_RINUNCIA.value(), ApplicationService.StatoDomanda.ESCLUSA.getValue());
            cmisService.createAdminSession().getObject(application.get()).updateProperties(properties);
            Map<String, ACLType> acesToRemove = new HashMap<String, ACLType>();
            List<String> groups = getGroupsCallToApplication(call);
            for (String group : groups) {
                acesToRemove.put(group, ACLType.Contributor);
            }
            aclService.removeAcl(cmisService.getAdminSession(), application.get().getProperty(CoolPropertyIds.ALFCMIS_NODEREF.value()).getValueAsString(), acesToRemove);
        }
        aclService.setInheritedPermission(bindingSession, esclusioneObject.getProperty(CoolPropertyIds.ALFCMIS_NODEREF.value()).getValueAsString(), true);
        String contentURL = contexURL + "/rest/application/esclusione?nodeRef=" + esclusioneObject.getId();
        String user = esclusioneObject.<String>getPropertyValue(JCONONPropertyIds.ATTACHMENT_USER.value());
        List<Document> attachmentRelated = Optional.ofNullable(esclusioneObject.<String>getPropertyValue(JCONONPropertyIds.ATTACHMENT_RELATED.value())).map(s -> Arrays.asList(s.split(","))).orElse(Collections.emptyList()).stream().map(s -> session.getObject(s)).filter(Document.class::isInstance).map(Document.class::cast).collect(Collectors.toList());
        String address = obtainAddress(esclusioneObject, "jconon_esclusione:email_pec", "jconon_esclusione:email", addressFromApplication);
        SimplePECMail simplePECMail = new SimplePECMail(userName, password);
        simplePECMail.setHostName(pecConfiguration.getHostSmtp());
        simplePECMail.setSubject(subject + " $$ " + esclusioneObject.getId());
        String content = "Con riferimento alla Sua domanda di partecipazione al concorso indicato in oggetto, si invia in allegato la relativa esclusione.<br>";
        content += "Distinti saluti.<br/><br/><br/><hr/>";
        content += "<b>Questo messaggio e' stato generato da un sistema automatico. Si prega di non rispondere.</b><br/><br/>";
        try {
            simplePECMail.setFrom(userName);
            simplePECMail.setReplyTo(Collections.singleton(new InternetAddress("undisclosed-recipients")));
            simplePECMail.setTo(Collections.singleton(new InternetAddress(address)));
            simplePECMail.attach(new ByteArrayDataSource(new ByteArrayInputStream(content.getBytes()), "text/html"), "", "", EmailAttachment.INLINE);
            simplePECMail.attach(new ByteArrayDataSource(esclusioneObject.getContentStream().getStream(), esclusioneObject.getContentStreamMimeType()), esclusioneObject.getName(), esclusioneObject.getName());
            if (!attachmentRelated.isEmpty()) {
                for (Document doc : attachmentRelated) {
                    simplePECMail.attach(new ByteArrayDataSource(doc.getContentStream().getStream(), doc.getContentStreamMimeType()), doc.getName(), doc.getName());
                    aclService.addAcl(bindingSession, doc.getPropertyValue(CoolPropertyIds.ALFCMIS_NODEREF.value()), Stream.of(new AbstractMap.SimpleEntry<>(user, ACLType.Consumer)).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
                }
            }
            simplePECMail.send();
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put(JCONON_ESCLUSIONE_STATO, StatoComunicazione.SPEDITO.name());
            esclusioneObject.updateProperties(properties);
            index++;
        } catch (EmailException | AddressException e) {
            LOGGER.error("Cannot send email to {}", address, e);
        }
        if (Optional.ofNullable(ioClient).isPresent()) {
            Optional<String> fiscalCode = esclusioneObject.getParents().stream().findAny().flatMap(folder -> Optional.ofNullable(folder.<String>getPropertyValue(JCONONPropertyIds.APPLICATION_CODICE_FISCALE.value())));
            if (fiscalCode.isPresent()) {
                try {
                    NewMessage newMessage = new NewMessage();
                    newMessage.setTimeToLive(7200);
                    newMessage.setFiscalCode(fiscalCode.get());
                    MessageContent2 messageContent2 = new MessageContent2();
                    messageContent2.setSubject(StringUtils.rightPad("Bando ".concat(call.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString()), 10));
                    messageContent2.setMarkdown("# Esclusione\n" + "In riferimento alla Sua domanda di partecipazione al concorso indicato in oggetto, Le inviamo la seguente *Esclusione*, che può essere scaricata attraverso il seguente link:\n" + "\n" + "[Scarica l'Esclusione](" + contentURL + ")\n" + "\n" + "Distinti saluti.");
                    newMessage.setContent(messageContent2);
                    if (Optional.ofNullable(ioClient.getProfile(fiscalCode.get())).map(limitedProfile -> Optional.ofNullable(limitedProfile.getSenderAllowed()).orElse(Boolean.TRUE)).orElse(Boolean.FALSE)) {
                        final InlineResponse201 inlineResponse201 = ioClient.submitMessageforUser(fiscalCode.get(), newMessage);
                        LOGGER.info("The IO message was successfully sent to {} with Id: {}", fiscalCode.get(), inlineResponse201.getId());
                    }
                } catch (Exception e) {
                    LOGGER.error("Cannot send IO message to {}", fiscalCode.get(), e);
                }
            }
        }
    }
    callRepository.removeVerificaPECTask(subject);
    callRepository.verificaPECTask(userName, password, subject, JCONON_ESCLUSIONE_STATO);
    return index;
}
Also used : Order(it.cnr.si.opencmis.criteria.Order) ByteArrayDataSource(javax.mail.util.ByteArrayDataSource) InlineResponse201(it.cnr.si.cool.jconon.io.model.InlineResponse201) ApplicationService(it.cnr.si.cool.jconon.service.application.ApplicationService) Autowired(org.springframework.beans.factory.annotation.Autowired) CallRepository(it.cnr.si.cool.jconon.repository.CallRepository) StringUtils(org.apache.commons.lang3.StringUtils) BigDecimal(java.math.BigDecimal) CriteriaFactory(it.cnr.si.opencmis.criteria.CriteriaFactory) OperationContextUtils(org.apache.chemistry.opencmis.client.util.OperationContextUtils) HSSFSheet(org.apache.poi.hssf.usermodel.HSSFSheet) CoolPropertyIds(it.cnr.cool.cmis.model.CoolPropertyIds) ObjectIdImpl(org.apache.chemistry.opencmis.client.runtime.ObjectIdImpl) BigInteger(java.math.BigInteger) HttpStatus(org.apache.commons.httpclient.HttpStatus) PrintParameterModel(it.cnr.si.cool.jconon.model.PrintParameterModel) PropertyDefinition(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition) CompetitionFolderService(it.cnr.si.cool.jconon.service.cache.CompetitionFolderService) JCONONPolicyType(it.cnr.si.cool.jconon.cmis.model.JCONONPolicyType) org.apache.chemistry.opencmis.commons.enums(org.apache.chemistry.opencmis.commons.enums) ZoneId(java.time.ZoneId) CMISUser(it.cnr.cool.security.service.impl.alfresco.CMISUser) MailService(it.cnr.cool.mail.MailService) Stream(java.util.stream.Stream) MessageContent2(it.cnr.si.cool.jconon.io.model.MessageContent2) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook) VerificaPECTask(it.cnr.si.cool.jconon.dto.VerificaPECTask) it.cnr.si.cool.jconon.util(it.cnr.si.cool.jconon.util) java.util(java.util) MimeTypes(it.cnr.cool.util.MimeTypes) CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) LocalDateTime(java.time.LocalDateTime) SimpleDateFormat(java.text.SimpleDateFormat) JsonParser(com.google.gson.JsonParser) NumberFormat(java.text.NumberFormat) InternetAddress(javax.mail.internet.InternetAddress) HttpServletRequest(javax.servlet.http.HttpServletRequest) GroupsEnum(it.cnr.cool.security.GroupsEnum) Service(org.springframework.stereotype.Service) StreamSupport(java.util.stream.StreamSupport) Restrictions(it.cnr.si.opencmis.criteria.restrictions.Restrictions) UrlBuilder(org.apache.chemistry.opencmis.commons.impl.UrlBuilder) org.apache.chemistry.opencmis.client.api(org.apache.chemistry.opencmis.client.api) JSONTokener(org.json.JSONTokener) PropertyData(org.apache.chemistry.opencmis.commons.data.PropertyData) JCONONFolderType(it.cnr.si.cool.jconon.cmis.model.JCONONFolderType) StrServ(it.cnr.cool.util.StrServ) HelpdeskService(it.cnr.si.cool.jconon.service.helpdesk.HelpdeskService) ProtocolRepository(it.cnr.si.cool.jconon.repository.ProtocolRepository) UserService(it.cnr.cool.security.service.UserService) Message(javax.mail.Message) JsonObject(com.google.gson.JsonObject) PermissionServiceImpl(it.cnr.cool.web.PermissionServiceImpl) URLName(javax.mail.URLName) LoggerFactory(org.slf4j.LoggerFactory) MultipartHttpServletRequest(org.springframework.web.multipart.MultipartHttpServletRequest) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) MessagingException(javax.mail.MessagingException) JSONObject(org.json.JSONObject) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Cell(org.apache.poi.ss.usermodel.Cell) ParseException(java.text.ParseException) Store(javax.mail.Store) CmisBindingsHelper(org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper) Response(org.apache.chemistry.opencmis.client.bindings.spi.http.Response) AddressException(javax.mail.internet.AddressException) NewMessage(it.cnr.si.cool.jconon.io.model.NewMessage) QueueService(it.cnr.si.cool.jconon.service.QueueService) StringUtil(it.cnr.cool.util.StringUtil) SubjectTerm(javax.mail.search.SubjectTerm) ACLType(it.cnr.cool.cmis.model.ACLType) Collectors(java.util.stream.Collectors) Environment(org.springframework.core.env.Environment) PropertyIds(org.apache.chemistry.opencmis.commons.PropertyIds) LocalDate(java.time.LocalDate) EmailException(org.apache.commons.mail.EmailException) CoolUserFactoryException(it.cnr.cool.exception.CoolUserFactoryException) JCONONPropertyIds(it.cnr.si.cool.jconon.cmis.model.JCONONPropertyIds) Async(org.springframework.scheduling.annotation.Async) PECConfiguration(it.cnr.si.cool.jconon.configuration.PECConfiguration) ContentStreamImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl) CommonsMultipartResolver(org.springframework.web.multipart.commons.CommonsMultipartResolver) IO(it.cnr.si.cool.jconon.io.repository.IO) PrintService(it.cnr.si.cool.jconon.service.PrintService) Inject(javax.inject.Inject) SearchTerm(javax.mail.search.SearchTerm) it.cnr.cool.cmis.service(it.cnr.cool.cmis.service) EmailAttachment(org.apache.commons.mail.EmailAttachment) Criteria(it.cnr.si.opencmis.criteria.Criteria) Util(it.cnr.cool.rest.util.Util) JCONONDocumentType(it.cnr.si.cool.jconon.cmis.model.JCONONDocumentType) TypeService(it.cnr.si.cool.jconon.service.TypeService) CacheRepository(it.cnr.si.cool.jconon.repository.CacheRepository) Logger(org.slf4j.Logger) BindingSession(org.apache.chemistry.opencmis.client.bindings.spi.BindingSession) ClientMessageException(it.cnr.cool.web.scripts.exception.ClientMessageException) Output(org.apache.chemistry.opencmis.client.bindings.spi.http.Output) StrSubstitutor(org.apache.commons.text.StrSubstitutor) ApplicationContext(org.springframework.context.ApplicationContext) EmailMessage(it.cnr.cool.mail.model.EmailMessage) java.io(java.io) DateTimeFormatter(java.time.format.DateTimeFormatter) Row(org.apache.poi.ss.usermodel.Row) MultipartFile(org.springframework.web.multipart.MultipartFile) CMISGroup(it.cnr.cool.security.service.impl.alfresco.CMISGroup) CMISUtil(it.cnr.cool.util.CMISUtil) I18nService(it.cnr.cool.service.I18nService) InternetAddress(javax.mail.internet.InternetAddress) MessageContent2(it.cnr.si.cool.jconon.io.model.MessageContent2) NewMessage(it.cnr.si.cool.jconon.io.model.NewMessage) InlineResponse201(it.cnr.si.cool.jconon.io.model.InlineResponse201) AddressException(javax.mail.internet.AddressException) EmailException(org.apache.commons.mail.EmailException) ByteArrayDataSource(javax.mail.util.ByteArrayDataSource) ACLType(it.cnr.cool.cmis.model.ACLType) CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) MessagingException(javax.mail.MessagingException) ParseException(java.text.ParseException) AddressException(javax.mail.internet.AddressException) EmailException(org.apache.commons.mail.EmailException) CoolUserFactoryException(it.cnr.cool.exception.CoolUserFactoryException) ClientMessageException(it.cnr.cool.web.scripts.exception.ClientMessageException) JsonObject(com.google.gson.JsonObject) JSONObject(org.json.JSONObject)

Example 2 with InlineResponse201

use of it.cnr.si.cool.jconon.io.model.InlineResponse201 in project cool-jconon by consiglionazionaledellericerche.

the class CallService method inviaConvocazioni.

public Long inviaConvocazioni(Session session, BindingSession bindingSession, String query, String contexURL, String userId, String callId, String userName, String password, AddressType addressFromApplication) throws IOException {
    Folder call = (Folder) session.getObject(callId);
    ItemIterable<QueryResult> convocazioni = session.query(query, false);
    long index = 0;
    String subject = i18NService.getLabel("subject-info", Locale.ITALIAN) + i18NService.getLabel("subject-confirm-convocazione", Locale.ITALIAN, call.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString());
    for (QueryResult convocazione : convocazioni.getPage(Integer.MAX_VALUE)) {
        Document convocazioneObject = (Document) session.getObject((String) convocazione.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue());
        aclService.setInheritedPermission(bindingSession, convocazioneObject.getProperty(CoolPropertyIds.ALFCMIS_NODEREF.value()).getValueAsString(), true);
        String contentURL = contexURL + "/rest/application/convocazione?nodeRef=" + convocazioneObject.getId();
        String address = obtainAddress(convocazioneObject, "jconon_convocazione:email_pec", "jconon_convocazione:email", addressFromApplication);
        String user = convocazioneObject.<String>getPropertyValue(JCONONPropertyIds.ATTACHMENT_USER.value());
        List<Document> attachmentRelated = Optional.ofNullable(convocazioneObject.<String>getPropertyValue(JCONONPropertyIds.ATTACHMENT_RELATED.value())).map(s -> Arrays.asList(s.split(","))).orElse(Collections.emptyList()).stream().map(s -> session.getObject(s)).filter(Document.class::isInstance).map(Document.class::cast).collect(Collectors.toList());
        SimplePECMail simplePECMail = new SimplePECMail(userName, password);
        simplePECMail.setHostName(pecConfiguration.getHostSmtp());
        simplePECMail.setSubject(subject + " $$ " + convocazioneObject.getId());
        String content = "Con riferimento alla Sua domanda di partecipazione al concorso indicato in oggetto, si invia in allegato la relativa convocazione.<br>" + "Per i candidati che non hanno indicato in domanda un indirizzo PEC o che non lo hanno comunicato in seguito, e' richiesta conferma di ricezione della presente cliccando sul seguente <a href=\"" + contentURL + "\">link</a> , <br/>qualora non dovesse funzionare copi questo [" + contentURL + "] nella barra degli indirizzi del browser.<br/>";
        content += "Distinti saluti.<br/><br/><br/><hr/>";
        content += "<b>Questo messaggio e' stato generato da un sistema automatico. Si prega di non rispondere.</b><br/><br/>";
        try {
            simplePECMail.setFrom(userName);
            simplePECMail.setReplyTo(Collections.singleton(new InternetAddress("undisclosed-recipients")));
            simplePECMail.setTo(Collections.singleton(new InternetAddress(address)));
            simplePECMail.attach(new ByteArrayDataSource(new ByteArrayInputStream(content.getBytes()), "text/html"), "", "", EmailAttachment.INLINE);
            simplePECMail.attach(new ByteArrayDataSource(convocazioneObject.getContentStream().getStream(), convocazioneObject.getContentStreamMimeType()), convocazioneObject.getName(), convocazioneObject.getName());
            if (!attachmentRelated.isEmpty()) {
                for (Document doc : attachmentRelated) {
                    simplePECMail.attach(new ByteArrayDataSource(doc.getContentStream().getStream(), doc.getContentStreamMimeType()), doc.getName(), doc.getName());
                    aclService.addAcl(bindingSession, doc.getPropertyValue(CoolPropertyIds.ALFCMIS_NODEREF.value()), Stream.of(new AbstractMap.SimpleEntry<>(user, ACLType.Consumer)).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
                }
            }
            simplePECMail.send();
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put(JCONON_CONVOCAZIONE_STATO, StatoComunicazione.SPEDITO.name());
            convocazioneObject.updateProperties(properties);
            index++;
        } catch (EmailException | AddressException e) {
            LOGGER.error("Cannot send email to {}", address, e);
        }
        if (Optional.ofNullable(ioClient).isPresent()) {
            Optional<String> fiscalCode = convocazioneObject.getParents().stream().findAny().flatMap(folder -> Optional.ofNullable(folder.<String>getPropertyValue(JCONONPropertyIds.APPLICATION_CODICE_FISCALE.value())));
            if (fiscalCode.isPresent()) {
                try {
                    NewMessage newMessage = new NewMessage();
                    newMessage.setTimeToLive(7200);
                    newMessage.setFiscalCode(fiscalCode.get());
                    MessageContent2 messageContent2 = new MessageContent2();
                    messageContent2.setSubject(StringUtils.rightPad("Bando ".concat(call.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString()), 10));
                    messageContent2.setMarkdown("# Convocazione\n" + "In riferimento alla Sua domanda di partecipazione al concorso indicato in oggetto, Le inviamo la seguente *Convocazione*, che può essere scaricata attraverso il seguente link:\n" + "\n" + "[Scarica la Convocazione](" + contentURL + ")\n" + "\n" + "Distinti saluti.");
                    newMessage.setContent(messageContent2);
                    if (Optional.ofNullable(ioClient.getProfile(fiscalCode.get())).map(limitedProfile -> Optional.ofNullable(limitedProfile.getSenderAllowed()).orElse(Boolean.TRUE)).orElse(Boolean.FALSE)) {
                        final InlineResponse201 inlineResponse201 = ioClient.submitMessageforUser(fiscalCode.get(), newMessage);
                        LOGGER.info("The IO message was successfully sent to {} with Id: {}", fiscalCode.get(), inlineResponse201.getId());
                    }
                } catch (Exception e) {
                    LOGGER.error("Cannot send IO message to {}", fiscalCode.get(), e);
                }
            }
        }
    }
    callRepository.removeVerificaPECTask(subject);
    callRepository.verificaPECTask(userName, password, subject, JCONON_CONVOCAZIONE_STATO);
    return index;
}
Also used : Order(it.cnr.si.opencmis.criteria.Order) ByteArrayDataSource(javax.mail.util.ByteArrayDataSource) InlineResponse201(it.cnr.si.cool.jconon.io.model.InlineResponse201) ApplicationService(it.cnr.si.cool.jconon.service.application.ApplicationService) Autowired(org.springframework.beans.factory.annotation.Autowired) CallRepository(it.cnr.si.cool.jconon.repository.CallRepository) StringUtils(org.apache.commons.lang3.StringUtils) BigDecimal(java.math.BigDecimal) CriteriaFactory(it.cnr.si.opencmis.criteria.CriteriaFactory) OperationContextUtils(org.apache.chemistry.opencmis.client.util.OperationContextUtils) HSSFSheet(org.apache.poi.hssf.usermodel.HSSFSheet) CoolPropertyIds(it.cnr.cool.cmis.model.CoolPropertyIds) ObjectIdImpl(org.apache.chemistry.opencmis.client.runtime.ObjectIdImpl) BigInteger(java.math.BigInteger) HttpStatus(org.apache.commons.httpclient.HttpStatus) PrintParameterModel(it.cnr.si.cool.jconon.model.PrintParameterModel) PropertyDefinition(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition) CompetitionFolderService(it.cnr.si.cool.jconon.service.cache.CompetitionFolderService) JCONONPolicyType(it.cnr.si.cool.jconon.cmis.model.JCONONPolicyType) org.apache.chemistry.opencmis.commons.enums(org.apache.chemistry.opencmis.commons.enums) ZoneId(java.time.ZoneId) CMISUser(it.cnr.cool.security.service.impl.alfresco.CMISUser) MailService(it.cnr.cool.mail.MailService) Stream(java.util.stream.Stream) MessageContent2(it.cnr.si.cool.jconon.io.model.MessageContent2) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook) VerificaPECTask(it.cnr.si.cool.jconon.dto.VerificaPECTask) it.cnr.si.cool.jconon.util(it.cnr.si.cool.jconon.util) java.util(java.util) MimeTypes(it.cnr.cool.util.MimeTypes) CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) LocalDateTime(java.time.LocalDateTime) SimpleDateFormat(java.text.SimpleDateFormat) JsonParser(com.google.gson.JsonParser) NumberFormat(java.text.NumberFormat) InternetAddress(javax.mail.internet.InternetAddress) HttpServletRequest(javax.servlet.http.HttpServletRequest) GroupsEnum(it.cnr.cool.security.GroupsEnum) Service(org.springframework.stereotype.Service) StreamSupport(java.util.stream.StreamSupport) Restrictions(it.cnr.si.opencmis.criteria.restrictions.Restrictions) UrlBuilder(org.apache.chemistry.opencmis.commons.impl.UrlBuilder) org.apache.chemistry.opencmis.client.api(org.apache.chemistry.opencmis.client.api) JSONTokener(org.json.JSONTokener) PropertyData(org.apache.chemistry.opencmis.commons.data.PropertyData) JCONONFolderType(it.cnr.si.cool.jconon.cmis.model.JCONONFolderType) StrServ(it.cnr.cool.util.StrServ) HelpdeskService(it.cnr.si.cool.jconon.service.helpdesk.HelpdeskService) ProtocolRepository(it.cnr.si.cool.jconon.repository.ProtocolRepository) UserService(it.cnr.cool.security.service.UserService) Message(javax.mail.Message) JsonObject(com.google.gson.JsonObject) PermissionServiceImpl(it.cnr.cool.web.PermissionServiceImpl) URLName(javax.mail.URLName) LoggerFactory(org.slf4j.LoggerFactory) MultipartHttpServletRequest(org.springframework.web.multipart.MultipartHttpServletRequest) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) MessagingException(javax.mail.MessagingException) JSONObject(org.json.JSONObject) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Cell(org.apache.poi.ss.usermodel.Cell) ParseException(java.text.ParseException) Store(javax.mail.Store) CmisBindingsHelper(org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper) Response(org.apache.chemistry.opencmis.client.bindings.spi.http.Response) AddressException(javax.mail.internet.AddressException) NewMessage(it.cnr.si.cool.jconon.io.model.NewMessage) QueueService(it.cnr.si.cool.jconon.service.QueueService) StringUtil(it.cnr.cool.util.StringUtil) SubjectTerm(javax.mail.search.SubjectTerm) ACLType(it.cnr.cool.cmis.model.ACLType) Collectors(java.util.stream.Collectors) Environment(org.springframework.core.env.Environment) PropertyIds(org.apache.chemistry.opencmis.commons.PropertyIds) LocalDate(java.time.LocalDate) EmailException(org.apache.commons.mail.EmailException) CoolUserFactoryException(it.cnr.cool.exception.CoolUserFactoryException) JCONONPropertyIds(it.cnr.si.cool.jconon.cmis.model.JCONONPropertyIds) Async(org.springframework.scheduling.annotation.Async) PECConfiguration(it.cnr.si.cool.jconon.configuration.PECConfiguration) ContentStreamImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl) CommonsMultipartResolver(org.springframework.web.multipart.commons.CommonsMultipartResolver) IO(it.cnr.si.cool.jconon.io.repository.IO) PrintService(it.cnr.si.cool.jconon.service.PrintService) Inject(javax.inject.Inject) SearchTerm(javax.mail.search.SearchTerm) it.cnr.cool.cmis.service(it.cnr.cool.cmis.service) EmailAttachment(org.apache.commons.mail.EmailAttachment) Criteria(it.cnr.si.opencmis.criteria.Criteria) Util(it.cnr.cool.rest.util.Util) JCONONDocumentType(it.cnr.si.cool.jconon.cmis.model.JCONONDocumentType) TypeService(it.cnr.si.cool.jconon.service.TypeService) CacheRepository(it.cnr.si.cool.jconon.repository.CacheRepository) Logger(org.slf4j.Logger) BindingSession(org.apache.chemistry.opencmis.client.bindings.spi.BindingSession) ClientMessageException(it.cnr.cool.web.scripts.exception.ClientMessageException) Output(org.apache.chemistry.opencmis.client.bindings.spi.http.Output) StrSubstitutor(org.apache.commons.text.StrSubstitutor) ApplicationContext(org.springframework.context.ApplicationContext) EmailMessage(it.cnr.cool.mail.model.EmailMessage) java.io(java.io) DateTimeFormatter(java.time.format.DateTimeFormatter) Row(org.apache.poi.ss.usermodel.Row) MultipartFile(org.springframework.web.multipart.MultipartFile) CMISGroup(it.cnr.cool.security.service.impl.alfresco.CMISGroup) CMISUtil(it.cnr.cool.util.CMISUtil) I18nService(it.cnr.cool.service.I18nService) InternetAddress(javax.mail.internet.InternetAddress) MessageContent2(it.cnr.si.cool.jconon.io.model.MessageContent2) NewMessage(it.cnr.si.cool.jconon.io.model.NewMessage) InlineResponse201(it.cnr.si.cool.jconon.io.model.InlineResponse201) AddressException(javax.mail.internet.AddressException) EmailException(org.apache.commons.mail.EmailException) ByteArrayDataSource(javax.mail.util.ByteArrayDataSource) CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) MessagingException(javax.mail.MessagingException) ParseException(java.text.ParseException) AddressException(javax.mail.internet.AddressException) EmailException(org.apache.commons.mail.EmailException) CoolUserFactoryException(it.cnr.cool.exception.CoolUserFactoryException) ClientMessageException(it.cnr.cool.web.scripts.exception.ClientMessageException) JsonObject(com.google.gson.JsonObject) JSONObject(org.json.JSONObject)

Example 3 with InlineResponse201

use of it.cnr.si.cool.jconon.io.model.InlineResponse201 in project cool-jconon by consiglionazionaledellericerche.

the class IOTest method newComunicazioneMesage.

@Test
public void newComunicazioneMesage() {
    NewMessage newMessage = new NewMessage();
    String fiscalCode = "AAAAAA00A00A000A";
    newMessage.setTimeToLive(7200);
    newMessage.setFiscalCode(fiscalCode);
    MessageContent2 messageContent2 = new MessageContent2();
    messageContent2.setSubject("Bando 315.58 PT - PROGETTAZIONE E-O GESTIONE IMPIANTI, STRUMENTAZIONI, SERVIZI");
    messageContent2.setMarkdown("# Comunicazione\n" + "In riferimento alla Sua domanda di partecipazione al concorso indicato in oggetto, Le inviamo la seguente *comunicazione*, che può scaricare attraverso il seguente link:\n" + "\n" + "[Scarica la Comunicazione](https://selezionionline.cnr.it/jconon/rest/content?nodeRef=99588489-2914-4fc8-9658-493f69ffc433;1.0&guest=true)\n" + "\n" + "Distinti saluti.");
    newMessage.setContent(messageContent2);
    LimitedProfile profile = ioClient.getProfile(fiscalCode);
    assertTrue(Optional.ofNullable(profile.getSenderAllowed()).orElse(Boolean.TRUE));
    if (Optional.ofNullable(profile.getSenderAllowed()).orElse(Boolean.TRUE)) {
        InlineResponse201 inlineResponse201 = ioClient.submitMessageforUser(fiscalCode, newMessage);
        assertNotNull(inlineResponse201.getId());
    }
}
Also used : MessageContent2(it.cnr.si.cool.jconon.io.model.MessageContent2) LimitedProfile(it.cnr.si.cool.jconon.io.model.LimitedProfile) NewMessage(it.cnr.si.cool.jconon.io.model.NewMessage) InlineResponse201(it.cnr.si.cool.jconon.io.model.InlineResponse201) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 4 with InlineResponse201

use of it.cnr.si.cool.jconon.io.model.InlineResponse201 in project cool-jconon by consiglionazionaledellericerche.

the class IOTest method newConvocazioneMesage.

@Test
public void newConvocazioneMesage() {
    NewMessage newMessage = new NewMessage();
    String fiscalCode = "AAAAAA00A00A000A";
    newMessage.setTimeToLive(7200);
    newMessage.setFiscalCode(fiscalCode);
    MessageContent2 messageContent2 = new MessageContent2();
    messageContent2.setSubject("Bando 315.58 PT - PROGETTAZIONE E-O GESTIONE IMPIANTI, STRUMENTAZIONI, SERVIZI");
    messageContent2.setMarkdown("# Convocazione\n" + "In riferimento alla Sua domanda di partecipazione al concorso indicato in oggetto, Le inviamo la seguente *convocazione*, che può essere scaricata attraverso il seguente link:\n" + "\n" + "[Scarica la Convocazione](https://selezionionline.cnr.it/jconon/rest/application/convocazione?nodeRef=99588489-2914-4fc8-9658-493f69ffc433;1.0&guest=true)\n" + "\n" + "Distinti saluti.");
    newMessage.setContent(messageContent2);
    LimitedProfile profile = ioClient.getProfile(fiscalCode);
    assertTrue(Optional.ofNullable(profile.getSenderAllowed()).orElse(Boolean.TRUE));
    if (Optional.ofNullable(profile.getSenderAllowed()).orElse(Boolean.TRUE)) {
        InlineResponse201 inlineResponse201 = ioClient.submitMessageforUser(fiscalCode, newMessage);
        assertNotNull(inlineResponse201.getId());
    }
}
Also used : MessageContent2(it.cnr.si.cool.jconon.io.model.MessageContent2) LimitedProfile(it.cnr.si.cool.jconon.io.model.LimitedProfile) NewMessage(it.cnr.si.cool.jconon.io.model.NewMessage) InlineResponse201(it.cnr.si.cool.jconon.io.model.InlineResponse201) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 5 with InlineResponse201

use of it.cnr.si.cool.jconon.io.model.InlineResponse201 in project cool-jconon by consiglionazionaledellericerche.

the class CallService method inviaComunicazioni.

public Long inviaComunicazioni(Session session, BindingSession bindingSession, String query, String contexURL, String userId, String callId, String userName, String password, AddressType addressFromApplication) throws IOException {
    Folder call = (Folder) session.getObject(callId);
    String subject = i18NService.getLabel("subject-info", Locale.ITALIAN) + i18NService.getLabel("subject-confirm-comunicazione", Locale.ITALIAN, call.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString());
    ItemIterable<QueryResult> comunicazioni = session.query(query, false);
    long index = 0;
    for (QueryResult comunicazione : comunicazioni.getPage(Integer.MAX_VALUE)) {
        Document comunicazioneObject = (Document) session.getObject((String) comunicazione.getPropertyById(PropertyIds.OBJECT_ID).getFirstValue());
        aclService.setInheritedPermission(bindingSession, comunicazioneObject.getProperty(CoolPropertyIds.ALFCMIS_NODEREF.value()).getValueAsString(), true);
        String address = obtainAddress(comunicazioneObject, "jconon_comunicazione:email_pec", "jconon_comunicazione:email", addressFromApplication);
        String contentURL = contexURL + "/rest/application/comunicazione?nodeRef=" + comunicazioneObject.getId();
        String user = comunicazioneObject.<String>getPropertyValue(JCONONPropertyIds.ATTACHMENT_USER.value());
        List<Document> attachmentRelated = Optional.ofNullable(comunicazioneObject.<String>getPropertyValue(JCONONPropertyIds.ATTACHMENT_RELATED.value())).map(s -> Arrays.asList(s.split(","))).orElse(Collections.emptyList()).stream().map(s -> session.getObject(s)).filter(Document.class::isInstance).map(Document.class::cast).collect(Collectors.toList());
        SimplePECMail simplePECMail = new SimplePECMail(userName, password);
        simplePECMail.setHostName(pecConfiguration.getHostSmtp());
        simplePECMail.setSubject(subject + " $$ " + comunicazioneObject.getId());
        String content = "Con riferimento alla Sua domanda di partecipazione al concorso indicato in oggetto, si invia in allegato la relativa comunicazione.<br>";
        content += "Distinti saluti.<br/><br/><br/><hr/>";
        content += "<b>Questo messaggio e' stato generato da un sistema automatico. Si prega di non rispondere.</b><br/><br/>";
        try {
            simplePECMail.setFrom(userName);
            simplePECMail.setReplyTo(Collections.singleton(new InternetAddress("undisclosed-recipients")));
            simplePECMail.setTo(Collections.singleton(new InternetAddress(address)));
            simplePECMail.attach(new ByteArrayDataSource(new ByteArrayInputStream(content.getBytes()), "text/html"), "", "", EmailAttachment.INLINE);
            simplePECMail.attach(new ByteArrayDataSource(comunicazioneObject.getContentStream().getStream(), comunicazioneObject.getContentStreamMimeType()), comunicazioneObject.getName(), comunicazioneObject.getName());
            if (!attachmentRelated.isEmpty()) {
                for (Document doc : attachmentRelated) {
                    simplePECMail.attach(new ByteArrayDataSource(doc.getContentStream().getStream(), doc.getContentStreamMimeType()), doc.getName(), doc.getName());
                    aclService.addAcl(bindingSession, doc.getPropertyValue(CoolPropertyIds.ALFCMIS_NODEREF.value()), Stream.of(new AbstractMap.SimpleEntry<>(user, ACLType.Consumer)).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
                }
            }
            simplePECMail.send();
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put(JCONON_COMUNICAZIONE_STATO, StatoComunicazione.SPEDITO.name());
            comunicazioneObject.updateProperties(properties);
            index++;
        } catch (EmailException | AddressException e) {
            LOGGER.error("Cannot send email to {}", address, e);
        }
        if (Optional.ofNullable(ioClient).isPresent()) {
            Optional<String> fiscalCode = comunicazioneObject.getParents().stream().findAny().flatMap(folder -> Optional.ofNullable(folder.<String>getPropertyValue(JCONONPropertyIds.APPLICATION_CODICE_FISCALE.value())));
            if (fiscalCode.isPresent()) {
                try {
                    NewMessage newMessage = new NewMessage();
                    newMessage.setTimeToLive(7200);
                    newMessage.setFiscalCode(fiscalCode.get());
                    MessageContent2 messageContent2 = new MessageContent2();
                    messageContent2.setSubject(StringUtils.rightPad("Bando ".concat(call.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString()), 10));
                    messageContent2.setSubject(StringUtils.rightPad("Bando ".concat(call.getProperty(JCONONPropertyIds.CALL_CODICE.value()).getValueAsString()), 80));
                    messageContent2.setMarkdown("# Comunicazione\n" + "In riferimento alla Sua domanda di partecipazione al concorso indicato in oggetto, Le inviamo la seguente *Comunicazione*, che può essere scaricata attraverso il seguente link:\n" + "\n" + "[Scarica la Comunicazione](" + contentURL + ")\n" + "\n" + "Distinti saluti.");
                    newMessage.setContent(messageContent2);
                    if (Optional.ofNullable(ioClient.getProfile(fiscalCode.get())).map(limitedProfile -> Optional.ofNullable(limitedProfile.getSenderAllowed()).orElse(Boolean.TRUE)).orElse(Boolean.FALSE)) {
                        final InlineResponse201 inlineResponse201 = ioClient.submitMessageforUser(fiscalCode.get(), newMessage);
                        LOGGER.info("The IO message was successfully sent to {} with Id: {}", fiscalCode.get(), inlineResponse201.getId());
                    }
                } catch (Exception e) {
                    LOGGER.error("Cannot send IO message to {}", fiscalCode.get(), e);
                }
            }
        }
    }
    callRepository.removeVerificaPECTask(subject);
    callRepository.verificaPECTask(userName, password, subject, JCONON_COMUNICAZIONE_STATO);
    return index;
}
Also used : Order(it.cnr.si.opencmis.criteria.Order) ByteArrayDataSource(javax.mail.util.ByteArrayDataSource) InlineResponse201(it.cnr.si.cool.jconon.io.model.InlineResponse201) ApplicationService(it.cnr.si.cool.jconon.service.application.ApplicationService) Autowired(org.springframework.beans.factory.annotation.Autowired) CallRepository(it.cnr.si.cool.jconon.repository.CallRepository) StringUtils(org.apache.commons.lang3.StringUtils) BigDecimal(java.math.BigDecimal) CriteriaFactory(it.cnr.si.opencmis.criteria.CriteriaFactory) OperationContextUtils(org.apache.chemistry.opencmis.client.util.OperationContextUtils) HSSFSheet(org.apache.poi.hssf.usermodel.HSSFSheet) CoolPropertyIds(it.cnr.cool.cmis.model.CoolPropertyIds) ObjectIdImpl(org.apache.chemistry.opencmis.client.runtime.ObjectIdImpl) BigInteger(java.math.BigInteger) HttpStatus(org.apache.commons.httpclient.HttpStatus) PrintParameterModel(it.cnr.si.cool.jconon.model.PrintParameterModel) PropertyDefinition(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition) CompetitionFolderService(it.cnr.si.cool.jconon.service.cache.CompetitionFolderService) JCONONPolicyType(it.cnr.si.cool.jconon.cmis.model.JCONONPolicyType) org.apache.chemistry.opencmis.commons.enums(org.apache.chemistry.opencmis.commons.enums) ZoneId(java.time.ZoneId) CMISUser(it.cnr.cool.security.service.impl.alfresco.CMISUser) MailService(it.cnr.cool.mail.MailService) Stream(java.util.stream.Stream) MessageContent2(it.cnr.si.cool.jconon.io.model.MessageContent2) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook) VerificaPECTask(it.cnr.si.cool.jconon.dto.VerificaPECTask) it.cnr.si.cool.jconon.util(it.cnr.si.cool.jconon.util) java.util(java.util) MimeTypes(it.cnr.cool.util.MimeTypes) CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) LocalDateTime(java.time.LocalDateTime) SimpleDateFormat(java.text.SimpleDateFormat) JsonParser(com.google.gson.JsonParser) NumberFormat(java.text.NumberFormat) InternetAddress(javax.mail.internet.InternetAddress) HttpServletRequest(javax.servlet.http.HttpServletRequest) GroupsEnum(it.cnr.cool.security.GroupsEnum) Service(org.springframework.stereotype.Service) StreamSupport(java.util.stream.StreamSupport) Restrictions(it.cnr.si.opencmis.criteria.restrictions.Restrictions) UrlBuilder(org.apache.chemistry.opencmis.commons.impl.UrlBuilder) org.apache.chemistry.opencmis.client.api(org.apache.chemistry.opencmis.client.api) JSONTokener(org.json.JSONTokener) PropertyData(org.apache.chemistry.opencmis.commons.data.PropertyData) JCONONFolderType(it.cnr.si.cool.jconon.cmis.model.JCONONFolderType) StrServ(it.cnr.cool.util.StrServ) HelpdeskService(it.cnr.si.cool.jconon.service.helpdesk.HelpdeskService) ProtocolRepository(it.cnr.si.cool.jconon.repository.ProtocolRepository) UserService(it.cnr.cool.security.service.UserService) Message(javax.mail.Message) JsonObject(com.google.gson.JsonObject) PermissionServiceImpl(it.cnr.cool.web.PermissionServiceImpl) URLName(javax.mail.URLName) LoggerFactory(org.slf4j.LoggerFactory) MultipartHttpServletRequest(org.springframework.web.multipart.MultipartHttpServletRequest) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) MessagingException(javax.mail.MessagingException) JSONObject(org.json.JSONObject) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Cell(org.apache.poi.ss.usermodel.Cell) ParseException(java.text.ParseException) Store(javax.mail.Store) CmisBindingsHelper(org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper) Response(org.apache.chemistry.opencmis.client.bindings.spi.http.Response) AddressException(javax.mail.internet.AddressException) NewMessage(it.cnr.si.cool.jconon.io.model.NewMessage) QueueService(it.cnr.si.cool.jconon.service.QueueService) StringUtil(it.cnr.cool.util.StringUtil) SubjectTerm(javax.mail.search.SubjectTerm) ACLType(it.cnr.cool.cmis.model.ACLType) Collectors(java.util.stream.Collectors) Environment(org.springframework.core.env.Environment) PropertyIds(org.apache.chemistry.opencmis.commons.PropertyIds) LocalDate(java.time.LocalDate) EmailException(org.apache.commons.mail.EmailException) CoolUserFactoryException(it.cnr.cool.exception.CoolUserFactoryException) JCONONPropertyIds(it.cnr.si.cool.jconon.cmis.model.JCONONPropertyIds) Async(org.springframework.scheduling.annotation.Async) PECConfiguration(it.cnr.si.cool.jconon.configuration.PECConfiguration) ContentStreamImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl) CommonsMultipartResolver(org.springframework.web.multipart.commons.CommonsMultipartResolver) IO(it.cnr.si.cool.jconon.io.repository.IO) PrintService(it.cnr.si.cool.jconon.service.PrintService) Inject(javax.inject.Inject) SearchTerm(javax.mail.search.SearchTerm) it.cnr.cool.cmis.service(it.cnr.cool.cmis.service) EmailAttachment(org.apache.commons.mail.EmailAttachment) Criteria(it.cnr.si.opencmis.criteria.Criteria) Util(it.cnr.cool.rest.util.Util) JCONONDocumentType(it.cnr.si.cool.jconon.cmis.model.JCONONDocumentType) TypeService(it.cnr.si.cool.jconon.service.TypeService) CacheRepository(it.cnr.si.cool.jconon.repository.CacheRepository) Logger(org.slf4j.Logger) BindingSession(org.apache.chemistry.opencmis.client.bindings.spi.BindingSession) ClientMessageException(it.cnr.cool.web.scripts.exception.ClientMessageException) Output(org.apache.chemistry.opencmis.client.bindings.spi.http.Output) StrSubstitutor(org.apache.commons.text.StrSubstitutor) ApplicationContext(org.springframework.context.ApplicationContext) EmailMessage(it.cnr.cool.mail.model.EmailMessage) java.io(java.io) DateTimeFormatter(java.time.format.DateTimeFormatter) Row(org.apache.poi.ss.usermodel.Row) MultipartFile(org.springframework.web.multipart.MultipartFile) CMISGroup(it.cnr.cool.security.service.impl.alfresco.CMISGroup) CMISUtil(it.cnr.cool.util.CMISUtil) I18nService(it.cnr.cool.service.I18nService) InternetAddress(javax.mail.internet.InternetAddress) MessageContent2(it.cnr.si.cool.jconon.io.model.MessageContent2) NewMessage(it.cnr.si.cool.jconon.io.model.NewMessage) InlineResponse201(it.cnr.si.cool.jconon.io.model.InlineResponse201) AddressException(javax.mail.internet.AddressException) EmailException(org.apache.commons.mail.EmailException) ByteArrayDataSource(javax.mail.util.ByteArrayDataSource) CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) MessagingException(javax.mail.MessagingException) ParseException(java.text.ParseException) AddressException(javax.mail.internet.AddressException) EmailException(org.apache.commons.mail.EmailException) CoolUserFactoryException(it.cnr.cool.exception.CoolUserFactoryException) ClientMessageException(it.cnr.cool.web.scripts.exception.ClientMessageException) JsonObject(com.google.gson.JsonObject) JSONObject(org.json.JSONObject)

Aggregations

InlineResponse201 (it.cnr.si.cool.jconon.io.model.InlineResponse201)5 MessageContent2 (it.cnr.si.cool.jconon.io.model.MessageContent2)5 NewMessage (it.cnr.si.cool.jconon.io.model.NewMessage)5 JsonObject (com.google.gson.JsonObject)3 JsonParser (com.google.gson.JsonParser)3 ACLType (it.cnr.cool.cmis.model.ACLType)3 CoolPropertyIds (it.cnr.cool.cmis.model.CoolPropertyIds)3 it.cnr.cool.cmis.service (it.cnr.cool.cmis.service)3 CoolUserFactoryException (it.cnr.cool.exception.CoolUserFactoryException)3 MailService (it.cnr.cool.mail.MailService)3 EmailMessage (it.cnr.cool.mail.model.EmailMessage)3 Util (it.cnr.cool.rest.util.Util)3 GroupsEnum (it.cnr.cool.security.GroupsEnum)3 UserService (it.cnr.cool.security.service.UserService)3 CMISGroup (it.cnr.cool.security.service.impl.alfresco.CMISGroup)3 CMISUser (it.cnr.cool.security.service.impl.alfresco.CMISUser)3 I18nService (it.cnr.cool.service.I18nService)3 CMISUtil (it.cnr.cool.util.CMISUtil)3 MimeTypes (it.cnr.cool.util.MimeTypes)3 StrServ (it.cnr.cool.util.StrServ)3