本文整理汇总了Java中org.kuali.rice.kcb.bo.RecipientDelivererConfig类的典型用法代码示例。如果您正苦于以下问题:Java RecipientDelivererConfig类的具体用法?Java RecipientDelivererConfig怎么用?Java RecipientDelivererConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RecipientDelivererConfig类属于org.kuali.rice.kcb.bo包,在下文中一共展示了RecipientDelivererConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveRecipientDelivererConfig
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* @see org.kuali.rice.kcb.service.RecipientPreferenceService#saveRecipientDelivererConfig(java.lang.String, java.lang.String, java.lang.String[])
*/
public void saveRecipientDelivererConfig(String recipientId, String delivererName, String[] channels) {
if (channels == null || channels.length == 0) return;
// if selected[0] is 0 we want to remove this deliverer
// for all channels. We already did that above.
for (String channel: channels) {
RecipientDelivererConfig config = new RecipientDelivererConfig();
config.setRecipientId(recipientId);
config.setDelivererName(delivererName);
config.setChannel(channel);
// first, verify that we aren't trying to insert a duplicate
Collection<RecipientDelivererConfig> deliverers = getDeliverersForRecipientAndChannel(recipientId, channel);
if (deliverers != null) {
for (RecipientDelivererConfig deliverer : deliverers) {
if (deliverer.getDelivererName().equals(delivererName)) {
throw new RiceRuntimeException("Attempting to save a duplicate Recipient Deliverer Config.");
}
}
}
dataObjectService.save(config);
}
}
示例2: getDelivererTypesForUserAndChannel
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* Determines what delivery endpoints the user has configured
* @param userRecipientId the user
* @return a Set of NotificationConstants.MESSAGE_DELIVERY_TYPES
*/
private Collection<String> getDelivererTypesForUserAndChannel(String userRecipientId, String channel) {
Set<String> deliveryTypes = new HashSet<String>(1);
// manually add the default one since they don't have an option on this one
//deliveryTypes.add(NotificationConstants.MESSAGE_DELIVERY_TYPES.DEFAULT_MESSAGE_DELIVERY_TYPE);
//now look for what they've configured for themselves
Collection<RecipientDelivererConfig> deliverers = recipientPrefs.getDeliverersForRecipientAndChannel(userRecipientId, channel);
for (RecipientDelivererConfig cfg: deliverers) {
deliveryTypes.add(cfg.getDelivererName());
}
//return GlobalNotificationServiceLocator.getInstance().getKENAPIService().getDeliverersForRecipientAndChannel(userRecipientId, channel);
return deliveryTypes;
}
示例3: saveRecipientDelivererConfig
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* @see org.kuali.rice.kcb.service.RecipientPreferenceService#saveRecipientDelivererConfig(java.lang.String, java.lang.String, java.lang.String[])
*/
public void saveRecipientDelivererConfig(String recipientId, String delivererName, String[] channels) {
if (channels == null || channels.length == 0) return;
// if selected[0] is 0 we want to remove this deliverer
// for all channels. We already did that above.
for (String channel: channels) {
RecipientDelivererConfig config = new RecipientDelivererConfig();
config.setRecipientId(recipientId);
config.setDelivererName(delivererName);
config.setChannel(channel);
// first, verify that we aren't trying to insert a duplicate
Collection<RecipientDelivererConfig> deliverers = getDeliverersForRecipientAndChannel(recipientId, channel);
if (deliverers != null) {
for (RecipientDelivererConfig deliverer : deliverers) {
if (deliverer.getDelivererName().equals(delivererName)) {
throw new RiceRuntimeException("Attempting to save a duplicate Recipient Deliverer Config.");
}
}
}
dao.save(config);
}
}
示例4: displayDelivererConfigurationForm
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* displayDelivererConfigurationForm - obtain information necessary
* for displaying all possible Deliverer types and forward to the form
* @param request
* @param response
* @return
* @throws ServletException
* @throws IOException
*/
public ModelAndView displayDelivererConfigurationForm(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String userid = request.getRemoteUser();
LOG.debug("remoteUser: "+userid);
// Get DeliveryType classes
Collection<MessageDeliverer> deliveryTypes = this.messageDelivererRegistryService.getAllDeliverers();
// get all channels
Collection<String> channels = getAllChannels();
// get all user preferences in a HashMap
HashMap<String, String> preferences = this.recipientPreferenceService.getRecipientPreferences(userid);
// get existing configured deliverers
Collection<RecipientDelivererConfig> currentDeliverers = this.recipientPreferenceService.getDeliverersForRecipient(userid);
// create a Map as an easy way for the JSP to determine whether a deliver is enabled for channels
Map<String, Boolean> currentDeliverersMap = new HashMap<String, Boolean>();
for (RecipientDelivererConfig udc: currentDeliverers) {
String channelName = udc.getChannel();
currentDeliverersMap.put(udc.getDelivererName() + "." + channelName, Boolean.TRUE);
}
Map<String, Object> model = new HashMap<String, Object>();
model.put("channels", channels);
model.put("deliveryTypes", deliveryTypes);
model.put("preferences", preferences);
model.put("currentDeliverersMap", currentDeliverersMap);
return new ModelAndView(VIEW, model);
}
示例5: getDeliverersForRecipient
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* @see org.kuali.rice.kcb.service.RecipientPreferenceService#getDeliverersForRecipient(java.lang.String)
*/
public Collection<RecipientDelivererConfig> getDeliverersForRecipient(String recipientId) {
QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create();
criteria.setPredicates(equal(RecipientDelivererConfig.RECIPIENT_ID, recipientId));
return dataObjectService.findMatching(RecipientDelivererConfig.class, criteria.build()).getResults();
}
示例6: getDeliverersForRecipientAndChannel
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* @see org.kuali.rice.kcb.service.RecipientPreferenceService#getDeliverersForRecipientAndChannel(java.lang.String, java.lang.String)
*/
public Collection<RecipientDelivererConfig> getDeliverersForRecipientAndChannel(String recipientId, String channel) {
QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create();
criteria.setPredicates(
equal(RecipientDelivererConfig.RECIPIENT_ID, recipientId),
equal(RecipientDelivererConfig.CHANNEL, channel)
);
return dataObjectService.findMatching(RecipientDelivererConfig.class, criteria.build()).getResults();
}
示例7: testCreate
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
@Test
public void testCreate() throws Exception {
prefsvc.saveRecipientDelivererConfig("user1", "mock", new String[] { "channel2" });
Collection<RecipientDelivererConfig> deliverers = prefsvc.getDeliverersForRecipient("user1");
assertEquals(2, deliverers.size());
}
示例8: getDeliverersForRecipientAndChannel
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* @see org.kuali.rice.kcb.service.RecipientPreferenceService#getDeliverersForRecipientAndChannel(java.lang.String, java.lang.String)
*/
public Collection<RecipientDelivererConfig> getDeliverersForRecipientAndChannel(String recipientId, String channel) {
Map<String, String> fields = new HashMap<String, String>(1);
fields.put(RecipientDelivererConfig.RECIPIENT_ID, recipientId);
fields.put(RecipientDelivererConfig.CHANNEL, channel);
return dao.findMatching(RecipientDelivererConfig.class, fields);
}
示例9: removeRecipientDelivererConfigs
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* @see org.kuali.rice.kcb.service.RecipientPreferenceService#removeRecipientDelivererConfigs(java.lang.String)
*/
public void removeRecipientDelivererConfigs(String recipientId) {
QueryByCriteria.Builder criteria = QueryByCriteria.Builder.create();
criteria.setPredicates(equal(RecipientDelivererConfig.RECIPIENT_ID, recipientId));
dataObjectService.deleteMatching(RecipientDelivererConfig.class, criteria.build());
}
示例10: testInvalidUpdate
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
@Test(expected = DataAccessException.class)
public void testInvalidUpdate() throws Exception {
// null channel
prefsvc.saveRecipientDelivererConfig("user1", null, new String[] { "channel2" });
KRADServiceLocator.getDataObjectService().flush(RecipientDelivererConfig.class);
}
示例11: testGetDeliverersForRecipientAndChannel
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
@Test
public void testGetDeliverersForRecipientAndChannel() {
Collection<RecipientDelivererConfig> cfgs = prefsvc.getDeliverersForRecipientAndChannel("user1", "channel1");
assertEquals(1, cfgs.size());
assertEquals("mock", cfgs.iterator().next().getDelivererName());
}
示例12: removeRecipientDelivererConfigs
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* @see org.kuali.rice.kcb.service.RecipientPreferenceService#removeRecipientDelivererConfigs(java.lang.String)
*/
public void removeRecipientDelivererConfigs(String recipientId) {
Map<String, String> fields = new HashMap<String, String>(1);
fields.put(RecipientDelivererConfig.RECIPIENT_ID, recipientId);
dao.deleteMatching(RecipientDelivererConfig.class, fields);
}
示例13: getDeliverersForRecipient
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* @see org.kuali.rice.kcb.service.RecipientPreferenceService#getDeliverersForRecipient(java.lang.String)
*/
public Collection<RecipientDelivererConfig> getDeliverersForRecipient(String recipientId) {
Map<String, String> fields = new HashMap<String, String>(1);
fields.put(RecipientDelivererConfig.RECIPIENT_ID, recipientId);
return dao.findMatching(RecipientDelivererConfig.class, fields);
}
示例14: getDeliverersForRecipientAndChannel
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* This method will retrieve all of the message deliverer configurations for a given user, associated with a
* particular channel.
* @param recipientId
* @param channel
*/
public Collection<RecipientDelivererConfig> getDeliverersForRecipientAndChannel(String recipientId, String channel);
示例15: getDeliverersForRecipient
import org.kuali.rice.kcb.bo.RecipientDelivererConfig; //导入依赖的package包/类
/**
* This method will retrieve all of the message deliverer configurations for a given user
* @param recipientId
*/
public Collection<RecipientDelivererConfig> getDeliverersForRecipient(String recipientId);