org.opencrx.kernel.backend
Class Activities

java.lang.Object
  extended by org.opencrx.kernel.backend.AbstractImpl
      extended by org.opencrx.kernel.backend.Activities

public class Activities
extends AbstractImpl


Field Summary
static short ACTIVITY_CLASS_ABSENCE
           
static short ACTIVITY_CLASS_EMAIL
           
static short ACTIVITY_CLASS_INCIDENT
           
static short ACTIVITY_CLASS_MAILING
           
static short ACTIVITY_CLASS_MEETING
           
static short ACTIVITY_CLASS_PHONE_CALL
           
static short ACTIVITY_CLASS_SALES_VISIT
           
static short ACTIVITY_CLASS_TASK
           
static String ACTIVITY_CREATOR_NAME_ABSENCES
           
static String ACTIVITY_CREATOR_NAME_BUGS_AND_FEATURES
           
static String ACTIVITY_CREATOR_NAME_EMAILS
           
static String ACTIVITY_CREATOR_NAME_INCIDENTS
           
static String ACTIVITY_CREATOR_NAME_MAILINGS
           
static String ACTIVITY_CREATOR_NAME_MEETING_ROOMS
           
static String ACTIVITY_CREATOR_NAME_MEETINGS
           
static String ACTIVITY_CREATOR_NAME_PHONE_CALLS
           
static String ACTIVITY_CREATOR_NAME_POLLS
           
static String ACTIVITY_CREATOR_NAME_PUBLIC_EMAILS
           
static String ACTIVITY_CREATOR_NAME_PUBLIC_MEETINGS
           
static String ACTIVITY_CREATOR_NAME_PUBLIC_PHONE_CALLS
           
static String ACTIVITY_CREATOR_NAME_PUBLIC_TASKS
           
static String ACTIVITY_CREATOR_NAME_SALES_VISITS
           
static String ACTIVITY_CREATOR_NAME_TASKS
           
static short ACTIVITY_LINK_TYPE_IS_DERIVED_FROM
           
static String ACTIVITY_PROCESS_NAME_BUG_AND_FEATURE_TRACKING
           
static String ACTIVITY_PROCESS_NAME_EMAILS
           
static String ACTIVITY_TRACKER_NAME_BUGS_AND_FEATURES
           
static String ACTIVITY_TRACKER_NAME_EMAILS
           
static String ACTIVITY_TRACKER_NAME_MEETING_ROOMS
           
static String ACTIVITY_TRACKER_NAME_MEETINGS
           
static String ACTIVITY_TRACKER_NAME_PHONE_CALLS
           
static String ACTIVITY_TRACKER_NAME_POLLS
           
static String ACTIVITY_TRACKER_NAME_PUBLIC
           
static String ACTIVITY_TRACKER_NAME_TASKS
           
static String ACTIVITY_TRACKER_NAME_TRASH
           
static String ACTIVITY_TYPE_NAME_ABSENCES
           
static String ACTIVITY_TYPE_NAME_BUGS_AND_FEATURES
           
static String ACTIVITY_TYPE_NAME_EMAILS
           
static String ACTIVITY_TYPE_NAME_INCIDENTS
           
static String ACTIVITY_TYPE_NAME_MAILINGS
           
static String ACTIVITY_TYPE_NAME_MEETINGS
           
static String ACTIVITY_TYPE_NAME_PHONE_CALLS
           
static String ACTIVITY_TYPE_NAME_SALES_VISITS
           
static String ACTIVITY_TYPE_NAME_TASKS
           
protected static String BOOKING_TEXT_NAME_WORK_EFFORT
           
static String CALENDAR_NAME_DEFAULT_BUSINESS
           
static String DEFAULT_EMAIL_CREATOR_ID
           
static short PARTY_TYPE_BCC
           
static short PARTY_TYPE_CC
           
static short PARTY_TYPE_FROM
           
static short PARTY_TYPE_TO
           
static short PRIORITY_HIGH
           
static short PRIORITY_IMMEDIATE
           
static short PRIORITY_LOW
           
static short PRIORITY_NORMAL
           
static short PRIORITY_URGENT
           
static String UNSPECIFIED_ADDRESS
           
static short WORKRECORD_TYPE_NA
           
static short WORKRECORD_TYPE_WORK_OVERTIME
           
static short WORKRECORD_TYPE_WORK_STANDARD
           
 
Constructor Summary
protected Activities()
           
 
Method Summary
 void addEmailRecipient(javax.jdo.PersistenceManager pm, EMail emailActivity, EMailAddress address, Message.RecipientType type)
          Creates and adds an email recipient to the email activity.
 void addEMailRecipients(EMail email, String sender, List<String> recipientTo, List<String> recipientCc, List<String> recipientBcc)
           
 void addMimeMessageAsMedia(MimeMessage mimeMessage, EMail emailActivity)
           
 void addNote(javax.jdo.PersistenceManager pm, EMail emailActivity, String title, String content)
          Adds a note to the currently processed email activity.
 ActivityWorkRecord addWorkAndExpenseRecord(Activity activity, Resource resource, String name, String description, Date startedAt, Date endedAt, BigDecimal quantity, Uom quantityUom, short recordType, short paymentType, short depotSelector, BigDecimal rate, short rateCurrency, Boolean isBillable, Boolean isReimbursable, List<PrincipalGroup> owningGroups)
           
 void assignTo(Activity activity, Resource resource)
           
 Object[] calcMainEffortEstimate(Activity activity)
           
 void calcTotalQuantity(AbstractFilterActivity activityFilter, short recordType, Date startAt, Date endAt, List<BigDecimal> totalQuantities, List<Uom> quantityUoms)
           
 void calcTotalQuantity(ActivityGroup activityGroup, short recordType, Date startAt, Date endAt, List<BigDecimal> totalQuantities, List<Uom> quantityUoms)
           
 void calcTotalQuantity(Activity activity, short recordType, Date startAt, Date endAt, List<BigDecimal> totalQuantities, List<Uom> quantityUoms)
           
protected  void calcTotalQuantity(List<WorkAndExpenseRecord> workAndExpenseRecords, List<BigDecimal> totalQuantities, List<Uom> quantityUoms)
           
 void calcTotalQuantity(Resource resource, short recordType, Date startAt, Date endAt, List<BigDecimal> totalQuantities, List<Uom> quantityUoms)
           
 int countFilteredActivity(AbstractFilterActivity activityFilter)
           
 void createOrUpdateMedia(EMail emailActivity, String contentType, String contentName, InputStream content)
          Adds a Media object to the currently processed email activity with the given content.
 ResourceAssignment createResourceAssignment(Activity activity, Resource resource, short resourceOrder, List<PrincipalGroup> owningGroups)
           
 ActivityFollowUp doFollowUp(Activity activity, String followUpTitle, String followUpText, ActivityProcessTransition processTransition, Contact assignTo)
           
 Activity findActivity(javax.jdo.PersistenceManager pm, ActivitiesFilterHelper activitiesHelper, String icalUid, String icalRecurrenceId)
           
 ActivityCategory findActivityCategory(String name, Segment segment, javax.jdo.PersistenceManager pm)
           
 ActivityCreator findActivityCreator(Collection<ActivityCreator> activityCreators, short activityClass)
           
 ActivityCreator findActivityCreator(String name, Segment segment)
           
 ActivityProcess findActivityProcess(String name, Segment segment, javax.jdo.PersistenceManager pm)
           
 ActivityProcessTransition findActivityProcessTransition(Activity activity, String transitionName)
           
 ActivityTracker findActivityTracker(String name, Segment segment, javax.jdo.PersistenceManager pm)
           
 ActivityType findActivityType(String name, Segment segment, javax.jdo.PersistenceManager pm)
           
 Calendar findCalendar(String name, Segment segment, javax.jdo.PersistenceManager pm)
           
 Resource findResource(Segment activitySegment, UserHome userHome)
           
 Segment getActivitySegment(javax.jdo.PersistenceManager pm, String providerName, String segmentName)
           
 ActivityQuery getFilteredActivityQuery(AbstractFilterActivity activityFilter, ActivityQuery query, boolean forCounting, javax.jdo.PersistenceManager pm)
           
static Activities getInstance()
           
 String getInternetAddress(AccountAddress address, String gateway)
           
 String[] getInternetAddresses(Address[] addresses)
           
 String getMessageBody(MimePart messagePart)
           
 short getMessagePriority(Message message)
          Extract the priority from the email message.
 String getRecipientsAsNoteText(javax.jdo.PersistenceManager pm, String providerName, String segmentName, String[] from, String[] to, String[] cc, String[] bcc, boolean isEMailAddressLookupCaseInsensitive, boolean isEMailAddressLookupIgnoreDisabled)
          Formats a text containing all the addresses of the different types (i.e., TO, CC, BCC) to be attached to the email activity by a note indicating whether an account containing the email address could be found.
 EMail importMimeMessage(String providerName, String segmentName, MimeMessage mimeMessage, ActivityCreator emailCreator, Address[] addressesFrom, Address[] addressesTo, Address[] addressesCc, Address[] addressesBcc, boolean isEMailAddressLookupCaseInsensitive, boolean isEMailAddressLookupIgnoreDisabled)
           
 ActivityCategory initActivityCategory(String categoryName, List<PrincipalGroup> owningGroups, javax.jdo.PersistenceManager pm, String providerName, String segmentName)
           
 ActivityCreator initActivityCreator(String creatorName, ActivityType activityType, List<ActivityGroup> activityGroups, List<PrincipalGroup> owningGroups, javax.jdo.PersistenceManager pm, String providerName, String segmentName)
           
 ActivityTracker initActivityTracker(String trackerName, List<PrincipalGroup> owningGroups, javax.jdo.PersistenceManager pm, String providerName, String segmentName)
           
 ActivityType initActivityType(String activityTypeName, short activityClass, ActivityProcess activityProcess, javax.jdo.PersistenceManager pm, String providerName, String segmentName)
           
 ActivityProcess initBugAndFeatureTrackingProcess(javax.jdo.PersistenceManager pm, String providerName, String segmentName)
           
 Calendar initCalendar(String calendarName, javax.jdo.PersistenceManager pm, String providerName, String segmentName)
           
 ActivityProcess initEmailProcess(javax.jdo.PersistenceManager pm, String providerName, String segmentName)
           
 boolean isAllAscii(String s)
           
 List<Activity> lookupEmailActivity(javax.jdo.PersistenceManager pm, String providerName, String segmentName, String externalLink)
          Search email activity with the given external link, i.e.
 void mapAddressesToEMailRecipients(EMail emailActivity, String[] addresses, Message.RecipientType type, boolean isEMailAddressLookupCaseInsensitive, boolean isEMailAddressLookupIgnoreDisabled)
          Adds an email recipient to the currently processed email activity if the email message contains an email address which is contained in an openCRX account.
 InputStream mapMessageContent(EMail emailActivity, Message message)
          Maps email activity to message.
 List<Address> mapMessageRecipients(EMail emailActivity)
           
 List<Address> mapMessageRecipients(EMail emailActivity, Message message)
           
 InputStream mapToMessage(EMail emailActivity, Message message)
           
 void markActivityAsDirty(Activity activity)
           
 void markAsAllDayEvent(Activity activity, String timezoneID)
           
 Activity newActivity(ActivityCreator activityCreator, String name, String description, String detailedDescription, Date suppliedScheduledStart, Date suppliedScheduledEnd, Date suppliedDueBy, Number suppliedPriority, Number suppliedIcalType, Contact reportingContact)
          Creates a new activity and links the tracker with this new activity.
 String[] parseContentType(String contentType)
           
 void reapplyActivityCreator(Activity activity, ActivityCreator activityCreator)
           
 void refreshItems(ActivityTracker activityTracker)
           
 ActivityTracker refreshTracker(ActivityTracker activityTracker)
           
static void register()
           
 void removeActivity(Activity activity, boolean preDelete)
           
 void removeActivityGroup(ActivityGroup activityGroup, boolean preDelete)
           
 void removeWorkRecord(WorkAndExpenseRecord workRecord, boolean preDelete)
           
 void sendEMail(EMail email)
           
 void updateActivity(Activity activity)
           
 void updateIcal(Activity activity, boolean isEMailAddressLookupCaseInsensitive, boolean isEMailAddressLookupIgnoreDisabled)
           
 void updateWorkAndExpenseRecord(WorkAndExpenseRecord workRecord)
           
 ActivityVote voteForActivity(Activity activity, String name, String description)
           
 
Methods inherited from class org.opencrx.kernel.backend.AbstractImpl
getInstance, getUidAsString, registerImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVITY_CLASS_EMAIL

public static final short ACTIVITY_CLASS_EMAIL
See Also:
Constant Field Values

ACTIVITY_CLASS_INCIDENT

public static final short ACTIVITY_CLASS_INCIDENT
See Also:
Constant Field Values

ACTIVITY_CLASS_MAILING

public static final short ACTIVITY_CLASS_MAILING
See Also:
Constant Field Values

ACTIVITY_CLASS_MEETING

public static final short ACTIVITY_CLASS_MEETING
See Also:
Constant Field Values

ACTIVITY_CLASS_PHONE_CALL

public static final short ACTIVITY_CLASS_PHONE_CALL
See Also:
Constant Field Values

ACTIVITY_CLASS_TASK

public static final short ACTIVITY_CLASS_TASK
See Also:
Constant Field Values

ACTIVITY_CLASS_ABSENCE

public static final short ACTIVITY_CLASS_ABSENCE
See Also:
Constant Field Values

ACTIVITY_CLASS_SALES_VISIT

public static final short ACTIVITY_CLASS_SALES_VISIT
See Also:
Constant Field Values

PARTY_TYPE_FROM

public static final short PARTY_TYPE_FROM
See Also:
Constant Field Values

PARTY_TYPE_TO

public static final short PARTY_TYPE_TO
See Also:
Constant Field Values

PARTY_TYPE_CC

public static final short PARTY_TYPE_CC
See Also:
Constant Field Values

PARTY_TYPE_BCC

public static final short PARTY_TYPE_BCC
See Also:
Constant Field Values

ACTIVITY_LINK_TYPE_IS_DERIVED_FROM

public static final short ACTIVITY_LINK_TYPE_IS_DERIVED_FROM
See Also:
Constant Field Values

WORKRECORD_TYPE_NA

public static final short WORKRECORD_TYPE_NA
See Also:
Constant Field Values

WORKRECORD_TYPE_WORK_STANDARD

public static final short WORKRECORD_TYPE_WORK_STANDARD
See Also:
Constant Field Values

WORKRECORD_TYPE_WORK_OVERTIME

public static final short WORKRECORD_TYPE_WORK_OVERTIME
See Also:
Constant Field Values

PRIORITY_LOW

public static final short PRIORITY_LOW
See Also:
Constant Field Values

PRIORITY_NORMAL

public static final short PRIORITY_NORMAL
See Also:
Constant Field Values

PRIORITY_HIGH

public static final short PRIORITY_HIGH
See Also:
Constant Field Values

PRIORITY_URGENT

public static final short PRIORITY_URGENT
See Also:
Constant Field Values

PRIORITY_IMMEDIATE

public static final short PRIORITY_IMMEDIATE
See Also:
Constant Field Values

BOOKING_TEXT_NAME_WORK_EFFORT

protected static final String BOOKING_TEXT_NAME_WORK_EFFORT
See Also:
Constant Field Values

DEFAULT_EMAIL_CREATOR_ID

public static final String DEFAULT_EMAIL_CREATOR_ID
See Also:
Constant Field Values

ACTIVITY_PROCESS_NAME_BUG_AND_FEATURE_TRACKING

public static final String ACTIVITY_PROCESS_NAME_BUG_AND_FEATURE_TRACKING
See Also:
Constant Field Values

ACTIVITY_PROCESS_NAME_EMAILS

public static final String ACTIVITY_PROCESS_NAME_EMAILS
See Also:
Constant Field Values

CALENDAR_NAME_DEFAULT_BUSINESS

public static final String CALENDAR_NAME_DEFAULT_BUSINESS
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_BUGS_AND_FEATURES

public static final String ACTIVITY_TYPE_NAME_BUGS_AND_FEATURES
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_EMAILS

public static final String ACTIVITY_TYPE_NAME_EMAILS
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_MEETINGS

public static final String ACTIVITY_TYPE_NAME_MEETINGS
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_PHONE_CALLS

public static final String ACTIVITY_TYPE_NAME_PHONE_CALLS
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_TASKS

public static final String ACTIVITY_TYPE_NAME_TASKS
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_MAILINGS

public static final String ACTIVITY_TYPE_NAME_MAILINGS
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_SALES_VISITS

public static final String ACTIVITY_TYPE_NAME_SALES_VISITS
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_ABSENCES

public static final String ACTIVITY_TYPE_NAME_ABSENCES
See Also:
Constant Field Values

ACTIVITY_TYPE_NAME_INCIDENTS

public static final String ACTIVITY_TYPE_NAME_INCIDENTS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_BUGS_AND_FEATURES

public static final String ACTIVITY_CREATOR_NAME_BUGS_AND_FEATURES
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_EMAILS

public static final String ACTIVITY_CREATOR_NAME_EMAILS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_MEETINGS

public static final String ACTIVITY_CREATOR_NAME_MEETINGS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_PHONE_CALLS

public static final String ACTIVITY_CREATOR_NAME_PHONE_CALLS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_TASKS

public static final String ACTIVITY_CREATOR_NAME_TASKS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_POLLS

public static final String ACTIVITY_CREATOR_NAME_POLLS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_MEETING_ROOMS

public static final String ACTIVITY_CREATOR_NAME_MEETING_ROOMS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_MAILINGS

public static final String ACTIVITY_CREATOR_NAME_MAILINGS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_SALES_VISITS

public static final String ACTIVITY_CREATOR_NAME_SALES_VISITS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_ABSENCES

public static final String ACTIVITY_CREATOR_NAME_ABSENCES
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_INCIDENTS

public static final String ACTIVITY_CREATOR_NAME_INCIDENTS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_PUBLIC_EMAILS

public static final String ACTIVITY_CREATOR_NAME_PUBLIC_EMAILS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_PUBLIC_MEETINGS

public static final String ACTIVITY_CREATOR_NAME_PUBLIC_MEETINGS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_PUBLIC_PHONE_CALLS

public static final String ACTIVITY_CREATOR_NAME_PUBLIC_PHONE_CALLS
See Also:
Constant Field Values

ACTIVITY_CREATOR_NAME_PUBLIC_TASKS

public static final String ACTIVITY_CREATOR_NAME_PUBLIC_TASKS
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_BUGS_AND_FEATURES

public static final String ACTIVITY_TRACKER_NAME_BUGS_AND_FEATURES
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_EMAILS

public static final String ACTIVITY_TRACKER_NAME_EMAILS
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_MEETINGS

public static final String ACTIVITY_TRACKER_NAME_MEETINGS
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_PHONE_CALLS

public static final String ACTIVITY_TRACKER_NAME_PHONE_CALLS
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_TASKS

public static final String ACTIVITY_TRACKER_NAME_TASKS
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_PUBLIC

public static final String ACTIVITY_TRACKER_NAME_PUBLIC
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_TRASH

public static final String ACTIVITY_TRACKER_NAME_TRASH
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_POLLS

public static final String ACTIVITY_TRACKER_NAME_POLLS
See Also:
Constant Field Values

ACTIVITY_TRACKER_NAME_MEETING_ROOMS

public static final String ACTIVITY_TRACKER_NAME_MEETING_ROOMS
See Also:
Constant Field Values

UNSPECIFIED_ADDRESS

public static final String UNSPECIFIED_ADDRESS
See Also:
Constant Field Values
Constructor Detail

Activities

protected Activities()
Method Detail

register

public static void register()

getInstance

public static Activities getInstance()
                              throws ServiceException
Throws:
ServiceException

refreshItems

public void refreshItems(ActivityTracker activityTracker)
                  throws ServiceException
Throws:
ServiceException

markActivityAsDirty

public void markActivityAsDirty(Activity activity)
                         throws ServiceException
Throws:
ServiceException

findActivityType

public ActivityType findActivityType(String name,
                                     Segment segment,
                                     javax.jdo.PersistenceManager pm)

findActivityProcess

public ActivityProcess findActivityProcess(String name,
                                           Segment segment,
                                           javax.jdo.PersistenceManager pm)

findActivityProcessTransition

public ActivityProcessTransition findActivityProcessTransition(Activity activity,
                                                               String transitionName)

findActivityCreator

public ActivityCreator findActivityCreator(String name,
                                           Segment segment)

findActivityTracker

public ActivityTracker findActivityTracker(String name,
                                           Segment segment,
                                           javax.jdo.PersistenceManager pm)

findActivityCategory

public ActivityCategory findActivityCategory(String name,
                                             Segment segment,
                                             javax.jdo.PersistenceManager pm)

findCalendar

public Calendar findCalendar(String name,
                             Segment segment,
                             javax.jdo.PersistenceManager pm)

initCalendar

public Calendar initCalendar(String calendarName,
                             javax.jdo.PersistenceManager pm,
                             String providerName,
                             String segmentName)

initEmailProcess

public ActivityProcess initEmailProcess(javax.jdo.PersistenceManager pm,
                                        String providerName,
                                        String segmentName)

initBugAndFeatureTrackingProcess

public ActivityProcess initBugAndFeatureTrackingProcess(javax.jdo.PersistenceManager pm,
                                                        String providerName,
                                                        String segmentName)

initActivityType

public ActivityType initActivityType(String activityTypeName,
                                     short activityClass,
                                     ActivityProcess activityProcess,
                                     javax.jdo.PersistenceManager pm,
                                     String providerName,
                                     String segmentName)

initActivityTracker

public ActivityTracker initActivityTracker(String trackerName,
                                           List<PrincipalGroup> owningGroups,
                                           javax.jdo.PersistenceManager pm,
                                           String providerName,
                                           String segmentName)

initActivityCategory

public ActivityCategory initActivityCategory(String categoryName,
                                             List<PrincipalGroup> owningGroups,
                                             javax.jdo.PersistenceManager pm,
                                             String providerName,
                                             String segmentName)

initActivityCreator

public ActivityCreator initActivityCreator(String creatorName,
                                           ActivityType activityType,
                                           List<ActivityGroup> activityGroups,
                                           List<PrincipalGroup> owningGroups,
                                           javax.jdo.PersistenceManager pm,
                                           String providerName,
                                           String segmentName)

refreshTracker

public ActivityTracker refreshTracker(ActivityTracker activityTracker)
                               throws ServiceException
Throws:
ServiceException

newActivity

public Activity newActivity(ActivityCreator activityCreator,
                            String name,
                            String description,
                            String detailedDescription,
                            Date suppliedScheduledStart,
                            Date suppliedScheduledEnd,
                            Date suppliedDueBy,
                            Number suppliedPriority,
                            Number suppliedIcalType,
                            Contact reportingContact)
                     throws ServiceException
Creates a new activity and links the tracker with this new activity.

Throws:
ServiceException

voteForActivity

public ActivityVote voteForActivity(Activity activity,
                                    String name,
                                    String description)
                             throws ServiceException
Throws:
ServiceException

markAsAllDayEvent

public void markAsAllDayEvent(Activity activity,
                              String timezoneID)

doFollowUp

public ActivityFollowUp doFollowUp(Activity activity,
                                   String followUpTitle,
                                   String followUpText,
                                   ActivityProcessTransition processTransition,
                                   Contact assignTo)
                            throws ServiceException
Throws:
ServiceException

updateWorkAndExpenseRecord

public void updateWorkAndExpenseRecord(WorkAndExpenseRecord workRecord)
                                throws ServiceException
Throws:
ServiceException

addWorkAndExpenseRecord

public ActivityWorkRecord addWorkAndExpenseRecord(Activity activity,
                                                  Resource resource,
                                                  String name,
                                                  String description,
                                                  Date startedAt,
                                                  Date endedAt,
                                                  BigDecimal quantity,
                                                  Uom quantityUom,
                                                  short recordType,
                                                  short paymentType,
                                                  short depotSelector,
                                                  BigDecimal rate,
                                                  short rateCurrency,
                                                  Boolean isBillable,
                                                  Boolean isReimbursable,
                                                  List<PrincipalGroup> owningGroups)
                                           throws ServiceException
Throws:
ServiceException

removeWorkRecord

public void removeWorkRecord(WorkAndExpenseRecord workRecord,
                             boolean preDelete)
                      throws ServiceException
Throws:
ServiceException

removeActivityGroup

public void removeActivityGroup(ActivityGroup activityGroup,
                                boolean preDelete)
                         throws ServiceException
Throws:
ServiceException

updateActivity

public void updateActivity(Activity activity)
                    throws ServiceException
Throws:
ServiceException

createResourceAssignment

public ResourceAssignment createResourceAssignment(Activity activity,
                                                   Resource resource,
                                                   short resourceOrder,
                                                   List<PrincipalGroup> owningGroups)
                                            throws ServiceException
Throws:
ServiceException

reapplyActivityCreator

public void reapplyActivityCreator(Activity activity,
                                   ActivityCreator activityCreator)
                            throws ServiceException
Throws:
ServiceException

getFilteredActivityQuery

public ActivityQuery getFilteredActivityQuery(AbstractFilterActivity activityFilter,
                                              ActivityQuery query,
                                              boolean forCounting,
                                              javax.jdo.PersistenceManager pm)
                                       throws ServiceException
Throws:
ServiceException

assignTo

public void assignTo(Activity activity,
                     Resource resource)
              throws ServiceException
Throws:
ServiceException

updateIcal

public void updateIcal(Activity activity,
                       boolean isEMailAddressLookupCaseInsensitive,
                       boolean isEMailAddressLookupIgnoreDisabled)
                throws ServiceException
Throws:
ServiceException

calcTotalQuantity

protected void calcTotalQuantity(List<WorkAndExpenseRecord> workAndExpenseRecords,
                                 List<BigDecimal> totalQuantities,
                                 List<Uom> quantityUoms)

calcTotalQuantity

public void calcTotalQuantity(Activity activity,
                              short recordType,
                              Date startAt,
                              Date endAt,
                              List<BigDecimal> totalQuantities,
                              List<Uom> quantityUoms)
                       throws ServiceException
Throws:
ServiceException

calcTotalQuantity

public void calcTotalQuantity(Resource resource,
                              short recordType,
                              Date startAt,
                              Date endAt,
                              List<BigDecimal> totalQuantities,
                              List<Uom> quantityUoms)
                       throws ServiceException
Throws:
ServiceException

calcTotalQuantity

public void calcTotalQuantity(ActivityGroup activityGroup,
                              short recordType,
                              Date startAt,
                              Date endAt,
                              List<BigDecimal> totalQuantities,
                              List<Uom> quantityUoms)
                       throws ServiceException
Throws:
ServiceException

calcTotalQuantity

public void calcTotalQuantity(AbstractFilterActivity activityFilter,
                              short recordType,
                              Date startAt,
                              Date endAt,
                              List<BigDecimal> totalQuantities,
                              List<Uom> quantityUoms)
                       throws ServiceException
Throws:
ServiceException

calcMainEffortEstimate

public Object[] calcMainEffortEstimate(Activity activity)
                                throws ServiceException
Throws:
ServiceException

countFilteredActivity

public int countFilteredActivity(AbstractFilterActivity activityFilter)
                          throws ServiceException
Throws:
ServiceException

addEmailRecipient

public void addEmailRecipient(javax.jdo.PersistenceManager pm,
                              EMail emailActivity,
                              EMailAddress address,
                              Message.RecipientType type)
Creates and adds an email recipient to the email activity.

Parameters:
emailActivity - The openCRX EMailActivity currently in process
address - The email address object
type - The address type (TO, CC, BCC)

createOrUpdateMedia

public void createOrUpdateMedia(EMail emailActivity,
                                String contentType,
                                String contentName,
                                InputStream content)
                         throws IOException
Adds a Media object to the currently processed email activity with the given content. This is how attachments of email messages can be imported.

Parameters:
rootPkg - The root package to be used for this request
emailActivity - The openCRX EMailActivity currently in process
content - The content of the media object, e.g. an attachment
Throws:
IOException

mapAddressesToEMailRecipients

public void mapAddressesToEMailRecipients(EMail emailActivity,
                                          String[] addresses,
                                          Message.RecipientType type,
                                          boolean isEMailAddressLookupCaseInsensitive,
                                          boolean isEMailAddressLookupIgnoreDisabled)
                                   throws ServiceException
Adds an email recipient to the currently processed email activity if the email message contains an email address which is contained in an openCRX account. Email addresses for which no account can be found, are recorded via a note attached to the email activity.

Parameters:
rootPkg - The root package to be used for this request
emailActivity - The EMailActivity currently in process
addresses - A list of addresses
type - The address type (TO, CC, BCC)
Throws:
ServiceException

lookupEmailActivity

public List<Activity> lookupEmailActivity(javax.jdo.PersistenceManager pm,
                                          String providerName,
                                          String segmentName,
                                          String externalLink)
Search email activity with the given external link, i.e. the given message id.

Parameters:
rootPkg - The root package to be used for this request
providerName - The name of the current provider
segmentName - The name of the current segment
externalLink - The message id
Returns:
A List of activities containing the message id

getActivitySegment

public Segment getActivitySegment(javax.jdo.PersistenceManager pm,
                                  String providerName,
                                  String segmentName)
Returns:
Returns the activitySegment.

findResource

public Resource findResource(Segment activitySegment,
                             UserHome userHome)

getRecipientsAsNoteText

public String getRecipientsAsNoteText(javax.jdo.PersistenceManager pm,
                                      String providerName,
                                      String segmentName,
                                      String[] from,
                                      String[] to,
                                      String[] cc,
                                      String[] bcc,
                                      boolean isEMailAddressLookupCaseInsensitive,
                                      boolean isEMailAddressLookupIgnoreDisabled)
                               throws ServiceException,
                                      MessagingException
Formats a text containing all the addresses of the different types (i.e., TO, CC, BCC) to be attached to the email activity by a note indicating whether an account containing the email address could be found.

Parameters:
rootPkg - The root package to be used for this request
providerName - The name of the current provider
segmentName - The name of the current segment
mimeMsg - The email to be imported as openCRX EMailActivity
Returns:
The formatted content for the 'Recipients' note
Throws:
ServiceException
MessagingException

addNote

public void addNote(javax.jdo.PersistenceManager pm,
                    EMail emailActivity,
                    String title,
                    String content)
Adds a note to the currently processed email activity.

Parameters:
rootPkg - The root package to be used for this request
emailActivity - The openCRX EMailActivity currently in process
title - The note's title
content - The note's content

getMessagePriority

public short getMessagePriority(Message message)
                         throws MessagingException
Extract the priority from the email message. Note that if no header element is found this indicates a "normal" priority. Note that rfc822 does not define a standard header field for priority. The name of the "priority" header field depends on your mail client used. "Importance" with values high, normal and low "Priority" with values Urgent and Non-Urgent "X-Priority" with values 1=high and 5=low These values are mapped to: respectively.

Returns:
the subject of the message
Throws:
MessagingException

getMessageBody

public String getMessageBody(MimePart messagePart)
                      throws IOException,
                             MessagingException
Throws:
IOException
MessagingException

isAllAscii

public boolean isAllAscii(String s)

mapMessageContent

public InputStream mapMessageContent(EMail emailActivity,
                                     Message message)
                              throws MessagingException
Maps email activity to message. If email activity has a media attachment which contains the original MimeMessage the stream of this message is returned in addition.

Throws:
MessagingException

getInternetAddress

public String getInternetAddress(AccountAddress address,
                                 String gateway)

mapMessageRecipients

public List<Address> mapMessageRecipients(EMail emailActivity)
                                   throws AddressException,
                                          MessagingException
Throws:
AddressException
MessagingException

mapMessageRecipients

public List<Address> mapMessageRecipients(EMail emailActivity,
                                          Message message)
                                   throws AddressException,
                                          MessagingException
Throws:
AddressException
MessagingException

mapToMessage

public InputStream mapToMessage(EMail emailActivity,
                                Message message)
                         throws MessagingException
Throws:
MessagingException

findActivity

public Activity findActivity(javax.jdo.PersistenceManager pm,
                             ActivitiesFilterHelper activitiesHelper,
                             String icalUid,
                             String icalRecurrenceId)

findActivityCreator

public ActivityCreator findActivityCreator(Collection<ActivityCreator> activityCreators,
                                           short activityClass)

removeActivity

public void removeActivity(Activity activity,
                           boolean preDelete)
                    throws ServiceException
Throws:
ServiceException

getInternetAddresses

public String[] getInternetAddresses(Address[] addresses)
                              throws AddressException
Throws:
AddressException

parseContentType

public String[] parseContentType(String contentType)

addMimeMessageAsMedia

public void addMimeMessageAsMedia(MimeMessage mimeMessage,
                                  EMail emailActivity)
                           throws IOException,
                                  MessagingException,
                                  ServiceException
Throws:
IOException
MessagingException
ServiceException

importMimeMessage

public EMail importMimeMessage(String providerName,
                               String segmentName,
                               MimeMessage mimeMessage,
                               ActivityCreator emailCreator,
                               Address[] addressesFrom,
                               Address[] addressesTo,
                               Address[] addressesCc,
                               Address[] addressesBcc,
                               boolean isEMailAddressLookupCaseInsensitive,
                               boolean isEMailAddressLookupIgnoreDisabled)
                        throws ServiceException,
                               MessagingException,
                               IOException,
                               ParseException
Throws:
ServiceException
MessagingException
IOException
ParseException

addEMailRecipients

public void addEMailRecipients(EMail email,
                               String sender,
                               List<String> recipientTo,
                               List<String> recipientCc,
                               List<String> recipientBcc)
                        throws ServiceException
Throws:
ServiceException

sendEMail

public void sendEMail(EMail email)
               throws ServiceException
Throws:
ServiceException


This software is published under the BSD license. Copyright © 2003-2010, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.