本文整理汇总了Java中net.fortuna.ical4j.model.PropertyList类的典型用法代码示例。如果您正苦于以下问题:Java PropertyList类的具体用法?Java PropertyList怎么用?Java PropertyList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertyList类属于net.fortuna.ical4j.model包,在下文中一共展示了PropertyList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadWorkEffort
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
protected static void loadWorkEffort(PropertyList componentProps, GenericValue workEffort) {
replaceProperty(componentProps, new DtStamp()); // iCalendar object created date/time
replaceProperty(componentProps, toClazz(workEffort.getString("scopeEnumId")));
replaceProperty(componentProps, toCreated(workEffort.getTimestamp("createdDate")));
replaceProperty(componentProps, toDescription(workEffort.getString("description")));
replaceProperty(componentProps, toDtStart(workEffort.getTimestamp("estimatedStartDate")));
replaceProperty(componentProps, toLastModified(workEffort.getTimestamp("lastModifiedDate")));
replaceProperty(componentProps, toPriority(workEffort.getLong("priority")));
replaceProperty(componentProps, toLocation(workEffort.getString("locationDesc")));
replaceProperty(componentProps, toStatus(workEffort.getString("currentStatusId")));
replaceProperty(componentProps, toSummary(workEffort.getString("workEffortName")));
Property uid = componentProps.getProperty(Uid.UID);
if (uid == null) {
// Don't overwrite UIDs created by calendar clients
replaceProperty(componentProps, toUid(workEffort.getString("workEffortId")));
}
replaceProperty(componentProps, toXProperty(workEffortIdXPropName, workEffort.getString("workEffortId")));
}
示例2: setWorkEffortServiceMap
import net.fortuna.ical4j.model.PropertyList; //导入依赖的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));
}
}
示例3: storeWorkEffort
import net.fortuna.ical4j.model.PropertyList; //导入依赖的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);
}
示例4: filterProperties
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
private void filterProperties(PropertyList properties,
StringBuffer buffer) {
if (isAllProperties()) {
buffer.append(properties.toString());
return;
}
if (! hasPropertyFilters()) {
return;
}
for (Property property : (List<Property>) properties) {
PropertyMatch pm = testPropertyValue(property.getName());
if (pm.isMatch()) {
if (pm.isValueExcluded()) {
chompPropertyValue(property, buffer);
}
else {
buffer.append(property.toString());
}
}
}
}
示例5: filterProperties
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
private void filterProperties(PropertyList<Property> properties,
StringBuffer buffer) {
if (isAllProperties()) {
buffer.append(properties.toString());
return;
}
if (! hasPropertyFilters()) {
return;
}
for (Property property : properties) {
PropertyMatch pm = testPropertyValue(property.getName());
if (pm.isMatch()) {
if (pm.isValueExcluded()) {
chompPropertyValue(property, buffer);
}
else {
buffer.append(property.toString());
}
}
}
}
示例6: setRecurrenceDates
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
public void setRecurrenceDates(DateList dates) {
if (dates == null) {
return;
}
PropertyList<RDate> rdateList = getEvent().getProperties().getProperties(Property.RDATE);
for (RDate rdate : rdateList) {
rdateList.remove(rdate);
}
if (dates.isEmpty()) {
return;
}
RDate rDate = new RDate(dates);
setDateListPropertyValue(rDate);
rdateList.add(rDate);
}
示例7: setExceptionDates
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
public void setExceptionDates(DateList dates) {
if (dates == null) {
return;
}
PropertyList<Property> properties = getEvent().getProperties();
for (Property exdate : properties.getProperties(Property.EXDATE)) {
properties.remove(exdate);
}
if (dates.isEmpty()) {
return;
}
ExDate exDate = new ExDate(dates);
setDateListPropertyValue(exDate);
properties.add(exDate);
}
示例8: verifyPeriods
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
/**
* verify periods.
* @param vfb VFreeBusy.
* @param fbtype FbType.
* @param periods The periods.
*/
private void verifyPeriods(VFreeBusy vfb, FbType fbtype, String periods) {
PropertyList<FreeBusy> props = vfb.getProperties(Property.FREEBUSY);
FreeBusy fb = null;
for(FreeBusy next : props) {
FbType type = (FbType) next.getParameter(Parameter.FBTYPE);
if(type==null && fbtype==null) {
fb = next;
}
else if(type != null && type.equals(fbtype)) {
fb = next;
}
}
if (fb == null) {
Assert.fail("periods " + periods + " not in " + vfb.toString());
}
Assert.assertEquals(periods, fb.getPeriods().toString());
}
示例9: setRecurrenceDates
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
/**
* Sets recurrence dates.
* @param dates The date list.
*/
public void setRecurrenceDates(DateList dates) {
if (dates == null) {
return;
}
PropertyList<Property> pl = getEvent().getProperties();
for (Property rdate : pl.getProperties(Property.RDATE)) {
pl.remove(rdate);
}
if (dates.isEmpty()) {
return;
}
RDate rDate = new RDate(dates);
setDateListPropertyValue(rDate);
pl.add(rDate);
}
示例10: setExceptionDates
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
/**
* Sets exception dates.
* @param dates The date list.
*/
public void setExceptionDates(DateList dates) {
if (dates == null) {
return;
}
PropertyList<Property> properties = getEvent().getProperties();
for (Property exdate : properties.getProperties(Property.EXDATE)) {
properties.remove(exdate);
}
if (dates.isEmpty()) {
return;
}
ExDate exDate = new ExDate(dates);
setDateListPropertyValue(exDate);
properties.add(exDate);
}
示例11: storeWorkEffort
import net.fortuna.ical4j.model.PropertyList; //导入依赖的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);
}
示例12: wrap
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
public void wrap(PropertyList properties, Cursor c) {
int columnIndex = c.getColumnIndex(keyGoogleEvent);
if (columnIndex != -1) {
String value = c.getString(columnIndex);
if (value != null) {
try {
Log.d(LOG_ID, "VEvent: " + keyVEvent + " GoogleEvent: " + keyGoogleEvent
+ " Value: " + value);
// Find timezone
// TimeZone timezone = new
// TimeZoneRegistryImpl().getTimeZone(c.getString(c
// .getColumnIndex("timezone")));
DateTime dateTime = new DateTime(Long.valueOf(value));
// dateTime.setTimeZone(timezone);
properties.add(createProperty(keyVEvent, dateTime.toString()));
} catch (Exception exc) {
Log.d(LOG_ID, "Error", exc);
}
}
}
}
示例13: readCategory
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
/**
* Returns a list of categories or an empty list if none found.
*
* @param vEvent
* @return
*/
private List<String> readCategory(VEvent vEvent) {
PropertyList propertyCategoryList = vEvent.getProperties(Property.CATEGORIES);
ArrayList<String> splittedCategoriesToReturn = new ArrayList<String>();
if (propertyCategoryList != null) {
for (int categoriesLineNum = 0; categoriesLineNum < propertyCategoryList.size(); categoriesLineNum++) {
Property propertyCategory = propertyCategoryList.get(categoriesLineNum);
String categories = propertyCategory.getValue();
if (categories != null) {
String[] categoriesSplit = StringUtils.split(categories, ",");
for (String category : categoriesSplit) {
if (!splittedCategoriesToReturn.contains(category)) {
splittedCategoriesToReturn.add(category);
}
}
}
}
}
return splittedCategoriesToReturn;
}
示例14: fromClazz
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
protected static String fromClazz(PropertyList propertyList) {
Clazz iCalObj = (Clazz) propertyList.getProperty(Clazz.CLASS);
if (iCalObj == null) {
return null;
}
return "WES_".concat(iCalObj.getValue());
}
示例15: fromCompleted
import net.fortuna.ical4j.model.PropertyList; //导入依赖的package包/类
protected static Timestamp fromCompleted(PropertyList propertyList) {
Completed iCalObj = (Completed) propertyList.getProperty(Completed.COMPLETED);
if (iCalObj == null) {
return null;
}
Date date = iCalObj.getDate();
return new Timestamp(date.getTime());
}