• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Method类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.fortuna.ical4j.model.property.Method的典型用法代码示例。如果您正苦于以下问题:Java Method类的具体用法?Java Method怎么用?Java Method使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Method类属于net.fortuna.ical4j.model.property包,在下文中一共展示了Method类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: generateCalendar

import net.fortuna.ical4j.model.property.Method; //导入依赖的package包/类
/**
 * Generates a Calendar Object
 * @param user 
 * @param project
 * @return Calendar of the user
 * 		   null if the calendar has not got events
 * @throws TooManyItemsToLoadException 
 */
private Calendar generateCalendar(TPersonBean user, String project) throws IOException, TooManyItemsToLoadException {
	Calendar calendar = new Calendar();
	
	calendar.getProperties().add(new ProdId("Calendar of Projects: "+ project));
	calendar.getProperties().add(Version.VERSION_2_0);
	calendar.getProperties().add(CalScale.GREGORIAN);
	calendar.getProperties().add(Method.PUBLISH);
	
	List<TWorkItemBean> workItemList = obtainIssues(user, project);
	
	if (workItemList!=null&&workItemList.size()!=0){
		addEventsFromWorkItemList(workItemList, calendar, user.getLocale());
		return calendar;
	}	
	else {
		return calendar;
	}
}
 
开发者ID:trackplus,项目名称:Genji,代码行数:27,代码来源:ICalendarSynchronizeAction.java


示例2: IcalHandler

import net.fortuna.ical4j.model.property.Method; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param method
 *            (@see IcalHandler) constants
 */
public IcalHandler(Method method) {
	log.debug("Icalhandler method type : " + method);

	icsCalendar = new Calendar();
	icsCalendar.getProperties().add(new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
	icsCalendar.getProperties().add(Version.VERSION_2_0);
	icsCalendar.getProperties().add(CalScale.GREGORIAN);
	icsCalendar.getProperties().add(method);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:16,代码来源:IcalHandler.java


示例3: setupCalendar

import net.fortuna.ical4j.model.property.Method; //导入依赖的package包/类
/**
 * Helper method to setup the standard parts of the calendar
 * @return
 */
private Calendar setupCalendar(String method) {
	
	String serverName = sakaiProxy.getServerName();
	
	//setup calendar
	Calendar calendar = new Calendar();
	calendar.getProperties().add(new ProdId("-//"+serverName+"//Sakai External Calendaring Service//EN"));
	calendar.getProperties().add(Version.VERSION_2_0);
	calendar.getProperties().add(CalScale.GREGORIAN);
	if (method != null) {
		calendar.getProperties().add(new Method(method));
	}
	return calendar;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:19,代码来源:ExternalCalendaringServiceImpl.java


示例4: processPostRequest

import net.fortuna.ical4j.model.property.Method; //导入依赖的package包/类
private void processPostRequest(Calendar calendar, ScheduleMultiResponse ms) {
    if (!Method.REQUEST.equals(calendar.getMethod())) {
        return;
    }

    processPostFreeBusyRequest(calendar, ms);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:8,代码来源:OutboxCollectionProvider.java


示例5: createSimpleContentItem

import net.fortuna.ical4j.model.property.Method; //导入依赖的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


示例6: getCalDavCalendar

import net.fortuna.ical4j.model.property.Method; //导入依赖的package包/类
public Calendar getCalDavCalendar(String userToken) throws URISyntaxException, ParseException {
    UserWithPermission user;

    try {
        user = findUserFromCalendarToken(userToken);
    } catch (EmptyResultDataAccessException ex) {
        throw new SecurityException("Invalid token");
    }

    if (userRepository.isCalendarFeedDisabled(user)) {
        throw new SecurityException("Calendar feed disabled");
    }

    final Calendar calendar = new Calendar();
    calendar.getProperties().add(new ProdId("-//Lavagna//iCal4j 1.0//EN"));
    calendar.getProperties().add(Version.VERSION_2_0);
    calendar.getProperties().add(CalScale.GREGORIAN);
    calendar.getProperties().add(Method.PUBLISH);

    final List<VEvent> events = new ArrayList<>();
    final String applicationUrl = StringUtils
        .appendIfMissing(configurationRepository.getValue(Key.BASE_APPLICATION_URL), "/");
    final CalendarEventHandler handler = new CalendarVEventHandler(applicationUrl, cardDataService, userRepository,
        events);

    // Milestones
    addMilestoneEvents(handler, user);

    // Cards
    addCardEvents(handler, user);

    calendar.getComponents().addAll(events);

    return calendar;
}
 
开发者ID:digitalfondue,项目名称:lavagna,代码行数:36,代码来源:CalendarService.java


示例7: simpleInvitionIcalLink

import net.fortuna.ical4j.model.property.Method; //导入依赖的package包/类
public void simpleInvitionIcalLink() {
	// Create a TimeZone
	TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
	TimeZone timezone = registry.getTimeZone("America/Mexico_City");
	VTimeZone tz = timezone.getVTimeZone();

	// Start Date is on: April 1, 2008, 9:00 am
	java.util.Calendar startDate = new GregorianCalendar();
	startDate.setTimeZone(timezone);
	startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
	startDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
	startDate.set(java.util.Calendar.YEAR, 2008);
	startDate.set(java.util.Calendar.HOUR_OF_DAY, 9);
	startDate.set(java.util.Calendar.MINUTE, 0);
	startDate.set(java.util.Calendar.SECOND, 0);

	// End Date is on: April 1, 2008, 13:00
	java.util.Calendar endDate = new GregorianCalendar();
	endDate.setTimeZone(timezone);
	endDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
	endDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
	endDate.set(java.util.Calendar.YEAR, 2008);
	endDate.set(java.util.Calendar.HOUR_OF_DAY, 13);
	endDate.set(java.util.Calendar.MINUTE, 0);
	endDate.set(java.util.Calendar.SECOND, 0);

	// Create the event
	String eventName = "Progress Meeting";
	DateTime start = new DateTime(startDate.getTime());
	DateTime end = new DateTime(endDate.getTime());
	VEvent meeting = new VEvent(start, end, eventName);

	// add timezone info..
	meeting.getProperties().add(tz.getTimeZoneId());

	// generate unique identifier..
	Uid uid = new Uid(UUID.randomUUID().toString());
	meeting.getProperties().add(uid);

	// add attendees..
	Attendee dev1 = new Attendee(URI.create("mailto:[email protected]"));
	dev1.getParameters().add(Role.REQ_PARTICIPANT);
	dev1.getParameters().add(new Cn("Developer 1"));
	meeting.getProperties().add(dev1);

	Attendee dev2 = new Attendee(URI.create("mailto:[email protected]"));
	dev2.getParameters().add(Role.OPT_PARTICIPANT);
	dev2.getParameters().add(new Cn("Developer 2"));
	meeting.getProperties().add(dev2);

	// Create a calendar
	net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
	icsCalendar.getProperties().add(
			new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
	icsCalendar.getProperties().add(CalScale.GREGORIAN);
	icsCalendar.getProperties().add(Version.VERSION_2_0);

	// Add the event and print
	icsCalendar.getComponents().add(meeting);

	Organizer orger = new Organizer(URI.create("[email protected]"));
	orger.getParameters().add(new Cn("Sebastian Wagner"));
	meeting.getProperties().add(orger);

	icsCalendar.getProperties().add(Method.REQUEST);

	log.debug(icsCalendar.toString());

	ByteArrayOutputStream bout = new ByteArrayOutputStream();
	CalendarOutputter outputter = new CalendarOutputter();
	try {
		outputter.output(icsCalendar, bout);
		iCalMimeBody = bout.toByteArray();

		sendIcalMessage();
	} catch (Exception e) {
		log.error("Error", e);
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:80,代码来源:TestSendIcalMessage.java


示例8: main

import net.fortuna.ical4j.model.property.Method; //导入依赖的package包/类
public static void main (final String... args)
        throws Exception
{
    final String ical = "BEGIN:VCALENDAR\n" +
            "PRODID:-//ACME/DesktopCalendar//EN\n" +
            "METHOD:REQUEST\n" +
            "X-LIC-NOTE: #I1. Reschedules C1\n" +
            "VERSION:2.0\n" +
            "BEGIN:VEVENT\n" +
            "ORGANIZER:Mailto:[email protected]\n" +
            "ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED;CN=BIG A:Mailto:[email protected]\n" +
            "ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=B:Mailto:[email protected]\n" +
            "ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=C:Mailto:[email protected]\n" +
            "ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=Hal:Mailto:[email protected]\n" +
            "ATTENDEE;RSVP=FALSE;CUTYPE=ROOM:[email protected]\n" +
            "ATTENDEE;ROLE=NON-PARTICIPANT;RSVP=FALSE:Mailto:[email protected]\n" +
            "DTSTAMP:19970611T190000Z\n" +
            "DTSTART:19970701T200000Z\n" +
            "DTEND:19970701T2000000Z\n" +
            "SUMMARY:Conference\n" +
            "UID:[email protected]\n" +
            "SEQUENCE:2\n" +
            "STATUS:CONFIRMED\n" +
            "END:VEVENT\n" +
            "END:VCALENDAR";

    final SimpleDateFormat dateFormat = new SimpleDateFormat();
    final CalendarBuilder calendarBuilder = new CalendarBuilder();

    final Calendar calendar = calendarBuilder.build(new StringReader(ical));

    final Method method = calendar.getMethod();

    System.out.println(method.getValue());  // REQUEST, e.g.
    System.out.println(method == Method.REQUEST);

    for (final Component component : (List<Component>)calendar.getComponents())
    {
        System.out.println(component.getName()); // VEVENT, e.g.

        if (component instanceof VEvent)
        {
            final VEvent vevent = (VEvent) component;

            System.out.println(vevent.getSummary());
            System.out.println(vevent.getDescription());
            System.out.println(dateFormat.format(vevent.getStartDate().getDate()));
        }

        for (final Property property : (List<Property>) component.getProperties(Property.ATTENDEE))
        {
            final Attendee attendee = (Attendee) property;

            System.out.println(attendee.getCalAddress().getSchemeSpecificPart());
            System.out.println(attendee.getParameter(Parameter.CN));
            System.out.println(attendee.getName());
            System.out.println(attendee.getValue());
        }
    }

    System.out.println("END");
    System.exit(0);
}
 
开发者ID:QSFT,项目名称:MimeUI,代码行数:64,代码来源:TextCalendarContentViewer.java


示例9: sendMail

import net.fortuna.ical4j.model.property.Method; //导入依赖的package包/类
@Transactional
public void sendMail(Event event, String email) throws AxelorException, MessagingException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, ValidationException, ParseException, ICalendarException{

	
	EmailAddress emailAddress = Beans.get(EmailAddressRepository.class).all().filter("self.address = ?1", email).fetchOne();
	User user = Beans.get(UserRepository.class).all().filter("self.partner.emailAddress.address = ?1", email).fetchOne();
	CrmConfig crmConfig = Beans.get(CrmConfigService.class).getCrmConfig(user.getActiveCompany());
	
	
	if(crmConfig.getSendMail() == true) {
		if(emailAddress == null){
			emailAddress = new EmailAddress(email);
		}
		
		Template guestAddedTemplate = crmConfig.getMeetingGuestAddedTemplate();
		Message message = new Message();
		if(guestAddedTemplate == null){
			
			if(message.getFromEmailAddress() == null){
				message.setFromEmailAddress(user.getPartner().getEmailAddress());
			}
			message.addToEmailAddressSetItem(emailAddress);
			message.setSubject(event.getSubject());
			message.setMailAccount(Beans.get(MailAccountService.class).getDefaultMailAccount());
		}
		else{
			message = Beans.get(TemplateMessageService.class).generateMessage(event, guestAddedTemplate);
			if(message.getFromEmailAddress() == null){
				message.setFromEmailAddress(user.getPartner().getEmailAddress());
			}
			message.addToEmailAddressSetItem(emailAddress);	
		}
		if(event.getUid() != null){
			CalendarService calendarService = Beans.get(CalendarService.class);
			Calendar cal = calendarService.getCalendar(event.getUid(), event.getCalendarCrm());
			cal.getProperties().add(Method.REQUEST);
			File file = calendarService.export(cal);
			Path filePath = file.toPath();
			MetaFile metaFile = new MetaFile();
			metaFile.setFileName( file.getName() );
			metaFile.setFileType( Files.probeContentType( filePath ) );
			metaFile.setFileSize( Files.size( filePath ) );
			metaFile.setFilePath( file.getName() );
			Set<MetaFile> fileSet = new HashSet<MetaFile>();
			fileSet.add(metaFile);
			Beans.get(MessageRepository.class).save(message);
			Beans.get(MessageService.class).attachMetaFiles(message, fileSet);
		}
		message = Beans.get(MessageService.class).sendByEmail(message);
	}
}
 
开发者ID:axelor,项目名称:axelor-business-suite,代码行数:52,代码来源:EventService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SelectByPrimaryKeyElementGenerator类代码示例发布时间:2022-05-22
下一篇:
Java Password类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap