本文整理汇总了Java中net.fortuna.ical4j.model.parameter.PartStat类的典型用法代码示例。如果您正苦于以下问题:Java PartStat类的具体用法?Java PartStat怎么用?Java PartStat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PartStat类属于net.fortuna.ical4j.model.parameter包,在下文中一共展示了PartStat类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAttendeesToEventWithRole
import net.fortuna.ical4j.model.parameter.PartStat; //导入依赖的package包/类
/**
* Adds attendees to an existing event with a given role
* Common logic for addAttendeesToEvent and addChairAttendeestoEvent
*
* @param vevent the VEvent to add the attendess too
* @param attendees list of Users that have been invited to the event
* @param role the role with which to add each user
* @return the VEvent for the given event or null if there was an error
*/
protected VEvent addAttendeesToEventWithRole(VEvent vevent, Set<User> attendees, Role role) {
if(!isIcsEnabled()) {
log.debug("ExternalCalendaringService is disabled. Enable via calendar.ics.generation.enabled=true in sakai.properties");
return null;
}
//add attendees to event with 'required participant' role
if(attendees != null){
for(User u: attendees) {
Attendee a = new Attendee(createMailURI(u.getEmail()));
a.getParameters().add(role);
a.getParameters().add(new Cn(u.getDisplayName()));
a.getParameters().add(PartStat.ACCEPTED);
a.getParameters().add(Rsvp.FALSE);
vevent.getProperties().add(a);
}
}
if(log.isDebugEnabled()){
log.debug("VEvent with attendees:" + vevent);
}
return vevent;
}
示例2: createSimpleContentItem
import net.fortuna.ical4j.model.parameter.PartStat; //导入依赖的package包/类
/**
* Creates a simple item which will be checked with simpleCheckCallExpectedHandler.
*
* @param user
* @return
* @throws URISyntaxException
*/
private ContentItem createSimpleContentItem(User user) throws URISyntaxException {
//call service
ContentItem contentItem = testHelper.makeDummyContent(user);
HibEventStamp eventStamp = new HibEventStamp();
VEvent vEvent = new VEvent();
vEvent.getProperties().add(Method.REQUEST);
vEvent.getProperties().add(Version.VERSION_2_0);
Attendee dev1 = new Attendee(URI.create("MAILTO:" + ATTENDEE_1));
dev1.getParameters().add(Role.REQ_PARTICIPANT);
dev1.getParameters().add(PartStat.NEEDS_ACTION);
dev1.getParameters().add(Rsvp.TRUE);
vEvent.getProperties().add(dev1);
Organizer organizer = new Organizer("MAILTO:" + ORGANIZER);
vEvent.getProperties().add(organizer);
vEvent.getProperties().add(Status.VEVENT_CONFIRMED);
vEvent.getProperties().add(Transp.OPAQUE);
Calendar calendar = new Calendar();
calendar.getComponents().add(vEvent);
eventStamp.setEventCalendar(calendar);
contentItem.addStamp(eventStamp);
return contentItem;
}
示例3: convertResponseTypeTypeToPartStat
import net.fortuna.ical4j.model.parameter.PartStat; //导入依赖的package包/类
/**
* Returns a never null {@link PartStat} for a given {@link ResponseTypeType}
*
* ResponseTypeType.ORGANIZER => PartStat.ACCEPTED
* ResponseTypeType.ACCEPT => PartStat.ACCEPTED
* ResponseTypeType.DECLINE => PartStat.DECLINED
* ResponseTypeType.TENTATIVE => PartStat.TENTATIVE
* All other ResponseTypeTypes => PartStat.NEEDS_ACTION
*
* @param responseType
* @return
*/
public static PartStat convertResponseTypeTypeToPartStat(ResponseTypeType responseType) {
if(null != responseType) {
if(responseType.equals(ResponseTypeType.ACCEPT) || responseType.equals(ResponseTypeType.ORGANIZER)) {
return PartStat.ACCEPTED;
}else if (responseType.equals(ResponseTypeType.DECLINE)) {
return PartStat.DECLINED;
}else if (responseType.equals(ResponseTypeType.TENTATIVE)) {
return PartStat.TENTATIVE;
}
}
return PartStat.NEEDS_ACTION;
}
示例4: convertPartStatToResponseTypeType
import net.fortuna.ical4j.model.parameter.PartStat; //导入依赖的package包/类
/**
* Returns a never null {@link ResponseTypeType} for a given {@link PartStat}
*
* PartStat.ACCEPTED => ResponseTypeType.ACCEPT
* PartStat.DECLINED => ResponseTypeType.DECLINE
* PartStat.TENTATIVE => ResponseTypeType.TENTATIVE
* PartStat.NEEDS_ACTION => ResponseTypeType.NO_RESPONSE_RECEIVED
* All other PartStats => ResponseTypeType.UNKNOWN
*
* @param partStat
* @return
*/
public static ResponseTypeType convertPartStatToResponseTypeType(PartStat partStat){
if(null != partStat){
if(partStat.equals(PartStat.ACCEPTED)){
return ResponseTypeType.ACCEPT;
}else if(partStat.equals(PartStat.DECLINED)){
return ResponseTypeType.DECLINE;
}else if(partStat.equals(PartStat.TENTATIVE)){
return ResponseTypeType.TENTATIVE;
}else if(partStat.equals(PartStat.NEEDS_ACTION)){
return ResponseTypeType.NO_RESPONSE_RECEIVED;
}
}
return ResponseTypeType.UNKNOWN;
}
示例5: convertResponseTypeTypeToPartStat
import net.fortuna.ical4j.model.parameter.PartStat; //导入依赖的package包/类
@Test
public void convertResponseTypeTypeToPartStat(){
for(ResponseTypeType rtt : ResponseTypeType.values()){
PartStat partStat = ExchangeEventConverterImpl.convertResponseTypeTypeToPartStat(rtt);
assertNotNull(partStat);
log.info(rtt +" ==> "+partStat.getValue());
}
}
示例6: convertNullToPartStat
import net.fortuna.ical4j.model.parameter.PartStat; //导入依赖的package包/类
@Test
public void convertNullToPartStat(){
ResponseTypeType rtt = null;
PartStat partStat = ExchangeEventConverterImpl.convertResponseTypeTypeToPartStat(rtt);
assertNotNull(partStat);
assertEquals(PartStat.NEEDS_ACTION, partStat);
log.info(rtt +" ==> "+partStat.getValue());
}
示例7: convertPartStatToResponseType
import net.fortuna.ical4j.model.parameter.PartStat; //导入依赖的package包/类
@Test
public void convertPartStatToResponseType(){
Set<PartStat> partStats = new HashSet<PartStat>();
partStats.add(PartStat.ACCEPTED);
partStats.add(PartStat.COMPLETED);
partStats.add(PartStat.DECLINED);
partStats.add(PartStat.DELEGATED);
partStats.add(PartStat.IN_PROCESS);
partStats.add(PartStat.NEEDS_ACTION);
partStats.add(PartStat.TENTATIVE);
partStats.add(null);
for(PartStat ps : partStats){
ResponseTypeType responseType = ExchangeEventConverterImpl.convertPartStatToResponseTypeType(ps);
assertNotNull(responseType);
if(ps == null){
assertEquals(ResponseTypeType.UNKNOWN, responseType);
}else if(ps.equals(PartStat.ACCEPTED)){
assertEquals(ResponseTypeType.ACCEPT, responseType);
}else if(ps.equals(PartStat.DECLINED)){
assertEquals(ResponseTypeType.DECLINE, responseType);
}else if(ps.equals(PartStat.TENTATIVE)){
assertEquals(ResponseTypeType.TENTATIVE, responseType);
}else if(ps.equals(PartStat.NEEDS_ACTION)){
assertEquals(ResponseTypeType.NO_RESPONSE_RECEIVED, responseType);
}else{
assertEquals(ResponseTypeType.UNKNOWN, responseType);
}
log.info(ps + " ==> " + responseType);
}
}
示例8: toParticipationStatus
import net.fortuna.ical4j.model.parameter.PartStat; //导入依赖的package包/类
protected static PartStat toParticipationStatus(String statusId) {
if (statusId == null) {
return null;
}
return toPartStatusMap.get(statusId);
}