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


Java Location类代码示例

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


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

示例1: icalResponse

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

import net.fortuna.ical4j.model.property.Location; //导入依赖的package包/类
private void addToCalendar() {
    Log.i(TAG, "addToCalendar: " + event.vEvent);
    Date startDate = event.vEvent.getStartDate().getDate();
    Date endDate = event.vEvent.getEndDate(true).getDate();

    Location location = event.vEvent.getLocation();
    String locationString = location != null && !location.getValue().isEmpty() ? location.getValue() : null;

    Intent intent = new Intent(Intent.ACTION_INSERT)
            .setData(CalendarContract.Events.CONTENT_URI)
            .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, startDate.getTime())
            .putExtra(CalendarContract.EXTRA_EVENT_END_TIME, endDate.getTime())
            .putExtra(CalendarContract.Events.TITLE, event.vEvent.getSummary().getValue());

    if (locationString != null)
        intent.putExtra(CalendarContract.Events.EVENT_LOCATION, locationString);

    ComponentName resolvedActivity = intent.resolveActivity(getPackageManager());

    if (resolvedActivity != null)
        startActivity(intent);
    else
        Toast.makeText(this, R.string.insert_calendar_event_failure, Toast.LENGTH_LONG).show();

}
 
开发者ID:Pattonville-App-Development-Team,项目名称:Android-App,代码行数:26,代码来源:CalendarEventDetailsActivity.java

示例3: addOtherProperties

import net.fortuna.ical4j.model.property.Location; //导入依赖的package包/类
private static VEvent addOtherProperties(VEvent newEvent, Task newTask, java.util.Calendar reminderTime)
   {
if (!newTask.getLocation().equals(EXCEPTION_LOCATION_NOT_SPECIFIED)) {
    newEvent.getProperties().add(new Location(newTask.getLocation()));
}

if (newTask.getPriority() != INVALID_PRIORITY_REF || newTask.getPriority() != EMPTY_PRIORITY_REF) {
    extractAndParsePriority(newEvent, newTask);
}

if (newTask.getIsThereReminder()) {
    extractAndParseReminder(newEvent, newTask, reminderTime);
}

return newEvent;
   }
 
开发者ID:MohitShridhar,项目名称:TASCA,代码行数:17,代码来源:Exporter.java

示例4: fromLocation

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

示例5: convertEventBean

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

示例6: toLocation

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

示例7: createEvent

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


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