Class ICalConverter

java.lang.Object
org.apache.ofbiz.workeffort.workeffort.ICalConverter

public class ICalConverter extends Object
iCalendar converter class. This class uses the iCal4J library.
  • Field Details

    • MODULE

      protected static final String MODULE
    • PARTY_ID_X_PARAM_NAME

      protected static final String PARTY_ID_X_PARAM_NAME
      See Also:
    • PROD_ID

      protected static final net.fortuna.ical4j.model.property.ProdId PROD_ID
    • UID_PREFIX

      protected static final String UID_PREFIX
      See Also:
    • WORKEFFORT_ID_X_PROP_NAME

      protected static final String WORKEFFORT_ID_X_PROP_NAME
      See Also:
    • REMINDER_X_PROP_NAME

      protected static final String REMINDER_X_PROP_NAME
      See Also:
    • FROM_STATUS_MAP

      protected static final Map<String,String> FROM_STATUS_MAP
    • TO_STATUS_MAP

      protected static final Map<String,net.fortuna.ical4j.model.property.Status> TO_STATUS_MAP
    • TO_PARTY_STATUS_MAP

      protected static final Map<String,net.fortuna.ical4j.model.parameter.PartStat> TO_PARTY_STATUS_MAP
    • FROM_PART_STATUS_MAP

      protected static final Map<String,String> FROM_PART_STATUS_MAP
    • FROM_ROLE_MAP

      protected static final Map<String,String> FROM_ROLE_MAP
  • Constructor Details

    • ICalConverter

      public ICalConverter()
  • Method Details

    • createAlarm

      protected static net.fortuna.ical4j.model.component.VAlarm createAlarm(GenericValue workEffortEventReminder)
    • createAttendee

      protected static net.fortuna.ical4j.model.property.Attendee createAttendee(GenericValue partyValue, Map<String,Object> context)
    • createOrganizer

      protected static net.fortuna.ical4j.model.property.Organizer createOrganizer(GenericValue partyValue, Map<String,Object> context)
    • createWorkEffort

      protected static ICalWorker.ResponseProperties createWorkEffort(net.fortuna.ical4j.model.Component component, Map<String,Object> context)
    • fromClazz

      protected static String fromClazz(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromCompleted

      protected static Timestamp fromCompleted(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromDescription

      protected static String fromDescription(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromDtEnd

      protected static Timestamp fromDtEnd(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromDtStart

      protected static Timestamp fromDtStart(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromDuration

      protected static Double fromDuration(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromLastModified

      protected static Timestamp fromLastModified(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromLocation

      protected static String fromLocation(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromParticipationStatus

      protected static String fromParticipationStatus(net.fortuna.ical4j.model.Parameter status)
    • fromPercentComplete

      protected static Long fromPercentComplete(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromPriority

      protected static Double fromPriority(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromStatus

      protected static String fromStatus(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromSummary

      protected static String fromSummary(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromUid

      protected static String fromUid(net.fortuna.ical4j.model.PropertyList propertyList)
    • fromXParameter

      protected static String fromXParameter(net.fortuna.ical4j.model.ParameterList parameterList, String parameterName)
    • fromXProperty

      protected static String fromXProperty(net.fortuna.ical4j.model.PropertyList propertyList, 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(String workEffortId, Map<String,Object> context) throws GenericEntityException
      Returns a calendar derived from a Work Effort calendar publish point.
      Parameters:
      workEffortId - ID of a work effort with workEffortTypeId equal to PUBLISH_PROPS.
      context - The conversion context
      Returns:
      An iCalendar as a String, or null if workEffortId is invalid.
      Throws:
      GenericEntityException - if communications with the database failed
    • getPartyUrl

      protected static void getPartyUrl(net.fortuna.ical4j.model.Property property, GenericValue partyAssign, Map<String,Object> context)
    • getRelatedWorkEfforts

      protected static List<GenericValue> getRelatedWorkEfforts(GenericValue workEffort, Map<String,Object> context)
    • hasPermission

      protected static boolean hasPermission(String workEffortId, String action, Map<String,Object> context)
    • invokeService

      protected static Map<String,Object> invokeService(String serviceName, Map<String,? extends Object> serviceMap, Map<String,Object> context)
    • isCalendarPublished

      protected static boolean isCalendarPublished(GenericValue publishProperties)
    • loadPartyAssignment

      protected static void loadPartyAssignment(net.fortuna.ical4j.model.Property property, GenericValue partyAssign, Map<String,Object> context)
    • loadRelatedParties

      protected static void loadRelatedParties(List<GenericValue> relatedParties, net.fortuna.ical4j.model.PropertyList componentProps, Map<String,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, Map<String,Object> context) throws GenericEntityException
      Throws:
      GenericEntityException
    • makePartyName

      protected static 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(Map<String,Object> map, String key, Object value)
    • setPartyIdFromUrl

      protected static void setPartyIdFromUrl(net.fortuna.ical4j.model.Property property, Map<String,Object> context)
    • setWorkEffortServiceMap

      protected static void setWorkEffortServiceMap(net.fortuna.ical4j.model.Component component, Map<String,Object> serviceMap)
    • storeCalendar

      public static ICalWorker.ResponseProperties storeCalendar(InputStream is, Map<String,Object> context) throws IOException, net.fortuna.ical4j.data.ParserException, GenericEntityException, GenericServiceException
      Updates work efforts from an incoming iCalendar request.
      Parameters:
      is - the input feeding the calendar parser
      context - parameters from the execution environment
      Returns:
      the response from the ICalWorker
      Throws:
      IOException - if there is an issue with is
      net.fortuna.ical4j.data.ParserException - if the calendar build process failed
      GenericEntityException - if communications with the database failed
      GenericServiceException - if createWorkEffortICalData or updateWorkEffortICalData service invocation failed
    • storePartyAssignments

      protected static ICalWorker.ResponseProperties storePartyAssignments(String workEffortId, net.fortuna.ical4j.model.Component component, Map<String,Object> context)
    • storeWorkEffort

      protected static ICalWorker.ResponseProperties storeWorkEffort(net.fortuna.ical4j.model.Component component, Map<String,Object> context) throws GenericEntityException
      Throws:
      GenericEntityException
    • toCalendarComponent

      protected static ICalWorker.ResponseProperties toCalendarComponent(net.fortuna.ical4j.model.ComponentList components, GenericValue workEffort, Map<String,Object> context) throws GenericEntityException
      Throws:
      GenericEntityException
    • toClazz

      protected static net.fortuna.ical4j.model.property.Clazz toClazz(String javaObj)
    • toCompleted

      protected static net.fortuna.ical4j.model.property.Completed toCompleted(Timestamp javaObj)
    • toCreated

      protected static net.fortuna.ical4j.model.property.Created toCreated(Timestamp javaObj)
    • toDescription

      protected static net.fortuna.ical4j.model.property.Description toDescription(String javaObj)
    • toDtEnd

      protected static net.fortuna.ical4j.model.property.DtEnd toDtEnd(Timestamp javaObj)
    • toDtStart

      protected static net.fortuna.ical4j.model.property.DtStart toDtStart(Timestamp javaObj)
    • toDuration

      protected static net.fortuna.ical4j.model.property.Duration toDuration(Double javaObj)
    • toLastModified

      protected static net.fortuna.ical4j.model.property.LastModified toLastModified(Timestamp javaObj)
    • toLocation

      protected static net.fortuna.ical4j.model.property.Location toLocation(String javaObj)
    • toParticipationStatus

      protected static net.fortuna.ical4j.model.parameter.PartStat toParticipationStatus(String statusId)
    • toPercentComplete

      protected static net.fortuna.ical4j.model.property.PercentComplete toPercentComplete(Long javaObj)
    • toPriority

      protected static net.fortuna.ical4j.model.property.Priority toPriority(Long javaObj)
    • toStatus

      protected static net.fortuna.ical4j.model.property.Status toStatus(String javaObj)
    • toSummary

      protected static net.fortuna.ical4j.model.property.Summary toSummary(String javaObj)
    • toUid

      protected static net.fortuna.ical4j.model.property.Uid toUid(String javaObj)
    • toXParameter

      protected static net.fortuna.ical4j.model.parameter.XParameter toXParameter(String name, String value)
    • toXProperty

      protected static net.fortuna.ical4j.model.property.XProperty toXProperty(String name, String value)