Class MRequest

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_Persistent, I_R_Request, Evaluatee

public class MRequest extends X_R_Request
Request Model
Version:
$Id: MRequest.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke
See Also:
  • Field Details

  • Constructor Details

    • MRequest

      public MRequest(Properties ctx, String R_Request_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      R_Request_UU - UUID key
      trxName - Transaction
    • MRequest

      public MRequest(Properties ctx, int R_Request_ID, String trxName)
      Constructor
      Parameters:
      ctx - context
      R_Request_ID - request or 0 for new
      trxName - transaction
    • MRequest

      public MRequest(Properties ctx, int R_Request_ID, String trxName, String... virtualColumns)
      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 - context
      SalesRep_ID - SalesRep
      R_RequestType_ID - request type
      Summary - summary
      isSelfService - self service
      trxName - transaction
    • MRequest

      public MRequest(Properties ctx, ResultSet rs, String trxName)
      Load Constructor
      Parameters:
      ctx - context
      rs - result set
      trxName - transaction
  • Method Details

    • getR_Request_ID

      public static int getR_Request_ID(String mailText)
      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

      public void addToResult(String Result)
      Add To Result
      Parameters:
      Result - text to append
    • setDueType

      public void setDueType()
      Set DueType (DUETYPE_*) based on Date Next Action
    • getActions

      public MRequestAction[] getActions()
      Get Action History
      Returns:
      array of MRequestAction
    • getUpdates

      public MRequestUpdate[] getUpdates(String confidentialType)
      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

      public MRequestUpdate[] getUpdatesPublic()
      Get Public Updates
      Returns:
      public updates
    • getUpdatesCustomer

      public MRequestUpdate[] getUpdatesCustomer()
      Get Customer Updates
      Returns:
      customer updates
    • getUpdatesInternal

      public MRequestUpdate[] getUpdatesInternal()
      Get Internal Updates
      Returns:
      internal updates
    • getRequestType

      public MRequestType getRequestType()
      Get Request Type
      Returns:
      Request Type
    • getRequestTypeName

      public String getRequestTypeName()
      Get Request Type Name
      Returns:
      Request Type Name
    • getCategory

      public MRequestCategory getCategory()
      Get Request Category
      Returns:
      MRequestCategory
    • getCategoryName

      public String getCategoryName()
      Get Request Category Name
      Returns:
      Request Category Name
    • getGroup

      public MGroup getGroup()
      Get Request Group
      Returns:
      MGroup
    • getGroupName

      public String getGroupName()
      Get Request Group Name
      Returns:
      Request Group Name
    • getStatus

      public MStatus getStatus()
      Get Status
      Returns:
      MStatus
    • getStatusName

      public String getStatusName()
      Get Request Status Name
      Returns:
      Request Status Name
    • getResolution

      public MResolution getResolution()
      Get Request Resolution
      Returns:
      MResolution
    • getResolutionName

      public String 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

      public String getDueTypeText()
      Get DueType Name
      Returns:
      DueType Name
    • getPriorityText

      public String getPriorityText()
      Get Priority Name
      Returns:
      Priority Name
    • getPriorityUserText

      public String getPriorityUserText()
      Get Importance Name
      Returns:
      Importance Name
    • getConfidentialText

      public String getConfidentialText()
      Get Confidential Type Name
      Returns:
      Confidential Type Name
    • getConfidentialEntryText

      public String getConfidentialEntryText()
      Get Confidential Type Entry Name
      Returns:
      Confidential Type Entry Name
    • setDateLastAlert

      public void setDateLastAlert()
      Set Date Last Alert to today
    • getSalesRep

      public MUser getSalesRep()
      Get Sales Rep
      Specified by:
      getSalesRep in interface I_R_Request
      Overrides:
      getSalesRep in class X_R_Request
      Returns:
      Sales Rep User
    • getSalesRepName

      public String getSalesRepName()
      Get Sales Rep Name
      Returns:
      Sales Rep Name
    • getCreatedByName

      public String getCreatedByName()
      Get Created By Name
      Returns:
      Created By Name
    • getUser

      public MUser getUser()
      Get Contact (may be not defined)
      Returns:
      Contact User or null
    • getBPartner

      public MBPartner 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

      public void setConfidentialTypeEntry(String ConfidentialTypeEntry)
      Set Confidential Type Entry.
      Validate new ConfidentialTypeEntry against current ConfidentialTypeEntry value.
      Specified by:
      setConfidentialTypeEntry in interface I_R_Request
      Overrides:
      setConfidentialTypeEntry in class X_R_Request
      Parameters:
      ConfidentialTypeEntry - confidentiality
    • webUpdate

      public boolean webUpdate(String result)
      Web Update of result
      Parameters:
      result - result text
      Returns:
      true if updated
    • toString

      public String toString()
      String Representation
      Overrides:
      toString in class X_R_Request
      Returns:
      info
    • createPDF

      public File createPDF()
      Create PDF
      Returns:
      not implemented, always return null
    • createPDF

      public File createPDF(File file)
      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 class PO
      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 interface I_R_Request
      Overrides:
      setSalesRep_ID in class X_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.
      Overrides:
      afterSave in class PO
      Parameters:
      newRecord - true if it is a new record
      success - true if save operation was success
      Returns:
      if save was a success
    • getMailTag

      public String 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)
      Get 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 Asset
      Record_UU - Record UUID
      whereClause -
      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)
      Create new request
      Parameters:
      tab - Grid Tab for request
      AD_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 request
      AD_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 UUID
      C_BPartner_ID -