Class ICalConverter
- java.lang.Object
-
- org.apache.ofbiz.workeffort.workeffort.ICalConverter
-
public class ICalConverter extends java.lang.Object
iCalendar converter class. This class uses the iCal4J library.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Map<java.lang.String,java.lang.String>
fromPartStatusMap
protected static java.util.Map<java.lang.String,java.lang.String>
fromRoleMap
protected static java.util.Map<java.lang.String,java.lang.String>
fromStatusMap
protected static java.lang.String
module
protected static java.lang.String
partyIdXParamName
protected static net.fortuna.ical4j.model.property.ProdId
prodId
protected static java.lang.String
reminderXPropName
protected static java.util.Map<java.lang.String,net.fortuna.ical4j.model.parameter.PartStat>
toPartStatusMap
protected static java.util.Map<java.lang.String,net.fortuna.ical4j.model.property.Status>
toStatusMap
protected static java.lang.String
uidPrefix
protected static java.lang.String
workEffortIdXPropName
-
Constructor Summary
Constructors Constructor Description ICalConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static net.fortuna.ical4j.model.component.VAlarm
createAlarm(GenericValue workEffortEventReminder)
protected static net.fortuna.ical4j.model.property.Attendee
createAttendee(GenericValue partyValue, java.util.Map<java.lang.String,java.lang.Object> context)
protected static net.fortuna.ical4j.model.property.Organizer
createOrganizer(GenericValue partyValue, java.util.Map<java.lang.String,java.lang.Object> context)
protected static ICalWorker.ResponseProperties
createWorkEffort(net.fortuna.ical4j.model.Component component, java.util.Map<java.lang.String,java.lang.Object> context)
protected static java.lang.String
fromClazz(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.sql.Timestamp
fromCompleted(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.String
fromDescription(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.sql.Timestamp
fromDtEnd(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.sql.Timestamp
fromDtStart(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.Double
fromDuration(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.sql.Timestamp
fromLastModified(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.String
fromLocation(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.String
fromParticipationStatus(net.fortuna.ical4j.model.Parameter status)
protected static java.lang.Long
fromPercentComplete(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.Double
fromPriority(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.String
fromStatus(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.String
fromSummary(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.String
fromUid(net.fortuna.ical4j.model.PropertyList propertyList)
protected static java.lang.String
fromXParameter(net.fortuna.ical4j.model.ParameterList parameterList, java.lang.String parameterName)
protected static java.lang.String
fromXProperty(net.fortuna.ical4j.model.PropertyList propertyList, java.lang.String propertyName)
protected static void
getAlarms(GenericValue workEffort, net.fortuna.ical4j.model.ComponentList alarms)
static ICalWorker.ResponseProperties
getICalendar(java.lang.String workEffortId, java.util.Map<java.lang.String,java.lang.Object> context)
Returns a calendar derived from a Work Effort calendar publish point.protected static void
getPartyUrl(net.fortuna.ical4j.model.Property property, GenericValue partyAssign, java.util.Map<java.lang.String,java.lang.Object> context)
protected static java.util.List<GenericValue>
getRelatedWorkEfforts(GenericValue workEffort, java.util.Map<java.lang.String,java.lang.Object> context)
protected static boolean
hasPermission(java.lang.String workEffortId, java.lang.String action, java.util.Map<java.lang.String,java.lang.Object> context)
protected static java.util.Map<java.lang.String,java.lang.Object>
invokeService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> serviceMap, java.util.Map<java.lang.String,java.lang.Object> context)
protected static boolean
isCalendarPublished(GenericValue publishProperties)
protected static void
loadPartyAssignment(net.fortuna.ical4j.model.Property property, GenericValue partyAssign, java.util.Map<java.lang.String,java.lang.Object> context)
protected static void
loadRelatedParties(java.util.List<GenericValue> relatedParties, net.fortuna.ical4j.model.PropertyList componentProps, java.util.Map<java.lang.String,java.lang.Object> context)
protected static void
loadWorkEffort(net.fortuna.ical4j.model.PropertyList componentProps, GenericValue workEffort)
protected static net.fortuna.ical4j.model.Calendar
makeCalendar(GenericValue workEffort, java.util.Map<java.lang.String,java.lang.Object> context)
protected static java.lang.String
makePartyName(GenericValue partyAssign)
protected static void
replaceParameter(net.fortuna.ical4j.model.ParameterList parameterList, net.fortuna.ical4j.model.Parameter parameter)
protected static void
replaceProperty(net.fortuna.ical4j.model.PropertyList propertyList, net.fortuna.ical4j.model.Property property)
protected static void
setMapElement(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String key, java.lang.Object value)
protected static void
setPartyIdFromUrl(net.fortuna.ical4j.model.Property property, java.util.Map<java.lang.String,java.lang.Object> context)
protected static void
setWorkEffortServiceMap(net.fortuna.ical4j.model.Component component, java.util.Map<java.lang.String,java.lang.Object> serviceMap)
static ICalWorker.ResponseProperties
storeCalendar(java.io.InputStream is, java.util.Map<java.lang.String,java.lang.Object> context)
Updates work efforts from an incoming iCalendar request.protected static ICalWorker.ResponseProperties
storePartyAssignments(java.lang.String workEffortId, net.fortuna.ical4j.model.Component component, java.util.Map<java.lang.String,java.lang.Object> context)
protected static ICalWorker.ResponseProperties
storeWorkEffort(net.fortuna.ical4j.model.Component component, java.util.Map<java.lang.String,java.lang.Object> context)
protected static ICalWorker.ResponseProperties
toCalendarComponent(net.fortuna.ical4j.model.ComponentList components, GenericValue workEffort, java.util.Map<java.lang.String,java.lang.Object> context)
protected static net.fortuna.ical4j.model.property.Clazz
toClazz(java.lang.String javaObj)
protected static net.fortuna.ical4j.model.property.Completed
toCompleted(java.sql.Timestamp javaObj)
protected static net.fortuna.ical4j.model.property.Created
toCreated(java.sql.Timestamp javaObj)
protected static net.fortuna.ical4j.model.property.Description
toDescription(java.lang.String javaObj)
protected static net.fortuna.ical4j.model.property.DtEnd
toDtEnd(java.sql.Timestamp javaObj)
protected static net.fortuna.ical4j.model.property.DtStart
toDtStart(java.sql.Timestamp javaObj)
protected static net.fortuna.ical4j.model.property.Duration
toDuration(java.lang.Double javaObj)
protected static net.fortuna.ical4j.model.property.LastModified
toLastModified(java.sql.Timestamp javaObj)
protected static net.fortuna.ical4j.model.property.Location
toLocation(java.lang.String javaObj)
protected static net.fortuna.ical4j.model.parameter.PartStat
toParticipationStatus(java.lang.String statusId)
protected static net.fortuna.ical4j.model.property.PercentComplete
toPercentComplete(java.lang.Long javaObj)
protected static net.fortuna.ical4j.model.property.Priority
toPriority(java.lang.Long javaObj)
protected static net.fortuna.ical4j.model.property.Status
toStatus(java.lang.String javaObj)
protected static net.fortuna.ical4j.model.property.Summary
toSummary(java.lang.String javaObj)
protected static net.fortuna.ical4j.model.property.Uid
toUid(java.lang.String javaObj)
protected static net.fortuna.ical4j.model.parameter.XParameter
toXParameter(java.lang.String name, java.lang.String value)
protected static net.fortuna.ical4j.model.property.XProperty
toXProperty(java.lang.String name, java.lang.String value)
-
-
-
Field Detail
-
module
protected static final java.lang.String module
-
partyIdXParamName
protected static final java.lang.String partyIdXParamName
- See Also:
- Constant Field Values
-
prodId
protected static final net.fortuna.ical4j.model.property.ProdId prodId
-
uidPrefix
protected static final java.lang.String uidPrefix
- See Also:
- Constant Field Values
-
workEffortIdXPropName
protected static final java.lang.String workEffortIdXPropName
- See Also:
- Constant Field Values
-
reminderXPropName
protected static final java.lang.String reminderXPropName
- See Also:
- Constant Field Values
-
fromStatusMap
protected static final java.util.Map<java.lang.String,java.lang.String> fromStatusMap
-
toStatusMap
protected static final java.util.Map<java.lang.String,net.fortuna.ical4j.model.property.Status> toStatusMap
-
toPartStatusMap
protected static final java.util.Map<java.lang.String,net.fortuna.ical4j.model.parameter.PartStat> toPartStatusMap
-
fromPartStatusMap
protected static final java.util.Map<java.lang.String,java.lang.String> fromPartStatusMap
-
fromRoleMap
protected static final java.util.Map<java.lang.String,java.lang.String> fromRoleMap
-
-
Method Detail
-
createAlarm
protected static net.fortuna.ical4j.model.component.VAlarm createAlarm(GenericValue workEffortEventReminder)
-
createAttendee
protected static net.fortuna.ical4j.model.property.Attendee createAttendee(GenericValue partyValue, java.util.Map<java.lang.String,java.lang.Object> context)
-
createOrganizer
protected static net.fortuna.ical4j.model.property.Organizer createOrganizer(GenericValue partyValue, java.util.Map<java.lang.String,java.lang.Object> context)
-
createWorkEffort
protected static ICalWorker.ResponseProperties createWorkEffort(net.fortuna.ical4j.model.Component component, java.util.Map<java.lang.String,java.lang.Object> context)
-
fromClazz
protected static java.lang.String fromClazz(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromCompleted
protected static java.sql.Timestamp fromCompleted(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromDescription
protected static java.lang.String fromDescription(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromDtEnd
protected static java.sql.Timestamp fromDtEnd(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromDtStart
protected static java.sql.Timestamp fromDtStart(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromDuration
protected static java.lang.Double fromDuration(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromLastModified
protected static java.sql.Timestamp fromLastModified(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromLocation
protected static java.lang.String fromLocation(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromParticipationStatus
protected static java.lang.String fromParticipationStatus(net.fortuna.ical4j.model.Parameter status)
-
fromPercentComplete
protected static java.lang.Long fromPercentComplete(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromPriority
protected static java.lang.Double fromPriority(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromStatus
protected static java.lang.String fromStatus(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromSummary
protected static java.lang.String fromSummary(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromUid
protected static java.lang.String fromUid(net.fortuna.ical4j.model.PropertyList propertyList)
-
fromXParameter
protected static java.lang.String fromXParameter(net.fortuna.ical4j.model.ParameterList parameterList, java.lang.String parameterName)
-
fromXProperty
protected static java.lang.String fromXProperty(net.fortuna.ical4j.model.PropertyList propertyList, java.lang.String propertyName)
-
getAlarms
protected static void getAlarms(GenericValue workEffort, net.fortuna.ical4j.model.ComponentList alarms) throws GenericEntityException
- Throws:
GenericEntityException
-
getICalendar
public static ICalWorker.ResponseProperties getICalendar(java.lang.String workEffortId, java.util.Map<java.lang.String,java.lang.Object> context) throws GenericEntityException
Returns a calendar derived from a Work Effort calendar publish point.- Parameters:
workEffortId
- ID of a work effort withworkEffortTypeId
equal toPUBLISH_PROPS
.context
- The conversion context- Returns:
- An iCalendar as a
String
, ornull
ifworkEffortId
is invalid. - Throws:
GenericEntityException
- if communications with the database failed
-
getPartyUrl
protected static void getPartyUrl(net.fortuna.ical4j.model.Property property, GenericValue partyAssign, java.util.Map<java.lang.String,java.lang.Object> context)
-
getRelatedWorkEfforts
protected static java.util.List<GenericValue> getRelatedWorkEfforts(GenericValue workEffort, java.util.Map<java.lang.String,java.lang.Object> context)
-
hasPermission
protected static boolean hasPermission(java.lang.String workEffortId, java.lang.String action, java.util.Map<java.lang.String,java.lang.Object> context)
-
invokeService
protected static java.util.Map<java.lang.String,java.lang.Object> invokeService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> serviceMap, java.util.Map<java.lang.String,java.lang.Object> context)
-
isCalendarPublished
protected static boolean isCalendarPublished(GenericValue publishProperties)
-
loadPartyAssignment
protected static void loadPartyAssignment(net.fortuna.ical4j.model.Property property, GenericValue partyAssign, java.util.Map<java.lang.String,java.lang.Object> context)
-
loadRelatedParties
protected static void loadRelatedParties(java.util.List<GenericValue> relatedParties, net.fortuna.ical4j.model.PropertyList componentProps, java.util.Map<java.lang.String,java.lang.Object> context)
-
loadWorkEffort
protected static void loadWorkEffort(net.fortuna.ical4j.model.PropertyList componentProps, GenericValue workEffort)
-
makeCalendar
protected static net.fortuna.ical4j.model.Calendar makeCalendar(GenericValue workEffort, java.util.Map<java.lang.String,java.lang.Object> context) throws GenericEntityException
- Throws:
GenericEntityException
-
makePartyName
protected static java.lang.String makePartyName(GenericValue partyAssign)
-
replaceParameter
protected static void replaceParameter(net.fortuna.ical4j.model.ParameterList parameterList, net.fortuna.ical4j.model.Parameter parameter)
-
replaceProperty
protected static void replaceProperty(net.fortuna.ical4j.model.PropertyList propertyList, net.fortuna.ical4j.model.Property property)
-
setMapElement
protected static void setMapElement(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String key, java.lang.Object value)
-
setPartyIdFromUrl
protected static void setPartyIdFromUrl(net.fortuna.ical4j.model.Property property, java.util.Map<java.lang.String,java.lang.Object> context)
-
setWorkEffortServiceMap
protected static void setWorkEffortServiceMap(net.fortuna.ical4j.model.Component component, java.util.Map<java.lang.String,java.lang.Object> serviceMap)
-
storeCalendar
public static ICalWorker.ResponseProperties storeCalendar(java.io.InputStream is, java.util.Map<java.lang.String,java.lang.Object> context) throws java.io.IOException, net.fortuna.ical4j.data.ParserException, GenericEntityException, GenericServiceException
Updates work efforts from an incoming iCalendar request.- Parameters:
is
- the input feeding the calendar parsercontext
- parameters from the execution environment- Returns:
- the response from the ICalWorker
- Throws:
java.io.IOException
- if there is an issue withis
net.fortuna.ical4j.data.ParserException
- if the calendar build process failedGenericEntityException
- if communications with the database failedGenericServiceException
- ifcreateWorkEffortICalData
orupdateWorkEffortICalData
service invocation failed
-
storePartyAssignments
protected static ICalWorker.ResponseProperties storePartyAssignments(java.lang.String workEffortId, net.fortuna.ical4j.model.Component component, java.util.Map<java.lang.String,java.lang.Object> context)
-
storeWorkEffort
protected static ICalWorker.ResponseProperties storeWorkEffort(net.fortuna.ical4j.model.Component component, java.util.Map<java.lang.String,java.lang.Object> context) throws GenericEntityException
- Throws:
GenericEntityException
-
toCalendarComponent
protected static ICalWorker.ResponseProperties toCalendarComponent(net.fortuna.ical4j.model.ComponentList components, GenericValue workEffort, java.util.Map<java.lang.String,java.lang.Object> context) throws GenericEntityException
- Throws:
GenericEntityException
-
toClazz
protected static net.fortuna.ical4j.model.property.Clazz toClazz(java.lang.String javaObj)
-
toCompleted
protected static net.fortuna.ical4j.model.property.Completed toCompleted(java.sql.Timestamp javaObj)
-
toCreated
protected static net.fortuna.ical4j.model.property.Created toCreated(java.sql.Timestamp javaObj)
-
toDescription
protected static net.fortuna.ical4j.model.property.Description toDescription(java.lang.String javaObj)
-
toDtEnd
protected static net.fortuna.ical4j.model.property.DtEnd toDtEnd(java.sql.Timestamp javaObj)
-
toDtStart
protected static net.fortuna.ical4j.model.property.DtStart toDtStart(java.sql.Timestamp javaObj)
-
toDuration
protected static net.fortuna.ical4j.model.property.Duration toDuration(java.lang.Double javaObj)
-
toLastModified
protected static net.fortuna.ical4j.model.property.LastModified toLastModified(java.sql.Timestamp javaObj)
-
toLocation
protected static net.fortuna.ical4j.model.property.Location toLocation(java.lang.String javaObj)
-
toParticipationStatus
protected static net.fortuna.ical4j.model.parameter.PartStat toParticipationStatus(java.lang.String statusId)
-
toPercentComplete
protected static net.fortuna.ical4j.model.property.PercentComplete toPercentComplete(java.lang.Long javaObj)
-
toPriority
protected static net.fortuna.ical4j.model.property.Priority toPriority(java.lang.Long javaObj)
-
toStatus
protected static net.fortuna.ical4j.model.property.Status toStatus(java.lang.String javaObj)
-
toSummary
protected static net.fortuna.ical4j.model.property.Summary toSummary(java.lang.String javaObj)
-
toUid
protected static net.fortuna.ical4j.model.property.Uid toUid(java.lang.String javaObj)
-
toXParameter
protected static net.fortuna.ical4j.model.parameter.XParameter toXParameter(java.lang.String name, java.lang.String value)
-
toXProperty
protected static net.fortuna.ical4j.model.property.XProperty toXProperty(java.lang.String name, java.lang.String value)
-
-