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


Java Description类代码示例

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


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

示例1: icalResponse

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
private GetEventsResponse icalResponse(Page<EventEntity> eventPage) {
    Calendar calendar = new Calendar();
    calendar.getProperties().add(new ProdId("-//PutPut//iCal4j 1.0//EN"));
    calendar.getProperties().add(Version.VERSION_2_0);
    calendar.getProperties().add(CalScale.GREGORIAN);
    
    eventPage
            .getContent()
            .stream()
            .forEach(event -> {
                TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
                net.fortuna.ical4j.model.TimeZone timezone = registry.getTimeZone(event.getTimezone());
                
                VEvent vEvent = createVEvent(event, timezone);
                
                vEvent.getProperties().add(new Uid(event.getId()));
                vEvent.getProperties().add(new Description(event.getDescription()));
                vEvent.getProperties().add(new Location(event.getLocation()));
                vEvent.getProperties().add(timezone.getVTimeZone().getTimeZoneId());
                
                calendar.getComponents().add(vEvent);
            });
    
    return GetEventsResponse.withCalendarOK(calendar.toString());
}
 
开发者ID:adrobisch,项目名称:putput,代码行数:26,代码来源:EventsResource.java

示例2: createCalendar

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
public static Calendar createCalendar(CalDavEvent calDavEvent, DateTimeZone timeZone) {
    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
    TimeZone timezone = registry.getTimeZone(timeZone.getID());

    Calendar calendar = new Calendar();
    calendar.getProperties().add(Version.VERSION_2_0);
    calendar.getProperties().add(new ProdId("openHAB"));
    VEvent vEvent = new VEvent();
    vEvent.getProperties().add(new Summary(calDavEvent.getName()));
    vEvent.getProperties().add(new Description(calDavEvent.getContent()));
    final DtStart dtStart = new DtStart(new net.fortuna.ical4j.model.DateTime(calDavEvent.getStart().toDate()));
    dtStart.setTimeZone(timezone);
    vEvent.getProperties().add(dtStart);
    final DtEnd dtEnd = new DtEnd(new net.fortuna.ical4j.model.DateTime(calDavEvent.getEnd().toDate()));
    dtEnd.setTimeZone(timezone);
    vEvent.getProperties().add(dtEnd);
    vEvent.getProperties().add(new Uid(calDavEvent.getId()));
    vEvent.getProperties().add(Clazz.PUBLIC);
    vEvent.getProperties()
            .add(new LastModified(new net.fortuna.ical4j.model.DateTime(calDavEvent.getLastChanged().toDate())));
    calendar.getComponents().add(vEvent);

    return calendar;
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:25,代码来源:Util.java

示例3: getDisplayAlarmDescription

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
/**
 * Gets display alarm description.
 * @return The alarm description.
 */
public String getDisplayAlarmDescription() {
    VAlarm alarm = getDisplayAlarm();
    if (alarm == null) {
        return null;
    }
    
    Description description = (Description) alarm.getProperties()
            .getProperty(Property.DESCRIPTION);
    
    if (description == null) {
        return null;
    }
    
    return description.getValue();
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:20,代码来源:MockBaseEventStamp.java

示例4: fromDescription

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
protected static String fromDescription(PropertyList propertyList) {
    Description iCalObj = (Description) propertyList.getProperty(Description.DESCRIPTION);
    if (iCalObj == null) {
        return null;
    }
    return iCalObj.getValue();
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:8,代码来源:ICalConverter.java

示例5: createEvent

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
private static VEvent createEvent(Date startDate, Date endDate, String title, Integer itemID, String description, Integer responsibleID, VTimeZone tz) throws SocketException {
	VEvent issueEvent = new VEvent(new Date(startDate.getTime()), new Date(endDate.getTime()), title);
	
	// add timezone info..
	issueEvent.getProperties().add(tz.getTimeZoneId());

	// add description
	issueEvent.getProperties().add(new Description(description));

	// TODO: more adds
	
	// generate unique identifier..
	UidGenerator ug = new UidGenerator(itemID.toString());
	issueEvent.getProperties().add(ug.generateUid());
	
	//add organizer to method=PUBLISH for Outlook
	try {
		TPersonBean personBean = LookupContainer.getPersonBean(responsibleID);
		if (personBean!=null) {
			String email = personBean.getEmail();
			if (email!=null) {
				URI mailToURI = new URI("MAILTO", email, null);
				issueEvent.getProperties().add(new Organizer(mailToURI));
			}
		}
	} catch (URISyntaxException e) {
		// TODO Auto-generated catch block
		LOGGER.error(ExceptionUtils.getStackTrace(e));
	}
	return issueEvent;
}
 
开发者ID:trackplus,项目名称:Genji,代码行数:32,代码来源:ICalendarSynchronizeAction.java

示例6: getDisplayAlarmDescription

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
public String getDisplayAlarmDescription() {
    VAlarm alarm = getDisplayAlarm();
    if(alarm==null) {
        return null;
    }
    
    Description description = (Description) alarm.getProperties()
            .getProperty(Property.DESCRIPTION);
    
    if(description==null) {
        return null;
    }
    
    return description.getValue();
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:16,代码来源:HibBaseEventStamp.java

示例7: extractAndParseReminder

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
public static void extractAndParseReminder(VEvent newEvent, Task newTask,
    java.util.Calendar reminderTime) {
VAlarm reminder = new VAlarm(new DateTime(reminderTime.getTime()));
reminder.getProperties().add(Action.DISPLAY);
reminder.getProperties().add(new Description(newTask.getTaskTitle()));

newEvent.getAlarms().add(reminder);
   }
 
开发者ID:MohitShridhar,项目名称:TASCA,代码行数:9,代码来源:Exporter.java

示例8: convertEventBean

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
private static VEvent convertEventBean(EventBean event) {
    Date begin;
    Date end;
    if (event.isAllDay()) {
        begin = new Date(event.getBegin().toCalendar(new Locale("pt")).getTime());
        end = new Date(event.getEnd().toCalendar(new Locale("pt")).getTime());
    } else {
        begin = new DateTime(event.getBegin().toCalendar(new Locale("pt")).getTime());
        end = new DateTime(event.getEnd().toCalendar(new Locale("pt")).getTime());
    }
    VEvent vEvent = new VEvent(begin, end, event.getTitle());

    vEvent.getStartDate().setTimeZone(TIMEZONE);
    vEvent.getEndDate().setTimeZone(TIMEZONE);

    if (event.getLocation() != null) {
        vEvent.getProperties().add(new Location(event.getLocation()));
    }

    if (event.getUrl() != null) {
        try {
            vEvent.getProperties().add(new Url(new URI(event.getUrl())));
        } catch (URISyntaxException e) {
        }
    }

    if (event.getNote() != null) {
        vEvent.getProperties().add(new Description(event.getNote()));
    }

    Uid uid = new Uid(digest(event.getTitle() + "-" + begin.toGMTString() + "-" + end.toGMTString()));
    vEvent.getProperties().add(uid);

    return vEvent;
}
 
开发者ID:FenixEdu,项目名称:fenixedu-academic,代码行数:36,代码来源:CalendarFactory.java

示例9: toDescription

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
protected static Description toDescription(String javaObj) {
    if (javaObj == null) {
        return null;
    }
    return new Description(javaObj);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:7,代码来源:ICalConverter.java

示例10: addDisplayAction

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
private void addDisplayAction(EventEntity event, VAlarm reminder) {
    reminder.getProperties().add(Action.DISPLAY);
    reminder.getProperties().add(new Description(event.getDescription()));
}
 
开发者ID:adrobisch,项目名称:putput,代码行数:5,代码来源:EventsResource.java

示例11: createEvent

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public VEvent createEvent(CalendarEvent event, Set<User> attendees, boolean timeIsLocal) {
	
	if(!isIcsEnabled()) {
		log.debug("ExternalCalendaringService is disabled. Enable via calendar.ics.generation.enabled=true in sakai.properties");
		return null;
	}
	
	VTimeZone tz = getTimeZone(timeIsLocal);

	//start and end date
	DateTime start = new DateTime(getStartDate(event.getRange()).getTime());
	DateTime end = new DateTime(getEndDate(event.getRange()).getTime());
	
	//create event incl title/summary
	VEvent vevent = new VEvent(start, end, event.getDisplayName());
		
	//add timezone
	vevent.getProperties().add(tz.getTimeZoneId());
	
	//add uid to event
	//could come from the vevent_uuid field in the calendar event, otherwise from event ID.
	String uuid = null;
	if(StringUtils.isNotBlank(event.getField("vevent_uuid"))) {
		uuid = event.getField("vevent_uuid");
	} else {
		uuid = event.getId();
	}		
	vevent.getProperties().add(new Uid(uuid));
	
	//add sequence to event
	//will come from the vevent_sequnece field in the calendar event, otherwise skip it
	String sequence = null;
	if(StringUtils.isNotBlank(event.getField("vevent_sequence"))) {
		sequence = event.getField("vevent_sequence");
		vevent.getProperties().add(new Sequence(sequence));
	}
		
	//add description to event
	vevent.getProperties().add(new Description(event.getDescription()));
	
	//add location to event
	vevent.getProperties().add(new Location(event.getLocation()));
	
	//add organiser to event
	if(StringUtils.isNotBlank(event.getCreator())) {

		String creatorEmail = sakaiProxy.getUserEmail(event.getCreator());

		URI mailURI = createMailURI(creatorEmail);
		Cn commonName = new Cn(sakaiProxy.getUserDisplayName(event.getCreator()));

		Organizer organizer = new Organizer(mailURI);
		organizer.getParameters().add(commonName);
		vevent.getProperties().add(organizer);
	}
	
	//add attendees to event with 'required participant' role
	vevent = addAttendeesToEvent(vevent, attendees);
	
	//add URL to event, if present
	String url = null;
	if(StringUtils.isNotBlank(event.getField("vevent_url"))) {
		url = event.getField("vevent_url");
		Url u = new Url();
		try {
			u.setValue(url);
			vevent.getProperties().add(u);
		} catch (URISyntaxException e) {
			//it doesnt matter, ignore it
		}
	}
	
	if(log.isDebugEnabled()){
		log.debug("VEvent:" + vevent);
	}
	
	return vevent;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:82,代码来源:ExternalCalendaringServiceImpl.java

示例12: makeDummyEvent

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
/**
 * Makes dummy event.
 * @return The event.
 */
public VEvent makeDummyEvent() {
    String serial = Integer.toString(++eseq);
    String summary = "dummy" + serial;

    // tomorrow
    java.util.Calendar start = java.util.Calendar.getInstance();
    start.add(java.util.Calendar.DAY_OF_MONTH, 1);
    start.set(java.util.Calendar.HOUR_OF_DAY, 9);
    start.set(java.util.Calendar.MINUTE, 30);

    // 1 hour duration
    Dur duration = new Dur(0, 1, 0, 0);
 
    VEvent event = new VEvent(new Date(start.getTime()), duration, summary);
    event.getProperties().add(new Uid(serial));
 
    // add timezone information
    VTimeZone tz = TimeZoneRegistryFactory.getInstance().createRegistry().
        getTimeZone("America/Los_Angeles").getVTimeZone();
    String tzValue =
        tz.getProperties().getProperty(Property.TZID).getValue();
    net.fortuna.ical4j.model.parameter.TzId tzParam =
        new net.fortuna.ical4j.model.parameter.TzId(tzValue);
    event.getProperties().getProperty(Property.DTSTART).
        getParameters().add(tzParam);

    // add an alarm for 5 minutes before the event with an xparam
    // on the description
    Dur trigger = new Dur(0, 0, -5, 0);
    VAlarm alarm = new VAlarm(trigger);
    alarm.getProperties().add(Action.DISPLAY);
    Description description = new Description("Meeting at 9:30am");
    XParameter xparam = new XParameter("X-COSMO-TEST-PARAM", "deadbeef");
    description.getParameters().add(xparam);
    alarm.getProperties().add(description);
    alarm.getProperties().add(new Description("Meeting at 9:30am"));
    event.getAlarms().add(alarm);

    // add an x-property with an x-param
    XProperty xprop = new XProperty("X-COSMO-TEST-PROP", "abc123");
    xprop.getParameters().add(xparam);
    event.getProperties().add(xprop);

    return event;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:50,代码来源:TestHelper.java

示例13: okPressed

import net.fortuna.ical4j.model.property.Description; //导入依赖的package包/类
@Override
protected void okPressed(){
	von.setTimeInMillis(dpVon.getDate().getTime());
	bis.setTimeInMillis(dpBis.getDate().getTime());
	Query<Termin> qbe = new Query<Termin>(Termin.class);
	qbe.add(Termin.FLD_TAG, Query.GREATER_OR_EQUAL, von.toString(TimeTool.DATE_COMPACT));
	qbe.add(Termin.FLD_TAG, Query.LESS_OR_EQUAL, bis.toString(TimeTool.DATE_COMPACT));
	qbe.add(Termin.FLD_BEREICH, Query.EQUALS, m);
	List<Termin> termine = qbe.execute();
	String fname = lFile.getText();
	if (fname.toLowerCase().endsWith(".csv")) { //$NON-NLS-1$
		new CSVExporter().doExport(fname, termine);
	} else {
		TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
		TimeZone timezone = registry.getTimeZone("Europe/Zurich"); //$NON-NLS-1$
		VTimeZone tz = timezone.getVTimeZone();
		Calendar calendar = new Calendar();
		calendar.getProperties().add(new ProdId("-//ch.elexis//Elexis v" + CoreHub.Version)); //$NON-NLS-1$
		calendar.getProperties().add(Version.VERSION_2_0);
		calendar.getProperties().add(CalScale.GREGORIAN);
		for (Termin t : termine) {
			if ((t.getStartMinute() == 0) && (t.getType().equals(Termin.typReserviert()))) {
				continue;
			}
			if ((t.getStartMinute() + t.getDurationInMinutes() == (23 * 60) + 59)
				&& (t.getType().equals(Termin.typReserviert()))) {
				continue;
			}
			TimeTool tt = new TimeTool(t.getStartTime());
			DateTime start = new DateTime(tt.getTime());
			tt.addMinutes(t.getDurationInMinutes());
			DateTime end = new DateTime(tt.getTime());
			VEvent vTermin = new VEvent(start, end, t.getPersonalia());
			vTermin.getProperties().add(tz.getTimeZoneId());
			Uid uid = new Uid(t.getId());
			vTermin.getProperties().add(uid);
			Description desc = new Description(t.getGrund());
			vTermin.getProperties().add(desc);
			calendar.getComponents().add(vTermin);
		}
		try {
			FileOutputStream fout = new FileOutputStream(lFile.getText());
			CalendarOutputter outputter = new CalendarOutputter();
			outputter.output(calendar, fout);
			
		} catch (Exception ex) {
			ExHandler.handle(ex);
			SWTHelper.alert(
				Messages.ICalTransfer_iOError,
				MessageFormat.format(Messages.ICalTransfer_couldNotWriteFile,
					lFile.getText()));
		}
	}
	super.okPressed();
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:56,代码来源:ICalTransfer.java


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