Package org.compiere.model
Class MRequest
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_R_Request
org.compiere.model.MRequest
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_Persistent
,I_R_Request
,Evaluatee
Request Model
- Version:
- $Id: MRequest.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
Fields inherited from class org.compiere.model.X_R_Request
CONFIDENTIALTYPE_AD_Reference_ID, CONFIDENTIALTYPE_Internal, CONFIDENTIALTYPE_PartnerConfidential, CONFIDENTIALTYPE_PrivateInformation, CONFIDENTIALTYPE_PublicInformation, CONFIDENTIALTYPEENTRY_AD_Reference_ID, CONFIDENTIALTYPEENTRY_Internal, CONFIDENTIALTYPEENTRY_PartnerConfidential, CONFIDENTIALTYPEENTRY_PrivateInformation, CONFIDENTIALTYPEENTRY_PublicInformation, DUETYPE_AD_Reference_ID, DUETYPE_Due, DUETYPE_Overdue, DUETYPE_Scheduled, NEXTACTION_AD_Reference_ID, NEXTACTION_FollowUp, NEXTACTION_None, PRIORITY_AD_Reference_ID, PRIORITY_High, PRIORITY_Low, PRIORITY_Medium, PRIORITY_Minor, PRIORITY_Urgent, PRIORITYUSER_AD_Reference_ID, PRIORITYUSER_High, PRIORITYUSER_Low, PRIORITYUSER_Medium, PRIORITYUSER_Minor, PRIORITYUSER_Urgent, TASKSTATUS_0NotStarted, TASKSTATUS_100Complete, TASKSTATUS_20Started, TASKSTATUS_40Busy, TASKSTATUS_60GoodProgress, TASKSTATUS_80NearlyDone, TASKSTATUS_90Finishing, TASKSTATUS_95AlmostDone, TASKSTATUS_99CleaningUp, TASKSTATUS_AD_Reference_ID
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
Fields inherited from interface org.compiere.model.I_R_Request
accessLevel, COLUMNNAME_A_Asset_ID, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_Role_ID, COLUMNNAME_AD_Table_ID, COLUMNNAME_AD_User_ID, COLUMNNAME_C_Activity_ID, COLUMNNAME_C_BPartner_ID, COLUMNNAME_C_Campaign_ID, COLUMNNAME_C_Invoice_ID, COLUMNNAME_C_InvoiceRequest_ID, COLUMNNAME_C_Order_ID, COLUMNNAME_C_Payment_ID, COLUMNNAME_C_Project_ID, COLUMNNAME_CloseDate, COLUMNNAME_ConfidentialType, COLUMNNAME_ConfidentialTypeEntry, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_DateCompletePlan, COLUMNNAME_DateLastAction, COLUMNNAME_DateLastAlert, COLUMNNAME_DateNextAction, COLUMNNAME_DateStartPlan, COLUMNNAME_DocumentNo, COLUMNNAME_DueType, COLUMNNAME_EndTime, COLUMNNAME_IsActive, COLUMNNAME_IsEscalated, COLUMNNAME_IsInvoiced, COLUMNNAME_IsSelfService, COLUMNNAME_LastResult, COLUMNNAME_M_ChangeRequest_ID, COLUMNNAME_M_FixChangeNotice_ID, COLUMNNAME_M_InOut_ID, COLUMNNAME_M_Product_ID, COLUMNNAME_M_ProductSpent_ID, COLUMNNAME_M_RMA_ID, COLUMNNAME_NextAction, COLUMNNAME_Priority, COLUMNNAME_PriorityUser, COLUMNNAME_Processed, COLUMNNAME_QtyInvoiced, COLUMNNAME_QtyPlan, COLUMNNAME_QtySpent, COLUMNNAME_R_Category_ID, COLUMNNAME_R_Group_ID, COLUMNNAME_R_MailText_ID, COLUMNNAME_R_Request_ID, COLUMNNAME_R_Request_UU, COLUMNNAME_R_RequestRelated_ID, COLUMNNAME_R_RequestType_ID, COLUMNNAME_R_Resolution_ID, COLUMNNAME_R_StandardResponse_ID, COLUMNNAME_R_Status_ID, COLUMNNAME_Record_ID, COLUMNNAME_Record_UU, COLUMNNAME_RequestAmt, COLUMNNAME_Result, COLUMNNAME_SalesRep_ID, COLUMNNAME_StartDate, COLUMNNAME_StartTime, COLUMNNAME_Summary, COLUMNNAME_TaskStatus, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMRequest
(Properties ctx, int SalesRep_ID, int R_RequestType_ID, String Summary, boolean isSelfService, String trxName) SelfService ConstructorMRequest
(Properties ctx, int R_Request_ID, String trxName) ConstructorMRequest
(Properties ctx, int R_Request_ID, String trxName, String... virtualColumns) MRequest
(Properties ctx, String R_Request_UU, String trxName) UUID based ConstructorMRequest
(Properties ctx, ResultSet rs, String trxName) Load Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToResult
(String Result) Add To Resultprotected boolean
afterSave
(boolean newRecord, boolean success) Called after Save for Post-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.protected boolean
beforeSave
(boolean newRecord) Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.Create PDFCreate PDF filevoid
doClose()
(Soft) Close request.void
doEscalate
(boolean user) Escalate requestGet Action HistoryGet BPartner (may be not defined)Get Request CategoryGet Request Category NameGet Confidential Type Entry NameGet Confidential Type NameGet Created By NameGet DueType NamegetGroup()
Get Request GroupGet Request Group NameGet Mail TagGet Priority NameGet Importance Namestatic int
getR_Request_ID
(String mailText) Get Request ID from mail textstatic int[]
getRequestCount
(int AD_Table_ID, int Record_ID, StringBuilder whereClause, String trxName) Deprecated.static int[]
getRequestCount
(int AD_Table_ID, int Record_ID, String Record_UU, StringBuilder whereClause, String trxName) Get number of active and inactive requestGet Request TypeGet Request Type NameGet Request ResolutionGet Request Resolution NameGet Sales RepGet Sales Rep NameGet StatusGet Request Status NamegetUpdates
(String confidentialType) Get Request Updates that should be visible for the given confidentialTypeGet Customer UpdatesGet Internal UpdatesGet Public UpdatesgetUser()
Get Contact (may be not defined)boolean
boolean
isDue()
Is dueboolean
Is Overdueboolean
Web Can Update Requeststatic void
newRequest
(GridTab tab, int AD_Table_ID, int Record_ID, int C_BPartner_ID) Deprecated.- usenewRequest(GridTab, int, int, String, int)
insteadstatic void
newRequest
(GridTab tab, int AD_Table_ID, int Record_ID, String Record_UU, int C_BPartner_ID) Create new requestvoid
setConfidentialTypeEntry
(String ConfidentialTypeEntry) Set Confidential Type Entry.
Validate new ConfidentialTypeEntry against current ConfidentialTypeEntry value.void
Set Date Last Alert to todayvoid
Set DueType (DUETYPE_*) based on Date Next Actionvoid
setIsChanged
(boolean changed) Set changed flagvoid
Find and Set Default Request Type.void
Find and Set Default Request Status.void
setSalesRep_ID
(int SalesRep_ID) Set SalesRep_IDtoString()
String Representationboolean
Web Update of resultMethods inherited from class org.compiere.model.X_R_Request
get_AccessLevel, getA_Asset, getA_Asset_ID, getAD_Role, getAD_Role_ID, getAD_Table, getAD_Table_ID, getAD_User, getAD_User_ID, getC_Activity, getC_Activity_ID, getC_BPartner, getC_BPartner_ID, getC_Campaign, getC_Campaign_ID, getC_Invoice, getC_Invoice_ID, getC_InvoiceRequest, getC_InvoiceRequest_ID, getC_Order, getC_Order_ID, getC_Payment, getC_Payment_ID, getC_Project, getC_Project_ID, getCloseDate, getConfidentialType, getConfidentialTypeEntry, getDateCompletePlan, getDateLastAction, getDateLastAlert, getDateNextAction, getDateStartPlan, getDocumentNo, getDueType, getEndTime, getKeyNamePair, getLastResult, getM_ChangeRequest, getM_ChangeRequest_ID, getM_FixChangeNotice, getM_FixChangeNotice_ID, getM_InOut, getM_InOut_ID, getM_Product, getM_Product_ID, getM_ProductSpent, getM_ProductSpent_ID, getM_RMA, getM_RMA_ID, getNextAction, getPriority, getPriorityUser, getQtyInvoiced, getQtyPlan, getQtySpent, getR_Category, getR_Category_ID, getR_Group, getR_Group_ID, getR_MailText, getR_MailText_ID, getR_Request_ID, getR_Request_UU, getR_RequestRelated, getR_RequestRelated_ID, getR_RequestType, getR_RequestType_ID, getR_Resolution, getR_Resolution_ID, getR_StandardResponse, getR_StandardResponse_ID, getR_Status, getR_Status_ID, getRecord_ID, getRecord_UU, getRequestAmt, getResult, getSalesRep_ID, getStartDate, getStartTime, getSummary, getTaskStatus, initPO, isEscalated, isInvoiced, isProcessed, isSelfService, setA_Asset_ID, setAD_Role_ID, setAD_Table_ID, setAD_User_ID, setC_Activity_ID, setC_BPartner_ID, setC_Campaign_ID, setC_Invoice_ID, setC_InvoiceRequest_ID, setC_Order_ID, setC_Payment_ID, setC_Project_ID, setCloseDate, setConfidentialType, setDateCompletePlan, setDateLastAction, setDateLastAlert, setDateNextAction, setDateStartPlan, setDocumentNo, setDueType, setEndTime, setIsEscalated, setIsInvoiced, setIsSelfService, setLastResult, setM_ChangeRequest_ID, setM_FixChangeNotice_ID, setM_InOut_ID, setM_Product_ID, setM_ProductSpent_ID, setM_RMA_ID, setNextAction, setPriority, setPriorityUser, setProcessed, setQtyInvoiced, setQtyPlan, setQtySpent, setR_Category_ID, setR_Group_ID, setR_MailText_ID, setR_Request_ID, setR_Request_UU, setR_RequestRelated_ID, setR_RequestType_ID, setR_Resolution_ID, setR_StandardResponse_ID, setR_Status_ID, setRecord_ID, setRecord_UU, setRequestAmt, setResult, setStartDate, setStartTime, setSummary, setTaskStatus
Methods inherited from class org.compiere.model.PO
afterDelete, beforeDelete, buildInsertSQL, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, toInsertSQL, unlock, update_Tree, validForeignKeys
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.compiere.model.I_Persistent
save
Methods inherited from interface org.compiere.model.I_R_Request
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
-
Field Details
-
SEPARATOR
Separator line- See Also:
-
-
Constructor Details
-
MRequest
UUID based Constructor- Parameters:
ctx
- ContextR_Request_UU
- UUID keytrxName
- Transaction
-
MRequest
Constructor- Parameters:
ctx
- contextR_Request_ID
- request or 0 for newtrxName
- transaction
-
MRequest
- Parameters:
ctx
-R_Request_ID
-trxName
-virtualColumns
-
-
MRequest
public MRequest(Properties ctx, int SalesRep_ID, int R_RequestType_ID, String Summary, boolean isSelfService, String trxName) SelfService Constructor- Parameters:
ctx
- contextSalesRep_ID
- SalesRepR_RequestType_ID
- request typeSummary
- summaryisSelfService
- self servicetrxName
- transaction
-
MRequest
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
-
Method Details
-
getR_Request_ID
Get Request ID from mail text- Parameters:
mailText
- mail text- Returns:
- R_Request_ID if mailText has request id tag ([Req#R_Request_ID#ID]), otherwise 0
-
setR_RequestType_ID
public void setR_RequestType_ID()Find and Set Default Request Type. -
setR_Status_ID
public void setR_Status_ID()Find and Set Default Request Status. -
addToResult
Add To Result- Parameters:
Result
- text to append
-
setDueType
public void setDueType()Set DueType (DUETYPE_*) based on Date Next Action -
getActions
Get Action History- Returns:
- array of MRequestAction
-
getUpdates
Get Request Updates that should be visible for the given confidentialType- Parameters:
confidentialType
- confidential type (CONFIDENTIALTYPEENTRY_*) or null for all- Returns:
- array of MRequestUpdate
-
getUpdatesPublic
Get Public Updates- Returns:
- public updates
-
getUpdatesCustomer
Get Customer Updates- Returns:
- customer updates
-
getUpdatesInternal
Get Internal Updates- Returns:
- internal updates
-
getRequestType
Get Request Type- Returns:
- Request Type
-
getRequestTypeName
Get Request Type Name- Returns:
- Request Type Name
-
getCategory
Get Request Category- Returns:
- MRequestCategory
-
getCategoryName
Get Request Category Name- Returns:
- Request Category Name
-
getGroup
Get Request Group- Returns:
- MGroup
-
getGroupName
Get Request Group Name- Returns:
- Request Group Name
-
getStatus
Get Status- Returns:
- MStatus
-
getStatusName
Get Request Status Name- Returns:
- Request Status Name
-
getResolution
Get Request Resolution- Returns:
- MResolution
-
getResolutionName
Get Request Resolution Name- Returns:
- Request Resolution Name
-
isOverdue
public boolean isOverdue()Is Overdue- Returns:
- true if overdue
-
isDue
public boolean isDue()Is due- Returns:
- true if due
-
getDueTypeText
Get DueType Name- Returns:
- DueType Name
-
getPriorityText
Get Priority Name- Returns:
- Priority Name
-
getPriorityUserText
Get Importance Name- Returns:
- Importance Name
-
getConfidentialText
Get Confidential Type Name- Returns:
- Confidential Type Name
-
getConfidentialEntryText
Get Confidential Type Entry Name- Returns:
- Confidential Type Entry Name
-
setDateLastAlert
public void setDateLastAlert()Set Date Last Alert to today -
getSalesRep
Get Sales Rep- Specified by:
getSalesRep
in interfaceI_R_Request
- Overrides:
getSalesRep
in classX_R_Request
- Returns:
- Sales Rep User
-
getSalesRepName
Get Sales Rep Name- Returns:
- Sales Rep Name
-
getCreatedByName
Get Created By Name- Returns:
- Created By Name
-
getUser
Get Contact (may be not defined)- Returns:
- Contact User or null
-
getBPartner
Get BPartner (may be not defined)- Returns:
- BPartner or null
-
isWebCanUpdate
public boolean isWebCanUpdate()Web Can Update Request- Returns:
- true if Web can update
-
setConfidentialTypeEntry
Set Confidential Type Entry.
Validate new ConfidentialTypeEntry against current ConfidentialTypeEntry value.- Specified by:
setConfidentialTypeEntry
in interfaceI_R_Request
- Overrides:
setConfidentialTypeEntry
in classX_R_Request
- Parameters:
ConfidentialTypeEntry
- confidentiality
-
webUpdate
Web Update of result- Parameters:
result
- result text- Returns:
- true if updated
-
toString
String Representation- Overrides:
toString
in classX_R_Request
- Returns:
- info
-
createPDF
Create PDF- Returns:
- not implemented, always return null
-
createPDF
Create PDF file- Parameters:
file
- output file- Returns:
- not implemented, always return null
-
beforeSave
protected boolean beforeSave(boolean newRecord) Description copied from class:PO
Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- true if it is a new record- Returns:
- true if record can be saved
-
setSalesRep_ID
public void setSalesRep_ID(int SalesRep_ID) Set SalesRep_ID- Specified by:
setSalesRep_ID
in interfaceI_R_Request
- Overrides:
setSalesRep_ID
in classX_R_Request
- Parameters:
SalesRep_ID
- id
-
afterSave
protected boolean afterSave(boolean newRecord, boolean success) Description copied from class:PO
Called after Save for Post-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it. -
getMailTag
Get Mail Tag- Returns:
- [Req#@{id}@#ID]
-
doClose
public void doClose()(Soft) Close request. Must be called after webUpdate. -
doEscalate
public void doEscalate(boolean user) Escalate request- Parameters:
user
- true if user escalated (PriorityUser), otherwise system (Priority)
-
isChanged
public boolean isChanged()- Returns:
- changed flag
-
setIsChanged
public void setIsChanged(boolean changed) Set changed flag- Parameters:
changed
-
-
getRequestCount
@Deprecated public static int[] getRequestCount(int AD_Table_ID, int Record_ID, StringBuilder whereClause, String trxName) Deprecated.- usegetRequestCount(int, int, String, StringBuilder, String)
insteadGet number of active and inactive request- Parameters:
AD_Table_ID
-Record_ID
-whereClause
-trxName
-- Returns:
- int[], [0] = inactive request count and [1] = active request count
-
getRequestCount
public static int[] getRequestCount(int AD_Table_ID, int Record_ID, String Record_UU, StringBuilder whereClause, String trxName) Get number of active and inactive request- Parameters:
AD_Table_ID
-Record_ID
- Record ID - used when Record_UU is null, and also to compare with User, BPartner, Order, Invoice, Payment, Project, Campaign and AssetRecord_UU
- Record UUIDwhereClause
-trxName
-- Returns:
- int[], [0] = inactive request count (Processed=Y) and [1] = active request count (Processed=N)
-
newRequest
@Deprecated public static void newRequest(GridTab tab, int AD_Table_ID, int Record_ID, int C_BPartner_ID) Deprecated.- usenewRequest(GridTab, int, int, String, int)
insteadCreate new request- Parameters:
tab
- Grid Tab for requestAD_Table_ID
-Record_ID
-C_BPartner_ID
-
-
newRequest
public static void newRequest(GridTab tab, int AD_Table_ID, int Record_ID, String Record_UU, int C_BPartner_ID) Create new request- Parameters:
tab
- Grid Tab for requestAD_Table_ID
-Record_ID
- Record ID - to fill Record_ID and also to fill with BPartner, User, Project, Asset, Order (also from OrderLine), Invoice, Product, Payment, InOut, RMA, RequestRelated (when from Request)Record_UU
- Record UUIDC_BPartner_ID
-
-
getRequestCount(int, int, String, StringBuilder, String)
instead