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


Java Message.setContentType方法代碼示例

本文整理匯總了Java中org.kuali.rice.kcb.bo.Message.setContentType方法的典型用法代碼示例。如果您正苦於以下問題:Java Message.setContentType方法的具體用法?Java Message.setContentType怎麽用?Java Message.setContentType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.kuali.rice.kcb.bo.Message的用法示例。


在下文中一共展示了Message.setContentType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testCreate

import org.kuali.rice.kcb.bo.Message; //導入方法依賴的package包/類
@Test
public void testCreate() {
    Message m = new Message();
    m.setContent("test content 2");
    m.setChannel("channel2");
    m.setContentType("test content type 2");
    m.setDeliveryType("test delivery type 2");
    m.setRecipient("test recipient 2");
    m.setTitle("test title 2");

    m = messageService.saveMessage(m);
    assertNotNull(m.getId());

    Collection<Message> ms = messageService.getAllMessages();
    assertNotNull(ms);
    assertEquals(2, ms.size());
    
    Message m2 = messageService.getMessage(m.getId());
    assertNotNull(m2);

    assertEqualsMD(m, m2);
    
    Message m1 = new Message();
    m1.setContent("a");
    m1.setChannel("a");
    m1.setContentType("a");
    m1.setDeliveryType("a");
    m1.setRecipient("a");
    m1.setTitle("a");
    
    // should allow more than one record with NULL origin id
    messageService.saveMessage(m1);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:34,代碼來源:MessageServiceTest.java

示例2: getMessage1

import org.kuali.rice.kcb.bo.Message; //導入方法依賴的package包/類
public static Message getMessage1() {
    Message m= new Message();
    m.setId(Long.valueOf(1));
    m.setChannel("channel1");
    m.setContent("test content 1");
    m.setContentType("test content type 1");
    m.setDeliveryType("test delivery type 1");
    m.setRecipient("test recipient 1");
    m.setTitle("test title 1");
    
    return m;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:KCBTestData.java

示例3: testCreate

import org.kuali.rice.kcb.bo.Message; //導入方法依賴的package包/類
@Test
@Override
public void testCreate() {
    Message m = new Message();
    m.setContent("test content 2");
    m.setChannel("channel2");
    m.setContentType("test content type 2");
    m.setDeliveryType("test delivery type 2");
    m.setRecipient("test recipient 2");
    m.setTitle("test title 2");

    messageService.saveMessage(m);
    assertNotNull(m.getId());

    Collection<Message> ms = messageService.getAllMessages();
    assertNotNull(ms);
    assertEquals(2, ms.size());
    
    Message m2 = messageService.getMessage(m.getId());
    assertNotNull(m2);

    assertEqualsMD(m, m2);
    
    Message m1 = new Message();
    m1.setContent("a");
    m1.setChannel("a");
    m1.setContentType("a");
    m1.setDeliveryType("a");
    m1.setRecipient("a");
    m1.setTitle("a");
    
    // should allow more than one record with NULL origin id
    messageService.saveMessage(m1);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:35,代碼來源:MessageServiceTest.java

示例4: deliver

import org.kuali.rice.kcb.bo.Message; //導入方法依賴的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

示例5: deliver

import org.kuali.rice.kcb.bo.Message; //導入方法依賴的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


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