当前位置: 首页>>代码示例>>Java>>正文


Java PartStat类代码示例

本文整理汇总了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;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:36,代码来源:ExternalCalendaringServiceImpl.java

示例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;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:36,代码来源:ContextServiceExtensionsAdviceTest.java

示例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; 
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:25,代码来源:ExchangeEventConverterImpl.java

示例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;
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:27,代码来源:ExchangeEventConverterImpl.java

示例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());
	}
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:9,代码来源:ExchangeEventConverterImplTest.java

示例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());
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:9,代码来源:ExchangeEventConverterImplTest.java

示例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);
	}
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:33,代码来源:ExchangeEventConverterImplTest.java

示例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);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:7,代码来源:ICalConverter.java


注:本文中的net.fortuna.ical4j.model.parameter.PartStat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。