|
Oracle Ultra Search APIs 9.0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.context.isearch.query.MailTool
This class implements the Ultra Search Java Email API.
It defines all constants and methods for accessing email source data.
An email source represents all emails sent to a specific email address or it's aliases. The most popular use of an email source is to represent all emails sent to a mailing list.
The methods implemented by this API can be classified as follows:
These methods return email data such as the list of existing email sources in the Ultra Search instance, information about a particular email source, the number of messages in an email source and the header fields of a message.
The methods that fall under this class are as follows:
Methods that return HTML code or are related to the presentation of HTML code
These methods perform the following tasks:
The methods that fall under this class are as follows:
Ultra Search database session methods
These methods are related to the jdbc database session. They include setting the username, password and session language.
The methods that fall under this class are as follows:
Utility methods
These methods exist as convenience method for the client web application developer. They encapsulate commonly performed tasks.
The methods that fall under this class are as follows:
Field Summary | |
static int |
DATE A constant that is used to retrieve the 'Date' header field information from the string array returned by the getEmailHeader method. |
static int |
FROM A constant that is used to retrieve the 'From' header field information from the string array returned by the getEmailHeader method. |
static int |
SEQ_NUM A constant that is used to retrieve the email sequence number from the string array returned by the getEmailHeader method. |
static int |
SUBJECT A constant that is used to retrieve the 'Subject' header field information from the string array returned by the getEmailHeader method. |
Constructor Summary | |
MailTool() Default constructor |
Method Summary | |
java.lang.String |
createLink(int emailSourceId) A utility method that creates a link that when clicked on, will render a page showing emails belonging to an email source. |
java.lang.String |
createLink(int emailSourceId, int messageId) A utility method that creates a link that when clicked on, will render a page showing the contents of an email. |
java.lang.String |
createLink(int emailSourceId, int messageId, int attachId) A utility method that creates a link that when clicked on, will render a page showing the contents of an email attachment of a specific email. |
java.lang.String[] |
getEmailHeader(int emailSourceId, int messageId) Gets the header information of an email. |
java.util.Vector |
getEmailHeaders(int emailSourceId, int startIndex, int endIndex) Gets the header information of an email. |
Item |
getEmailSource(int emailSourceId) Get one email source |
Item[] |
getEmailSources() Gets a list of email sources that are defined in the Oracle Ultra Search instance. |
java.lang.String |
getMailPagePath() Gets the URL path of the web application (JSP or Servlet) that will render the contents of an email. |
int |
getMessageCount(int emailSourceId) Gets the number of messages in an email source. |
javax.mail.internet.MimeMessage |
getMimeMessage(int emailSourceId, int messageId) Gets an email message as a javax.mail.internet.MimeMessage object. |
java.lang.String |
getResourceFileName() Gets the name of the .properties file that contains the database resource settings. |
java.lang.String |
getSchema() |
java.lang.String |
getSessionLang() Gets the session language for the database SQL session. |
java.lang.String |
getUser() Gets the database username of the Ultra Search instance that should be accessed. |
java.lang.String |
htmlEncode(java.lang.String str) Convenience method for converting certain characters into HTML encoding. |
void |
setMailPagePath(java.lang.String s) Sets the URL path of the web application (JSP or Servlet) that will render the contents of an email. |
void |
setPassword(java.lang.String s) Sets the database username password of the Ultra Search instance that should be accessed. |
void |
setResourceFileName(java.lang.String s) Sets the name of the .properties file that contains the database resource settings. |
void |
setSessionLang(java.lang.String str) Sets the session language for database SQL session. |
void |
setUser(java.lang.String s) Sets the database username of the Ultra Search instance that should be accessed. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FROM
public static final int SUBJECT
public static final int DATE
public static final int SEQ_NUM
Constructor Detail |
public MailTool()
Method Detail |
public void setMailPagePath(java.lang.String s)
s
- a portion of a URL string representing the mail rendering application.public java.lang.String getMailPagePath()
public void setResourceFileName(java.lang.String s) throws java.sql.SQLException
s
- the database resource filenamepublic java.lang.String getResourceFileName()
public void setUser(java.lang.String s)
s
- This must be an Oracle database username.public java.lang.String getUser()
public void setPassword(java.lang.String s)
s
- This must be the password of an Oracle database user.public void setSessionLang(java.lang.String str)
The session language determines how Oracle Text choose a lexer to interpret the query string.
The session language is a string that the Oracle Server understands. This list can be found in the Oracle National Language Support Guide. The languages returned by the getLanguages method are not exactly the same as those needed by the Oracle Server. Do not use the languages returned by the getLanguages method.
str
- Theh Oracle Server compatible language string.public java.lang.String getSessionLang()
public java.lang.String createLink(int emailSourceId)
This method uses the URL defined by the setMailPagePath method. Therefore, setMailPagePath must be correctly called first.
emailSourceId
- The ID of the email source.public java.lang.String createLink(int emailSourceId, int messageId)
This method uses the URL defined by the setMailPagePath method. Therefore, setMailPagePath must be correctly called first.
emailSourceId
- The ID of the email source.messageId
- The ID of the message within the email source.public java.lang.String createLink(int emailSourceId, int messageId, int attachId)
This method uses the URL defined by the setMailPagePath method. Therefore, setMailPagePath must be correctly called first.
emailSourceId
- The ID of the email source.messageId
- The ID of the message within the email source.attachId
- The ID of the attachment to the specified email.public java.lang.String htmlEncode(java.lang.String str)
This method analyzes the input string and performs the following conversions:
str
- The input string to convert.public int getMessageCount(int emailSourceId) throws java.sql.SQLException
emailSourceId
- The number id of the email source.public Item getEmailSource(int emailSourceId) throws java.sql.SQLException
Returns an Item object whose ID is the email source ID, name is the email address of the email source and description is the description of the email source.
For example:
ID is 5
name is "all_users@company.com"
description is "email source for All Users"
emailSourceId
- public java.lang.String getSchema() throws java.sql.SQLException
public Item[] getEmailSources() throws java.sql.SQLException
public java.lang.String[] getEmailHeader(int emailSourceId, int messageId) throws java.sql.SQLException
Returns an array of Strings where the
1st element is the FROM header field of the email.
2nd element is the SUBJECT header field of the email.
3rd element is the DATE header field of the email.
The client web application may use the following constants to access the string array values instead of using index numbers:
emailSourceId
- The ID of the email source.messageId
- The ID of the message within the email source.public java.util.Vector getEmailHeaders(int emailSourceId, int startIndex, int endIndex) throws java.sql.SQLException
Returns a Vector of arraies of Strings where the
1st element is the FROM header field of the email.
2nd element is the SUBJECT header field of the email.
3rd element is the DATE header field of the email.
4th element is the SEQ_NUM of the email.
The client web application may use the following constants to access the string array values instead of using index numbers:
emailSourceId
- The ID of the email source.startIndex
- The index of the first email header returned.endIndex
- The index of the last email header returned.public javax.mail.internet.MimeMessage getMimeMessage(int emailSourceId, int messageId) throws java.sql.SQLException, java.io.IOException, javax.mail.MessagingException
The email message comes from the email archive directory which is directly accessible by the database server machine (which may not be the same machine as the application server).
emailSourceId
- The ID of the email source.messageId
- The ID of the message within the email source.
|
Oracle Ultra Search APIs 9.0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |