本文整理汇总了Java中net.fortuna.ical4j.model.property.Status类的典型用法代码示例。如果您正苦于以下问题:Java Status类的具体用法?Java Status怎么用?Java Status使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Status类属于net.fortuna.ical4j.model.property包,在下文中一共展示了Status类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: cancelEvent
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public VEvent cancelEvent(VEvent vevent) {
if(!isIcsEnabled()) {
log.debug("ExternalCalendaringService is disabled. Enable via calendar.ics.generation.enabled=true in sakai.properties");
return null;
}
// You can only have one status so make sure we remove any previous ones.
vevent.getProperties().removeAll(vevent.getProperties(Property.STATUS));
vevent.getProperties().add(Status.VEVENT_CANCELLED);
// Must define a sequence for cancellations. If one was not defined when the event was created use 1
if (vevent.getProperties().getProperty(Property.SEQUENCE) == null) {
vevent.getProperties().add(new Sequence("1"));
}
if(log.isDebugEnabled()){
log.debug("VEvent cancelled:" + vevent);
}
return vevent;
}
开发者ID:sakaiproject,项目名称:sakai,代码行数:26,代码来源:ExternalCalendaringServiceImpl.java
示例2: fromStatus
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
protected static String fromStatus(PropertyList propertyList) {
Status iCalObj = (Status) propertyList.getProperty(Status.STATUS);
if (iCalObj == null) {
return null;
}
return fromStatusMap.get(iCalObj.getValue());
}
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:8,代码来源:ICalConverter.java
示例3: setStatus
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
/**
* Update the STATUS property on a VTODO component.
*
* @param status
* status to set. If null, the STATUS property will be removed
* @param vtodo
* vtodo component to update
*/
public static void setStatus(Status status, VToDo vtodo) {
Status currStatus = vtodo.getStatus();
if (currStatus != null) {
vtodo.getProperties().remove(currStatus);
}
if (status != null) {
vtodo.getProperties().add(status);
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:19,代码来源:ICalendarUtils.java
示例4: setStatus
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
public void setStatus(String text) {
// ical4j Status value is immutable, so if there's any change
// at all, we have to remove the old status and add a new
// one.
Status status = (Status)
getEvent().getProperties().getProperty(Property.STATUS);
if (status != null) {
getEvent().getProperties().remove(status);
}
if (text == null) {
return;
}
getEvent().getProperties().add(new Status(text));
}
开发者ID:1and1,项目名称:cosmo,代码行数:15,代码来源:HibBaseEventStamp.java
示例5: setStatus
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
/**
* Sets status.
* @param text The text.
*/
public void setStatus(String text) {
// ical4j Status value is immutable, so if there's any change
// at all, we have to remove the old status and add a new
// one.
Status status = (Status)
getEvent().getProperties().getProperty(Property.STATUS);
if (status != null) {
getEvent().getProperties().remove(status);
}
if (text == null) {
return;
}
getEvent().getProperties().add(new Status(text));
}
开发者ID:1and1,项目名称:cosmo,代码行数:19,代码来源:MockBaseEventStamp.java
示例6: testEntityConverterTask
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
/**
* Tests entity convertor task.
* @throws Exception - if something is wrong this exception is thrown.
*/
@Test
public void testEntityConverterTask() throws Exception {
Calendar calendar = getCalendar("vtodo.ics");
NoteItem note = converter.convertTaskCalendar(calendar);
Assert.assertTrue(TriageStatus.CODE_NOW==note.getTriageStatus().getCode());
// add COMPLETED
DateTime completeDate = new DateTime("20080122T100000Z");
VToDo vtodo = (VToDo) calendar.getComponents(Component.VTODO).get(0);
ICalendarUtils.setCompleted(completeDate, vtodo);
note = converter.convertTaskCalendar(calendar);
TriageStatus ts = note.getTriageStatus();
Assert.assertTrue(TriageStatus.CODE_DONE==ts.getCode());
Assert.assertTrue(TriageStatusUtil.getDateFromRank(ts.getRank()).getTime()==completeDate.getTime());
note.setTriageStatus(null);
ICalendarUtils.setCompleted(null, vtodo);
Assert.assertNull(vtodo.getDateCompleted());
ICalendarUtils.setStatus(Status.VTODO_COMPLETED, vtodo);
// verify that TriageStatus.rank is set ot current time when
// STATUS:COMPLETED is present and COMPLETED is not present
long begin = (System.currentTimeMillis() / 1000) * 1000;
note = converter.convertTaskCalendar(calendar);
long end = (System.currentTimeMillis() / 1000) * 1000;
ts = note.getTriageStatus();
Assert.assertTrue(TriageStatus.CODE_DONE==ts.getCode());
long rankTime = TriageStatusUtil.getDateFromRank(ts.getRank()).getTime();
Assert.assertTrue(rankTime<=end && rankTime>=begin);
}
开发者ID:1and1,项目名称:cosmo,代码行数:39,代码来源:EntityConverterTest.java
示例7: createSimpleContentItem
import net.fortuna.ical4j.model.property.Status; //导入依赖的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
示例8: createTestEvent
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
private void createTestEvent(LocalCalendar calendar) {
try {
TimeZone tzVienna = DateUtils.tzRegistry.getTimeZone("Europe/Vienna");
Event event = new Event();
event.uid = "[email protected]";
event.summary = "Sample event";
event.description = "Sample event with date/time";
event.location = "Sample location";
event.dtStart = new DtStart("20150501T120000", tzVienna);
event.dtEnd = new DtEnd("20150501T130000", tzVienna);
event.organizer = new Organizer(new URI("mailto:[email protected]"));
event.rRule = new RRule("FREQ=DAILY;COUNT=10");
event.forPublic = false;
event.status = Status.VEVENT_CONFIRMED;
// set an alarm one day, two hours, three minutes and four seconds before begin of event
event.alarms.add(new VAlarm(new Dur(-1, -2, -3, -4)));
// add two attendees
event.attendees.add(new Attendee(new URI("mailto:[email protected]")));
event.attendees.add(new Attendee(new URI("mailto:[email protected]")));
// add exception with alarm and attendee
Event exception = new Event();
exception.recurrenceId = new RecurrenceId("20150502T120000", tzVienna);
exception.summary = "Exception for sample event";
exception.dtStart = new DtStart("20150502T140000", tzVienna);
exception.dtEnd = new DtEnd("20150502T150000", tzVienna);
exception.alarms.add(new VAlarm(new Dur(-2, -3, -4, -5)));
exception.attendees.add(new Attendee(new URI("mailto:[email protected]")));
event.exceptions.add(exception);
// add EXDATE
event.exDates.add(new ExDate(new DateList("20150502T120000", Value.DATE_TIME, tzVienna)));
// add to calendar
Uri uri = new LocalEvent(calendar, event, null, null).add();
showMessage("Event created: " + uri);
showEvents(calendar);
} catch (Exception e) {
e.printStackTrace();
showMessage(e.toString());
}
}
开发者ID:6thsolution,项目名称:EasyAppleSyncAdapter,代码行数:46,代码来源:MainActivity.java
示例9: toStatus
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
protected static Status toStatus(String javaObj) {
if (javaObj == null) {
return null;
}
return toStatusMap.get(javaObj);
}
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:7,代码来源:ICalConverter.java
示例10: setCalendarAttributes
import net.fortuna.ical4j.model.property.Status; //导入依赖的package包/类
/**
* Sets calendar attributes.
* @param note The note item.
* @param task The task vToDo.
*/
private void setCalendarAttributes(NoteItem note, VToDo task) {
// UID
if(task.getUid()!=null) {
note.setIcalUid(task.getUid().getValue());
}
// for now displayName is limited to 1024 chars
if (task.getSummary() != null) {
note.setDisplayName(StringUtils.substring(task.getSummary()
.getValue(), 0, 1024));
}
if (task.getDescription() != null) {
note.setBody(task.getDescription().getValue());
}
// look for DTSTAMP
if (task.getDateStamp() != null) {
note.setClientModifiedDate(task.getDateStamp().getDate());
}
// look for absolute VALARM
VAlarm va = ICalendarUtils.getDisplayAlarm(task);
if (va != null && va.getTrigger()!=null) {
Trigger trigger = va.getTrigger();
Date reminderTime = trigger.getDateTime();
if (reminderTime != null) {
note.setReminderTime(reminderTime);
}
}
// look for COMPLETED or STATUS:COMPLETED
Completed completed = task.getDateCompleted();
Status status = task.getStatus();
TriageStatus ts = note.getTriageStatus();
// Initialize TriageStatus if necessary
if(completed!=null || Status.VTODO_COMPLETED.equals(status)) {
if (ts == null) {
ts = TriageStatusUtil.initialize(entityFactory
.createTriageStatus());
note.setTriageStatus(ts);
}
// TriageStatus.code will be DONE
note.getTriageStatus().setCode(TriageStatus.CODE_DONE);
// TriageStatus.rank will be the COMPLETED date if present
// or currentTime
if(completed!=null) {
note.getTriageStatus().setRank(
TriageStatusUtil.getRank(completed.getDate().getTime()));
}
else {
note.getTriageStatus().setRank(
TriageStatusUtil.getRank(System.currentTimeMillis()));
}
}
// check for X-OSAF-STARRED
if ("TRUE".equals(ICalendarUtils.getXProperty(X_OSAF_STARRED, task))) {
TaskStamp taskStamp = StampUtils.getTaskStamp(note);
if (taskStamp == null) {
note.addStamp(entityFactory.createTaskStamp());
}
}
}
开发者ID:1and1,项目名称:cosmo,代码行数:74,代码来源:EntityConverter.java
注:本文中的net.fortuna.ical4j.model.property.Status类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论