本文整理汇总了Java中net.fortuna.ical4j.model.Component.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Component.getProperties方法的具体用法?Java Component.getProperties怎么用?Java Component.getProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.fortuna.ical4j.model.Component
的用法示例。
在下文中一共展示了Component.getProperties方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setWorkEffortServiceMap
import net.fortuna.ical4j.model.Component; //导入方法依赖的package包/类
protected static void setWorkEffortServiceMap(Component component, Map<String, Object> serviceMap) {
PropertyList propertyList = component.getProperties();
setMapElement(serviceMap, "scopeEnumId", fromClazz(propertyList));
setMapElement(serviceMap, "description", fromDescription(propertyList));
setMapElement(serviceMap, "locationDesc", fromLocation(propertyList));
setMapElement(serviceMap, "priority", fromPriority(propertyList));
setMapElement(serviceMap, "currentStatusId", fromStatus(propertyList));
setMapElement(serviceMap, "workEffortName", fromSummary(propertyList));
setMapElement(serviceMap, "universalId", fromUid(propertyList));
// Set some fields to null so calendar clients can revert changes
serviceMap.put("estimatedStartDate", null);
serviceMap.put("estimatedCompletionDate", null);
serviceMap.put("estimatedMilliSeconds", null);
serviceMap.put("lastModifiedDate", null);
serviceMap.put("actualCompletionDate", null);
serviceMap.put("percentComplete", null);
setMapElement(serviceMap, "estimatedStartDate", fromDtStart(propertyList));
setMapElement(serviceMap, "estimatedMilliSeconds", fromDuration(propertyList));
setMapElement(serviceMap, "lastModifiedDate", fromLastModified(propertyList));
if ("VTODO".equals(component.getName())) {
setMapElement(serviceMap, "actualCompletionDate", fromCompleted(propertyList));
setMapElement(serviceMap, "percentComplete", fromPercentComplete(propertyList));
} else {
setMapElement(serviceMap, "estimatedCompletionDate", fromDtEnd(propertyList));
}
}
示例2: storeWorkEffort
import net.fortuna.ical4j.model.Component; //导入方法依赖的package包/类
protected static ResponseProperties storeWorkEffort(Component component, Map<String, Object> context) throws GenericEntityException, GenericServiceException {
PropertyList propertyList = component.getProperties();
String workEffortId = fromXProperty(propertyList, workEffortIdXPropName);
Delegator delegator = (Delegator) context.get("delegator");
GenericValue workEffort = EntityQuery.use(delegator).from("WorkEffort").where("workEffortId", workEffortId).queryOne();
if (workEffort == null) {
return ICalWorker.createNotFoundResponse(null);
}
if (!hasPermission(workEffortId, "UPDATE", context)) {
return null;
}
Map<String, Object> serviceMap = FastMap.newInstance();
serviceMap.put("workEffortId", workEffortId);
setWorkEffortServiceMap(component, serviceMap);
invokeService("updateWorkEffort", serviceMap, context);
return storePartyAssignments(workEffortId, component, context);
}
示例3: storeWorkEffort
import net.fortuna.ical4j.model.Component; //导入方法依赖的package包/类
protected static ResponseProperties storeWorkEffort(Component component, Map<String, Object> context) throws GenericEntityException, GenericServiceException {
PropertyList propertyList = component.getProperties();
String workEffortId = fromXProperty(propertyList, workEffortIdXPropName);
Delegator delegator = (Delegator) context.get("delegator");
GenericValue workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), false);
if (workEffort == null) {
return ICalWorker.createNotFoundResponse(null);
}
if (!hasPermission(workEffortId, "UPDATE", context)) {
return null;
}
Map<String, Object> serviceMap = FastMap.newInstance();
serviceMap.put("workEffortId", workEffortId);
setWorkEffortServiceMap(component, serviceMap);
invokeService("updateWorkEffort", serviceMap, context);
return storePartyAssignments(workEffortId, component, context);
}
示例4: componentToUTC
import net.fortuna.ical4j.model.Component; //导入方法依赖的package包/类
/**
* @param comp The component.
*/
private void componentToUTC(Component comp) {
// Do to each top-level property
for (Property prop : (List<Property>) comp.getProperties()) {
if (prop instanceof DateProperty) {
DateProperty dprop = (DateProperty) prop;
Date date = dprop.getDate();
if (date instanceof DateTime &&
(((DateTime) date).getTimeZone() != null)) {
dprop.setUtc(true);
}
}
}
// Do to each embedded component
ComponentList subcomps = null;
if (comp instanceof VEvent) {
subcomps = ((VEvent)comp).getAlarms();
}
else if (comp instanceof VToDo) {
subcomps = ((VToDo)comp).getAlarms();
}
if (subcomps != null) {
for (Component subcomp : (List<Component>) subcomps) {
componentToUTC(subcomp);
}
}
}
示例5: componentToUTC
import net.fortuna.ical4j.model.Component; //导入方法依赖的package包/类
/**
* @param comp The component.
*/
private void componentToUTC(Component comp) {
// Do to each top-level property
for (Property prop : (List<Property>) comp.getProperties()) {
if (prop instanceof DateProperty) {
DateProperty dprop = (DateProperty) prop;
Date date = dprop.getDate();
if (date instanceof DateTime &&
(((DateTime) date).getTimeZone() != null)) {
dprop.setUtc(true);
}
}
}
// Do to each embedded component
ComponentList<? extends CalendarComponent> subcomps = null;
if (comp instanceof VEvent) {
subcomps = ((VEvent) comp).getAlarms() ;
}
else if (comp instanceof VToDo) {
subcomps = ((VToDo)comp).getAlarms();
}
if (subcomps != null) {
for (CalendarComponent subcomp : subcomps) {
componentToUTC(subcomp);
}
}
}
示例6: fixExDates
import net.fortuna.ical4j.model.Component; //导入方法依赖的package包/类
private void fixExDates(Component comp) throws Exception {
PropertyList<ExDate> exDates = comp.getProperties(Property.EXDATE);
List<Property> toAdd = new ArrayList<>();
List<Property> toRemove = new ArrayList<>();
for(ExDate exDate : exDates) {
// ical likes a single exdate
if(exDate.getDates().size()==1) {
continue;
}
// remove exdate with multiple dates
toRemove.add(exDate);
// create single dates instead
for(Date date : exDate.getDates()) {
ExDate singleEx = (ExDate) exDate.copy();
singleEx.getDates().clear();
singleEx.getDates().add(date);
toAdd.add(singleEx);
}
}
// remove exdates with multiple dates
comp.getProperties().removeAll(toRemove);
// Add all single exdates
comp.getProperties().addAll(toAdd);
}
示例7: fixDateTimeProperties
import net.fortuna.ical4j.model.Component; //导入方法依赖的package包/类
private void fixDateTimeProperties(Component component) {
PropertyList<Property> props = component.getProperties();
for(Property prop : props) {
if(prop instanceof DateProperty || prop instanceof DateListProperty) {
Value v = (Value) prop.getParameter(Parameter.VALUE);
if(Value.DATE_TIME.equals(v)) {
prop.getParameters().remove(v);
}
}
}
}