DEMPIERE-1113 Make standard processes more extensible by plugin

This commit is contained in:
Heng Sin Low 2013-06-27 00:47:31 +08:00
parent fd6b6051ae
commit fd19a9058b
1 changed files with 33 additions and 33 deletions

View File

@ -53,31 +53,31 @@ import org.compiere.util.EMailAuthenticator;
*/ */
public class RequestEMailProcessor extends SvrProcess public class RequestEMailProcessor extends SvrProcess
{ {
private String p_IMAPHost = null; protected String p_IMAPHost = null;
private String p_IMAPUser = null; protected String p_IMAPUser = null;
private String p_IMAPPwd = null; protected String p_IMAPPwd = null;
private String p_RequestFolder = null; protected String p_RequestFolder = null;
private String p_InboxFolder = null; protected String p_InboxFolder = null;
private String p_ErrorFolder = null; protected String p_ErrorFolder = null;
private int C_BPartner_ID = 0; protected int C_BPartner_ID = 0;
private int AD_User_ID = 0; protected int AD_User_ID = 0;
private int AD_Role_ID = 0; protected int AD_Role_ID = 0;
private int SalesRep_ID = 0; protected int SalesRep_ID = 0;
private int R_RequestType_ID = 0; protected int R_RequestType_ID = 0;
private String p_DefaultPriority = null; protected String p_DefaultPriority = null;
private String p_DefaultConfidentiality = null; protected String p_DefaultConfidentiality = null;
private int noProcessed = 0; protected int noProcessed = 0;
private int noRequest = 0; protected int noRequest = 0;
private int noError = 0; protected int noError = 0;
/** Session */ /** Session */
private Session m_session = null; protected Session m_session = null;
/** Store */ /** Store */
private Store m_store = null; protected Store m_store = null;
/** Process Error */ /** Process Error */
private static final int ERROR = 0; protected static final int ERROR = 0;
/** Process Request */ /** Process Request */
private static final int REQUEST = 1; protected static final int REQUEST = 1;
/** Process Workflow */ /** Process Workflow */
// private static final int WORKFLOW = 2; // private static final int WORKFLOW = 2;
/** Process Delivery Confirm */ /** Process Delivery Confirm */
@ -171,7 +171,7 @@ public class RequestEMailProcessor extends SvrProcess
* @return Session * @return Session
* @throws Exception * @throws Exception
*/ */
private Session getSession() throws Exception protected Session getSession() throws Exception
{ {
if (m_session != null) if (m_session != null)
return m_session; return m_session;
@ -196,7 +196,7 @@ public class RequestEMailProcessor extends SvrProcess
* @return Store * @return Store
* @throws Exception * @throws Exception
*/ */
private Store getStore() throws Exception protected Store getStore() throws Exception
{ {
if (m_store != null) if (m_store != null)
return m_store; return m_store;
@ -217,7 +217,7 @@ public class RequestEMailProcessor extends SvrProcess
* @return number of processed * @return number of processed
* @throws Exception * @throws Exception
*/ */
private void processInBox() throws Exception protected void processInBox() throws Exception
{ {
// Folder // Folder
Folder folder; Folder folder;
@ -331,7 +331,7 @@ public class RequestEMailProcessor extends SvrProcess
* @return Type of Message * @return Type of Message
* @throws MessagingException * @throws MessagingException
*/ */
private boolean createRequest(Message msg) throws MessagingException, SQLException { protected boolean createRequest(Message msg) throws MessagingException, SQLException {
// Assign from variable // Assign from variable
Address[] from = msg.getFrom(); Address[] from = msg.getFrom();
String fromAddress; String fromAddress;
@ -563,7 +563,7 @@ public class RequestEMailProcessor extends SvrProcess
} }
} }
private boolean updateRequest(int request_upd, Message msg) throws MessagingException, SQLException { protected boolean updateRequest(int request_upd, Message msg) throws MessagingException, SQLException {
MRequest requp = new MRequest(getCtx(), request_upd, get_TrxName()); MRequest requp = new MRequest(getCtx(), request_upd, get_TrxName());
// Body as result // Body as result
Address[] from = msg.getFrom(); Address[] from = msg.getFrom();
@ -578,7 +578,7 @@ public class RequestEMailProcessor extends SvrProcess
* @return Type of Message * @return Type of Message
* @throws Exception * @throws Exception
*/ */
private int processMessage (Message msg) throws Exception protected int processMessage (Message msg) throws Exception
{ {
dumpEnvelope (msg); dumpEnvelope (msg);
dumpBody (msg); dumpBody (msg);
@ -617,7 +617,7 @@ public class RequestEMailProcessor extends SvrProcess
* @param msg message * @param msg message
* @return subject or "" * @return subject or ""
*/ */
private String getSubject (Message msg) protected String getSubject (Message msg)
{ {
try try
{ {
@ -637,7 +637,7 @@ public class RequestEMailProcessor extends SvrProcess
* @param msg Message * @param msg Message
* @return message or "" * @return message or ""
*/ */
private String getMessage (Part msg) protected String getMessage (Part msg)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
try try
@ -722,7 +722,7 @@ public class RequestEMailProcessor extends SvrProcess
* @param msg message * @param msg message
* @return delivery info or null * @return delivery info or null
*/ */
private String getDeliveryReport (Part msg) protected String getDeliveryReport (Part msg)
{ {
try try
{ {
@ -767,7 +767,7 @@ public class RequestEMailProcessor extends SvrProcess
* @return info or null * @return info or null
* @throws Exception * @throws Exception
*/ */
private String getDeliveredReportDetail (Part part) throws Exception protected String getDeliveredReportDetail (Part part) throws Exception
{ {
Object content = part.getContent(); Object content = part.getContent();
if (content == null) if (content == null)
@ -820,7 +820,7 @@ public class RequestEMailProcessor extends SvrProcess
* @param m message * @param m message
* @throws Exception * @throws Exception
*/ */
private void dumpEnvelope(Message m) throws Exception protected void dumpEnvelope(Message m) throws Exception
{ {
printOut("-----------------------------------------------------------------"); printOut("-----------------------------------------------------------------");
Address[] a; Address[] a;
@ -938,7 +938,7 @@ public class RequestEMailProcessor extends SvrProcess
* @param p * @param p
* @throws Exception * @throws Exception
*/ */
private void dumpBody (Part p) throws Exception protected void dumpBody (Part p) throws Exception
{ {
// http://www.iana.org/assignments/media-types/ // http://www.iana.org/assignments/media-types/
printOut("================================================================="); printOut("=================================================================");
@ -1015,7 +1015,7 @@ public class RequestEMailProcessor extends SvrProcess
* Print * Print
* @param s string * @param s string
*/ */
private void printOut(String s) protected void printOut(String s)
{ {
// System.out.print(indentStr.substring(0, level * 2)); // System.out.print(indentStr.substring(0, level * 2));
// System.out.println(s); // System.out.println(s);