Package com.proxemo.todo4.common
Class ToDoScriptingHelper
- java.lang.Object
-
- com.proxemo.todo4.common.ToDoScriptingHelper
-
public class ToDoScriptingHelper extends java.lang.Object
Helper object for all scripting environments. Please check the inheriting classes for further details and check if the required methods are available in client or server scripts.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ERROR_MESSAGE
static java.lang.String
FAILURE
static int
INFORMATION_MESSAGE
static java.lang.String
SUCCESS
static int
WARNING_MESSAGE
-
Constructor Summary
Constructors Constructor Description ToDoScriptingHelper(ToDoTask task, java.util.List<ToDoAttachment> attachments)
ToDoScriptingHelper(ToDoTask task, java.util.List<ToDoAttachment> attachments, com.proxemo.todo4.ui.forms.base.FormDataProvider mepa)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activateForm(java.lang.String formName)
This method attaches the form to the current task.ToDoTask
addAttachmentsToTask(ToDoTask task, java.util.List<ToDoAttachment> attachments)
void
addDaysToScheduledEndDate(int days)
Add days to the scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
void
addHoursToScheduledEndDate(int hours)
Add hours to the scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
void
addJarFromFile(java.lang.String path)
This method dynamically load a jar file at runtime.void
addJarFromUrl(java.lang.String url)
This method dynamically load a jar file at runtime.static void
addLabelFromPDF(byte[] pdf, ToDoForm md)
ToDoForm
addMetaData(long metaDataId)
Add a form (MetaData object) to the current task.ToDoForm
addMetaDataByName(java.lang.String metaDataName)
Add a form (MetaData object) to the current task.void
addMinutesToScheduledEndDate(int minutes)
Add minutes to the scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
void
addSecondsToScheduledEndDate(int seconds)
Add seconds to the scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
void
addValueForField(ToDoForm md, java.lang.String name, java.lang.Object value)
Set the value of the attribute with the specified name into the form.java.lang.String
bytesToString(byte[] bytes, java.lang.String charSetName)
Converts the bytes to a string of character set charSetName.java.lang.Object
callStaticMethodForClass(java.lang.String className, java.lang.String methodName)
This method calls a static method for of a class.void
close()
This method updates the metacontent attribute of the task in the current context.void
copyFormValue(java.lang.String sourceFormName, java.lang.String sourceAttributeName, java.lang.String targetFormName, java.lang.String targetAttributeName)
This method copies the value from one field in the source form to another field in the target formjava.lang.Object
createArray(java.lang.String classname, int size)
Creates an array of objects type classname and size.void
createCsvDataCacheFromString(java.lang.String cacheName, java.lang.String csvData)
Creates a data cache from a comma-separated-value-formatted String.void
createCsvDataCacheFromUrl(java.lang.String cacheName, java.lang.String url, int expiryInterval)
Creates a data cache from an URL pointing to a comma-separated-value-formatted File.static ToDoForm
createFormFromByteArray(java.util.Collection<ToDoPDFFormField> formFields, byte[] rawDocument, java.lang.String fileName, ToDoForm theForm, int xGrid, int yGrid, int xOffset, int yOffset, java.lang.StringBuffer mappingFunction)
Fills a form (com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
) from a the PDF-File.static ToDoForm
createFormFromFile(java.util.Collection<ToDoPDFFormField> ff, java.lang.String fileName, ToDoForm theForm)
Fills a form (com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
) from a the PDF-File.ToDoForm
createFormFromPdfAttachment(ToDoAttachment pdfAttachment, java.lang.String formName)
FieldCachedMao(); Creates a new form from a given PDF-Attachment.java.lang.Object
createInstance(java.lang.String className)
java.util.Set<ToDoMailAttachment>
createMailAttachmentsFromTask()
java.util.Set<ToDoMailAttachment>
createMailAttachmentsFromToDoAttachmentProxies(ToDoOutgoingMail mail)
long
createTask(int addressedGroupId, java.lang.String title, java.lang.String description, int minutes, int prio, int ownerId, java.util.Map<java.lang.Long,java.util.Map<java.lang.String,java.lang.Object>> forms, java.util.List<ToDoAttachment> attachments)
long
createTask(int addressedGroupId, java.lang.String title, java.lang.String description, int minutes, int prio, int ownerId, java.util.Map<java.lang.Long,java.util.Map<java.lang.String,java.lang.Object>> forms, java.util.List<ToDoAttachment> attachments, java.util.Map<java.lang.String,java.lang.String> properties)
This method allows the creation of a task via scripting.long
createTask(int addressedGroupId, java.lang.String title, java.lang.String description, int minutes, int ownerId, java.util.Map<java.lang.Long,java.util.Map<java.lang.String,java.lang.Object>> forms, java.util.List<ToDoAttachment> attachments)
This method allows the creation of a task via scripting.long
createTask(int addressedGroupId, java.lang.String title, java.lang.String description, int minutes, int ownerId, java.util.Map<java.lang.Long,java.util.Map<java.lang.String,java.lang.Object>> forms, java.util.List<ToDoAttachment> attachments, java.util.Map<java.lang.String,java.lang.String> properties)
void
errorMessage(java.lang.String message)
Shows an error message.static boolean
executionWasSuccessfull(java.lang.String result)
Convenience function to test whether the result string equals "success".java.lang.Object
extractByRegExp(java.lang.String input, java.lang.String regExp, boolean multiMatch)
Extracts the first (multiMatch=false) or all (multiMatch=true) multipletts of capturing groups from the input according to the regular expression regExp.static ToDoForm
extractFormFields(java.util.Collection<ToDoPDFFormField> ff, ToDoForm theForm, java.io.ByteArrayInputStream bais, int xGrid, int yGrid, int offsetX, int offsetY, java.lang.StringBuffer mappingFunction)
static java.lang.String
extractTextFromPDF(byte[] pdf)
boolean
finishTask(long taskId, long userId, java.lang.String doneComment)
Close another task identified by taskId parameter.void
focusComponent(java.lang.String formName, java.lang.String attributeName)
This method tries to focus the widget corresponding to the form fieldVEvent
generateEvent(int year, int month, int day, int hour, int minute, int durationMinutes, java.lang.String summary, java.lang.String description, java.lang.String organizerEmail, java.lang.String organizerName, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> attendees, java.lang.String uid)
This method creates a calendar event, that can be send as an invitation via the method sendInvitation.java.lang.String
getAdminArea()
Returns the current admin area on GPS capable devices.java.util.Map<java.lang.Long,ToDoForm>
getAllForms()
This method returns all forms in the current context.int
getAttachmentLength(ToDoAttachmentProxy ap)
Query the attachment length for the corresponding attachmentToDoAttachment[]
getAttachments()
Returns a deep copied array of all current available available forms (com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
) of the currentcom.proxemo.todo.bom.ToDoTask
.java.lang.Object
getAttributeValue(java.lang.String mdName, java.lang.String attName)
This method returns the value of the field in the given form.java.lang.String
getCity()
Returns the current city on GPS capable devices.ToDoTask
getClonedTask()
com.proxemo.todo4.server.objectstore.ToDoObjectStore
getComponentStore()
Returns the current ToDoComponentStore representing the databasecom.proxemo.xutl.csv.CsvDataCache
getCsvDataCache(java.lang.String cacheName)
Lookup up of a data cache.java.sql.Connection
getCustomDB(java.lang.String name)
Returns a JDBC Connection to a database specified by the parameter name.java.sql.Connection
getDefaultCustomDB()
Returns a JDBC Connection to the default database.java.lang.String
getEventAttachmentAsText(java.lang.String summary, java.lang.String description, java.lang.String organizator, java.lang.String attendee, java.lang.String location, java.lang.String dateString, ToDoAttachment at)
This method creates a textual representation of the given event attachment.java.lang.String
getEventAttachmentProxyAsText(java.lang.String summary, java.lang.String description, java.lang.String organizer, java.lang.String attendee, java.lang.String location, java.lang.String dateString, ToDoAttachmentProxy ap)
This method creates a textual representation of the given event attachment.byte[]
getFormAsPDF(java.lang.String pageSize, boolean portrait, int fontsize, ToDoForm md, float gridwidth, float gridheight, float cellwidth, float cellheight)
Creates an array of objects type classname and size.ToDoForm
getFormById(long id)
ToDoForm
getFormByName(java.lang.String name)
com.proxemo.todo4.ui.forms.base.FormDataProvider
getFormPanel()
This method returns the MetaDataPaneljava.lang.Object
getFormValue(java.lang.String formName, java.lang.String attributeName)
This method returns the value of a form fieldToDoOutgoingMail
getHeuristicOriginMail()
This method was created to treat task, that were created by a "bounced" email.java.lang.Object
getInstanceForClass(java.lang.String className)
This method creates an instance of a class specified by the name.java.lang.Object
getInstanceForClass(java.lang.String className, java.lang.Object[] args, java.lang.Class<?>... parameterTypes)
This method creates an instance of a class specified by the name.ToDoMailbox
getMailboxByEmail(java.lang.String email)
ToDoMailbox
getMailBoxByEmailAddress(java.lang.String emailAddress)
This method searches for an active todo4teams mailbox matches the given email address.ToDoMailbox
getMailBoxByEmailId(long emailId)
This method searches for an active todo4teams mailbox matches the given email address.ToDoMailbox
getMailboxById(long id)
ToDoForm
getMetaDataFromTaskByName(java.lang.String metaDataName)
Retrieves a form with the name metaDataName of the current task.java.lang.Object
getObjectByName(java.lang.String className)
Dynamically load Class as specified by className.ToDoPDFFormField[]
getPdfFormFields(ToDoAttachment pdfAttachment)
Parses the PDF-Form pdfAttachment and returns an array of allToDoPDFFormField
and its containing values.ToDoPDFFormField[]
getPdfFormFieldsNew(ToDoAttachment pdfAttachment)
Parses the PDF-Form pdfAttachment and returns an array of allToDoPDFFormField
and its containing values.java.util.Date
getScheduledEndDateByServiceTimes(int minutes, int startHourWeekdays, int startMinuteWeekdays, int endHourWeekdays, int endMinuteWeekdays, int startHourSaturdays, int startMinuteSaturdays, int endHourSaturdays, int endMinuteSaturdays, int startHourSundays, int startMinuteSundays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the current timestamp and the effective service times given by the parameters.java.util.Date
getScheduledEndDateByServiceTimes2(java.util.Date nowDate, int minutes, int startHourWeekdays, int startMinuteWeekdays, int endHourWeekdays, int endMinuteWeekdays, int startHourSaturdays, int startMinuteSaturdays, int endHourSaturdays, int endMinuteSaturdays, int startHourSundays, int startMinuteSundays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the timestamp nowDate and the effective service times given by the parameters.java.util.Date
getScheduledEndDateByServiceTimes3(java.util.Date nowDate, int minutes, int startHourWeekdays, int startMinuteWeekdays, int endHourWeekdays, int endMinuteWeekdays, int startHourFridays, int startMinuteFridays, int endHourFridays, int endMinuteFridays, int startHourSaturdays, int startMinuteSaturdays, int endHourSaturdays, int endMinuteSaturdays, int startHourSundays, int startMinuteSundays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the timestamp nowDate and the effective service times given by the parameters.java.util.Date
getScheduledEndDateByServiceTimes4(int minutes, int startHourWeekdays, int startMinuteWeekdays, int endHourWeekdays, int endMinuteWeekdays, int startHourFridays, int startMinuteFridays, int endHourFridays, int endMinuteFridays, int startHourSaturdays, int startMinuteSaturdays, int endHourSaturdays, int endMinuteSaturdays, int startHourSundays, int startMinuteSundays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the current timestamp and the effective service times given by the parameters.java.util.Date
getScheduledEndDay(int workingdays, boolean weekday, boolean friday, boolean saturday, boolean sunday, int endHourWeekdays, int endMinuteWeekdays, int endHourFridays, int endMinuteFridays, int endHourSaturdays, int endMinuteSaturdays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the current timestamp and the effective service times given by the parameters.java.util.Date
getScheduledEndDay(java.util.Date nowDate, int workingdays, boolean weekday, boolean friday, boolean saturday, boolean sunday, int endHourWeekdays, int endMinuteWeekdays, int endHourFridays, int endMinuteFridays, int endHourSaturdays, int endMinuteSaturdays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the current timestamp given by the parameter nowDate and the effective service times given by the parameters.java.util.Set<ToDoAttachmentProxy>
getSecuredAttachments(java.lang.String comment)
This method searches for dangerous zips containing executables in the attachments of the current task.java.lang.Object
getSelectedTableValue(java.lang.String formName, java.lang.String attributeName)
This method returns the selected row of a table as an array of stringsjava.lang.String
getServerPropertyByName(java.lang.String name)
Retrieve a server property string by its name.java.lang.String
getStackAsString(java.lang.Throwable t)
Creates a string representation of a javaThrowable
java.lang.String
getStreet()
Returns the current street on GPS capable devices.java.lang.String
getStreetNo()
Returns the current street no on GPS capable devices.java.lang.String
getSubAdminArea()
Returns the current sub admin area on GPS capable devices.ToDoForm[]
getTaskMetaData()
Returns a deep copied array of all current available forms (com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
).ToDoUser[]
getUser()
Returns a deep copied array of all current availablecom.proxemo.todo.bom.ToDoUser
.ToDoUser
getUserById(long id)
ToDoUser
getUserByUserName(java.lang.String username)
java.lang.String
getWebPage(java.lang.String url)
Downloads html page to a given url and returns it as a Stringjava.lang.Object
getWidget(ToDoForm form, java.lang.String name)
This method returns the field widget of a form.ToDoWorkGroup
getWorkgroupById(long id)
ToDoWorkGroup
getWorkgroupByName(java.lang.String name)
ToDoWorkGroup[]
getWorkGroups()
Returns a deep copied array of all current availablecom.proxemo.todo.bom.ToDoWorkGroup
.java.lang.String
getZip()
Returns the current zip on GPS capable devices.void
infoMessage(java.lang.String message)
Shows an info message.java.lang.String
insertOnTop(java.lang.String text, java.lang.String inserttext)
Inserts the inserttext on top of text.void
insertPDFPreviews(int numPagesPerPdfMax)
Generate a PDF-Preview.boolean
isHoliday(java.util.Date givenDate)
Checks whether the given date is on fixed holiday or can be calculated by the gaussian formula So the detected holidays are: New Year's Day, Good Friday, Easter Sunday, Easter Monday, May Day, Ascension Day, Whit Sunday, Whit Monday, Christmas Eve, Christmas Days and New Year's Eve.boolean
isWeekend(java.util.Date givenDate)
Checks whether the given date is on saturday or sundayvoid
loadClass(java.lang.String className)
This method dynamically loads a class at runtime.void
message(java.lang.String message, java.lang.String title, VaadinIcon icon)
void
navigateToAddress(java.lang.String address)
This method starts the navigation on GPS capable devices.void
notifyAll(java.lang.String title, java.lang.String message, java.lang.String topic)
This method notifies all user of this instance of todo4teams that are subscribed to webpush messagesvoid
notifyUser(java.lang.Long userId, java.lang.String title, java.lang.String message, java.lang.String topic)
This method notifies the user if he is subscribed to webpush messagesvoid
notifyUserTicket(java.lang.Long userId, java.lang.String title, java.lang.String message, java.lang.String topic, java.lang.Long ticketId)
Notify user with id UserId and offer a deep link to ticket 'ticketId':void
notifyWorkGroup(java.lang.Long workgroupId, java.lang.String title, java.lang.String message, java.lang.String topic)
This method notifies all user of this workgroup that are subscribed to webpush messagesvoid
notifyWorkgroupTicket(java.lang.Long workgroupId, java.lang.String title, java.lang.String message, java.lang.String topic, java.lang.Long ticketId)
Notify all members of workgroup with id workgroupId and offer a deep link to ticket 'ticketId':static java.lang.String
plainTextToHtml(java.lang.String text)
This method converts the HTML-text to plain text.void
propagateTaskToGroup(java.lang.String groupName)
This method is a simulation of the creation of a follow up task in the finish action of the server.void
propagateTaskToGroupById(java.lang.Long groupId)
This method is a simulation of the creation of a follow up task in the finish action of the server.void
propagateTaskToUser(java.lang.String userName)
This method is a simulation of the creation of a follow up task in the finish action of the server.void
propagateTaskToUserById(java.lang.Long userId)
This method is a simulation of the creation of a follow up task in the finish action of the server.java.util.List<ToDoTask>
query(int maxCounts, int timeout, java.lang.String keyword, java.lang.Integer state, java.lang.Integer prio, java.lang.Long id, java.lang.Long assigneeId, java.lang.Long ownerId, java.util.Date fromDate, java.util.Date toDate, java.util.Date fromDateStart, java.util.Date toDateStart, java.util.Date fromDateEnd, java.util.Date toDateEnd, java.util.List<java.lang.String> lon, java.util.List<java.lang.String> lov, java.lang.String formName)
This method executes an archive query on the server.java.util.List<ToDoTask>
queryMetaData(int maxCounts, int timeout, java.util.List<java.lang.String> lon, java.util.List<java.lang.String> lov, java.lang.String formName)
This method executes a query concerning forms on the server.java.lang.String
readUrlToString(java.lang.String url, int connectTimeoutMs, int readTimeoutMs)
This method open a connection to the url, reads the input and returns the result as a string.void
removeAllAttachments()
Removes allcom.proxemo.todo.bom.ToDoAttachmentProxy
from the currentcom.proxemo.todo.bom.ToDoTask
.void
removeAttachment(java.lang.String attachmentName)
Removes thecom.proxemo.todo.bom.ToDoAttachmentProxy
as specified by attachmentName from the currentcom.proxemo.todo.bom.ToDoTask
.void
resendMail(java.lang.Long mailId, java.lang.String subject, java.lang.String to, java.lang.String cc, java.lang.String bcc)
This method creates a copy of an outgoing email specified by mailId attachment.void
routeToGroup(long groupId)
Set the addressee of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoWorkGroup
with the specified groupId.void
routeToGroupByName(java.lang.String groupName)
Set the addressee of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoWorkGroup
with the specified groupName.void
routeToUser(long userId)
Set the addressee of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoUser
with the specified userId.void
routeToUserByName(java.lang.String userName)
Set the addressee of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoUser
with the specified userName.void
sendInvitation(VEvent event, java.lang.String subject, java.lang.String eventComment, java.lang.String to, long mailboxId)
void
sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to)
This method sends an email via an active todo4teams mailbox matching the given id.void
sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, boolean withAttachments)
This method sends an email via an active todo4teams mailbox matching the given email address.void
sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, boolean isHTMLEMail)
This method sends an email via an active todo4teams mailbox matching the given id.void
sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, boolean isHTMLEMail)
This method sends an email via an active todo4teams mailbox matching the given id.void
sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, boolean isHTMLEMail, boolean withAttachments)
This method sends an email via an active todo4teams mailbox matching the given email id.void
sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, boolean withAttachments)
This method sends an email via an active todo4teams mailbox matching the given id.void
sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, java.util.Collection<java.lang.String> attachments)
This method sends an email via an active todo4teams mailbox matching the given email id.void
sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to)
This method sends an email via an active todo4teams mailbox matching the given email address.void
sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, boolean withAttachments)
This method sends an email via an active todo4teams mailbox matching the given email address.void
sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, boolean isHTMLEMail)
This method sends an email via an active todo4teams mailbox matching the given email address.void
sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, boolean isHTMLEMail)
This method sends an email via an active todo4teams mailbox matching the given email address.void
sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, boolean isHTMLEMail, boolean withAttachments)
This method sends an email via an active todo4teams mailbox matching the given email address.void
sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, boolean withAttachments)
This method sends an email via an active todo4teams mailbox matching the given email address.void
sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, java.util.Collection<java.lang.String> attachments)
This method sends an email via an active todo4teams mailbox matching the given email address.void
sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, java.util.Set<ToDoMailAttachment> mailAttachments)
This method sends an email via an active todo4teams mailbox.void
sendSMS(java.lang.Long id, java.lang.String receiver, java.lang.String smstext)
This method starts sending an SMS.void
setAttributeValue(java.lang.String mdName, java.lang.String attName, java.lang.Object value)
This method sets the value of the field in the given form.void
setDateForScheduledEndDate(int year, int month, int day, int hour, int minute, int second)
Set absolute scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
.void
setFormDataProvider(com.proxemo.todo4.ui.forms.base.FormDataProvider mepa)
This method returns the MetaDataPanelvoid
setFormValue(java.lang.String formName, java.lang.String attributeName, java.lang.Object v)
This method sets the value of a form widgetvoid
setFromMailAddress(java.lang.String from)
Set the from address for the outgoing email (differing from the default address taken from the email box which will send the email).void
setOwner(long userId)
Set the owner of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoUser
with the specified userId.void
setOwnerByUsername(java.lang.String userName)
Set the owner of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoUser
with the specified userName.void
setSecondsForScheduledEndDate(int seconds)
Add seconds to current time of the default Locale and set them as scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
.boolean
validEmailList(java.lang.String email)
Checks whether the email is a single or comma separated list of valid email-addressesvoid
warningMessage(java.lang.String message)
Shows a warning.com.proxemo.todo4.ui.YesNoDialog
yesNoMessage(java.lang.String message)
Shows a question and a yes and a no button.
-
-
-
Field Detail
-
ERROR_MESSAGE
public static final int ERROR_MESSAGE
- See Also:
- Constant Field Values
-
INFORMATION_MESSAGE
public static final int INFORMATION_MESSAGE
- See Also:
- Constant Field Values
-
WARNING_MESSAGE
public static final int WARNING_MESSAGE
- See Also:
- Constant Field Values
-
SUCCESS
public static final java.lang.String SUCCESS
- See Also:
- Constant Field Values
-
FAILURE
public static final java.lang.String FAILURE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ToDoScriptingHelper
public ToDoScriptingHelper(ToDoTask task, java.util.List<ToDoAttachment> attachments, com.proxemo.todo4.ui.forms.base.FormDataProvider mepa) throws java.io.IOException
- Throws:
java.io.IOException
-
ToDoScriptingHelper
public ToDoScriptingHelper(ToDoTask task, java.util.List<ToDoAttachment> attachments) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getFormPanel
public com.proxemo.todo4.ui.forms.base.FormDataProvider getFormPanel()
This method returns the MetaDataPanel- Returns:
- the corresponding MetaDataPanel
-
setFormDataProvider
public void setFormDataProvider(com.proxemo.todo4.ui.forms.base.FormDataProvider mepa)
This method returns the MetaDataPanel
-
getWidget
public java.lang.Object getWidget(ToDoForm form, java.lang.String name)
This method returns the field widget of a form.- Parameters:
form
- the form which contains the widgetname
- the name of the field- Returns:
- the widget corresponding to the form field or null if no field with that name is found
-
notifyAll
public void notifyAll(java.lang.String title, java.lang.String message, java.lang.String topic)
This method notifies all user of this instance of todo4teams that are subscribed to webpush messages- Parameters:
title
- the title of this messagemessage
- the body of this messagetopic
- the tag of the message
-
notifyWorkGroup
public void notifyWorkGroup(java.lang.Long workgroupId, java.lang.String title, java.lang.String message, java.lang.String topic)
This method notifies all user of this workgroup that are subscribed to webpush messages- Parameters:
workgroupId
- the Id of the workgrouptitle
- the title of this messagemessage
- the body of this messagetopic
- the tag of the message
-
notifyUser
public void notifyUser(java.lang.Long userId, java.lang.String title, java.lang.String message, java.lang.String topic)
This method notifies the user if he is subscribed to webpush messages- Parameters:
userId
- the Id of the usertitle
- the title of this messagemessage
- the body of this messagetopic
- the tag of the message
-
notifyUserTicket
public void notifyUserTicket(java.lang.Long userId, java.lang.String title, java.lang.String message, java.lang.String topic, java.lang.Long ticketId)
Notify user with id UserId and offer a deep link to ticket 'ticketId':- Parameters:
userId
-title
-message
-topic
-ticketId
-
-
notifyWorkgroupTicket
public void notifyWorkgroupTicket(java.lang.Long workgroupId, java.lang.String title, java.lang.String message, java.lang.String topic, java.lang.Long ticketId)
Notify all members of workgroup with id workgroupId and offer a deep link to ticket 'ticketId':- Parameters:
workgroupId
-title
-message
-topic
-ticketId
-
-
copyFormValue
public void copyFormValue(java.lang.String sourceFormName, java.lang.String sourceAttributeName, java.lang.String targetFormName, java.lang.String targetAttributeName)
This method copies the value from one field in the source form to another field in the target form- Parameters:
sourceFormName
- the name of the source formsourceAttributeName
- the name of the field in the source formtargetFormName
- the name of the target formtargetAttributeName
- the name of the field in the target form
-
getSelectedTableValue
public java.lang.Object getSelectedTableValue(java.lang.String formName, java.lang.String attributeName)
This method returns the selected row of a table as an array of strings- Parameters:
formName
- the name formattributeName
- the name of the field in the form- Returns:
- the array of strings representing the selected row or null if no row is selected
-
getFormValue
public java.lang.Object getFormValue(java.lang.String formName, java.lang.String attributeName)
This method returns the value of a form field- Parameters:
formName
- the name formattributeName
- the name of the field in the form- Returns:
- the value of the field as an object. The actual type depends on the field type.
-
setFormValue
public void setFormValue(java.lang.String formName, java.lang.String attributeName, java.lang.Object v)
This method sets the value of a form widget- Parameters:
formName
- the name formattributeName
- the name of the field in the formv
- the value to be set to the form field
-
focusComponent
public void focusComponent(java.lang.String formName, java.lang.String attributeName)
This method tries to focus the widget corresponding to the form field- Parameters:
formName
- the name formattributeName
- the name of the field corresponding to widget
-
activateForm
public void activateForm(java.lang.String formName)
This method attaches the form to the current task.- Parameters:
formName
- the name form
-
getServerPropertyByName
public java.lang.String getServerPropertyByName(java.lang.String name) throws java.lang.Exception
Retrieve a server property string by its name. See the list of server properties when logged in as 'admin' in the client.- Parameters:
name
- the name of the property- Returns:
- the property value
- Throws:
java.lang.Exception
- if name is null or property is not found
-
validEmailList
public boolean validEmailList(java.lang.String email)
Checks whether the email is a single or comma separated list of valid email-addresses- Parameters:
email
- single or comma separated list of email-addresses- Returns:
- boolean indicating a valid or invalid email address
-
createTask
public long createTask(int addressedGroupId, java.lang.String title, java.lang.String description, int minutes, int ownerId, java.util.Map<java.lang.Long,java.util.Map<java.lang.String,java.lang.Object>> forms, java.util.List<ToDoAttachment> attachments) throws java.lang.Exception
This method allows the creation of a task via scripting. Use this method with care !- Parameters:
addressedGroupId
- the id of the group the new task is addressed totitle
- the title of the newly created taskdescription
- the description of the newly created taskminutes
- the scheduled end times in minutesownerId
- the id of the owner of the newly created taskforms
- the forms of the newly created taskattachments
- the attachments of the newly created task. The semantics is as follows: The forms with the ids of the outer map are loaded. The fields in this form are preset with the name/value pairs of the corresponding map.- Throws:
java.lang.Exception
- if the addressedGroupId or the ownerId are non-existent or inactive
-
createTask
public long createTask(int addressedGroupId, java.lang.String title, java.lang.String description, int minutes, int prio, int ownerId, java.util.Map<java.lang.Long,java.util.Map<java.lang.String,java.lang.Object>> forms, java.util.List<ToDoAttachment> attachments) throws java.lang.Exception
- Throws:
java.lang.Exception
-
addAttachmentsToTask
public ToDoTask addAttachmentsToTask(ToDoTask task, java.util.List<ToDoAttachment> attachments)
-
createTask
public long createTask(int addressedGroupId, java.lang.String title, java.lang.String description, int minutes, int prio, int ownerId, java.util.Map<java.lang.Long,java.util.Map<java.lang.String,java.lang.Object>> forms, java.util.List<ToDoAttachment> attachments, java.util.Map<java.lang.String,java.lang.String> properties) throws java.lang.Exception
This method allows the creation of a task via scripting. Use this method with care !- Parameters:
addressedGroupId
- the id of the group the new task is addressed totitle
- the title of the newly created taskdescription
- the description of the newly created taskminutes
- the scheduled end times in minutesprio
- the priorityownerId
- the id of the owner of the newly created taskforms
- the forms of the newly created taskattachments
- the attachments of the newly created task. The semantics is as follows: The forms with the ids of the outer map are loaded. The fields in this form are preset with the name/value pairs of the corresponding map.properties
- a map of task properties- Throws:
java.lang.Exception
- if the addressedGroupId or the ownerId are non-existent or inactive
-
createTask
public long createTask(int addressedGroupId, java.lang.String title, java.lang.String description, int minutes, int ownerId, java.util.Map<java.lang.Long,java.util.Map<java.lang.String,java.lang.Object>> forms, java.util.List<ToDoAttachment> attachments, java.util.Map<java.lang.String,java.lang.String> properties) throws java.lang.Exception
- Throws:
java.lang.Exception
-
addMetaData
public ToDoForm addMetaData(long metaDataId) throws java.lang.Exception
Add a form (MetaData object) to the current task.- Parameters:
metaDataId
- Id of the form to be added- Returns:
- the form object
- Throws:
java.lang.Exception
- if no form with corresponding to the metaDataId is found
-
setFromMailAddress
public void setFromMailAddress(java.lang.String from)
Set the from address for the outgoing email (differing from the default address taken from the email box which will send the email). Please check if Your email server accepts the from-address set here! Email addresses with foreign domain names will probably rejected by your smtp server or will be rejected as spam by the receiving server.- Parameters:
from
- the from address of the outgoing email
-
addValueForField
public void addValueForField(ToDoForm md, java.lang.String name, java.lang.Object value) throws java.lang.Exception
Set the value of the attribute with the specified name into the form. This method modifies the form and not its gui representation.- Parameters:
md
- the formname
- the name of the attributevalue
- the value to set- Throws:
java.lang.Exception
- if the MetaData are null, the name of attribute is null or no attribute with name is found
-
addMetaDataByName
public ToDoForm addMetaDataByName(java.lang.String metaDataName) throws java.lang.Exception
Add a form (MetaData object) to the current task.- Parameters:
metaDataName
- name of the form to be added- Returns:
- the form object
- Throws:
java.lang.Exception
- if no meta data found with metaDataName
-
getMetaDataFromTaskByName
public ToDoForm getMetaDataFromTaskByName(java.lang.String metaDataName)
Retrieves a form with the name metaDataName of the current task.- Parameters:
metaDataName
- name of the form to searched- Returns:
- the form object or null if no form with metaDataName found
-
routeToGroup
public void routeToGroup(long groupId) throws java.lang.Exception
Set the addressee of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoWorkGroup
with the specified groupId.- Parameters:
groupId
- the Id of thecom.proxemo.todo.bom.ToDoWorkGroup
thecom.proxemo.todo.bom.ToDoTask
should be addressed to- Throws:
java.lang.Exception
- if nocom.proxemo.todo.bom.ToDoWorkGroup
with groupId is found
-
routeToGroupByName
public void routeToGroupByName(java.lang.String groupName) throws java.lang.Exception
Set the addressee of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoWorkGroup
with the specified groupName.- Parameters:
groupName
- the name of thecom.proxemo.todo.bom.ToDoWorkGroup
thecom.proxemo.todo.bom.ToDoTask
should be addressed to- Throws:
java.lang.Exception
- if nocom.proxemo.todo.bom.ToDoWorkGroup
with groupName is found. In this case thecom.proxemo.todo.bom.ToDoTask
is set to statecom.proxemo.todo.bom.ToDoTask#STATE_REJECTED
-
routeToUser
public void routeToUser(long userId) throws java.lang.Exception
Set the addressee of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoUser
with the specified userId.- Parameters:
userId
- the id of thecom.proxemo.todo.bom.ToDoUser
thecom.proxemo.todo.bom.ToDoTask
should be addressed to- Throws:
java.lang.Exception
- if nocom.proxemo.todo.bom.ToDoUser
with userId is found. In this case thecom.proxemo.todo.bom.ToDoTask
is set to statecom.proxemo.todo.bom.ToDoTask#STATE_REJECTED
-
routeToUserByName
public void routeToUserByName(java.lang.String userName) throws java.lang.Exception
Set the addressee of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoUser
with the specified userName.- Parameters:
userName
- the name of thecom.proxemo.todo.bom.ToDoUser
thecom.proxemo.todo.bom.ToDoTask
should be addressed to- Throws:
java.lang.Exception
- if nocom.proxemo.todo.bom.ToDoUser
with userName is found. In this case thecom.proxemo.todo.bom.ToDoTask
is set to statecom.proxemo.todo.bom.ToDoTask#STATE_REJECTED
-
setOwner
public void setOwner(long userId) throws java.lang.Exception
Set the owner of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoUser
with the specified userId.- Parameters:
userId
- the id of thecom.proxemo.todo.bom.ToDoUser
who should own thecom.proxemo.todo.bom.ToDoTask
- Throws:
java.lang.Exception
- if nocom.proxemo.todo.bom.ToDoUser
with userId is found
-
setOwnerByUsername
public void setOwnerByUsername(java.lang.String userName) throws java.lang.Exception
Set the owner of the currentcom.proxemo.todo.bom.ToDoTask
to thecom.proxemo.todo.bom.ToDoUser
with the specified userName.- Parameters:
userName
- the name of thecom.proxemo.todo.bom.ToDoUser
who should own thecom.proxemo.todo.bom.ToDoTask
- Throws:
java.lang.Exception
- if nocom.proxemo.todo.bom.ToDoUser
with userName is found
-
addSecondsToScheduledEndDate
public void addSecondsToScheduledEndDate(int seconds)
Add seconds to the scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
- Parameters:
seconds
- to be added
-
addMinutesToScheduledEndDate
public void addMinutesToScheduledEndDate(int minutes)
Add minutes to the scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
- Parameters:
minutes
- to be added
-
addHoursToScheduledEndDate
public void addHoursToScheduledEndDate(int hours)
Add hours to the scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
- Parameters:
hours
- to be added
-
addDaysToScheduledEndDate
public void addDaysToScheduledEndDate(int days)
Add days to the scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
- Parameters:
days
- to be added
-
setSecondsForScheduledEndDate
public void setSecondsForScheduledEndDate(int seconds)
Add seconds to current time of the default Locale and set them as scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
.- Parameters:
seconds
- to be added
-
setDateForScheduledEndDate
public void setDateForScheduledEndDate(int year, int month, int day, int hour, int minute, int second)
Set absolute scheduled end date of the currentcom.proxemo.todo.bom.ToDoTask
.- Parameters:
year
- with four digitsmonth
- to be set (from 0=january to 11=december)day
- of month (from 1 to 28..31)hour
- of day as used for 24-hour clockminute
- of hoursecond
- of minute
-
getTaskMetaData
public ToDoForm[] getTaskMetaData()
Returns a deep copied array of all current available forms (com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
).- Returns:
- array of
com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
-
getUser
public ToDoUser[] getUser()
Returns a deep copied array of all current availablecom.proxemo.todo.bom.ToDoUser
.- Returns:
- array of
com.proxemo.todo.bom.ToDoUser
-
getWorkGroups
public ToDoWorkGroup[] getWorkGroups()
Returns a deep copied array of all current availablecom.proxemo.todo.bom.ToDoWorkGroup
.- Returns:
- array of
com.proxemo.todo.bom.ToDoWorkGroup
-
removeAllAttachments
public void removeAllAttachments()
Removes allcom.proxemo.todo.bom.ToDoAttachmentProxy
from the currentcom.proxemo.todo.bom.ToDoTask
.
-
getAttachments
public ToDoAttachment[] getAttachments()
Returns a deep copied array of all current available available forms (com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
) of the currentcom.proxemo.todo.bom.ToDoTask
.- Returns:
- array of
com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
-
removeAttachment
public void removeAttachment(java.lang.String attachmentName)
Removes thecom.proxemo.todo.bom.ToDoAttachmentProxy
as specified by attachmentName from the currentcom.proxemo.todo.bom.ToDoTask
. If no correspondingcom.proxemo.todo.bom.ToDoAttachmentProxy
is found, the request is ignored.- Parameters:
attachmentName
- name of thecom.proxemo.todo.bom.ToDoAttachmentProxy
to be removed
-
getObjectByName
public java.lang.Object getObjectByName(java.lang.String className) throws java.lang.Exception
Dynamically load Class as specified by className. If no Class corresponding to className is found - null is returned.- Parameters:
className
- name of the Class to be loaded- Returns:
- instance of newly created Class
- Throws:
java.lang.Exception
-
extractByRegExp
public java.lang.Object extractByRegExp(java.lang.String input, java.lang.String regExp, boolean multiMatch)
Extracts the first (multiMatch=false) or all (multiMatch=true) multipletts of capturing groups from the input according to the regular expression regExp.- Parameters:
input
- the string to be searched for the regular expressionregExp
- the regular expression describing the search conditionmultiMatch
- boolean that determines whether the first (multiMatch=false) or all (multiMatch=true) multipletts are returned- Returns:
- either an array of strings (multiMatch=false) or an array of an array of strings (multiMatch=true)
-
bytesToString
public java.lang.String bytesToString(byte[] bytes, java.lang.String charSetName) throws java.io.UnsupportedEncodingException
Converts the bytes to a string of character set charSetName.- Parameters:
bytes
- the raw bytes to be convertedcharSetName
- the name of the character set to be used (e.g. "UTF-8"). If charSetName is null, UTF-8 is used.- Returns:
- the newly created string
- Throws:
java.io.UnsupportedEncodingException
- if bytes can not be encoded in charSetName
-
getPdfFormFields
public ToDoPDFFormField[] getPdfFormFields(ToDoAttachment pdfAttachment) throws java.io.IOException
Parses the PDF-Form pdfAttachment and returns an array of allToDoPDFFormField
and its containing values.- Parameters:
pdfAttachment
- the ToDoAttachment to be parsed- Returns:
- array of
ToDoPDFFormField
- Throws:
java.io.IOException
- if pdfAttachment is null etc.
-
createFormFromPdfAttachment
public ToDoForm createFormFromPdfAttachment(ToDoAttachment pdfAttachment, java.lang.String formName) throws java.io.IOException
FieldCachedMao(); Creates a new form from a given PDF-Attachment.- Parameters:
pdfAttachment
- thecom.proxemo.todo.bom.ToDoAttachment
to be parsedformName
- the name of the new form- Returns:
- the new created form
- Throws:
java.io.IOException
- if pdfAttachment is null etc.
-
createFormFromFile
public static ToDoForm createFormFromFile(java.util.Collection<ToDoPDFFormField> ff, java.lang.String fileName, ToDoForm theForm) throws java.io.FileNotFoundException, java.io.IOException
Fills a form (com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
) from a the PDF-File.- Parameters:
fileName
- name of the PDF-FiletheForm
- the form to be enrichedff
- collection of ToDoPDFFormField to be filled- Returns:
- the filled form
- Throws:
java.io.IOException
- if file io somehow failedjava.io.FileNotFoundException
- if file corresponding to fileName could not be found
-
extractTextFromPDF
public static java.lang.String extractTextFromPDF(byte[] pdf) throws java.io.IOException
- Throws:
java.io.IOException
-
addLabelFromPDF
public static void addLabelFromPDF(byte[] pdf, ToDoForm md) throws java.io.IOException
- Throws:
java.io.IOException
-
extractFormFields
public static ToDoForm extractFormFields(java.util.Collection<ToDoPDFFormField> ff, ToDoForm theForm, java.io.ByteArrayInputStream bais, int xGrid, int yGrid, int offsetX, int offsetY, java.lang.StringBuffer mappingFunction) throws java.io.IOException
- Throws:
java.io.IOException
-
errorMessage
public void errorMessage(java.lang.String message)
Shows an error message.- Parameters:
message
- the error text to be shown
-
warningMessage
public void warningMessage(java.lang.String message)
Shows a warning.- Parameters:
message
- the warning text to be shown
-
infoMessage
public void infoMessage(java.lang.String message)
Shows an info message.- Parameters:
message
- the info text to be shown
-
message
public void message(java.lang.String message, java.lang.String title, VaadinIcon icon)
-
yesNoMessage
public com.proxemo.todo4.ui.YesNoDialog yesNoMessage(java.lang.String message)
Shows a question and a yes and a no button.- Parameters:
message
- the text to be displayed- Returns:
- 0 for yes-button pressed and 1 for no-button pressed.
-
executionWasSuccessfull
public static boolean executionWasSuccessfull(java.lang.String result)
Convenience function to test whether the result string equals "success".- Parameters:
result
- the string to be checked- Returns:
- true for successful execution - otherwise false
-
getCsvDataCache
public com.proxemo.xutl.csv.CsvDataCache getCsvDataCache(java.lang.String cacheName)
Lookup up of a data cache. A use case e.g. is the lookup of phone numbers, email addresses etc. of VIPs. A precondition is the initializing of the data cache viacreateCsvDataCacheFromString(String cacheName, String csvData)
orcreateCsvDataCacheFromUrl(String cacheName, String url, int expiryInterval)
- Parameters:
cacheName
- the name by which the cache can be accessed.- Returns:
- the data cache in a comma-separated-value-formatted format.
-
createCsvDataCacheFromString
public void createCsvDataCacheFromString(java.lang.String cacheName, java.lang.String csvData) throws java.io.IOException
Creates a data cache from a comma-separated-value-formatted String. This is necessary to access later on the created cache with the provided name. A use case e.g. is the lookup of phone numbers, email addresses etc. of VIPs.- Parameters:
cacheName
- the name by which the cache can be accessed later on.csvData
- the comma-separated-value-formatted String providing the data.- Throws:
java.io.IOException
- if the csvData are null etc.
-
createCsvDataCacheFromUrl
public void createCsvDataCacheFromUrl(java.lang.String cacheName, java.lang.String url, int expiryInterval) throws java.net.MalformedURLException, java.io.IOException
Creates a data cache from an URL pointing to a comma-separated-value-formatted File. This is necessary to access later on the created cache with the provided name. A use case e.g. is the lookup of phone numbers, email addresses etc. of VIPs.- Parameters:
cacheName
- the name by which the cache can be accessed later on.url
- where a CSV-File can be found.expiryInterval
- the interval in seconds indicating the refresh interval after which the file is reloaded- Throws:
java.io.IOException
- if an IO-error occurredjava.net.MalformedURLException
- if the url is malformed
-
getScheduledEndDateByServiceTimes
public java.util.Date getScheduledEndDateByServiceTimes(int minutes, int startHourWeekdays, int startMinuteWeekdays, int endHourWeekdays, int endMinuteWeekdays, int startHourSaturdays, int startMinuteSaturdays, int endHourSaturdays, int endMinuteSaturdays, int startHourSundays, int startMinuteSundays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the current timestamp and the effective service times given by the parameters. This method helps to avoid to create tickets with scheduled end times that can not be satisfied due to night break, weekend etc.- Parameters:
minutes
- the offset of the scheduled end timestartHourWeekdays
- start of service time hour from Mo-DostartMinuteWeekdays
- start of service time minute from Mo-DoendHourWeekdays
- end of service time hour from Mo-DoendMinuteWeekdays
- end of service time minute from Mo-DostartHourSaturdays
- start of service time hour on SastartMinuteSaturdays
- start of service time minute on SaendHourSaturdays
- end of service time hour on SaendMinuteSaturdays
- end of service time minute on SastartHourSundays
- start of service time hour on SustartMinuteSundays
- start of service time minute on SuendHourSundays
- end of service time hour on SuendMinuteSundays
- end of service time minute on Su- Returns:
- the effective scheduled end time
-
getScheduledEndDateByServiceTimes2
public java.util.Date getScheduledEndDateByServiceTimes2(java.util.Date nowDate, int minutes, int startHourWeekdays, int startMinuteWeekdays, int endHourWeekdays, int endMinuteWeekdays, int startHourSaturdays, int startMinuteSaturdays, int endHourSaturdays, int endMinuteSaturdays, int startHourSundays, int startMinuteSundays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the timestamp nowDate and the effective service times given by the parameters. This method helps to avoid to create tickets with scheduled end times that can not be satisfied due to night break, weekend etc.- Parameters:
nowDate
- the reference date for the calculation of the scheduled end timeminutes
- the offset of the scheduled end timestartHourWeekdays
- start of service time hour from Mo-DostartMinuteWeekdays
- start of service time minute from Mo-DoendHourWeekdays
- end of service time hour from Mo-DoendMinuteWeekdays
- end of service time minute from Mo-DostartHourSaturdays
- start of service time hour on SastartMinuteSaturdays
- start of service time minute on SaendHourSaturdays
- end of service time hour on SaendMinuteSaturdays
- end of service time minute on SastartHourSundays
- start of service time hour on SustartMinuteSundays
- start of service time minute on SuendHourSundays
- end of service time hour on SuendMinuteSundays
- end of service time minute on Su- Returns:
- the effective scheduled end time
-
getScheduledEndDateByServiceTimes3
public java.util.Date getScheduledEndDateByServiceTimes3(java.util.Date nowDate, int minutes, int startHourWeekdays, int startMinuteWeekdays, int endHourWeekdays, int endMinuteWeekdays, int startHourFridays, int startMinuteFridays, int endHourFridays, int endMinuteFridays, int startHourSaturdays, int startMinuteSaturdays, int endHourSaturdays, int endMinuteSaturdays, int startHourSundays, int startMinuteSundays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the timestamp nowDate and the effective service times given by the parameters. This method helps to avoid to create tickets with scheduled end times that can not be satisfied due to night break, weekend etc.- Parameters:
nowDate
- the reference date for the calculation of the scheduled end timeminutes
- the offset of the scheduled end timestartHourWeekdays
- start of service time hour from Mo-DostartMinuteWeekdays
- start of service time minute from Mo-DoendHourWeekdays
- end of service time hour from Mo-DoendMinuteWeekdays
- end of service time minute from Mo-DostartHourFridays
- start of service time hour on FristartMinuteFridays
- start of service time minute on FriendHourFridays
- end of service time hour on FriendMinuteFridays
- end of service time minute on FristartHourSaturdays
- start of service time hour on SastartMinuteSaturdays
- start of service time minute on SaendHourSaturdays
- end of service time hour on SaendMinuteSaturdays
- end of service time minute on SastartHourSundays
- start of service time hour on SustartMinuteSundays
- start of service time minute on SuendHourSundays
- end of service time hour on SuendMinuteSundays
- end of service time minute on Su- Returns:
- the effective scheduled end time
-
getScheduledEndDateByServiceTimes4
public java.util.Date getScheduledEndDateByServiceTimes4(int minutes, int startHourWeekdays, int startMinuteWeekdays, int endHourWeekdays, int endMinuteWeekdays, int startHourFridays, int startMinuteFridays, int endHourFridays, int endMinuteFridays, int startHourSaturdays, int startMinuteSaturdays, int endHourSaturdays, int endMinuteSaturdays, int startHourSundays, int startMinuteSundays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the current timestamp and the effective service times given by the parameters. This method helps to avoid to create tickets with scheduled end times that can not be satisfied due to night break, weekend etc.- Parameters:
minutes
- the offset of the scheduled end timestartHourWeekdays
- start of service time hour from Mo-DostartMinuteWeekdays
- start of service time minute from Mo-DoendHourWeekdays
- end of service time hour from Mo-DoendMinuteWeekdays
- end of service time minute from Mo-DostartHourFridays
- start of service time hour on FristartMinuteFridays
- start of service time minute on FriendHourFridays
- end of service time hour on FriendMinuteFridays
- end of service time minute on FristartHourSaturdays
- start of service time hour on SastartMinuteSaturdays
- start of service time minute on SaendHourSaturdays
- end of service time hour on SaendMinuteSaturdays
- end of service time minute on SastartHourSundays
- start of service time hour on SustartMinuteSundays
- start of service time minute on SuendHourSundays
- end of service time hour on SuendMinuteSundays
- end of service time minute on Su- Returns:
- the effective scheduled end time
-
getScheduledEndDay
public java.util.Date getScheduledEndDay(int workingdays, boolean weekday, boolean friday, boolean saturday, boolean sunday, int endHourWeekdays, int endMinuteWeekdays, int endHourFridays, int endMinuteFridays, int endHourSaturdays, int endMinuteSaturdays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the current timestamp and the effective service times given by the parameters. This method helps to avoid to create tickets with scheduled end times that can not be satisfied due to night break, weekend etc. This method is to be used for service times for more than one working day- Parameters:
workingdays
- number of working days to be taken into accountweekday
- Mon-Do to be taken into accountfriday
- Friday to be taken into accountsaturday
- Saturday to be taken into accountsunday
- Sunday to be taken into accountendHourWeekdays
- end of service time hour from Mon-DoendMinuteWeekdays
- end of service time minute from Mon-DoendHourFridays
- end of service time hour on FriendMinuteFridays
- end of service time minute on FriendHourSaturdays
- end of service time hour on SatendMinuteSaturdays
- end of service time minute on SatendHourSundays
- end of service time hour on Sun.endMinuteSundays
- end of service time minute on Su- Returns:
- the effective scheduled end time
-
getScheduledEndDay
public java.util.Date getScheduledEndDay(java.util.Date nowDate, int workingdays, boolean weekday, boolean friday, boolean saturday, boolean sunday, int endHourWeekdays, int endMinuteWeekdays, int endHourFridays, int endMinuteFridays, int endHourSaturdays, int endMinuteSaturdays, int endHourSundays, int endMinuteSundays)
Calculates the scheduled end time of a ticket taking into account the current timestamp given by the parameter nowDate and the effective service times given by the parameters. This method helps to avoid to create tickets with scheduled end times that can not be satisfied due to night break, weekend etc. This method is to be used for service times for more than one working day- Parameters:
workingdays
- number of working days to be taken into accountweekday
- Mon-Do to be taken into accountfriday
- Friday to be taken into accountsaturday
- Saturday to be taken into accountsunday
- Sunday to be taken into accountendHourWeekdays
- end of service time hour from Mon-DoendMinuteWeekdays
- end of service time minute from Mon-DoendHourFridays
- end of service time hour on FriendMinuteFridays
- end of service time minute on FriendHourSaturdays
- end of service time hour on SatendMinuteSaturdays
- end of service time minute on SatendHourSundays
- end of service time hour on Sun.endMinuteSundays
- end of service time minute on Su- Returns:
- the effective scheduled end time
-
getMailBoxByEmailAddress
public ToDoMailbox getMailBoxByEmailAddress(java.lang.String emailAddress) throws java.lang.Exception
This method searches for an active todo4teams mailbox matches the given email address.- Parameters:
emailAddress
- the email address to be searched for- Returns:
- the found todo4teams mailbox
- Throws:
java.lang.Exception
- if no active todo4teams-mailbox with this email address is found
-
getMailBoxByEmailId
public ToDoMailbox getMailBoxByEmailId(long emailId) throws java.lang.Exception
This method searches for an active todo4teams mailbox matches the given email address.- Parameters:
emailId
- the id of the mailbox to be searched for- Returns:
- the found todo4teams mailbox
- Throws:
java.lang.Exception
- if no active todo4teams-mailbox with this email address is found
-
getSecuredAttachments
public java.util.Set<ToDoAttachmentProxy> getSecuredAttachments(java.lang.String comment)
This method searches for dangerous zips containing executables in the attachments of the current task.- Parameters:
comment
- for the task description if an attachment is removed- Returns:
- the cleaned attachment list containing only attachments that are not suspicious
-
sendmail
public void sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, boolean withAttachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email address.- Parameters:
emailAddress
- the mail address of the mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent towithAttachments
- specifies whether the task attachments should be attached to the emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, boolean withAttachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email address.- Parameters:
emailId
- the id of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent towithAttachments
- specifies whether the task attachments should be attached to the emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email address.- Parameters:
emailAddress
- the email address of the mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent totext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given id.- Parameters:
emailId
- the id of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent totext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, boolean isHTMLEMail) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email address.- Parameters:
emailAddress
- the email address of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailisHTMLEMail
- specifies whether the email should be sent as an HTML emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, boolean isHTMLEMail) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given id.- Parameters:
emailId
- the id of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailisHTMLEMail
- specifies whether the email should be sent as an HTML emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, boolean isHTMLEMail) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email address.- Parameters:
emailAddress
- the email address of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailisHTMLEMail
- specifies whether the email should be sent as an HTML emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, boolean isHTMLEMail) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given id.- Parameters:
emailId
- the id of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailisHTMLEMail
- specifies whether the email should be sent as an HTML emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, boolean withAttachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email address.- Parameters:
emailAddress
- the email address of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailfrom
- sets the from address (depends on the mail server !)isHTMLEMail
- specifies whether the email should be sent as an HTML emailwithAttachments
- specifies whether the task attachments should be attached to the emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, boolean withAttachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given id.- Parameters:
emailId
- the id of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailfrom
- sets the from address (depends on the mail server !)isHTMLEMail
- specifies whether the email should be sent as an HTML emailwithAttachments
- specifies whether the task attachments should be attached to the emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, java.util.Collection<java.lang.String> attachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email address.- Parameters:
emailAddress
- the email address of the mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailfrom
- sets the from address (depends on the mail server !)isHTMLEMail
- specifies whether the email should be sent as an HTML emailattachments
- array of urls to attachmentstext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, java.util.Collection<java.lang.String> attachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email id.- Parameters:
emailId
- the id of the active mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailfrom
- sets the from address (depends on the mail server !)isHTMLEMail
- specifies whether the email should be sent as an HTML emailattachments
- array of urls to attachmentstext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, boolean isHTMLEMail, boolean withAttachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email address.- Parameters:
emailAddress
- the email address of the mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailisHTMLEMail
- specifies whether the email should be sent as an HTML emailwithAttachments
- specifies whether the task attachments should be attached to the emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(long emailId, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, boolean isHTMLEMail, boolean withAttachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox matching the given email id.- Parameters:
emailId
- the id of the mailbox to be searched forsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailisHTMLEMail
- specifies whether the email should be sent as an HTML emailwithAttachments
- specifies whether the task attachments should be attached to the emailtext
- the body text of the email- Throws:
java.lang.Exception
- if no active mailbox is found
-
sendmail
public void sendmail(java.lang.String emailAddress, java.lang.String subject, java.lang.String text, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String replyTo, java.lang.String from, boolean isHTMLEMail, java.util.Set<ToDoMailAttachment> mailAttachments) throws java.lang.Exception
This method sends an email via an active todo4teams mailbox.- Parameters:
mailbox
- the mailbox to be usedsubject
- the subject of the emailto
- the email address the email is sent tocc
- carbon copy of the emailbcc
- blind carbon copy of the emailreplyTo
- the preferred reply address of the emailfrom
- sets the from address (depends on the mail server !)isHTMLEMail
- specifies whether the email should be sent as an HTML emailmailAttachments
- specifies the attachments that should be attached to the mailtext
- the body text of the email- Throws:
java.lang.Exception
-
propagateTaskToGroup
public void propagateTaskToGroup(java.lang.String groupName) throws java.lang.Exception
This method is a simulation of the creation of a follow up task in the finish action of the server.- Parameters:
groupName
- the name of the group the task should be propagated to- Throws:
java.lang.Exception
- if no active group with the groupName can be found
-
propagateTaskToGroupById
public void propagateTaskToGroupById(java.lang.Long groupId) throws java.lang.Exception
This method is a simulation of the creation of a follow up task in the finish action of the server.- Parameters:
groupId
- the id of the group the task should be propagated to- Throws:
java.lang.Exception
- if no active group with the groupName can be found
-
propagateTaskToUser
public void propagateTaskToUser(java.lang.String userName) throws java.lang.Exception
This method is a simulation of the creation of a follow up task in the finish action of the server.- Parameters:
userName
- the name of the user the task should be propagated to- Throws:
java.lang.Exception
- if no active user with the userName can be found
-
propagateTaskToUserById
public void propagateTaskToUserById(java.lang.Long userId) throws java.lang.Exception
This method is a simulation of the creation of a follow up task in the finish action of the server.- Parameters:
userId
- the id of the user the task should be propagated to- Throws:
java.lang.Exception
- if no active user with the userName can be found
-
getClonedTask
public ToDoTask getClonedTask()
-
plainTextToHtml
public static java.lang.String plainTextToHtml(java.lang.String text)
This method converts the HTML-text to plain text. All HTML Tags are stripped.- Parameters:
text
- the HTML text to be converted- Returns:
- the plain text
-
getAllForms
public java.util.Map<java.lang.Long,ToDoForm> getAllForms()
This method returns all forms in the current context.- Returns:
- map of form id to
com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
entries.
-
readUrlToString
public java.lang.String readUrlToString(java.lang.String url, int connectTimeoutMs, int readTimeoutMs) throws java.io.IOException
This method open a connection to the url, reads the input and returns the result as a string.- Parameters:
url
- the URL to be openedconnectTimeoutMs
- the connect timeout of the connection in millisecondsreadTimeoutMs
- the read timeout of the connection in milliseconds- Returns:
- the content of the url
- Throws:
java.io.IOException
- on read or connect timeout
-
close
public void close()
This method updates the metacontent attribute of the task in the current context. For internal use only.
-
sendSMS
public void sendSMS(java.lang.Long id, java.lang.String receiver, java.lang.String smstext) throws java.lang.Exception
This method starts sending an SMS.- Parameters:
login
- the username of the service loginpassword
- the password of the service loginreceiver
- the phone number the SMS is send tosmstext
- the text of the SMSorigin
- the sending phone number- Throws:
java.lang.Exception
-
addJarFromFile
public void addJarFromFile(java.lang.String path) throws java.net.MalformedURLException
This method dynamically load a jar file at runtime.- Parameters:
path
- file path to the jar file. Only specify the path. The URL is build internally.- Throws:
java.net.MalformedURLException
- if path is malformed
-
addJarFromUrl
public void addJarFromUrl(java.lang.String url) throws java.net.MalformedURLException
This method dynamically load a jar file at runtime.- Parameters:
url
- URL to the the jar file.- Throws:
java.net.MalformedURLException
- if url is malformed
-
loadClass
public void loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
This method dynamically loads a class at runtime.- Parameters:
className
- name of the class to be loaded- Throws:
java.lang.ClassNotFoundException
- if the class could not be found
-
getAttributeValue
public java.lang.Object getAttributeValue(java.lang.String mdName, java.lang.String attName)
This method returns the value of the field in the given form.- Parameters:
mdName
- name of the formattName
- name of the field- Returns:
- the value of the field in the given form
-
setAttributeValue
public void setAttributeValue(java.lang.String mdName, java.lang.String attName, java.lang.Object value)
This method sets the value of the field in the given form.- Parameters:
mdName
- name of the formattName
- name of the fieldvalue
- value of the field
-
navigateToAddress
public void navigateToAddress(java.lang.String address)
This method starts the navigation on GPS capable devices.- Parameters:
address
- the address to be used
-
getStreet
public java.lang.String getStreet()
Returns the current street on GPS capable devices.- Returns:
- current street
-
getStreetNo
public java.lang.String getStreetNo()
Returns the current street no on GPS capable devices.- Returns:
- current street no
-
getZip
public java.lang.String getZip()
Returns the current zip on GPS capable devices.- Returns:
- current zip
-
getCity
public java.lang.String getCity()
Returns the current city on GPS capable devices.- Returns:
- current city
-
getAdminArea
public java.lang.String getAdminArea()
Returns the current admin area on GPS capable devices.- Returns:
- current admin area
-
getSubAdminArea
public java.lang.String getSubAdminArea()
Returns the current sub admin area on GPS capable devices.- Returns:
- current sub admin area
-
insertOnTop
public java.lang.String insertOnTop(java.lang.String text, java.lang.String inserttext)
Inserts the inserttext on top of text. Works for plain text and html.- Parameters:
text
- the base textinserttext
- the text to be added on top of text- Returns:
- the new created text
-
isWeekend
public boolean isWeekend(java.util.Date givenDate)
Checks whether the given date is on saturday or sunday- Parameters:
givenDate
- the Date to be checked- Returns:
- boolean indicating whether the day is on saturday or sunday
-
isHoliday
public boolean isHoliday(java.util.Date givenDate)
Checks whether the given date is on fixed holiday or can be calculated by the gaussian formula So the detected holidays are: New Year's Day, Good Friday, Easter Sunday, Easter Monday, May Day, Ascension Day, Whit Sunday, Whit Monday, Christmas Eve, Christmas Days and New Year's Eve.- Parameters:
givenDate
- the Date to be checked- Returns:
- boolean indicating whether the day is a detected holiday
-
getFormAsPDF
public byte[] getFormAsPDF(java.lang.String pageSize, boolean portrait, int fontsize, ToDoForm md, float gridwidth, float gridheight, float cellwidth, float cellheight) throws java.lang.Exception
Creates an array of objects type classname and size.- Parameters:
pageSize
- A0,A1,A2,A3,A4portrait
- true if portrait orientation of page, false is landscapefontsize
- the size of used the fontmd
- theToDoForm
gridwidth
- the cell width of the gridgridheight
- the cell height of the grid- Returns:
- the newly created PDf as a byte array
- Throws:
java.lang.Exception
- on form generation errors
-
getWebPage
public java.lang.String getWebPage(java.lang.String url)
Downloads html page to a given url and returns it as a String- Parameters:
url
- the URL to be downloaded- Returns:
- the webpage containing the whole html of the webpage identified by url
-
getStackAsString
public java.lang.String getStackAsString(java.lang.Throwable t)
Creates a string representation of a javaThrowable
- Parameters:
t
- theThrowable
to be parsed- Returns:
- the message and stack of the
Throwable
-
createArray
public java.lang.Object createArray(java.lang.String classname, int size) throws java.lang.Exception
Creates an array of objects type classname and size.- Parameters:
classname
- the canonical name of the Classsize
- the length of the array to be created- Returns:
- the newly created array
- Throws:
java.lang.ClassNotFoundException
- if classname does not correspond to a classjava.lang.NegativeArraySizeException
- if the size of the array is negativejava.lang.Exception
-
createInstance
public java.lang.Object createInstance(java.lang.String className) throws java.lang.Exception
- Throws:
java.lang.Exception
-
generateEvent
public VEvent generateEvent(int year, int month, int day, int hour, int minute, int durationMinutes, java.lang.String summary, java.lang.String description, java.lang.String organizerEmail, java.lang.String organizerName, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> attendees, java.lang.String uid)
This method creates a calendar event, that can be send as an invitation via the method sendInvitation.- Parameters:
year
- year of the eventmonth
- month of the eventday
- day of the eventhour
- hour of the eventminute
- minute of the eventdurationMinutes
- the duration of the event in minutessummary
- a short summary of the eventdescription
- a description of the eventorganizerEmail
- the email address of the organizerorganizerName
- the name of the organizerlocation
- the location of the eventattendees
- a map with the names of the attendees as keys and the email address as a value
-
sendInvitation
public void sendInvitation(VEvent event, java.lang.String subject, java.lang.String eventComment, java.lang.String to, long mailboxId) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getHeuristicOriginMail
public ToDoOutgoingMail getHeuristicOriginMail()
This method was created to treat task, that were created by a "bounced" email. It analyzes the description of the current task and tries to find a second "To:"-tag. Afterward it tries to read the last email send in the last 24h from todo4teams with this to-address.- Returns:
- the originator email by which this "bounced" email was created
-
resendMail
public void resendMail(java.lang.Long mailId, java.lang.String subject, java.lang.String to, java.lang.String cc, java.lang.String bcc)
This method creates a copy of an outgoing email specified by mailId attachment. An event attachment is a file in ical format (ics). It is e.g. used by outlook to send invitations etc.- Parameters:
mailId
- Id of outgoing mail to be send againsubject
- New subject of mailto
- New to address of mailcc
- New cc address of mailbcc
- New bcc address of mail
-
getEventAttachmentProxyAsText
public java.lang.String getEventAttachmentProxyAsText(java.lang.String summary, java.lang.String description, java.lang.String organizer, java.lang.String attendee, java.lang.String location, java.lang.String dateString, ToDoAttachmentProxy ap)
This method creates a textual representation of the given event attachment. An event attachment is a file in ical format (ics). It is e.g. used by outlook to send invitations etc.- Parameters:
summary
- prefix of the summarydescription
- prefix of the descriptionorganizer
- prefix of the organizerattendee
- prefix of the attendeelocation
- prefix of the locationdateString
- prefix of the dateStringap
- the attachment proxy to be parsed- Returns:
- the textual representation of the event
-
getEventAttachmentAsText
public java.lang.String getEventAttachmentAsText(java.lang.String summary, java.lang.String description, java.lang.String organizator, java.lang.String attendee, java.lang.String location, java.lang.String dateString, ToDoAttachment at) throws java.io.UnsupportedEncodingException, java.io.IOException, ParserException
This method creates a textual representation of the given event attachment. An event attachment is a file in ical format (ics). It is e.g. used by outlook to send invitations etc.- Parameters:
summary
- prefix of the summarydescription
- prefix of the descriptionorganizer
- prefix of the organizerattendee
- prefix of the attendeelocation
- prefix of the locationdateString
- prefix of the dateStringat
- the attachment to be parsed- Returns:
- the textual representation of the event
- Throws:
java.io.UnsupportedEncodingException
java.io.IOException
ParserException
-
createMailAttachmentsFromTask
public java.util.Set<ToDoMailAttachment> createMailAttachmentsFromTask()
-
createMailAttachmentsFromToDoAttachmentProxies
public java.util.Set<ToDoMailAttachment> createMailAttachmentsFromToDoAttachmentProxies(ToDoOutgoingMail mail)
-
getAttachmentLength
public int getAttachmentLength(ToDoAttachmentProxy ap)
Query the attachment length for the corresponding attachment- Parameters:
ap
- thecom.proxemo.todo.bom.ToDoAttachmentProxy
- Returns:
- -1 if an error occurred or the
com.proxemo.todo.bom.ToDoAttachment
could not be found
-
finishTask
public boolean finishTask(long taskId, long userId, java.lang.String doneComment) throws java.lang.Exception
Close another task identified by taskId parameter.- Parameters:
taskId
- id of the task to closeuserId
- user to set as the assigneedoneComment
-- Returns:
- true if the task could by closed successfuly
- Throws:
java.lang.Exception
-
insertPDFPreviews
public void insertPDFPreviews(int numPagesPerPdfMax)
Generate a PDF-Preview. If used in an E-Mail-REceive-Handler-Script, this method inserts a preview of an attached PDF or TIFF-file into the description of a ticket. Thus the agent can control the contents of the attachment without the need of opening the attachment.- Parameters:
numPagesPerPdfMax
- the number of pages that should be converted
-
getDefaultCustomDB
public java.sql.Connection getDefaultCustomDB()
Returns a JDBC Connection to the default database. The database is created if it does not exist yet.- Returns:
- a JDBC connection or null in case of an internal error
-
createFormFromByteArray
public static ToDoForm createFormFromByteArray(java.util.Collection<ToDoPDFFormField> formFields, byte[] rawDocument, java.lang.String fileName, ToDoForm theForm, int xGrid, int yGrid, int xOffset, int yOffset, java.lang.StringBuffer mappingFunction) throws java.lang.Exception
Fills a form (com.proxemo.ToDoForm.bom.ToDoTaskSuperMetaData
) from a the PDF-File.- Parameters:
formFields
- empty Collection of form fieldsfileName
- name of the PDF-FiletheForm
- the form to be enrichedrawDocument
- the PDF-Document as a byte blockxGrid
- virtual grid columns for the formyGrid
- virtual grid rows of the formxOffset
- correction factor, normally 0yOffset
- correction factor, normally 0mappingFunction
- the mapping function to parse the PDF-form in a mailbox-script- Returns:
- the filled form
- Throws:
java.lang.Exception
-
getCustomDB
public java.sql.Connection getCustomDB(java.lang.String name)
Returns a JDBC Connection to a database specified by the parameter name. The database is created if it does not exist yet.- Parameters:
name
- the name of the database- Returns:
- a JDBC connection or null in case of an internal error
-
getPdfFormFieldsNew
public ToDoPDFFormField[] getPdfFormFieldsNew(ToDoAttachment pdfAttachment) throws java.lang.Exception
Parses the PDF-Form pdfAttachment and returns an array of allToDoPDFFormField
and its containing values. This method is superior and more robust than {@link ToDoScriptingHelper#getPdfFormFields(ToDoAttachment).- Parameters:
pdfAttachment
-- Returns:
- array of
ToDoPDFFormField
- Throws:
java.lang.Exception
-
getComponentStore
public com.proxemo.todo4.server.objectstore.ToDoObjectStore getComponentStore()
Returns the current ToDoComponentStore representing the database- Returns:
- current instance of
com.proxemo.todo4.server.objectstore.ToDoObjectStore.server.ToDoComponentStore
-
query
public java.util.List<ToDoTask> query(int maxCounts, int timeout, java.lang.String keyword, java.lang.Integer state, java.lang.Integer prio, java.lang.Long id, java.lang.Long assigneeId, java.lang.Long ownerId, java.util.Date fromDate, java.util.Date toDate, java.util.Date fromDateStart, java.util.Date toDateStart, java.util.Date fromDateEnd, java.util.Date toDateEnd, java.util.List<java.lang.String> lon, java.util.List<java.lang.String> lov, java.lang.String formName) throws java.io.IOException
This method executes an archive query on the server. The query result is returned. the query strategy is to search for a the name value pairs in the given form. All tasks are searched that contain all fields containing the matching values.- Parameters:
maxCounts
- maximum number of hits allowedtimeout
- query timeout in millisecondskeyword
- in title, description or attachment of a taskstate
- the state of the taskprio
- the prio of the taskid
- the id of the taskassigneeId
- id of the author, that means the user who finished the taskownerId
- id of the ownerfromDate
- interval start of the task creation datetoDate
- interval end of the task creation datefromDateStart
- interval start of the task start date, that means the timestamp when the task was lockedtoDateStart
- interval end of the task start datefromDateEnd
- interval start of the task end date, that means the timestamp when the task was finishedtoDateEnd
- interval end of the task end datelon
- list of names describing the list of fields to be searched forlov
- list of values describing the values that have to be matchedformName
- name of the form- Returns:
- the query result
- Throws:
several
- exceptions are thrown on timeouts, connection problems etc.java.io.IOException
-
queryMetaData
public java.util.List<ToDoTask> queryMetaData(int maxCounts, int timeout, java.util.List<java.lang.String> lon, java.util.List<java.lang.String> lov, java.lang.String formName) throws java.io.IOException
This method executes a query concerning forms on the server. The query result is returned. the query strategy is to search for a the name value pairs in the given form. All tasks are searched that contain all fields containing the matching values.- Parameters:
maxCounts
- maximum number of hits allowedtimeout
- the timeout in millisecondslon
- list of names describing the list of fields to be searched forlov
- list of values describing the values that have to be matchedformName
- name of the form- Returns:
- the query result default
- Throws:
several
- exceptions are thrown on timeouts, connection problems etc.java.io.IOException
-
getInstanceForClass
public java.lang.Object getInstanceForClass(java.lang.String className)
This method creates an instance of a class specified by the name.- Parameters:
name
- name of the class for which an instance should be constructed with the default constructor- Returns:
- the constructed object - null if something went wrong
-
getInstanceForClass
public java.lang.Object getInstanceForClass(java.lang.String className, java.lang.Object[] args, java.lang.Class<?>... parameterTypes)
This method creates an instance of a class specified by the name.- Parameters:
name
- name of the class for which an instance should be constructed with the constructor with args arguments- Returns:
- the constructed object - null if something went wrong
-
callStaticMethodForClass
public java.lang.Object callStaticMethodForClass(java.lang.String className, java.lang.String methodName)
This method calls a static method for of a class.- Parameters:
className
- name of the class for which the method should be calledmethodName
- name of the method which should be called- Returns:
- the result of the method
-
getWorkgroupById
public ToDoWorkGroup getWorkgroupById(long id)
-
getWorkgroupByName
public ToDoWorkGroup getWorkgroupByName(java.lang.String name)
-
getUserById
public ToDoUser getUserById(long id)
-
getUserByUserName
public ToDoUser getUserByUserName(java.lang.String username)
-
getMailboxById
public ToDoMailbox getMailboxById(long id)
-
getMailboxByEmail
public ToDoMailbox getMailboxByEmail(java.lang.String email)
-
getFormById
public ToDoForm getFormById(long id)
-
getFormByName
public ToDoForm getFormByName(java.lang.String name)
-
-