atg.commerce.invoice
Class InvoiceTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.invoice.InvoiceTools
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
InvoiceTools

public class InvoiceTools
extends GenericService

A low-level interface to the Invoice repository, encapsulating most repository operations inside higher level API's. This class is not intended to completely shield the application from knowledge that invoices are implemented on top of a repository, but is intended to provide some convenience methods for creating and accessing invoice repository items.


Field Summary
static java.lang.String CLASS_VERSION
           
protected static java.util.ResourceBundle sDefaultResources
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
InvoiceTools()
           
 
Method Summary
 RepositoryItem addInvoice(MutableRepositoryItem pInvoice)
          Add a new invoice repository item to the repository.
 void addProfileToBean(RepositoryItem pInvoice, java.lang.Object pBean)
          Find the user profile of the user who created an invoice and add it to an arbitrary Java Bean.
 void copyInvoiceRequestProperties(InvoiceRequestInfo pInfo, MutableRepositoryItem pInvoice)
          Copy property values from an InvoiceRequestInfo object to an invoice repository item, using the mapping specified by invoiceRequestPropertyMap.
 MutableRepositoryItem createInvoice(java.lang.String pInvoiceNumber)
          Create a new invoice repository item.
 MutableRepositoryItem createInvoice(java.lang.String pInvoiceNumber, boolean pMakePersistent)
          Create a new invoice repository item, optionally adding it to the invoice repository.
 javax.jms.ObjectMessage createInvoiceMessage(RepositoryItem pInvoice, MessageSourceContext pContext, java.lang.String pMessagePort, boolean pFetchProfile)
          Create a patchbay-compatible invoice message from a specified invoice repository item using the default message bean class and the default invoice item to message bean property mapping.
 javax.jms.ObjectMessage createInvoiceMessage(RepositoryItem pInvoice, java.lang.String pMessageBeanClass, MessageSourceContext pContext, java.lang.String pMessagePort, java.util.Properties pPropertyMap, boolean pFetchProfile)
          Create a patchbay-compatible invoice message from a specified invoice repository item.
 RepositoryItem[] findInvoicesByInvoiceNumber(java.lang.String pInvoiceNumber)
          Search the repository for invoices having a particular invoice number.
 RepositoryItem[] findInvoicesByPropertyValue(java.util.Map pValues)
          Search the repository for invoices having a set of particular property values.
 RepositoryItem[] findInvoicesByPropertyValue(java.lang.String pPropertyName, java.lang.Object pTargetValue)
          Search the repository for invoices having a particular property value.
 RepositoryItem[] findInvoicesByPropertyValue(java.lang.String pPropertyName_1, java.lang.Object pTargetValue_1, java.lang.String pPropertyName_2, java.lang.Object pTargetValue_2)
          Search the repository for invoices having two particular property values.
 java.lang.String getBalanceDuePropertyName()
          Return the name of the property used to store an invoice's balance due.
 java.lang.String getDefaultInvoiceMessageClass()
          Return the class that createInvoiceMessage will use as the default "Dynamo message bean" type.
 java.util.Properties getDefaultInvoiceMessageMap()
          Return the mapping of properties from repository item to Dynamo message bean that createInvoiceMessage will use by default.
 RepositoryItem getDeliveryInfo(RepositoryItem pInvoice)
          Return the repository item that represents an invoice's delivery information.
 MutableRepositoryItem getDeliveryInfoForUpdate(RepositoryItem pInvoice)
          Return a mutable version of the repository item that represents an invoice's delivery information.
 java.lang.String getDeliveryInfoPropertyName()
          Return the name of the property used to store an invoice's delivery information.
 java.lang.String getDSSProfilePropertyName()
          Get the name of the JMS message property where Dynamo Scenario Server expects to find a reference to the user profile.
 RepositoryItem getInvoice(java.lang.String pRepositoryId)
          Get the invoice with the specified repository id.
 MutableRepositoryItem getInvoiceForUpdate(java.lang.String pRepositoryId)
          Get a mutable version of the invoice with the specified repository id.
 java.lang.String getInvoiceItemDescriptorName()
          Return the repository item descriptor name for the invoice item type.
 java.lang.String getInvoiceNumberPropertyName()
          Return the name of the property used to store an invoice's invoice number.
 MutableRepository getInvoiceRepository()
          Return the repository being used to store and retrieve invoices.
 java.util.Properties getInvoiceRequestPropertyMap()
          Return the map describing the association between properties of an InvoiceRequestInfo object and properties of an invoice repository item.
 java.lang.String getLastModifiedPropertyName()
          Return the name of the property used to store an invoice's last modified date and time.
 java.lang.String getOrderIdPropertyName()
          Return the name of the property used to store an invoice's order id.
 java.lang.String getPaymentDueDatePropertyName()
          Return the name of the property used to store an invoice's payment due date.
 java.lang.String getPaymentGroupIdPropertyName()
          Return the name of the property used to store an invoice's payment group id.
 RepositoryItem getPaymentTerms(RepositoryItem pInvoice)
          Return the repository item that represents an invoice's payment terms.
 RepositoryItem getPaymentTermsForUpdate(RepositoryItem pInvoice)
          Return a mutable version of the repository item that represents an invoice's payment terms.
 java.lang.String getPaymentTermsPropertyName()
          Return the name of the property used to store an invoice's payment terms.
 java.lang.String getPONumberPropertyName()
          Return the name of the property used to store an invoice's purchase order number.
 CommerceProfileTools getProfileTools()
           
 PropertyTools getPropertyTools()
           
 RepositoryItem getUserProfile(RepositoryItem pInvoice)
          Return the user profile of the user who created the order that was paid for with the specified invoice.
 void removeInvoice(RepositoryItem pInvoice)
          Remove the specified invoice repository item from the repository.
 void removeInvoice(java.lang.String pRepositoryId)
          Remove the specified invoice repository item from the repository.
 void setBalanceDuePropertyName(java.lang.String pBalanceDuePropertyName)
          Specify the name of the property used to store an invoice's balance due.
 void setDefaultInvoiceMessageClass(java.lang.String pDefaultInvoiceMessageClass)
          Specify the class that createInvoiceMessage will use as the default "Dynamo message bean" type.
 void setDefaultInvoiceMessageMap(java.util.Properties pDefaultInvoiceMessageMap)
          Specify the mapping of properties from repository item to Dynamo message bean that createInvoiceMessage will use by default.
 void setDeliveryInfoPropertyName(java.lang.String pDeliveryInfoPropertyName)
          Specify the name of the property used to store an invoice's delivery information.
 void setDSSProfilePropertyName(java.lang.String pDSSProfilePropertyName)
          Set the name of the JMS message property where Dynamo Scenario Server expects to find a reference to the user profile.
 void setInvoiceItemDescriptorName(java.lang.String pInvoiceItemDescriptorName)
          Specify the repository item descriptor name for the invoice item type.
 void setInvoiceNumberPropertyName(java.lang.String pInvoiceNumberPropertyName)
          Specify the name of the property used to store an invoice's invoice number.
 void setInvoiceRepository(MutableRepository pInvoiceRepository)
          Specify which invoice repository to use.
 void setInvoiceRequestPropertyMap(java.util.Properties pInvoiceRequestPropertyMap)
          Specify the association between properties of an InvoiceRequestInfo object and properties of an invoice repository item.
 void setLastModifiedPropertyName(java.lang.String pLastModifiedPropertyName)
          Specify the name of the property used to store an invoice's last modified date and time.
 void setOrderIdPropertyName(java.lang.String pOrderIdPropertyName)
          Specify the name of the property used to store an invoice's order id.
 void setPaymentDueDatePropertyName(java.lang.String pPaymentDueDatePropertyName)
          Specify the name of the property used to store an invoice's payment due date.
 void setPaymentGroupIdPropertyName(java.lang.String pPaymentGroupIdPropertyName)
          Specify the name of the property used to store an invoice's payment group id.
 void setPaymentTermsPropertyName(java.lang.String pPaymentTermsPropertyName)
          Specify the name of the property used to store an invoice's payment terms.
 void setPONumberPropertyName(java.lang.String pPONumberPropertyName)
          Specify the name of the property used to store an invoice's purchase order number.
 void setProfileTools(CommerceProfileTools pProfileTools)
           
 void setPropertyTools(PropertyTools pPropertyTools)
           
 void updateInvoice(MutableRepositoryItem pInvoice)
          Update invoice properties in the invoice repository and set the repository item's last-modified-time to the current date and time.
 void updateInvoice(MutableRepositoryItem pInvoice, boolean pUpdateTimestamp)
          Update invoice properties in the invoice repository, optionally updating the repository item's last-modified-time automatically.
 void updateLastModifiedTime(MutableRepositoryItem pMutableInvoice)
          Set an invoice's last modified date and time to the current date and time.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

sDefaultResources

protected static java.util.ResourceBundle sDefaultResources
Constructor Detail

InvoiceTools

public InvoiceTools()
Method Detail

setInvoiceRepository

public void setInvoiceRepository(MutableRepository pInvoiceRepository)
Specify which invoice repository to use. The repository must be a mutable repository so that invoices can be created and updated.


getInvoiceRepository

public MutableRepository getInvoiceRepository()
Return the repository being used to store and retrieve invoices.


setInvoiceItemDescriptorName

public void setInvoiceItemDescriptorName(java.lang.String pInvoiceItemDescriptorName)
Specify the repository item descriptor name for the invoice item type.


getInvoiceItemDescriptorName

public java.lang.String getInvoiceItemDescriptorName()
Return the repository item descriptor name for the invoice item type.


setLastModifiedPropertyName

public void setLastModifiedPropertyName(java.lang.String pLastModifiedPropertyName)
Specify the name of the property used to store an invoice's last modified date and time.


getLastModifiedPropertyName

public java.lang.String getLastModifiedPropertyName()
Return the name of the property used to store an invoice's last modified date and time.


setDeliveryInfoPropertyName

public void setDeliveryInfoPropertyName(java.lang.String pDeliveryInfoPropertyName)
Specify the name of the property used to store an invoice's delivery information.


getDeliveryInfoPropertyName

public java.lang.String getDeliveryInfoPropertyName()
Return the name of the property used to store an invoice's delivery information.


setPaymentTermsPropertyName

public void setPaymentTermsPropertyName(java.lang.String pPaymentTermsPropertyName)
Specify the name of the property used to store an invoice's payment terms.


getPaymentTermsPropertyName

public java.lang.String getPaymentTermsPropertyName()
Return the name of the property used to store an invoice's payment terms.


setInvoiceNumberPropertyName

public void setInvoiceNumberPropertyName(java.lang.String pInvoiceNumberPropertyName)
Specify the name of the property used to store an invoice's invoice number.


getInvoiceNumberPropertyName

public java.lang.String getInvoiceNumberPropertyName()
Return the name of the property used to store an invoice's invoice number.


setPONumberPropertyName

public void setPONumberPropertyName(java.lang.String pPONumberPropertyName)
Specify the name of the property used to store an invoice's purchase order number.


getPONumberPropertyName

public java.lang.String getPONumberPropertyName()
Return the name of the property used to store an invoice's purchase order number.


setBalanceDuePropertyName

public void setBalanceDuePropertyName(java.lang.String pBalanceDuePropertyName)
Specify the name of the property used to store an invoice's balance due.


getBalanceDuePropertyName

public java.lang.String getBalanceDuePropertyName()
Return the name of the property used to store an invoice's balance due.


setPaymentDueDatePropertyName

public void setPaymentDueDatePropertyName(java.lang.String pPaymentDueDatePropertyName)
Specify the name of the property used to store an invoice's payment due date.


getPaymentDueDatePropertyName

public java.lang.String getPaymentDueDatePropertyName()
Return the name of the property used to store an invoice's payment due date.


setOrderIdPropertyName

public void setOrderIdPropertyName(java.lang.String pOrderIdPropertyName)
Specify the name of the property used to store an invoice's order id.


getOrderIdPropertyName

public java.lang.String getOrderIdPropertyName()
Return the name of the property used to store an invoice's order id.


setPaymentGroupIdPropertyName

public void setPaymentGroupIdPropertyName(java.lang.String pPaymentGroupIdPropertyName)
Specify the name of the property used to store an invoice's payment group id.


getPaymentGroupIdPropertyName

public java.lang.String getPaymentGroupIdPropertyName()
Return the name of the property used to store an invoice's payment group id.


setDSSProfilePropertyName

public void setDSSProfilePropertyName(java.lang.String pDSSProfilePropertyName)
Set the name of the JMS message property where Dynamo Scenario Server expects to find a reference to the user profile. The default setting is "profile", and should not be changed unless DSS changes at some point in the future.


getDSSProfilePropertyName

public java.lang.String getDSSProfilePropertyName()
Get the name of the JMS message property where Dynamo Scenario Server expects to find a reference to the user profile.


setProfileTools

public void setProfileTools(CommerceProfileTools pProfileTools)

getProfileTools

public CommerceProfileTools getProfileTools()

setPropertyTools

public void setPropertyTools(PropertyTools pPropertyTools)

getPropertyTools

public PropertyTools getPropertyTools()

setInvoiceRequestPropertyMap

public void setInvoiceRequestPropertyMap(java.util.Properties pInvoiceRequestPropertyMap)
Specify the association between properties of an InvoiceRequestInfo object and properties of an invoice repository item.

The left hand side of each map entry is a property expression valid for InvoiceRequestInfo; the right hand side is a property expression valid for the invoice repository item. Either side may contain dotted names that refer to sub-properties of a given object.

The value of each InvoiceRequestInfo property is looked up and copied to the corresponding invoice repository item property by the copyInvoiceRequestProperties method.

Example configuration:


 invoiceRequestPropertyMap=\
    paymentDueDate=paymentDueDate,\
    paymentNetDays=paymentTerms.netDays,\
    paymentDiscountDays=paymentTerms.discountDays,\
    preferredFormat=deliveryInfo.preferredFormat,\
    billingAddress.firstName=deliveryInfo.firstName,\
    billingAddress.middleName=deliveryInfo.middleName,\
    billingAddress.lastName=deliveryInfo.lastName
 


getInvoiceRequestPropertyMap

public java.util.Properties getInvoiceRequestPropertyMap()
Return the map describing the association between properties of an InvoiceRequestInfo object and properties of an invoice repository item.

See Also:
setInvoiceRequestPropertyMap(java.util.Properties)

setDefaultInvoiceMessageClass

public void setDefaultInvoiceMessageClass(java.lang.String pDefaultInvoiceMessageClass)
Specify the class that createInvoiceMessage will use as the default "Dynamo message bean" type.


getDefaultInvoiceMessageClass

public java.lang.String getDefaultInvoiceMessageClass()
Return the class that createInvoiceMessage will use as the default "Dynamo message bean" type.


setDefaultInvoiceMessageMap

public void setDefaultInvoiceMessageMap(java.util.Properties pDefaultInvoiceMessageMap)
Specify the mapping of properties from repository item to Dynamo message bean that createInvoiceMessage will use by default. See setInvoiceRequestPropertyMap for more information about property maps and how to use them.

See Also:
createInvoiceMessage(atg.repository.RepositoryItem, java.lang.String, atg.dms.patchbay.MessageSourceContext, java.lang.String, java.util.Properties, boolean)

getDefaultInvoiceMessageMap

public java.util.Properties getDefaultInvoiceMessageMap()
Return the mapping of properties from repository item to Dynamo message bean that createInvoiceMessage will use by default.

See Also:
createInvoiceMessage(atg.repository.RepositoryItem, java.lang.String, atg.dms.patchbay.MessageSourceContext, java.lang.String, java.util.Properties, boolean)

createInvoice

public MutableRepositoryItem createInvoice(java.lang.String pInvoiceNumber,
                                           boolean pMakePersistent)
                                    throws InvoiceException
Create a new invoice repository item, optionally adding it to the invoice repository.

Parameters:
pInvoiceNumber - The invoice number for the new invoice, which may be null if no invoice number is desired.
pMakePersistent - If true the new item will be added to the invoice repository immediately, in which case the application should populate the item properties and then call updateInvoice to make the changes persistent.

If false the new item will be transient, in which case the application should populate the item properties and then call addInvoice to make the new item and its properties persistent.

In either case, a mutable repository item is returned.

Returns:
a mutable item ready for calls to setPropertyValue and either addInvoice or updateInvoice
Throws:
InvoiceException - if any repository error occurs while creating the new item. The sourceException property of the invoice exception provides access to the original RepositoryException.

createInvoice

public MutableRepositoryItem createInvoice(java.lang.String pInvoiceNumber)
                                    throws InvoiceException
Create a new invoice repository item. The new item is transient; to add it to the invoice repository and make it persistent, call addInvoice after initializing the new invoice's properties.

Parameters:
pInvoiceNumber - The invoice number for the new invoice, which may be null if no invoice number is desired.
Returns:
a mutable item ready for calls to setPropertyValue and addInvoice
Throws:
InvoiceException - if any repository error occurs while creating the new item. The sourceException property of the invoice exception provides access to the original RepositoryException.

addInvoice

public RepositoryItem addInvoice(MutableRepositoryItem pInvoice)
                          throws InvoiceException
Add a new invoice repository item to the repository.

Returns:
a readonly version of the new item, which may or may not be the same as the object specified in the call to addInvoice.
Throws:
InvoiceException - if any repository error occurs while creating the new item. The sourceException property of the invoice exception provides access to the original RepositoryException.

getInvoice

public RepositoryItem getInvoice(java.lang.String pRepositoryId)
                          throws InvoiceException
Get the invoice with the specified repository id.

Throws:
InvoiceException - if any repository error occurs while retrieving the item. The sourceException property of the invoice exception provides access to the original RepositoryException.

getInvoiceForUpdate

public MutableRepositoryItem getInvoiceForUpdate(java.lang.String pRepositoryId)
                                          throws InvoiceException
Get a mutable version of the invoice with the specified repository id.

Throws:
InvoiceException - if any repository error occurs while retrieving the item. The sourceException property of the invoice exception provides access to the original RepositoryException.

updateInvoice

public void updateInvoice(MutableRepositoryItem pInvoice,
                          boolean pUpdateTimestamp)
                   throws InvoiceException
Update invoice properties in the invoice repository, optionally updating the repository item's last-modified-time automatically.

Parameters:
pInvoice - The invoice being saved to the repository.
pUpdateTimestamp - Flag indicating whether or not to update the last modified time. If true, the last modified time of the repository item will be set to the current date and time. Otherwise the last modified time will remain unchanged. Note that the last modified time will be updated even if no properties in the repository item have changed value since the last update.
Throws:
InvoiceException - if any repository error occurs while updating the item. The sourceException property of the invoice exception provides access to the original RepositoryException.

updateInvoice

public void updateInvoice(MutableRepositoryItem pInvoice)
                   throws InvoiceException
Update invoice properties in the invoice repository and set the repository item's last-modified-time to the current date and time.

Throws:
InvoiceException - if any repository error occurs while updating the item. The sourceException property of the invoice exception provides access to the original RepositoryException.

removeInvoice

public void removeInvoice(RepositoryItem pInvoice)
                   throws InvoiceException
Remove the specified invoice repository item from the repository. The application should not make any further use of the repository item after the removeInvoice call returns.

Throws:
InvoiceException - if any repository error occurs while removing the item. The sourceException property of the invoice exception provides access to the original RepositoryException.

removeInvoice

public void removeInvoice(java.lang.String pRepositoryId)
                   throws InvoiceException
Remove the specified invoice repository item from the repository. The application should not make any further use of the repository item after the removeInvoice call returns.

Throws:
InvoiceException - if any repository error occurs while removing the item. The sourceException property of the invoice exception provides access to the original RepositoryException.

findInvoicesByPropertyValue

public RepositoryItem[] findInvoicesByPropertyValue(java.lang.String pPropertyName,
                                                    java.lang.Object pTargetValue)
                                             throws InvoiceException
Search the repository for invoices having a particular property value.

Parameters:
pPropertyName - A property name of the form "invoiceNumber" or "deliveryInfo.lastName" whose value is of interest.
pTargetValue - The value of the named property to search for.
Returns:
Array of invoice repository items whose properties match the specified target value, or null if no matching invoices are found.
Throws:
InvoiceException - if any repository error occurs while searching the repository. The sourceException property of the invoice exception provides access to the original RepositoryException.

findInvoicesByPropertyValue

public RepositoryItem[] findInvoicesByPropertyValue(java.lang.String pPropertyName_1,
                                                    java.lang.Object pTargetValue_1,
                                                    java.lang.String pPropertyName_2,
                                                    java.lang.Object pTargetValue_2)
                                             throws InvoiceException
Search the repository for invoices having two particular property values. Performs a query of the form "(pPropertyName_1 EQUALS pTargetValue_1) AND (pPropertyName_2 EQUALS pTargetValue_2)".

Parameters:
pPropertyName_1 - A property name of the form "invoiceNumber" or "deliveryInfo.lastName" whose value is of interest.
pTargetValue_1 - The value of the property specified by pPropertyName_1 to search for.
pPropertyName_2 - Another property name.
pTargetValue_2 - The value of the property specified by pPropertyName_2 to search for.
Returns:
Array of invoice repository items whose properties match the specified target value, or null if no matching invoices are found.
Throws:
InvoiceException - if any repository error occurs while searching the repository. The sourceException property of the invoice exception provides access to the original RepositoryException.

findInvoicesByPropertyValue

public RepositoryItem[] findInvoicesByPropertyValue(java.util.Map pValues)
                                             throws InvoiceException
Search the repository for invoices having a set of particular property values. Performs a query of the form "(property1 EQUALS value1) AND (property2 EQUALS value2) AND (property3 EQUALS value3) ..." for all property value pairs

Parameters:
pValues - A Map whose keys are property names, and whose values are the target values for the corresponding property.
Returns:
Array of invoice repository items whose properties match the specified target value, or null if no matching invoices are found.
Throws:
InvoiceException - if any repository error occurs while searching the repository. The sourceException property of the invoice exception provides access to the original RepositoryException.

findInvoicesByInvoiceNumber

public RepositoryItem[] findInvoicesByInvoiceNumber(java.lang.String pInvoiceNumber)
                                             throws InvoiceException
Search the repository for invoices having a particular invoice number.

Parameters:
pInvoiceNumber - The invoice number to search for.
Returns:
Array of invoice repository items having the specified invoice number.
Throws:
InvoiceException - if any repository error occurs while searching the repository. The sourceException property of the invoice exception provides access to the original RepositoryException.

getDeliveryInfo

public RepositoryItem getDeliveryInfo(RepositoryItem pInvoice)
Return the repository item that represents an invoice's delivery information.


getDeliveryInfoForUpdate

public MutableRepositoryItem getDeliveryInfoForUpdate(RepositoryItem pInvoice)
                                               throws InvoiceException
Return a mutable version of the repository item that represents an invoice's delivery information. After updating the delivery info's properties, the application should call updateInvoice on the parent invoice.

Throws:
InvoiceException

getPaymentTerms

public RepositoryItem getPaymentTerms(RepositoryItem pInvoice)
Return the repository item that represents an invoice's payment terms.


getPaymentTermsForUpdate

public RepositoryItem getPaymentTermsForUpdate(RepositoryItem pInvoice)
                                        throws InvoiceException
Return a mutable version of the repository item that represents an invoice's payment terms. After updating the payment terms properties, the application should call updateInvoice on the parent invoice.

Throws:
InvoiceException

getUserProfile

public RepositoryItem getUserProfile(RepositoryItem pInvoice)
                              throws InvoiceException
Return the user profile of the user who created the order that was paid for with the specified invoice.

Throws:
InvoiceException

updateLastModifiedTime

public void updateLastModifiedTime(MutableRepositoryItem pMutableInvoice)
Set an invoice's last modified date and time to the current date and time.


copyInvoiceRequestProperties

public void copyInvoiceRequestProperties(InvoiceRequestInfo pInfo,
                                         MutableRepositoryItem pInvoice)
                                  throws InvoiceException
Copy property values from an InvoiceRequestInfo object to an invoice repository item, using the mapping specified by invoiceRequestPropertyMap.

Throws:
InvoiceException - if any error occurs getting property values from the object or setting them in the repository item
See Also:
setInvoiceRequestPropertyMap(java.util.Properties)

createInvoiceMessage

public javax.jms.ObjectMessage createInvoiceMessage(RepositoryItem pInvoice,
                                                    java.lang.String pMessageBeanClass,
                                                    MessageSourceContext pContext,
                                                    java.lang.String pMessagePort,
                                                    java.util.Properties pPropertyMap,
                                                    boolean pFetchProfile)
                                             throws InvoiceException
Create a patchbay-compatible invoice message from a specified invoice repository item.

Parameters:
pInvoice - The invoice repository item whose data is represented in the message.
pMessageBeanClass - The message bean class that will carry the data in the message.
pContext - The message source context to use when creating the new message.
pMessagePort - The JMS port on which to send the message.
pPropertyMap - The table that specifies the mapping of values from properties of the invoice repository to properties of the message bean.
pFetchProfile - If true, and if the message bean class contains a property named profile whose type is RepositoryItem, then the profile property will be set to the user profile of the use who placed the order resulting in the creation of pInvoice. Otherwise no special attempt will be made to populate the profile property of the message bean, even if it exists.
Returns:
A new instance of javax.jms.ObjectMessage whose underlying object data is contained within an instance of the specified message bean class.
Throws:
InvoiceException

createInvoiceMessage

public javax.jms.ObjectMessage createInvoiceMessage(RepositoryItem pInvoice,
                                                    MessageSourceContext pContext,
                                                    java.lang.String pMessagePort,
                                                    boolean pFetchProfile)
                                             throws InvoiceException
Create a patchbay-compatible invoice message from a specified invoice repository item using the default message bean class and the default invoice item to message bean property mapping.

Parameters:
pInvoice - The invoice repository item whose data is represented in the message.
pContext - The message source context to use when creating the new message.
pMessagePort - The JMS port on which to send the message.
pFetchProfile - If true, and if the message bean class contains a property named profile whose type is RepositoryItem, then the profile property will be set to the user profile of the use who placed the order resulting in the creation of pInvoice. Otherwise no special attempt will be made to populate the profile property of the message bean, even if it exists.
Returns:
A new instance of javax.jms.ObjectMessage whose underlying object data is contained within an instance of the specified message bean class.
Throws:
InvoiceException
See Also:
setDefaultInvoiceMessageClass(java.lang.String), setDefaultInvoiceMessageMap(java.util.Properties)

addProfileToBean

public void addProfileToBean(RepositoryItem pInvoice,
                             java.lang.Object pBean)
                      throws java.beans.IntrospectionException,
                             PropertyNotFoundException,
                             InvoiceException
Find the user profile of the user who created an invoice and add it to an arbitrary Java Bean. If the object specified by pBean has a property named profile whose type is RepositoryItem, then set this property to the profile of the user who placed the order paid for by pInvoice. If pBean does not have such a property, return without doing anything.

Throws:
java.beans.IntrospectionException
PropertyNotFoundException
InvoiceException