當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageDTO類代碼示例

本文整理匯總了Java中org.kuali.rice.kcb.api.message.MessageDTO的典型用法代碼示例。如果您正苦於以下問題:Java MessageDTO類的具體用法?Java MessageDTO怎麽用?Java MessageDTO使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MessageDTO類屬於org.kuali.rice.kcb.api.message包,在下文中一共展示了MessageDTO類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sendNotification

import org.kuali.rice.kcb.api.message.MessageDTO; //導入依賴的package包/類
@Override
protected void sendNotification(ActionItem actionItem) {
    super.sendNotification(actionItem);

    String enableKENNotificationValue = ConfigContext.getCurrentContextConfig().getProperty(KewApiConstants.ENABLE_KEN_NOTIFICATION);
    boolean enableKENNotification = Boolean.parseBoolean(enableKENNotificationValue);
    // we only send per-user messages to KCB
    if (!enableKENNotification || actionItem.getPrincipalId() != null)
        return;


    // send it off to KCB if available
    MessagingService ms = (MessagingService) GlobalResourceLoader.getService(new QName(KCBConstants.SERVICE_NAMESPACE, KCBServiceNames.KCB_MESSAGING));
    if (ms == null) {
    	LOG.info("Could not locate KCB MessagingService.  Message will not be forwarded to the KCB.");
    	return;
    }
    MessageDTO mvo = new MessageDTO();
    mvo.setChannel("KEW");
    mvo.setContent("i'm a kew notification");
    mvo.setContentType("KEW notification");
    mvo.setDeliveryType(actionItem.getActionRequestCd());
    mvo.setProducer("[email protected]");
    mvo.setTitle(actionItem.getDocLabel() + " - " + actionItem.getDocName() + " - " + actionItem.getDocTitle());
    if (StringUtils.isNotBlank(actionItem.getDocHandlerURL())) {
    	mvo.setUrl(actionItem.getDocHandlerURL() + "?docId=" + actionItem.getDocumentId());
    }
    mvo.setOriginId(String.valueOf(actionItem.getId()));
    try {
        // just assume it's a user at this point...
        mvo.setRecipient(actionItem.getPrincipalId());
        LOG.debug("Sending message to KCB: " + mvo);
        ms.deliver(mvo);
    } catch (Exception e) {
        throw new WorkflowRuntimeException("could not deliver message to KCB", e);
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:38,代碼來源:KCBNotificationService.java

示例2: deliver

import org.kuali.rice.kcb.api.message.MessageDTO; //導入依賴的package包/類
/**
     * @see org.kuali.rice.kcb.service.MessagingService#deliver(org.kuali.rice.kcb.dto.MessageDTO)
     */
    @Override
    public Long deliver(MessageDTO message) throws MessageDeliveryException {
        if (message == null) {
            throw new RiceIllegalArgumentException("message is null");
        }

        Collection<String> delivererTypes = getDelivererTypesForUserAndChannel(message.getRecipient(), message.getChannel());
        LOG.debug("Deliverer types for " + message.getRecipient() + "/" + message.getChannel() + ": " + delivererTypes.size());

        if (delivererTypes.isEmpty()) {
            // no deliverers configured? just skipp it
            LOG.debug("No deliverers are configured for " + message.getRecipient() + "/" + message.getChannel());
            return null;
        }

        Message m = new Message();
        m.setTitle(message.getTitle());
        m.setDeliveryType(message.getDeliveryType());
        m.setChannel(message.getChannel());
        m.setRecipient(message.getRecipient());
        m.setContentType(message.getContentType());
        m.setUrl(message.getUrl());
        m.setContent(message.getContent());
        m.setOriginId(message.getOriginId());

        LOG.debug("saving message: " +m);
        m = messageService.saveMessage(m);

        for (String type: delivererTypes) {
            
            MessageDelivery delivery = new MessageDelivery();
            delivery.setDelivererTypeName(type);
            delivery.setMessage(m);

//            MessageDeliverer deliverer = delivererRegistry.getDeliverer(delivery);
//            if (deliverer != null) {
//                deliverer.deliverMessage(delivery);
//            }
        
            LOG.debug("saving messagedelivery: " +delivery);
            messageDeliveryService.saveMessageDelivery(delivery);
        }

        LOG.debug("queuing job");
        queueJob(MessageProcessingJob.Mode.DELIVER, m.getId(), null, null);

        LOG.debug("returning");
        return m.getId();
    }
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:53,代碼來源:MessagingServiceImpl.java

示例3: deliver

import org.kuali.rice.kcb.api.message.MessageDTO; //導入依賴的package包/類
/**
     * @see org.kuali.rice.kcb.service.MessagingService#deliver(org.kuali.rice.kcb.dto.MessageDTO)
     */
    @Override
    public Long deliver(MessageDTO message) throws MessageDeliveryException {
        if (message == null) {
            throw new RiceIllegalArgumentException("message is null");
        }

        Collection<String> delivererTypes = getDelivererTypesForUserAndChannel(message.getRecipient(), message.getChannel());
        LOG.debug("Deliverer types for " + message.getRecipient() + "/" + message.getChannel() + ": " + delivererTypes.size());

        if (delivererTypes.isEmpty()) {
            // no deliverers configured? just skipp it
            LOG.debug("No deliverers are configured for " + message.getRecipient() + "/" + message.getChannel());
            return null;
        }

        final Message m = new Message();
        m.setTitle(message.getTitle());
        m.setDeliveryType(message.getDeliveryType());
        m.setChannel(message.getChannel());
        m.setRecipient(message.getRecipient());
        m.setContentType(message.getContentType());
        m.setUrl(message.getUrl());
        m.setContent(message.getContent());
        m.setOriginId(message.getOriginId());

        LOG.debug("saving message: " +m);
        messageService.saveMessage(m);

        for (String type: delivererTypes) {
            
            MessageDelivery delivery = new MessageDelivery();
            delivery.setDelivererTypeName(type);
            delivery.setMessage(m);

//            MessageDeliverer deliverer = delivererRegistry.getDeliverer(delivery);
//            if (deliverer != null) {
//                deliverer.deliverMessage(delivery);
//            }
        
            LOG.debug("saving messagedelivery: " +delivery);
            messageDeliveryService.saveMessageDelivery(delivery);
        }

        LOG.debug("queuing job");
        queueJob(MessageProcessingJob.Mode.DELIVER, m.getId(), null, null);

        LOG.debug("returning");
        return m.getId();
    }
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:53,代碼來源:MessagingServiceImpl.java

示例4: deliver

import org.kuali.rice.kcb.api.message.MessageDTO; //導入依賴的package包/類
/**
 * Delivers a message
 * 
 * @param message message to deliver
 * @return identifier for the message
 * @throws MessageDeliveryException if unable to deliver message.
 * @throws RiceIllegalArgumentException if the message is null.
 */
public Long deliver(MessageDTO message) throws MessageDeliveryException, RiceIllegalArgumentException;
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:10,代碼來源:MessagingService.java


注:本文中的org.kuali.rice.kcb.api.message.MessageDTO類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。