Professional Documents
Culture Documents
Xstore Pos-170-03-Ftg
Xstore Pos-170-03-Ftg
October 2019
Oracle® Retail Xstore Point of Service, Frameworks & Technologies Guide, Release 17.0
E92431-03
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Primary Author: A. Meske
This software and related documentation are provided under a license agreement containing
restrictions on use and disclosure and are protected by intellectual property laws. Except as
expressly permitted in your license agreement or allowed by law, you may not use, copy,
reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or
display any part, in any form, or by any means. Reverse engineering, disassembly, or
decompilation of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be
error-free. If you find any errors, please report them to us in writing.
If this software or related documentation is delivered to the U.S. Government or anyone licensing
it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated
software, any programs installed on the hardware, and/or documentation, delivered to U.S.
Government end users are “commercial computer software” pursuant to the applicable Federal
Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication,
disclosure, modification, and adaptation of the programs, including any operating system,
integrated software, any programs installed on the hardware, and/or documentation, shall be
subject to license terms and license restrictions applicable to the programs. No other rights are
granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management
applications. It is not developed or intended for use in any inherently dangerous applications,
including applications that may create a risk of personal injury. If you use this software or
hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe,
backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its
affiliates disclaim any liability for any damages caused by use of this software or hardware in
dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC
trademarks are used under license and are trademarks or registered trademarks of SPARC
International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or
registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open
Group.
This software or hardware and documentation may provide access to or information about
content, products, and services from third parties. Oracle Corporation and its affiliates are not
responsible for and expressly disclaim all warranties of any kind with respect to third-party
content, products, and services unless otherwise set forth in an applicable agreement between you
and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or
damages incurred due to your access to or use of third-party content, products, or services, except
as set forth in an applicable agreement between you and Oracle.
Value-Added Reseller (VAR) Language
Oracle Retail VAR Applications
The following restrictions and provisions only apply to the programs referred to in this section
and licensed to you. You acknowledge that the programs may contain third party software (VAR
applications) licensed to Oracle. Depending upon your product and its version number, the VAR
applications may include:
(i) the MicroStrategy Components developed and licensed by MicroStrategy Services Corporation
(MicroStrategy) of McLean, Virginia to Oracle and imbedded in the MicroStrategy for Oracle
Retail Data Warehouse and MicroStrategy for Oracle Retail Planning & Optimization applications.
(ii) the Wavelink component developed and licensed by Wavelink Corporation (Wavelink) of
Kirkland, Washington, to Oracle and imbedded in Oracle Retail Mobile Store Inventory
Management.
(iii) the software component known as Access Via™ licensed by Access Via of Seattle, Washington,
and imbedded in Oracle Retail Signs and Oracle Retail Labels and Tags.
(iv) the software component known as Adobe Flex™ licensed by Adobe Systems Incorporated of
San Jose, California, and imbedded in Oracle Retail Promotion Planning & Optimization
application.
You acknowledge and confirm that Oracle grants you use of only the object code of the VAR
Applications. Oracle will not deliver source code to the VAR Applications to you.
Notwithstanding any other term or condition of the agreement and this ordering document, you
shall not cause or permit alteration of any VAR Applications. For purposes of this section,
"alteration" refers to all alterations, translations, upgrades, enhancements, customizations or
modifications of all or any portion of the VAR Applications including all reconfigurations,
reassembly or reverse assembly, re-engineering or reverse engineering and recompilations or
reverse compilations of the VAR Applications or any derivatives of the VAR Applications. You
acknowledge that it shall be a breach of the agreement to utilize the relationship, and/or
confidential information of the VAR Applications for purposes of competitive discovery.
The VAR Applications contain trade secrets of Oracle and Oracle's licensors and Customer shall
not attempt, cause, or permit the alteration, decompilation, reverse engineering, disassembly or
other reduction of the VAR Applications to a human perceivable form. Oracle reserves the right to
replace, with functional equivalent software, any of the VAR Applications in future releases of the
applicable program.
Contents
1 Send Us Your Comments..............................................................1-12
1 Preface............................................................................................1-13
Audience...................................................................................................................... 1-13
Documentation Accessibility .................................................................................. 1-13
Access to Oracle Support.................................................................................... 1-13
Related Documents .................................................................................................. 1-13
Customer Support...................................................................................................... 1-14
Review Patch Documentation ................................................................................. 1-14
Oracle Retail Documentation on the Oracle Technology Network................ 1-14
Conventions ................................................................................................................ 1-14
1 Introduction......................................................................................1-1
Overview ....................................................................................................................... 1-1
Audience........................................................................................................................ 1-1
About This Manual ..................................................................................................... 1-1
3 Operation Chains.............................................................................3-1
Overview ....................................................................................................................... 3-1
About This Chapter............................................................................................... 3-1
The Operation Chain Framework (OpChains) ...................................................... 3-1
Operation Chain Defined ..................................................................................... 3-1
Operations and Chains ......................................................................................... 3-1
OpChains and Business Logic ............................................................................. 3-2
OpChain Flexibility ............................................................................................... 3-2
OpChain Example: Printing a Receipt................................................................ 3-2
Benefits of Operations Chains .................................................................................. 3-2
Configurability....................................................................................................... 3-2
Extensibility ............................................................................................................ 3-3
4
Reusability .............................................................................................................. 3-3
Modifying OpChains.................................................................................................. 3-3
Adding a New Step to an OpChain .................................................................... 3-3
Changing the Order of Operations in an OpChain .......................................... 3-3
Overriding and Extending Xstore Point of Service Base Functions............... 3-4
OpChainConfig.xml.................................................................................................... 3-5
Sample OpChain........................................................................................... 3-10
Reconfiguring an OpChain ......................................................................... 3-10
5
Xref-To-Child Fields............................................................................................ 4-14
The Data Transfer for Xstore File: <InverseRelationship> Element Attributes4-14
The Data Transfer for Java File: Providing Additional Java Code to the Data Model
4-15
Data Transfer for Java Files ................................................................................ 4-15
Overriding Auto-Generated Methods.............................................................. 4-16
Example of an Override .............................................................................. 4-16
Introduction to the Data Model Classes................................................................ 4-17
The Object ID Class ............................................................................................. 4-18
The Model Interface Class .................................................................................. 4-19
General Overview ........................................................................................ 4-19
Interface Extension ....................................................................................... 4-19
The DBA Model Class......................................................................................... 4-20
The DAO Model Class ........................................................................................ 4-20
The Model Class .................................................................................................. 4-20
Property “Getters” and “Setters”............................................................... 4-21
Relationship Access Methods ..................................................................... 4-21
Manually Created Methods ........................................................................ 4-21
Extensions...................................................................................................... 4-21
The Relationship Class........................................................................................ 4-21
Overhead Classes ................................................................................................ 4-21
DataModelFactoryImpl ............................................................................... 4-22
JDBCAdapterMapImpl................................................................................ 4-22
Data Transfer for Xstore Data Management......................................................... 4-22
Data Sources ......................................................................................................... 4-22
Persistence Managers.......................................................................................... 4-22
Data Replication................................................................................................... 4-23
Queries and Object Wrapping ........................................................................... 4-23
5 Data Sources....................................................................................5-1
Overview ....................................................................................................................... 5-1
About this Chapter ................................................................................................ 5-1
DataSourceConfig.xml File........................................................................................ 5-1
DataSourceConfig.xml Example:.............................................................................. 5-5
6
7 Replication Configuration...............................................................7-1
Overview ....................................................................................................................... 7-1
About This Chapter............................................................................................... 7-1
Enabling and Disabling Replication in Xstore Point of Service ........................ 7-2
DtxReplicationConfig.xml ........................................................................................ 7-2
Queue Configuration (<ReplicationQueue>)..................................................... 7-3
Replication Services (<service>)........................................................................... 7-4
DtxReplicationConfiguration.xml Sample ................................................. 7-6
8 Query Configuration........................................................................8-1
Overview ....................................................................................................................... 8-1
About this chapter ................................................................................................. 8-1
QueryConfig.xml ......................................................................................................... 8-2
Elements and Attributes............................................................................................. 8-2
<Query> Element - Using DTXQL....................................................................... 8-2
<Query> Element - Raw SQL ............................................................................... 8-9
7
Field (<field>) ....................................................................................................... 9-25
Call a Function (method).................................................................................... 9-28
method Example........................................................................................... 9-28
method Chain Example ............................................................................... 9-28
<method_param> Example ......................................................................... 9-28
Looping Iterator (<iterator>) .............................................................................. 9-28
Custom Iterator: Iteration on Multiple Objects and Methods ............... 9-31
Multiple Lines of Text from com_receipt_text (<textblock>) ........................ 9-31
<textblock> Ordering and Formatting....................................................... 9-35
Barcode (<barcode>)..................................................................................... 9-35
Call New Object (<call>) ..................................................................................... 9-36
About Formatters and Custom Fields .............................................................. 9-37
DocBuilder field............................................................................................ 9-37
About Aggregate Fields...................................................................................... 9-38
About Fields Within Fields ................................................................................ 9-39
Method Parameters (<method_param>) .......................................................... 9-40
Other Field Elements........................................................................................... 9-40
Field Style (style) .......................................................................................... 9-40
Field Location (<location>).......................................................................... 9-41
Field Alignment (alignment) ...................................................................... 9-42
Field Priority (<priority>) ............................................................................ 9-43
8
Device Settings by Category.................................................................................. 10-16
POS Printer Settings - jpos.xml........................................................................ 10-16
Cash Drawer Settings........................................................................................ 10-19
Signature Capture (SigCap) Settings .............................................................. 10-19
MICR Settings .................................................................................................... 10-20
MSR Settings ...................................................................................................... 10-20
PINPad Settings ................................................................................................. 10-21
Ingenico Settings................................................................................................ 10-21
11 Reporting Framework....................................................................11-1
Overview ..................................................................................................................... 11-1
About This Chapter............................................................................................. 11-1
Overview of the Report Creation Process ............................................................. 11-1
Data Templates .................................................................................................... 11-1
SQL Queries.......................................................................................................... 11-2
XML Configuration Files Used in Reporting ....................................................... 11-2
ReportQueryConfig.xml........................................................................................... 11-3
Database-Specific ReportQueryConfig.xml Files............................................ 11-3
12 Forms Framework..........................................................................12-1
Overview ..................................................................................................................... 12-1
About This Chapter............................................................................................. 12-1
FieldDefinitionConfig.xml ...................................................................................... 12-1
Examples............................................................................................................... 12-3
Label Field ..................................................................................................... 12-3
Text Field ....................................................................................................... 12-3
List Field ........................................................................................................ 12-3
GroupingList Field ....................................................................................... 12-3
Image Field .................................................................................................... 12-3
Table Field ..................................................................................................... 12-3
Chart Field ..................................................................................................... 12-4
Anchor Field.................................................................................................. 12-4
ProgressBar Field.......................................................................................... 12-4
Signature Field.............................................................................................. 12-4
MoreAuthInfo Field ..................................................................................... 12-4
FieldLayoutConfig.xml............................................................................................. 12-4
Example................................................................................................................. 12-6
Form Definition Files................................................................................................ 12-7
13 Spring Integration........................................................................13-11
Overview ................................................................................................................... 13-11
Benefits ...................................................................................................................... 13-11
Dependency Injection ....................................................................................... 13-12
9
Spring Beans....................................................................................................... 13-12
Spring Bean Files ........................................................................................ 13-12
Use of the Configurable Annotation and Injection of Fields ......................... 13-13
Example - Operation ......................................................................................... 13-13
Custom Spring Scopes ............................................................................................ 13-14
Application Mode.............................................................................................. 13-14
Training Mode.................................................................................................... 13-14
Transaction .................................................................................................. 13-15
Scoping/Value Keys ................................................................................................ 13-15
DefaultScope ...................................................................................................... 13-16
Use ................................................................................................................ 13-16
Removal of Values...................................................................................... 13-17
TransactionScope............................................................................................... 13-18
Use ................................................................................................................ 13-18
Removal of Values...................................................................................... 13-19
Management of Helpers/Singletons .................................................................... 13-19
Define a helper bean.......................................................................................... 13-20
Use it in a class ................................................................................................... 13-20
Override the helper bean (assume that CstCustomerHelper extends
CustomerHelper) ............................................................................................... 13-20
Management of Services ........................................................................................ 13-20
Service Implementations .................................................................................. 13-20
Service Handlers ................................................................................................ 13-20
Flow Transparency and OpChainConfig.xml Readability.............................. 13-20
New Elements .................................................................................................... 13-21
Op ................................................................................................................. 13-21
ValidationOp............................................................................................... 13-21
PromptOp.................................................................................................... 13-21
WorkerOp.................................................................................................... 13-22
OpChainRoute ............................................................................................ 13-22
14 Internationalization........................................................................14-1
Overview ..................................................................................................................... 14-1
About this Chapter .............................................................................................. 14-1
Internationalization (i18n) ....................................................................................... 14-2
Implementing i18n .............................................................................................. 14-2
Applications of Internationalization in Xstore Point of Service ................... 14-2
Internationalization (i18n) and Localization (L10n) ....................................... 14-3
Multilingualization (m17n) ................................................................................ 14-3
Xstore Point of Service i18n Implementation....................................................... 14-3
Java Standards...................................................................................................... 14-3
Language Codes .................................................................................................. 14-3
Configuring Languages in Xstore Point of Service......................................... 14-4
Sample Entries in LocaleMap.xml: ............................................................ 14-4
10
Language Files ..................................................................................................... 14-4
Individual Customization .................................................................................. 14-5
Translation Resource Bundles ........................................................................... 14-6
Language and Country................................................................................ 14-6
Defining Common Mappings for Different Keys .................................... 14-7
Configuration Accelerators...................................................................................... 14-8
Xstore Office and SystemConfigMetadata.properties........................................ 14-8
Overview .............................................................................................................. 14-8
i18n and the SystemConfigMetadata.properties File ..................................... 14-9
Creating a "Stub" Metadata File for Other Languages............................ 14-9
11
Send Us Your Comments
Oracle welcomes customers' comments and suggestions on the quality and usefulness of
this document.
Your feedback is important, and helps us to best meet your needs as a user of our
products. For example:
• Are the implementation steps correct and complete?
• Did you understand the context of the procedures?
• Did you find any errors in the information?
• Does the structure of the information help you with your tasks?
• Do you need different information or graphics? If so, where, and in what format?
• Are the examples correct? Do you need more examples?
If you find any errors or have any other suggestions for improvement, then please tell us
your name, the name of the company who has licensed our products, the title and part
number of the documentation and the chapter, section, and page number (if available).
Note: Before sending us your comments, you might like to check that
you have the latest version of the document and if any concerns are
already addressed. To do this, access the Online Documentation
available on the Oracle Technology Network Web site. It contains the
most current Documentation Library plus all documents revised or
released recently.
12
Preface
This guide describes the programming and configuration frameworks used in the
development of Xstore Point of Service, and the technologies integrated with Xstore
Point of Service.
Audience
This Frameworks & Technologies Guide is for administrators and programmers of
Oracle Retail Xstore Point of Service.
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility
Program website at http://www.oracle.com/pls/topic/
lookup?ctx=acc&id=docacc.
Related Documents
For more information, see the following documents in the Xstore Point of Service 17.0
documentation set:
• Xstore Suite Release Notes
• Xstore Suite Oracle Retail Xstore Suite 17.0/Merchandising 16.0.1 Implementation
Guide
• Xstore Point-of-Service User Guide
• Xstore Point-of-Service Mobile User Guide
• Xstore Point-of-Service Reports Guide
• Xstore Point-of-Service Manager's Guide
• Xstore Point-of-Service Shipping, Receiving, and Inventory Guide
• Xstore Office User Guide
• Oracle Retail Xstore Point-of-Service, Lane Checkout User Interface User Guide
• Xstore Suite Implementation and Security Guide
• Xstore Point-of-Service Host Interface Guide
• Xstore Suite Deal Pricing Guide
• Xenvironment User Guide
• Xstore Point-of-Service Services Guide
13
Customer Support
Customer Support
To contact Oracle Customer Support, access My Oracle Support at the following URL:
https://support.oracle.com
When contacting Customer Support, please provide the following:
• Product version and program/module name
• Functional and technical description of the problem (include business impact)
• Detailed step-by-step instructions to re-create
• Exact error message received
• Screen shots of each step you take
Conventions
Navigate: This is a navigate statement. It tells you how to get to the start of the procedure
and ends with a screen shot of the starting point and the statement “the Window Name
window opens.”
This is a code sample
It is used to display examples of code
14
Conventions
15
1
Introduction
Overview
This guide has been designed to provide the reader with a basic understanding of Xstore
Point of Service and the technology underlying its design. This guide is not intended as a
complete technical guide to every facet of Xstore Point of Service; however, it includes
information to provide a better understanding of the technology and methodology used
in the design of Xstore Point of Service.
Audience
This guide is intended for technical personnel working with Xstore Point of Service. This
can include anyone responsible for altering or creating process flows, configuring Xstore
Point of Service, or looking for a more fundamental understanding of Xstore Point of
Service and the concepts used in its design and creation.
Introduction 1-1
About This Manual
• Chapter 11, “Reporting Framework” explains how reports are created and run in
Xstore Point of Service.
• Chapter 13, “Spring Integration” describes Xstore Point of Service’s integration with
the Spring framework.
• Chapter 14, “Internationalization” describes how internationalization (i18n) is
implemented in Xstore Point of Service.
Overview
Configurations are generally more flexible, manageable, extensible, and easily deployed
than code-based modifications. Xstore Point of Service supports several configuration
formats, each with their own benefits and restrictions. The following formats are briefly
explained below: XML, Java Resource Bundle, Java Properties, and Database.
XML
XML (Extensible Markup Language) is the most versatile and common means of
configuring Xstore Point of Service. Xstore Point of Service application of XML makes
use of hierarchies and explicit data typing to assign runtime parameters or build
equivalent object structures.
XML is used where parent/child-based hierarchies must be supported. The
configurations are implemented in the various XML files corresponding to specific
functional or technical domains.
Java Properties
A .properties file contains string-key-to-string-value mappings. Its equivalent Java
representation is called a Properties object. Unlike XML, Properties configurations do
not support hierarchies or non-string data types. When manipulated programmatically,
Properties objects may be “chained” to form an arbitrarily deep extension hierarchy.
Outside of code, however, there are no real or implied relationships between
.properties files. Therefore, Properties objects are extensible, but .properties files
are not.
A Properties object is usually employed where the data being configured is naturally a
collection of simple key-value pairs.
Database
This data can be updated via downloads, which makes it slightly less static and slightly
easier to maintain as a result. The set of reason codes for returning an item is an example.
Xstore Point of Service can reference such configurations via its Persistence framework.
Database configuration is used where the data is, or may be part of, a download
interface between the home office and the application clients.
Event Handling
Events are defined methods by which a user can interact with Xstore Point of Service.
Xstore Point of Service is a highly interactive application. Examples of Events include
selecting a key, selecting a combination of keys, or entering text from the keyboard.
Mouse activities such as clicking and selecting an item from a list are also Events.
Xstore Point of Service can be described as an Event-driven application. It provides
“listeners” that detect Events, then Xstore Point of Service responds to them accordingly.
Configuration Priorities
The configuration framework supports a mechanism for ranking configurations by
priority. Higher-priority configurations extend or override equivalent, lower-priority
configurations. Configuration priorities are determined by the configuration path which
determines the locations of all client configuration resources, and is mapped to the VM
parameter dtv.config.path.
All base configuration resources, which have the lowest priority, are located in the
classpath-accessible directory dtv/res/config.
Overriding XML
• The lowest-priority level declaration of an element determines that element’s
ancestral context.
• In order to describe an override, the element to be overridden must be identified by
both its ancestral context and name/ID.
• Siblings and ancestors will be unaffected by overrides resolved for elements not
belonging to an undifferentiated collection.
• Overriding any member of an undifferentiated collection results in the substitution
of all members of that collection with those specified in the overriding configuration.
Overriding Properties
• For the purposes of conflict detection, property entries are identified by their keys
and the name of the file in which they are declared.
• Overriding a property entry requires mapping a new value to the key to be
overridden in a file with the same name as that overridden key.
• All configuration path-based overrides are processed against a set of properties
before any programmatic hierarchies are enforced.
• The value of a property that is deeper in its programmatic hierarchy than another,
higher-priority (per the configuration path) property will still take precedence in a
lookup operation.
Overview
This chapter describes what Operation Chains (OpChains) are, what they do, and how
they are configured. Because Xstore Point of Service builds standard functionality using
OpChains, an understanding of this software design and implementation method will
help you understand Xstore Point of Service more fully. In addition, this will allow you
to see how flexible Xstore Point of Service can be.
function). All Xstore Point of Service application functions are implemented by the use
of operation chains.
OpChain Flexibility
While most processing will follow a “straight-through” flow, the OpChain Framework
has the flexibility to accommodate new types of operation chains created for special
processing needs.
PRINT_RECEIPTS OpChain
Wait for
Build Email Print Save Print Fiscal
Receipts to
Receipts Receipts Receipts Receipts Receipts
Print
Configurability
The Operation Chain Framework gives you the ability to customize Xstore Point of
Service to meet your specific business requirements without having to modify source
code. Operation chains are contained within files that are easily accessible and editable.
Extensibility
The Operation Chain Framework allows you to define and implement new business
logic that may not be available in the base version of Xstore Point of Service. This can
also be done without touching source code.
Reusability
Operation chains typically contain operations and other chains. The ability to reuse an
existing chain is useful for logical flows that are common across multiple functions. For
example, after defining an OpChain for receipt printing, it could be easily inserted into
other OpChains such as those for a layaway sale, a special order sale, or a regular retail
sale.
Modifying OpChains
This section describes how OpChains may be modified by adding or deleting steps,
changing the sequence of steps, and how base functions can be overridden.
PRINT_RECEIPTS OpChain
Wait for
Build Email Print Save Print Fiscal
Receipts to
Receipts Receipts Receipts Receipts Receipts
Print
Print
Receipts in
Back Office
By editing the OpChain XML file, you have complete control over the order in which
operations are executed.
PRINT_RECEIPTS OpChain
Wait for
Build Print Email Save Print Fiscal
Receipts to
Receipts Receipts Receipts Receipts Receipts
Print
Print
Receipts in
Back Office
Build
Receipts PRINT_RECEIPTS OpChain
Email
W ait for
Custom Print Receipts Save Print Fiscal
Receipts to
Receipts Receipts Receipts Receipts
… and send Print
Messages
Overriding an Print
operation Receipts in
Back Office
Extending an
operation
In Figure 3-4, the operation Custom Receipts replaces the base operation Build
Receipts, and the original operation is ignored during processing.
Furthermore, ...and send Messages extends the capabilities of Email
Receipts—its parent—and enhances the operation’s functionality. As long as the
programming interface (the API) does not change, the customized operation will
function properly even if the Xstore Point of Service application is updated. The parent,
or original operation, will be distributed with updates.
OpChainConfig.xml
The file OpChainConfig.xml defines the structure and process flows for all the
OpChains used in Xstore Point of Service.
This file has the following organization:
<OpChainSet> Element:
xmlns:xsi Attribute
xsi:noNamespaceSchemaLocation Attribute
<OpChain> Element:
name Attribute
signal Attribute
contextKey Attribute
rollbackChainKey Attribute
rollbackLevel Attribute
<Op> Element:
class Attribute
required Attribute
breakpoint Attribute
longRunning Attribute
contextKey Attribute
<Parameter> Element:
dtype Attribute
name Attribute
value Attribute
ref Attribute
<value> Element:
dtype Attribute
<entry> Element:
dtype Attribute
key Attribute
value Attribute
<OpChainRoute> Element:
chainKey Attribute
chainType Attribute
condition Attribute
<Choice> Element:
chainKey Attribute
condition Attribute
chainType Attribute
<Condition> Element:
class Attribute
<Parameter> Element:
dtype Attribute
name Attribute
value Attribute
ref Attribute
<value> Element:
dtype Attribute
<entry> Element:
dtype Attribute
key Attribute
value Attribute
<PromptOp> Element: (Sub-type of <Op>)
key Attribute
validationsBean Attribute
<WorkerOp> Element: (Sub-type of <Op>)
workersBean Attribute
<ValidationOp> Element: (Sub-type of <Op>)
validationsBean Attribute
• <OpChainSet> - This element contains all the OpChains defined in the file.
- xmlns:xsi - The XML schema definition.
- xsi:noNamespaceSchemaLocation - The name of the .xsd file associated
with the XML file.
• <OpChain> - This element defines an OpChain and its process flow. This element
has the following attributes:
- name - This attribute uniquely identifies a chain. This name is used to refer to
the <OpChain> in other <OpChain> elements, or in other files.
- signal - This attribute identifies the action that will be performed when the
chain completes. The most common values are:
Note: This includes the help information displayed when the user
presses the F1 key.
• <Op> - This element specifies the fully-qualified name for a Java class run as part of
the chain. (Note: <Operation> has been deprecated.) Any number of <Op> tags
can be included within an <OpChain> element. This element has the following
attributes:
- class - This attribute specifies the fully-qualified name of the Java class
implementing this operation.
- required - This attribute specifies whether or not the operation is required to
complete successfully in order for its parent chain to continue. An <Op> defaults
to “True” (required) unless this attribute is set to “False”.
- breakpoint - This attribute marks an escape point from the current operation.
This provides the ability to control the flow of operations. An enabled
breakpoint indicates that its parent Op should be re-run after a reversal if:
* it exists in the currently-running Chain
* it has previously completed
- contextKey - This attribute sets a context key for a specific operation at the
<Op> level.
- longRunning - This attribute is used to tag an operation that has a large
amount of background processing. This triggers the “Please Wait” message in
Xstore Point of Service.
• <Parameter> - This element is used to send a parameter value to the Java class
called in the <Op> element.
Note: This element can be the child of many different elements in the
OpChain configuration format.
- name - The name of the parameter. This attribute performs the same function as
the <param_name> element.
- value - The value that is sent in the parameter. If the value attribute is used,
the parameter is sent as a String. If the parameter being sent has a different data
type (such as Boolean or Class), the <param_value> sub-element must be
used, with the dtype attribute indicating the type of data being sent.
• <value> - This element contains the value sent in the named <Parameter>. This
element allows a value that is not a String to be sent as a parameter.
- dtype - This attribute indicates the type of data contained in the
<param_value> element.
• <OpChainRoute> - Routes processing to a specified <OpChain>. A condition can
be specified to determine the next chain to run (optional). When no condition is
specified, the chain always runs.
- chainKey - This attribute specifies the name used to refer to the included
<OpChain>.
- chainType - This attribute determines the chain type: STACK (default) or
START. When no chainType is specified, assumes STACK type.
* STACK (default) - Once the called chain completes, processing is returned to
the referring chain.
* START - Once the called chain completes, processing does not return to the
referring chain.
- condition - A class that implements the run chain condition interface to
determine if the specified chainKey will run. If no condition is specified, the
chain always runs.
Note: A “!” before the class will invert the results of the condition by
setting the invert parameter behind the scenes.
• <Choice> - A tag element (container) for chainKey and chainType. The first
choice that has the condition satisfied will be run and all others will be ignored.
- dtype - Data type.
- chainKey - The name used to refer to the included <OpChain>.
- condition - A class that implements the run chain condition interface to
determine if the specified chainKey will run. If no condition is specified, the
chain always runs.
A “!” before the class will invert the results of the condition by setting the invert
parameter behind the scenes.
Example:
• <PromptOp> - Sub-type of <Op> element. Provides clarity to indicate the user will
be prompted for something.
- key - The prompt key (only specified on an exception basis). Overrides the
default value in the operation.
- validationsBean - A reference to the bean that defines the list of validation
rules to apply on the prompt if applicable. Optional on the <PromptOp>.
• <WorkerOp> - Sub-type of <Op> element. Runs the list of workers.
- workersBean - A reference to the bean that defines the list of workers to be run.
Any class using this tag must implement the IWorkerOp interface.
• <ValidationOp> - Sub-type of <Op> element. Runs the validation rules.
Sample OpChain
Reconfiguring an OpChain
Note: The examples shown here are provided for illustration
purposes only and may not represent a valid operation order.
OpChains are easily reconfigured by editing the XML file. In the first example below, the
system first prompts for a reason (following bolded comment) and then prompts for a
comment (following bolded comment) during a No Sale transaction.
comment is not necessary, that operation could be marked as a comment or deleted from
the file.
<OpChain name="NO_SALE_MANUAL">
<Command class="dtv.pos.register.SaleItemCmd" />
<Op class="dtv.pos.nosale.CreateNoSaleTransactionOp" />
Overview
This chapter describes the Data Transfer for Xstore (DTX) Framework, what it does, how
it is used by Xstore Point of Service, and the files that are used in its configuration.
Because DTX is used as an interface between Xstore Point of Service and some of its
external data sources, an understanding of DTX allows you to understand how many
disparate data sources are managed.
The use of DTX for data transfer and translation can allow disparate data sources to be
seamlessly managed in Xstore Point of Service through a consistent interface. Xstore
Point of Service simply makes requests for information or data propagation, while DTX
handles the details of connecting with the data source and moving data from place to
place.
• “Introduction to the Data Model Classes” provides an overview of the six data
model classes generated when DAOGen processes the DTX and DTJ configuration
files.
• “Data Transfer for Xstore Data Management” provides an overview of DTX data
management and describes where to find more information about certain areas of
DTX.
Object Persistence
Data is packaged in units called objects. Every object is constructed according to its data
model, which acts as a template for the object. A data model describes the properties of
an object, and provides methods (typically Java language “getters” and “setters”) for
accessing it. For example, items, customers, and prices are different types of data, each of
which has its own model. An unlimited number of data types may be defined.
An object must be persisted (saved) so that it can be accessed whenever it is needed. The
persistence process is accomplished via a variety of mechanisms including, but not
limited to, serialization into an XML representation of the object which is transmitted to
a servlet; translation to database table rows; and translation into SOAP-based web
service calls. The DTX Framework handles the process of persisting objects, even across
distributed storage locations.
Projects
A Project is a logical grouping of files that are related to a single technology, framework,
or function of an application. For example, the DTX Project includes all of the files that
are needed to support base Xstore Point of Service data models. This includes both
source files and generated output files. Another example is the data2 Project, which
includes all of the files that generate or perform the data persistence function within the
DTX Framework.
In the development environment, a Project is typically organized into a logically
arranged folder structure so that all of the related files are grouped together.
The output of a Project is a .jar file that is packaged as a component of the application.
The dtv-dtx.jar file and the dtv-data2.jar file are, respectively, products of the
dtx and data2 projects. They are both found in the lib folder for the Xstore Point of
Service application.
Creating Data Transfer for Xstore-Based Data Models for Other Projects
If you need to create data models for other Projects that also use DTX configuration files,
the following sample XML statements from build.xml can be a useful template. The
file build.xml is in the root of the DTX project in SVN (Subversion). Edit the
parameters to indicate the source folders for your new Project.
<target name="generation" depends="-init">
<taskdef classpathref="libs" name="dao-generation"
classname="dtv.data2.access.impl.daogen.DAOGenAnt"/>
<dao-generation dest="${gen}" dir="${config}"
modeldir="${src}"
genmodels="false">
</target>
Process Overview
The DTX Framework automatically generates six classes which are used to work with
data objects. These classes are generated at build time, and must be created before the
DTX Framework can use them. In the data2 Project (dtv-data2.jar) there is a method
named dtv.data2.access.impl.daogen.DAOGen. It processes two XML-style
configuration files and creates the classes from which the data objects are derived.
Working With Data Model Configuration Files: Data Transfer for Xstore
and Data Transfer for Java
To create the data models, DAOGen processes two types of configuration files from the
DTX Project: DTX files and Data Transfer for Java (DTJ) files:
• A DTX file has the file extension .dtx and it defines the fields that are included in a
data model. This file also defines the relationships between columns in a database
table and fields in other data models.
• A DTJ file has the file extension .dtj and it contains any special Java code that must
be added to the generated data model.
<Field> Element:
parent Attribute
child Attribute
value Attribute
xref-field Attribute
export Attribute
shared Attribute
<InverseRelationship> Element:
name Attribute
parent Attribute
<InverseRelationship name="parentCard"
parent="CustomerLoyaltyCard"/>
<Relationship name="awardCoupons" type="One-Many"
child="AwardAccountCoupon">
<field parent="organizationId" child="organizationId"/>
<field parent="cardNumber" child="cardNumber"/>
<field parent="accountId" child="accountId"/>
</Relationship>
</DAOMapping>
If this data model implements additional methods, those method signatures (or
declarations) must appear in an additional, manually-created interface. This
additional interface must be stored in the Project that contains the data models (see
“Projects”). For example, the DTX Project contains all of the data models for Xstore
Point of Service.
• code - If this attribute is present, and it is set to “true”, the data model represents a
code. Access to additional methods is available in the auto-generated data model.
• extensible - If this attribute is present, and it is set to “true”, the data model that
is auto-generated may be extended by other data models.
• extends - If the data model is an extension of another data model, the name of the
parent data model is indicated by this attribute.
Generally, only the name of the parent data model appears in this attribute. The
parent data model's package should not be assigned in this attribute, unless it is
generated outside of the main DTX project.
If the data model does not extend another data model, the extends attribute should
not be included.
• model-generator - If this attribute is present, it determines the custom class used
to generate the data model.
- Class - The data model's class name is recorded in this field. This is useful
when a database row has a field indicating which subclass to use. An example is
the itm_item.dtv_class_name field in the Xstore Point of Service database,
where there are different kinds of items such as physical, non-physical, and
work orders.
• key - The key attribute indicates if the field is part of the primary key. This attribute
must be present and set to “true” to include this field in the primary key.
• export - If this attribute is not present, or is present and set to “true”, the “getters”
and “setters” are included in the code generated from the DTX file. This is typically
done if additional tasks must be performed before “getting” or “setting” a property.
The alternative “getters” and “setters” appear in the DTJ file. If this attribute is
present and set to “false”, the code is not included.
• incrementField - This attribute is included when updates to the database are to
be performed using the data model. If the incrementField attribute is present
and set to “true”, the DTX Framework determines the difference between the
original and current value when an UPDATE query is run for the data model. The
difference is passed into the UPDATE query's parameters.
The UPDATE query then performs the update using syntax like that shown in the
following example:
UPDATE tsn_session_tndr SET create_date = ?, create_user_id = ?,
update_date = ?, update_user_id = ?, actual_media_amt =
actual_media_amt + ?, actual_media_count = actual_media_count + ?
WHERE organization_id = ? AND rtl_loc_id = ? AND session_id = ?
AND tndr_id = ?
In this example, the actual_media_amt and actual_media_count fields are
not simply overwritten. Instead, the amount that represents the difference between
them is passed in, and the query updates the value using that difference.
• defaultValue - When reading in a row from the database, if a field is set to “null”,
then the value assigned to this attribute is recorded in the data model property.
• suppress-event - If true, causes events to not be posted to the rest of the
application when the field is modified.
• sensitive - If true, data in this field will not be included in log files.
• encrypt - The name of an encryption key. If this attribute is set, the data in the
database field will be encrypted using the named encrypted key.
The DTX Framework does not offer “lazy loading”, in which the child columns are
loaded only when they are needed. Nor does the DTX Framework persist a parent
column without persisting its children. Because of this, the overhead resources required
for relationships have the potential to become prohibitively large. Be careful when
assigning relationships to data models.
• child - The name of the child data model. The child’s package does not appear in
this attribute.
• export - Indicates whether the methods to access the relationship on the parent
object are made available in the generated code. If this attribute is present and it is
set to “false”, then the methods that permit access to the relationship will not be
available in the data model’s interface. Defaults to “true” if not specified.
• dependent - When true, the child object is meaningless without the parent object.
• useParentPm - When true, use the same lookup rules as the parent object.
A sample One-One relationship from a DTX file is shown below.
<Relationship name="privilege" type="One-One"
child="Privilege">
<field parent="organizationId" child="organizationId"/>
<field parent="privilegeType" child="privilegeType"/>
</Relationship>
• table - The mapping table that is used to link the parent object and the child object.
Note that the mapping table does not need a data model object.
• element-name - The name used in the code for a relationship with a child object.
When a parent has multiple Many-Many relationships with children of the same
type, this element differentiates the relationships in the generated code.
• export - Indicates whether the methods to access the relationship on the parent
object are made available in the generated code. If this attribute is present and it is
set to “false”, then the methods that permit access to the relationship will not be
available in the data model’s interface. Defaults to “true” if not specified.
The <field> tags for a Many-Many relationship fall into two categories. The first
category links the parent to the mapping table. The second category links the
mapping table to the child. The attributes assigned to each <field> tag may vary,
depending on the tag’s category. For more information on <field> tags, see “The
Data Transfer for Xstore File: <Relationship> <Field> Element Attributes”.
A sample Many-Many relationship from a DTX file is shown below.
<Relationship name="includedItems" type="Many-Many" child="Item"
table="dsc_discount_item_inclusions" element-name="includeItem">
<field parent="discountCode" xref-field="discount_code"/>
<field parent="organizationId" xref-field="organization_id"/>
<field xref-field="organization_id" child="organizationId"/>
<field xref-field="item_id" child="itemId"/>
</Relationship>
Parent-to-Child Fields
If the mapping is for a One-One relationship (see “One-One Relationships Between Data
Models”) or a One-Many relationship (see “One-Many Relationships Between Data
Models”), the <field> tag maps the parent to a child. In this relationship, the field tag
may have the following attributes:
• parent - The name of the property in the parent data model. Note that the parent
data model is the DTX file currently being edited.
• child - The name of the corresponding property in the child data model.
Parent-to-Xref Fields
If the mapping is for a Many-Many relationship (see “Many-Many Relationships
Between Data Models”), a <field> tag is used to map the parent to the mapping table.
In this relationship, the <field> tag has the following attributes:
• parent - The name of the property in the parent data model. Note that the parent
data model is the DTX file currently being edited.
Xref-To-Child Fields
If the mapping is for a Many-Many relationship (see “Many-Many Relationships
Between Data Models”), a <field> tag is used to map the mapping table to the child. In
this relationship, the <field> tag has the following attributes:
• xref-field - The name of the corresponding database column in the mapping
table. Note that, unlike the child attribute, the xref-field contains a database
column, not a data model property.
• child - The name of the corresponding property in the child data model.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * **/
/* * WARNING WARNING WARNING WARNING WARNING WARNING * */
/* * * */
/* * CUSTOM CODE BELOW THIS POINT. EDIT IN APPROPRIATE DTJ * */
/* * * */
/* * WARNING WARNING WARNING WARNING WARNING WARNING * */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */
When DAOGen sees this comment, it looks for the auto-generated method with the
same method signature. DAOGen then changes the auto-generated method’s scope to
“protected” and appends the word Impl to the end of the method name. The method in
the DTJ file is then appended to the end of the data model.
Example of an Override
Assume that DAOGen auto-generated a method with the following signature:
public void addTransactionNotes(dtv.xst.dao.trn.ITransactionNotes
argNote)
However, the client application sets the noteSequence property in the
dtv.xst.dao.trn.ITransactionNotes object before performing this addition.
Therefore, the developer writes another method with the same signature in the DTJ file,
as in the following example:
/* {OVERRIDE GENERATED METHOD} */
public void addTransactionNotes(dtv.xst.dao.trn.ITransactionNotes
argNote) {
argNote.setNoteSequence(this.getTransactionNotes().size() + 1);
addTransactionNotesImpl(argNote);
When DAOGen sees this comment, it looks for the auto-generated public void
addTransactionNotes(dtv.xst.dao.trn.ITransactionNotes argNote)
Object ID Name is derived from the id attribute in the DTX file immediately
followed by “Id”
Model Interface “I” is always the first letter, followed by name of the data model
DBA Class Name is the same as the name of the data model, followed by “DBA”
DAO Class Name is the same as the name of the data model, followed by
“DAO”
Model Class The assigned name of the class followed by the word “Model”
Relationship Class The name of the data model, followed by the name of the
relationship, followed by “RelationshipDBA”
The table below provides an overview of the six data model classes. More details about
each of them are provided in the following pages.
Table 4-2: Data Model Classes
Two “overhead” classes are also automatically created at the same time as the six model
classes. These two classes are used in the persistence process when the data models are
loaded.
Table 4-3: Auto-Generated Overhead Classes
Note: Order is critical. The order in which values are listed in the
String must match the order of the <field> tags in the DTX file.
General Overview
The Model Interface class contains the method signatures (or declarations) for all of the
auto-generated methods in the Model class (see The Model Class).
The auto-generated interface is in the package specified in the package attribute in the
DTX file.
Interface Extension
The auto-generated interface extends the interface that is specified in the implements
attribute in the DTX file.
If there are no additional manually created methods for the data model (in the DTJ file),
the implements attribute should be set to dtv.data2.access.IDataModel.
If there are additional manually created methods in the DTJ file, those method
signatures should appear in a manually created interface. The implements attribute in
the DTX file should contain the name of this manually created interface. This causes the
auto-generated interface to extend the manually generated interface.
The following rules should be followed for manually created interfaces:
• The manually created interface must always extend
dtv.data2.access.IDataModel.
• If the data model extends another data model, the manually created interface should
extend the parent model's auto-generated interface.
• Other interfaces may also be extended. For example, in the Xstore Point of Service
application, some manually created interfaces extend
dtv.data2.access.ICodeInterface.
• By convention, the manually created interface should reside in the same package as
the auto-generated interface.
• The name of the manually created interface should start with an “I”, followed by the
name of the Data Model, followed by the word “Model”. For example, if the data
model's name is Party, then the manually created interface should be named
IPartyModel.
• Manually created interfaces should be stored in the src folder of the DTX Project for
Xstore Point of Service. Auto-generated interfaces are stored in the gen folder of the
DTX Project.
• Manually created interfaces for future projects should be stored in a different folder
from the auto-generated interfaces.
Extensions
The Model Class always extends a superclass. DAOGen follows these steps to determine
which superclass to extend:
• The value in the extends attribute in the DTX file is checked. This attribute is used
when a Data Model is an extension of another Data Model. If the extends attribute
in the DTX file has a value, the Model will extend the class specified in this attribute.
• If the DTX file has its has-properties attribute set to “true”, the model extends
dtv.data2.access.impl.AbstractDataModelWithPropertyImpl.
• If the code attribute in the DTX file is set to “true”, the Model extends
dtv.data2.access.impl.AbstractCodeImpl.
• If none of the first three conditions are satisfied, the Model extends
dtv.data2.access.impl.AbstractDataModelImpl, which is the default
abstract superclass. Most models extend this class.
Overhead Classes
Two additional classes are auto-generated by DAOGen. These two classes are used
during the Persistence process when loading the data models. The client application
should never have to use these classes directly.
DataModelFactoryImpl
The dtv.data2.access.impl.DataModelFactoryImpl class contains three
methods that are used when loading Data Models:
• getRelationshipsImpl() – This method returns the Relationship classes for a
given DAO class.
• getModelForDAOImpl() – This method returns the Model for a given DAO class.
• getModelForInterface() – This method returns the Model for a given auto-
generated interface.
JDBCAdapterMapImpl
The dtv.data2.access.impl.jdbc.JDBCAdapterMapImpl class also contains
three methods that are used when loading Data Models:
• getTableAdapterImpl() – This includes two method signatures:
- One accepts the ID Object.
- The other accepts a Class object.
However, regardless of which one is called, they both return the DBA class for the
Object or Class passed in. If a Class is passed in, it must represent a DAO, Object ID,
or auto-generated interface.
• getRelationshipAdapterImpl() – This method returns the Relationship class
for a given Class and relationship name. The Class object must represent a DAO
Object.
Data Sources
For data to be persisted, replicated, or retrieved, DTX must know where and how to
open the source(s) where the data will be read and/or written. This information is
configured in the DataSourceConfig.xml file, which provides technical information
about the data sources used by DTX.
Note: See Chapter 5, “Data Sources” for more information about data
sources and configuring access to them through the
DataSourceConfig.xml file.
Persistence Managers
Every data model must be associated with a Persistence Manager Type (a “PM Type”)
and every PM Type is associated with a data source. These two associations ensure that
each type of data (as defined by its model) is stored in the proper data source location,
since data can be stored in various places, depending upon business or other
requirements.
Persistence Managers are configured in two files:
Data Replication
Data replication is part of the DTX Persistence Framework. Data must be persisted to a
data source before it can be replicated. As data is persisted, it is offered to the replication
framework for examination. Based on configuration, data may be replicated to any
number of other destinations, depending on what conditions are present. For example,
data may be conditionally persisted based on the type of data and the data source that is
targeted.
Replication can be configured to meet diverse needs. For example, replication can be
used to ensure that all store data is persisted to a central database, even when availability
of that data source is limited. Replication can also be configured to keep certain
databases synchronized with each other, or to ensure that all data generated by a register
is available on the local database as well as the central database.
Depending on configuration, delivery of replication data can be “guaranteed”. If some
data cannot be replicated immediately upon request, the replication framework will
queue up that data in its local data store for later delivery. Optionally, expiration times
can be specified on a guaranteed delivery. The replication queue features a “relegation”
strategy that tracks the number of attempts to replicate a piece of data and will gradually
retry replication less frequently as its failure count rises. The number of replication
attempts and the failure count values are configurable.
Overview
Data sources are configured in the DTX Framework through the file
DataSourceConfig.xml. For a data source to be available to Xstore Point of Service
for persisting, retrieving, replicating, or backing up data, the data source must be
configured in the DataSourceConfig.xml file.
Each data source has a number of crucial parameters, including:
• A unique name.
• Whether it should be considered enabled at runtime.
• If necessary, a URL defining the location of the data source.
• If necessary, a network scope to determine the color of the database availability
indicator when the data source goes offline.
• The strategy defining the protocol by which object-to-database interactions (and vice
versa) are performed.
• If necessary, a set of key-value pairs parameterizing the strategy and/or connection.
• If necessary, a datasource ping by which a data source is considered to be online or
offline.
Data sources are not referenced programmatically, they are instead identified by one or
more persistence managers.
DataSourceConfig.xml File
This section describes the elements and attributes for the DataSourceConfig.xml file,
which configures data sources for the DTX Framework. The file has the following
organization:
<DataSourceSet> Element:
xmlns:xsi Attribute
xsi:noNamespaceSchemaLocation Attribute
<DataSource> Element:
name Attribute
HighAvailability Attribute
<Enabled> Element
<NetworkScope> Element
<Strategy> Element
<Property> Element:
key Attribute
value Attribute
<value> Element:
dtype Attribute
cipher Attribute
encrypted Attribute
<Ping> Element:
<ClassName> Element:
dtype Attribute
<Property> Element:
key Attribute
value Attribute
• <DataSourceSet> - (ROOT ELEMENT) The element containing the set of all Data
Sources configured in the DataSourceConfig.xml file. This element contains as
many <DataSource> elements as necessary. This element contains the following
attributes:
- xmlns:xsi - The XML schema definition.
- xsi:noNamespaceSchemaLocation - The name of the .xsd file associated
with the XML file.
• <DataSource> - This element defines a data source that is available to Xstore Point
of Service. Each <DataSource> element contains attributes and sub-elements that
describe how the application accesses the data source. This element has the
following attributes:
- name - Contains the name of the data source.
- enabled - This element indicates whether the data source may be accessed.
This element has the following possible values:
- strategy - The name of the bean used to implement the persistence strategy
for the data source. There are several strategies available in the DTX Framework,
all of which are part of the DTX Persistence Project.
Note: If there are both LAN and WAN data sources offline, the
database indicator turns red.
• <Enabled> - This element indicates whether the data source may be accessed. This
element has the following possible values:
Note: If there are both LAN and WAN data sources offline, the
database indicator turns red.
• <Strategy> - This element contains the name of the bean used to implement the
persistence strategy for the data source. There are several strategies available in the
DTX Framework, all of which are part of the DTX Persistence Project:
- key - This attribute indicates the property key that is being configured. The
exact property keys that are available may vary, depending on the driver being
used. The four most common keys for JDBC data sources are:
* ConnectionDriverName - The name of the driver.
* ConnectionURL - The data source's connection string.
* ConnectionUserName - The User ID used when making the connection.
* ConnectionPassword - The Password used when making the connection.
- value - This attribute indicates the value assigned to the property key. For a
value that requires encryption, the value is assigned through a <value>
element (see below).
- <value> - This element can be used in place of the value attribute. This element
contains data that has been encrypted (such as User IDs and Passwords). This
element has the following attributes:
* dtype - The type of data contained in the <value> element. The only
possible value for this attribute is “EncryptedString”.
* cipher - The cipher used to encrypt the data.
* encrypted - The encrypted value of the property.
• <Ping> - Defines the rules used when pinging a remote data source.
- <ClassName> - This element contains the name of the class that is used to
perform the ping. This element has the following attribute:
* dtype - Indicates the type of information contained within the element. The
only possible value for this attribute is “Class”.
- <Property> - This element is used to define the network properties of the
location being pinged. This element contains the following attributes:
* key - This attribute indicates the property key that is being configured. The
most common values for this attribute are:
Host - The name of the host server that is being pinged.
Port - The port on the host server that is being pinged.
Timeout - The amount of time, in milliseconds, to wait for a response from
the host server.
* value - This attribute indicates the value assigned to the property key.
DataSourceConfig.xml Example:
<DataSourceSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../pos/config/dtv/res/config/
DataSourceConfig.xsd">
<DataSource name="Relate" networkScope="WAN">
<Enabled dtype="Boolean">true</Enabled>
<Strategy dtype="String">relatePersistenceStrategy</Strategy>
<Ping>
<ClassName dtype="Class">dtv.data2.access.impl.SocketPing</
ClassName>
<Property key="Host" value="xxxxxxxxxx"/>
Overview
Once the DTX data sources have been configured, DTX must know how Java objects are
mapped to data sources. These mappings are created through two files,
PmTypeMappingConfig.xml and PersistenceManagerConfig.xml.
These two files use Persistence Mapping (PM) Types to map Java objects to data sources.
The file PmTypeMappingConfig.xml maps Java objects to PM Types and the file
PersistenceManagerConfig.xml maps the PM Types to data sources. This allows
several different but related Java objects to be mapped to data sources in the same
manner.
For example, if there are several Java objects related to customer accounts, all of these
Java objects should access the same data sources. By using PM Types, these Java objects
can all be mapped to one PM Type. Then if there are changes to the data sources used for
customer accounts, changes do not need to be made for every Java object. Instead, the
changes can be made only for the one PM Type.
PmTypeMappingConfig.xml
This file maps Java objects to Persistence Manager (PM) Types. These mappings create
one-to-many relationships between PM Types and Java objects. This organizes the Java
objects into logical, intuitively named groups, and allows multiple Java objects to be
configured to access the same data sources.
<PmTypeMapping> Element:
ObjectId Attribute
PmType Attribute
<PmTypeMappingSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PmTypeMappingConfig.xsd">
<PmTypeMapping ObjectId="dtv.xst.dao.com.TransactionPropertyPromptId"
PmType="REGISTER_CORE"/>
<PmTypeMapping ObjectId="dtv.xst.dao.ctl.EventLogEntryId"
PmType="EVENT_LOG_ENTRY"/>
<PmTypeMapping ObjectId="dtv.xst.dao.cwo.CategoryServiceLocationId"
PmType="CODES"/>
<PmTypeMapping ObjectId="dtv.xst.dao.cwo.InvoiceId" PmType="CUSTOMER_ACCOUNT"/
>
<PmTypeMapping ObjectId="dtv.xst.dao.cwo.InvoiceLineItemId"
PmType="CUSTOMER_ACCOUNT"/>
PersistenceManagerConfig.xml
This configuration file associates a PM Type with a data source defined in the file
DataSourceConfig.xml (see DataSourceConfig.xml File in Chapter 5, “Data Sources”
for more information). Note that the DTX Framework supports multiple data sources.
The following elements and attributes are used in this file:
• <PersistenceManagerTypeSet> - (ROOT ELEMENT) The element containing the
set of all PM types. Contains the <PersistenceManagerType> sub-elements. This
element contains the following attributes:
- xmlns:xsi - The XML schema definition.
- xsi:noNamespaceSchemaLocation - The name of the schema .xsd file
associated with the XML file.
• <Online> - The data source used when Xstore Point of Service is online. It may
contain as many <LookupLocation> and <PersistenceLocation> sub-
elements as necessary.
- dtype - The type of data defined within the element.
• <LookupLocation> - For all elements with this name, this element defines the data
source used when retrieving data. The <Online>, <Offline>, and <Training>
elements all contain a sub-element with this name. For multiple
<LookupLocation> elements, the order in the file is respected.
PersistenceManagerConfig.xml Example
<PersistenceManagerType name="EMPLOYEE" ref="STORE_STANDARD" sync="true">
<Online dtype="LocationGroup">
<LookupLocation dataSourceName="StorePrimary"/>
<LookupLocation dataSourceName="Local"/>
<LookupLocation dataSourceName="Xcenter"/>
<PersistenceLocation dataSourceName="StorePrimary"/>
</Online>
</PersistenceManagerType>
Overview
Xstore Point of Service replication is controlled through two files, system.properties
and DtxReplicationConfig.xml. The file system.properties provides an
option to turn replication on and off, while DtxReplicationConfig.xml is used to
configure the options and data sources used when replication is turned on.
This chapter does not describe the configuration of data sources. However, replication
configuration does use the data sources configured in the file
DataSourceConfig.xml. For more information describing data sources and data
source configuration, see Chapter 5, “Data Sources”.
dtv.data2.replication.enabled=ON
dtv.data2.replication.enabled=OFF
DtxReplicationConfig.xml
There are two main sections in the DtxReplicationConfig.xml file:
• The first section defines the rules used when retrying a failed replication attempt.
This section uses a <ReplicationQueue> element for each data source (see Queue
Configuration (<ReplicationQueue>)).
• The second section describes the replication services that are provided. The tag
associated with this section is <service> and each service must have a name. The
<service> tag also has a number of sub-elements that provide the details needed
to implement the service (see Replication Services (<service>)).
The file DtxReplicationConfig.xml has the following organization:
<ReplicationQueue> Element:
dataSource Attribute
cycleInterval Attribute
workstationStart1 Attribute
workstationEnd1 Attribute
maxRecsPerCycle Attribute
errorNotificationCycles Attribute
<relegationLevel> Element:
failedAttempts Attribute
retryAfterCycles Attribute
<service> Element:
name Attribute
enabled Attribute
expireAfter Attribute
<condition> Element:
class Attribute
<conditionParam> Element:
key Attribute
value Attribute
<destination> Element:
type Attribute
dataSourceName Attribute
destinationService Attribute
dataSourceList Attribute
<subscriber> Element:
exclude Attribute
name Attribute
Note: The next cycle cannot fire until the process is idle. For example,
with a 30 second cycle, cycle #2 cannot fire unless the replication
process has been idle for at least a full cycle interval (i.e., 30 seconds).
So if cycle #1 begins at 0:30 and ends at 0:31, cycle #2 will NOT execute
at 1:00 because 30 seconds have not yet elapsed since 0:31. Instead,
cycle #2 will run at 1:30.
All replication requests are written to the database table ctl_replication_queue for
processing. After a replication transaction is successful or expires, it is removed from this
table.
DtxReplicationConfiguration.xml Sample
The example below shows a sample configuration for data replication.
<DtxReplicationConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="DtxReplicationConfig.xsd">
<ReplicationQueue dataSource="Replication" cycleInterval="30000"
maxRecsPerCycle="50" errorNotificationCycles="60">
<relegationLevel failedAttempts="3" retryAfterCycles="30"/>
<relegationLevel failedAttempts="10" retryAfterCycles="240"/>
<relegationLevel failedAttempts="15" retryAfterCycles="480"/>
<relegationLevel failedAttempts="20" retryAfterCycles="960"/>
<relegationLevel failedAttempts="25" retryAfterCycles="2880"/>
<relegationLevel failedAttempts="30" retryAfterCycles="9999999"/>
</ReplicationQueue>
...
<service name="Local->Xcenter" expireAfter="never">
<condition
class="dtv.data2.replication.dtximpl.condition.CurrentDataSourceCondition">
Overview
This chapter describes the QueryConfig.xml file, which is used for the creation and
configuration of queries used by Xstore Point of Service. These queries are used by the
Persistence Framework when retrieving data from data sources.
QueryConfig.xml
To run a query, Xstore Point of Service sends a query request to the Persistence
Framework. This request includes the query name and the parameters for the query. The
Persistence Framework then searches through the QueryConfig.xml file for a query
that matches the query name provided in the request. Once that query is located,
Persistence Framework uses the query information in a call to the method
DataFactory.getObjectByQuery().
The QueryConfig.xml file has the following structure:
<QuerySet> Root Element:
xmlns:xsi Attribute
xsi:noNamespaceSchemaLocation Attribute
<Queries> Element:
<Query> Element
<Subqueries> Element:
<Query> Element
<ResultFilter> Element:
dtype Attribute
<ResultClass> Element:
dtype Attribute
<ResultField> Element:
name Attribute
type Attribute
order Attribute
function Attribute
<Select> Element:
from Attribute
distinct Attribute
<ResultField> Element
<Join> Element:
left Attribute
right Attribute
type Attribute
<On> Element:
operand Attribute
parameter Attribute
ignoreCase Attribute
literal Attribute
left Attribute
right Attribute
<Where> Element:
name Attribute
type Attribute
order Attribute
<Suffix> Element:
dtype Attribute
<Sort> Element:
field Attribute
order Attribute
required Attribute
<Having> Element:
<TestExpression> Element
dtype Attribute
<Condition> Element
dtype Attribute
<Parameter> Element
name Attribute
<Property> Element:
<Key> Element
<Value> Element
• <Query> - An element to contain the configuration for a single query. Parent
Element: <Queries> or <Subqueries>.
- name - The name of the query. This is the name used to refer to the query.
[Required]
- pmType - Specifies the Persistence Manager Type of the query. [Optional].
If this attribute is not set, the Persistence Manager Type will be determined by
the query's "FROM" object mapping in the PmTypeMappingConfig.xml file.
A sample query is shown below. Descriptions for each element and attribute in
QueryConfig.xml follow the sample.
<Query name="CUSTOMER_ACCOUNT_DETAIL_LOOKUP">
<ResultClass dtype="String">
dtv.xst.query.results.CustAccountSearchResult</ResultClass>
<Select from="CustomerAccount" distinct="true">
<ResultField name="organizationId" type="Long"/>
<ResultField name="custAccountId" type="String"/>
<ResultField name="custAccountCode" type="String"/>
<ResultField name="Party.firstName" type="String"/>
<ResultField name="Party.lastName" type="String"/>
<ResultField name="accountBalance" type="BigDecimal"/>
<ResultField name="CustomerItemAccount.activeAccountTotal"
type="BigDecimal"/>
<ResultField name="accountSetupDate" type="Date"/>
<ResultField name="custAccountStateCode" type="String"/>
</Select>
<Join right="CustomerItemAccount" left="CustomerAccount"/>
<Join right="CustomerItemAccountDetail"
left="CustomerItemAccount"/>
<Join right="Party" left="CustomerAccount">
<On right="partyId" left="partyId"/>
<On right="organizationId" left="organizationId"/>
</Join>
<Where>
<Required field="custAccountCode"/>
<Required field="organizationId"/>
<Required field="retailLocationId"/>
<Optional field="custAccountId"/>
<Optional field="accountPurchaseOrderNumber"
ignoreCase="true" parameter="argPoNumber" operand="EQUALS"/>
<Optional field="Party.customerId" ignoreCase="false"
operand="EQUALS"/>
<Optional field="partyId"/>
<Optional field="CustomerItemAccountDetail.stateCode"
ignoreCase="false" parameter="argDetailStatus"
operand="EQUALS"/>
</Where>
<Sort field="accountSetupDate"/>
</Query>
• <QueryHandler> - Defines the query handler to be used for this query. Must be
DtxQueryHandler when building a query through XML. Parent Element: <Query>.
Note: If this element is not specified, DTXQL queries will use the
class dtv.data2.access.query.DtxQueryHandler. Otherwise,
queries that use raw SQL will use the class
dtv.data2.access.query.SQLQueryHandler.
* dtv.data2.access.query.DtxQueryHandler - DtxQueryHandler
should be used when a query returns data directly in a Data Model object.
When this data handling class is called, the handler returns the data in a
Collection, even if only one match is found.
• <ResultFilter> - Specifies the Spring bean name of a filter that will filter the
results of the query. [Optional]
- dtype - Defines the type of the element. [Required]
• <ResultClass> - Defines the result class to store result of the query in. Parent
Element: <Query>. For queries using the DtxQueryHandler, this class should be
the ID class of the DTX object storing the result (for example, PartyId).
Note: Only used when the query populates a result class object that is
not a DTX object.
- name - The name of the field. Required when a result class is defined (for
queries using the SQL handler). The name should match the accessor method
names in the result class. [Required]
- type - The data type being stored in the result field. [Optional]
- order - The order that this field belongs in. [Optional] DEFAULT=Natural
ordering.
- function - The function performed on the data for this field. [Optional].
This attribute can have the following value:
* SUM - Sum of all the values.
• <Select> - Defines the SELECT statement for the SQL. Parent Element:
<Query>.
- from - Name of the DTX object from which the data is queried. [Required]
- distinct - Indicates whether the select statement should only return distinct
rows. [Optional] DEFAULT=false
• <Join> - Defines the JOIN statement for the SQL. Parent Element: <Query>.
- left - Name of the DTX object on the left. [Required]
- right - Name of the DTX object on the right. [Required]
- type - Type of join to perform. [Optional] DEFAULT=INNER
This attribute must have one of the following values:
* INNER
* LEFT
* LEFT OUTER
* RIGHT
* FULL
• <On> - Defines the fields on which the tables are joined. Parent Element: <Join>.
Note: If no <On> elements are specified, the DTX objects are joined
on the primary key fields.
* LESS_THAN
* LESS_THAN_EQUALTO
* IS
* LIKE
* EXISTS
- parameter - Name of the parameter. [Optional] DEFAULT=argX, where X is
the capitalized field name.
- ignoreCase - Indicates whether to compare strings without considering
case. [Optional] DEFAULT=false
- literal - Literal value of a field. Must be included if either the left or
right attribute is not included.
- left - Name of the field on the left. If this attribute is not included, the right
and literal attributes must be included.
- right - Name of the field on the right. If this attribute is not included, the
left and literal attributes must be included.
• <Where> - Defines the WHERE clause for the SQL. Parent Element: <Query>.
• <Required> - Defines a field that must either have a query parameter included,
or must have a literal value defined. Parent Element: <Where> or <Or>.
- operand - Operand used to compare the field values. [Optional]
DEFAULT=EQUALS
This attribute must have one of the following values:
* EQUALS
* GREATER_THAN
* GREATER_THAN_EQUALTO
* LESS_THAN
* LESS_THAN_EQUALTO
* IS
* LIKE
Note: You may include a wildcard (%) on either side of the field
name when using the operand LIKE.
* EXISTS
- parameter - Name of the parameter. [Optional] DEFAULT=argX, where X is
the capitalized field name.
- ignoreCase - Indicates whether to compare strings without considering
case. [Optional] DEFAULT=false
- literal - Literal value of a field. [Optional]
- field - Name of the field. [Optional]
- columnRef - Name of a column in the form <Table>.<Field> where <Table> is
the name of the table and <Field> is the name of the field in the table. [Optional]
Note: You may include a wildcard (%) on either side of the field
name when using the operand LIKE.
* EXISTS
- parameter - Name of the parameter. [Optional] DEFAULT=argX, where X is
the capitalized field name.
Example:
<SQL> Element:
required Attribute
order Attribute
<Statement> Element
dtype Attribute
<WhereClause> Element
dtype Attribute
<Parameter> Element
name Attribute
<Expression> Element
trigger Attribute
parameters Attribute
<Suffix> Element:
dtype Attribute
<Sort> Element:
field Attribute
order Attribute
required Attribute
<Having> Element:
<TestExpression> Element
dtype Attribute
<Condition> Element
dtype Attribute
<Parameter> Element
name Attribute
<Property> Element:
<Key> Element
<Value> Element
• <Query> - An element to contain the configuration for a single query. Parent
Element: <Queries> or <Subqueries>.
- name - The name of the query. This is the name used to refer to the query.
[Required]
- pmType - Specifies the Persistence Manager Type of the query. [Optional]
If this attribute is not set, the Persistence Manager Type will be determined by
the query's "FROM" object mapping in the PmTypeMappingConfig.xml file.
A sample query is shown below. Descriptions for each element and attribute in
QueryConfig.xml follow the sample.
• <QueryHandler> - Defines the query handler to be used for this query. Must be
DtxQueryHandler when building a query through XML. Parent Element: <Query>.
Note: If this element is not specified, DTXQL queries will use the
class dtv.data2.access.query.DtxQueryHandler. Otherwise,
queries that use raw SQL will use the class
dtv.data2.access.query.SQLQueryHandler.
• <Statement> - Used to store the base SQL query to be executed. Parent Element:
<SQL>.
- dtype - Defines the type of the element. [Required]
- CORRESPONDING PROPERTY: SQL, SQL1, SQL2, …
• <WhereClause> - Used to store the base WhereClause for DTX queries. Parent
Element: <SQL>.
- dtype - Defines the type of the element. [Required]
- CORRESPONDING PROPERTY: WhereClause
Example:
<SQL>
<WhereClause dtype="String"><![CDATA[
WHERE t.organization_id = ?
AND t.cust_acct_id = ?
AND t.cust_acct_code = ?
AND t.invoice_balance > 0
order by t.invoice_date asc
]]></WhereClause>
<Parameter name="argOrganizationId"/>
<Parameter name="argAcctId"/>
<Parameter name="argAcctCode"/>
</SQL>
Note: The framework always interprets the "t" alias to mean “the
primary table”.
• <Parameter> - Used to specify a required parameter for the parent SQL element.
Parent Element: <SQL, Having>.
- name - The name of the required parameter. [Optional]
- CORRESPONDING PROPERTY: Parameters
• <Expression> - An optional expression to append to the where clause portion of
a SQL statement. Parent Element: <SQL>
- trigger - The parameter name to trigger the addition of this optional
expression. [Required]
- parameters - The required parameters for this optional expression.
[Optional] DEFAULT=The parameter name specified in the trigger attribute.
- CORRESPONDING PROPERTY: SQL.<ParameterName> and
Parameters.<ParameterName>
Example:
• <Sort> - Defines a field to sort the results off of, and optional sort order. Parent
Element: <Query>.
- field - DESCRIPTION: The field to sort off of. This can be a literal field to sort
off of or it can be a parameter that is passed in through the application.
[Required]
- order - DESCRIPTION: The order in which to sort the field. This is a parameter
only. [Optional]
- required - Used to specify whether the sort for the query is required.
DEFAULT=true.
- CORRESPONDING PROPERTY: Sort, Sort.Order
Example:
<Having>
<TestExpression dtype="String">COALESCE(SUM(CASE WHEN TSL.return_flag='0'
THEN TSL.net_amt END),0)</TestExpression>
<Condition dtype="String">BETWEEN ? AND ?</Condition>
<Parameter name="startAmtPurchased"/>
<Parameter name="endAmtPurchased"/>
</Having>
Note: There are many XML elements and attributes that can be used
instead of properties to define a query to be used in Xstore as
described in the sections above. However, there are some instances
where a property is required.
<Property>
<Key dtype="String">QueryType</Key>
<Value dtype="String"><![CDATA[Procedure]]></Value>
</Property>
Overview
This chapter describes the DocBuilder Framework, which is used to create documents
that are printed on the receipt printer. This includes both receipt printing and frankings
that are performed on tenders.
Note that report creation is not configured through the DocBuilder Framework. Reports
are configured through the Reporting Framework, which is described in Chapter 11,
“Reporting Framework”.
Tracing
Tracing is a helpful tool for debugging receipt and log configurations when something
unexpected happens. It can help you identify the configuration that caused a problem
with a particular part of a receipt or log.
Enable tracing for receipt building: Set the following system property to “true” in the
file system.properties:
dtv.hardware.rcptbuilding.RcptElementFactory.trace=true
The section name and source file name and line number will be included in the
generated document at the start of each section. With this information you can find the
part of the configuration that produces each part of the receipt.
RcptConfig.xml
The RcptConfig.xml file defines all aspects of the receipts and tender frankings that
are printed in the receipt printer. These are constructed through document sections that
can be additionally formatted through special formatters. In addition, receipts are given
copy rules that affect the number and type of receipts printed for different transaction
types.
The file RcptConfig.xml is organized as follows:
<ReceiptDefinitions> Element:
xmlns:xsi Attribute
xsi:noNamespaceSchemaLocation Attribute
<FormatterMap> Element:
<Formatter> Element:
See Formatter (<Formatter>) for the organization of this element.
<ReceiptCopyRules> Element:
<ReceiptCopyRule> Element:
See Receipt Copy Rule (<ReceiptCopyRule>) for the organization of
this element.
<receipts> Element:
<receipt> Element
See Receipt Document (<receipt>) for the organization of this element.
<FrankTenders> Element:
<FrankTender> Element
See Tender Franking (<FrankTender>) for the organization of this
element.
<sections> Element:
<section> Element:
See Section (<section>) for the organization of this element.
Formatter (<Formatter>)
A Formatter provides additional formatting capabilities beyond those available from an
object, or through the configuration options available in a <section> element.
The <Formatter> element has the following organization:
<Formatter> Element:
name Attribute
class Attribute
ctx Attribute
force Attribute
formatterType Attribute
includeCurrencySymbol Attribute
format Attribute
length Attribute
<Class> Element
<Parameter> Element:
name Attribute
value Attribute
<param_value> Element:
dtype Attribute
• name - This attribute defines the name of the <Formatter>. This name is used by a
<field> element’s formatter attribute to call the <Formatter>.
• class - Contains the fully-qualified name of the Java class that formats the output.
This Java class must implement dtv.pos.docbuilding.format.IFormatter.
• ctx - Defines the output context for the content: Document, View, or Receipt
(default). This attribute allows information to be formatted based on the output
context.
• <Class> - Contains the fully-qualified name of the Java class that formats the
output. This Java class must implement
dtv.pos.docbuilding.format.IFormatter.
• <Parameter> - This element is used to send a parameter value to the Java class
called in the <Class> element.
- name - The name of the parameter.
- value - The value that is sent in the parameter. If the value attribute is used,
the parameter is sent as a String. If the parameter being sent has a different data
type (such as Boolean or Class), the <param_value> sub-element must be
used, with the dtype attribute indicating the type of data being sent.
• <param_value> - This element contains the value sent in the named
<Parameter>. This element allows a value that is not a String to be sent as a
parameter.
- dtype - This attribute indicates the type of data contained in the
<param_value> element.
Formatter Example
<Formatter name="TimeclockEntryType"
class="dtv.pos.i18n.format.CodeDescriptionFormatter" ctx="RECEIPT">
<Parameter name="setCodeClass">
<param_value
dtype="Class">dtv.pos.timeclock.TimeClockEntryType</param_value>
</Parameter>
</Formatter>
document_id Element:
dtype Attribute
copy_count Element:
dtype Attribute
additive Element:
dtype Attribute
• name - The name of the <ReceiptCopyRule>. This name is used to call the
<ReceiptCopyRule>.
• document - Defines the <receipt> document type called by the
<ReceiptCopyRule> when all of the <Rule> conditions are met.
• additive - Indicates whether additional <ReceiptCopyRule> elements may be
processed alongside this <ReceiptCopyRule>, or if no other
<ReceiptCopyRule> should be processed for the transaction.
• copies - Indicates the number of receipt copies that are created by the
<ReceiptCopyRule> when the conditions specified by the rule are met.
• enabled - Determines whether the <ReceiptCopyRule> is currently in use.
• <enabled> - This element determines whether the <ReceiptCopyRule> is
currently in use.
- dtype - Indicates the type of data contained in the element. The only valid value
for this attribute is “Boolean”. This element has the following values:
* true - The <ReceiptCopyRule> is currently in use.
* false - The <ReceiptCopyRule> is not currently in use.
• <Rule> - This element defines a rule for the Receipt Copy Rule. If the conditions for
the <Rule> are met, processing of the <ReceiptCopyRule> continues. If the
conditions are not met, processing stops in the <ReceiptCopyRule> and no
document is printed.
If there are multiple <Rule> elements in a <ReceiptCopyRule>, then all of the
<Rule> conditions must be met.
• class - Contains the fully-qualified name of a Java class that determines whether
the conditions for a <Rule> have been met. This class must implement the
dtv.pos.hardware.rcptbuilding.copyrules.IRcptCopyRule class.
• <Class> - This element contains the fully-qualified name of a Java class that
determines whether the conditions for a <Rule> have been met. This class must
implement the
dtv.pos.hardware.rcptbuilding.copyrules.IRcptCopyRule class.
• <Parameter> - This element is used to send a parameter value to the Java class
called in the <Class> element.
- name - The name of the parameter.
- value - The value that is sent in the parameter. If the value attribute is used,
the parameter is sent as a String. If the parameter being sent has a different data
type (such as Boolean or Class), the <param_value> sub-element must be
used, with the dtype attribute indicating the type of data being sent.
<receipt document="CUSTOMER_TENDER_EXCHANGE"
sectionref="CUSTOMER_TENDER_EXCHANGE_COPY"/>
<receipt document="GIFT" sectionref="GiftReceipts" email="true"/>
• type - This attribute indicates the tender type for which this <FrankTender> is
used.
• action - This attribute indicates whether this <FrankTender> is used when the
tender is being issued (ISSUED) or redeemed (REDEEMED).
• post_void - This attribute indicates whether the <FrankTender> is used during a
post void transaction. This attribute has the following valid values:
- true - This <FrankTender> is used for a post void of a transaction in which
the tender_type was issued_or_redeemed.
- false - This <FrankTender> is used for a non-post void transaction in which
the tender_type is being issued_or_redeemed
• <enabled> - This element determines whether the <FrankTender> is currently in
use.
- dtype - Indicates the type of data contained in the element. The only valid value
for this attribute is “Boolean”. This element has the following values:
* true - The <FrankTender> is currently in use.
• key - This attribute contains a preconfigured text variable used to display text in the
output. Contents determined by text variables use translation keys and ITranslator to
determine the text displayed.
• <EvaluatedFormattable> - This element creates formattable text output using
the output from a function. The output of this element replaces one of the variable
placeholders from the <TranslationKey>. See Append Formattable Text Output
by a Function (<EvaluatedFormattable>) for more information about this element.
<ParametrizedFormattable> Example
The following <ParametrizedFormattable> element may be used in franking a
check tender:
<ParameterizedFormattable key="_frankCheckDescription">
<EvaluatedFormattable method="getTender.getDescription"/>
<EvaluatedFormattable method="getCheckSequenceNumber"/>
• method - This attribute contains the name of the function that is performed on the
current object.
• formatter - This attribute determines the name of the formatter that is used to
format the output. See Formatter (<Formatter>) for more information.
Section (<section>)
A section, defined by a <section> element, is a named area of a document that is used
as a building block of the document. These building blocks can be constructed from
individual elements, multiple elements, repeating elements, or combinations of elements
and other sections. A section may contain one or more conditions that are used to
evaluate the current object and determine if the section should be built or skipped.
Sections may be referenced from many different locations and references may be
embedded as deeply as necessary. A section reference is used to simplify a configuration
and reuse a section of a document in more than one place or in more than one type of
document. A section reference contains only the name of another section. (The name is
case-sensitive, just like Java.)
<horizontal_rule> Element:
style Attribute
<field> Element:
See Field (<field>) for the organization of this element.
<picture> Element:
filename Attribute
preload Attribute
<signature> Element:
<field> Element:
See Field (<field>) for the organization of this element.
<pagebreak> Element:
• name - This attribute is used to apply a name to the section. This name can then be
used to reference the section through a <sectionref> element.
• dbRef - This attribute specifies that the contents for this section will be obtained
from the COM_RECEIPT_TEXT table. The date retrieved from the specified method
is evaluated against COM_RECEIPT_TEXT.EFFECTIVE_DATE and
COM_RECEIPT_TEXT.EXPIRATION_DATE to determine if the receipt text should be
included. The format of this field is
<<TEXT_CODE>>::<<TEXT_SUBCODE>>::<<DATE_METHOD_TO_CALL>> where
<<TEXT_CODE>> will match the value from COM_RECEIPT_TEXT.TEXT_CODE,
<<TEXT_SUBCODE>> will match the value from
COM_RECEIPT_TEXT.TEXT_SUBCODE, and <<DATE_METHOD_TO_CALL>> will be
a method to call via reflection on the current target object.
• class - This attribute contains the fully-qualified Java class name used to return a
condition result, or examine the current object.
• method - This attribute contains the name of the function that is performed on the
current object. The data returned is converted to a String and the results are
compared against a value defined in the comparison attribute. If the method
returns a NULL value, the value is appended as a zero-length string.
• comparison - This attribute defines the comparison performed between the data
from the method and a certain, defined value.
• inverted - Indicates whether the Boolean result of the condition should be
inverted.
• method_param - This attribute defines a parameter that is passed to the function
called in the method attribute.
• <Parameter> - This element is used to send a parameter value to the Java class
called in the <Class> element, or define the comparison value for the comparison
attribute.
- name - The name of the parameter.
- value - The value that is sent in the parameter. Only used when passing a
parameter to a <Class>. If the value attribute is used, the parameter is sent as
a String. If the parameter being sent has a different data type (such as Boolean),
the <param_value> sub-element must be used, with the dtype attribute
indicating the type of data being sent.
Comparison Condition
A simple condition defines a method of the current object to be examined (method), a
comparison to perform (comparison), and—depending on the comparison—a
comparison value (param_value).
The definitions and usage of both the “method” and the “method parameters” elements
are identical to those in any other method field. See “Call a Function (method)” for more
information.
The comparison Attribute defines the comparison to be applied to the method results.
The following values are valid for the comparison attribute:
• EQUAL - The value returned equals another value.
• NOT_EQUAL - The value returned does not equal another value.
• IS_NULL - The value returned by the method is null.
• NOT_NULL - The value returned by the method is not null.
• IS_BLANK - The string returned by the method is blank.
• NOT_BLANK - The string returned by the method is not blank.
• IS_EMPTY - The list returned by the method is empty.
• NOT_EMPTY - The list returned by the method is not empty.
• LESS_THAN - The value returned is less than another value.
• GREATER_THAN - The value returned is greater than another value.
• GREATER_THAN_ZERO - The value returned is positive in sign.
• LESS_THAN_ZERO - The value returned is negative in sign.
• LESS_THAN_OR_EQUAL - The value returned is less than or equal to another value.
• GREATER_THAN_OR_EQUAL - The value returned is greater than or equal to another
value.
• TRUE - The method returned a value of “true”.
• FALSE - The method returned a value of “false”.
The comparison values NULL, NOT_NULL, IS_BLANK, NOT_BLANK, IS_EMPTY,
NOT_EMPTY, TRUE, and FALSE do not require a condition parameter to compare the
value against. All other <comparison> values require a condition parameter to
compare against; the comparison parameter is defined by the <param_value> sub-
element of the <Parameter> element.
Condition Examples
The following example shows a condition that checks whether the value returned by
getAmount is greater than zero:
Another example shows a condition that checks whether the value returned by
getCardType is not equal to the debit value on the card.
Example
<condition>
<method dtype="String">getAmount</method>
<comparison dtype="String">GREATER_THAN</comparison>
<Parameter name="VALUE">
<param_value dtype="BigDecimal">0</param_value>
</Parameter>
</condition>
<condition method="getSignature.getSignature"
comparison="NOT_NULL"/>
<condition
class="dtv.pos.docbuilding.conditions.IncludeTenderTypeCondition"
type="CREDIT_CARD"/>
This following example returns "true" if the line item tender is a non-foreign travelers
check.
<section name="travelers_check_tender">
<condition
class="dtv.pos.docbuilding.conditions.LineTenderTypeCondition"
value="TRAVELERS_CHECK"/>
<row>
<field method="getTender.getDescription"/>
<field method="getAmount" formatter="Money" loc="-3"/>
</row>
</section>
Multiple Conditions
When there is more than one <condition> for an element, all of the <condition>
sub-elements associated with an element must be met for the element to appear. In other
words, there is an AND operator between the <condition> elements. If any one
<condition> for an element returns a “false” value, the element is not displayed.
<condition
class="dtv.pos.docbuilding.conditions.InstanceOfCondition"
value="dtv.xst.dao.ttr.ICreditDebitTenderLineItem"/>
• <left_margin> - This element determines the width and style of the left margin.
- dtype - This attribute indicates the type of data used for the element, which
affects the margin created. This following values are valid for this attribute:
* Integer - When the dtype attribute is set to this value, the number in the
element defines the number of spaces in the left margin.
* String - When the dtype attribute is set to this value, the string in the
element is used as the actual text in the left margin.
The left_margin attribute performs the same function as the <left_margin>
element. However, by using this attribute, the dtype is interpreted rather than
explicitly set, as it is with the <left_margin> element.
• <right_margin> - This element determines the width and style of the right
margin.
- dtype - This attribute indicates the type of data used for the element, which
affects the resulting margin. This following values are valid for this attribute:
* Integer - When the dtype attribute is set to this value, the number in the
element defines the number of spaces in the right margin.
* String - When the dtype attribute is set to this value, the string in the
element is used as the actual text in the right margin.
The right_margin attribute performs the same function as the <right_margin>
element. However, by using this attribute, the dtype is interpreted rather than
explicitly set, as it is with the <right_margin> element.
• style - This attribute determines the style of the text. The following values are
preconfigured for this attribute:
- BOLD - The field is printed using bold text.
- UNDERLINE - The field is printed with underlined text.
- STRONGUNDERLINE - The field is printed with text that is both bold and
underlined.
- ITALICS - The field is printed in italics.
- REVERSE - The field is printed with colors reversed. For example, the field is
printed with white text on a black background, rather than black text on a white
background.
• charsize - This attribute determines the size of the characters in the text. The
following values are preconfigured for this attribute:
- NORMAL - The characters are of normal size.
- DOUBLEHIGH - The characters are of normal width and double height.
- DOUBLEWIDE - The characters are of normal height and double width.
- (X2HW) DOUBLEHIGHDOUBLEWIDE - The characters are of both double height
and double width.
• align (alignment) - The attribute determines the horizontal alignment of the
text. The following values are preconfigured for the attribute:
- (L) LEFT - Field information begins on the left edge of the field. (default)
- (R) RIGHT - Field information begins on the right edge of the field.
- (C) CENTERED - Field information is centered within the field.
• <condition> - This element uses configurable logic to determine whether to
include data in a document. If this condition returns a “true” value, then the data is
displayed. If this condition returns a “false”, the data is not displayed. See “Apply a
Condition (<condition>)” for a full description of the <condition> element, its use,
and its structure.
• <field> - This element determines the contents displayed in the <region>. See
“Field (<field>)” for more information.
The sample <region> defined above would produce the following output:
0000000001111111111222222222233333333334
1234567890123456789012345678901234567890
The sample <region> defined above would produce the following output:
**NOTICE**
This loyalty card has expired or has one or more
expired accounts.
The sample <region> with Integer margins produces the following results:
000000000111111111122222222223333333
333412345678901234567890123456789012
34567890
The sample <region> with String margins produces the following results:
* 000000000111111111122222222223333333 *
* 333412345678901234567890123456789012 *
* 34567890 *
* *
* Cardholder will pay card issuer *
* above amount pursuant to Cardholder *
* Agreement *
* *
* Le Titulaire versera ce montant a *
* L'émetteur conformement au contrat *
* adherent *
Field (<field>)
This section describes several different types of fields and how they are used. A field
may have a Formatter associated with it that will change the way the field is displayed.
There are four different types of fields that can be configured. These field types are
configured through the inclusion of certain sub-elements of the <field> element. There
can be only one of these sub-elements in each <field> element. These field types and
their associate sub-elements are the following:
• Text - A field that displays pre-defined text. Uses a <text> element or text
attribute.
• Method - A field that displays the output of a function. Uses a method attribute.
• System Property - A field that displays the value of a system property. Uses a
systemproperty attribute.
• Aggregate - A field that calls a Java class that then retrieves information from
multiple locations. Uses an <aggregate> element.
The <field> element has the following organization:
<field> Element:
formatter Attribute
text Attribute
style Attribute
align Attribute
loc Attribute
method Attribute
method_param Attribute
systemproperty Attribute
<text> Element:
dtype Attribute
<aggregate> Element:
class Attribute
contents Attribute
• <priority> - This element determines which fields may overtype other fields. If a
field overlaps another field, the <priority> tag is used to determine which field is
displayed in the overlapping area. The values of the <priority> elements are
compared, and the <field> with the higher <priority> value is displayed.
When two fields have equal priorities, the field that appears later in the definition is
given a higher priority.
The default <priority> for each <field> is zero.
- dtype - Indicates the type of data contained in the element. The only valid value
for this attribute is “Integer”.
PRIORITY EXAMPLE
If the receipt printer has 40 characters per line and the description field exceeds 20 characters, the quantity
field overtypes it. This would occur because the description field does not have a defined priority (it
defaults to zero) but the quantity field has a defined priority of “1”.
If the extended price is more than 10 characters wide, it will overtype the quantity since they both have a
defined priority of 1, but the extended price field is defined after the quantity field.
<row>
<field>
<priority dtype=”Integer”>0</priority>
<method dtype="String">getItem.getDescription</method>
</field>
<field>
<location dtype="Integer">-20</location>
<priority dtype="Integer">1</priority>
<method dtype="String">getQuantity</method>
</field>
<field>
<location dtype="Integer">-10</location>
<priority dtype="Integer">1</priority>
<method dtype="String">getExtendedPrice</method>
</field>
</row>
method Example
In the following example, the method getTransactionSequence is invoked on the
current object. Because no iterators are encountered, the object should implement
IPosTransaction. This method returns a long value which is converted to a String
and appended to the receipt document.
<field method="getTransactionSequence"/>
<field method="getOperatorParty.getEmployeeId"/>
<method_param> Example
Some functions called by the method attribute may require parameters to be sent to
them. The <method_param> element is used to send these parameters to the called
function.
<call method="getTaxModifiers">
<call method="get">
<method_param dtype="Integer">0</method_param>
<sectionref>SINGLE_TAX_SUBSECTION</sectionref>
</call>
</call>
<condition> Element:
See “Apply a Condition (<condition>)” for the organization of this
element.
<item_comparator> Element:
dtype Attribute
The following sub-elements of <iterator> are identical to those in
the <section> element. See “Section (<section>)” and, if available, the
element-specific section for more information on the organization of
the sub-elements listed below.
<iterator> Element:
As described in this section.
<row> Element
<region> Element:
See “Text Block with Multiple Lines (<region>)” for the organization of
this element.
<textblock> Element:
See “Multiple Lines of Text from com_receipt_text (<textblock>)” for
the organization of this element.
<call> Element
<sectionref> Element
<barcode> Element:
See “Barcode (<barcode>)” for the organization of this element.
<picture> Element
<horizontal_rule> Element
<signature> Element
<pagebreak> Element:
<percent_width> Element
• method - This attribute contains the name of the function that is performed on the
current object. The data returned by the method function is a collection of data, a
subtype of a collection, or an array of any type. The <iterator> loops once for
each data item in the collection. If the method returns a NULL value, the
<iterator> loop does not perform any processing.
• <method_param> - This element defines a parameter that is passed to the function
called in the method. Can also be an attribute.
- dtype - This attribute indicates the type of data contained in the parameter.
• <condition> - This element uses configurable logic to determine whether to
process the current data item from the collection. If this condition returns a “true”
value, then the <iterator> processes the data in the current data item. If this
condition returns a “false”, the data item is not processed and the <iterator> loop
continues with the next data item in the collection. See “Apply a Condition
(<condition>)” for a full description of the <condition> element and its structure.
• <item_comparator> - This element specifies the fully-qualified class used to sort
the data collection created by the method. This class implements the
java.util.Comparator class.
<DateMethod> Element:
dtype Attribute
<code> Element:
dtype Attribute
method Attribute
text Attribute
<text> Element:
dtype Attribute
<method> Element:
dtype Attribute
<method_param> Element:
dtype Attribute
<systemproperty> Element:
dtype Attribute
<aggregate> Element:
<Class> Element
<contents> Element:
dtype Attribute
<subcode> Element:
dtype Attribute
text Attribute
method Attribute
<text> Element:
dtype Attribute
<method> Element:
dtype Attribute
<method_param> Element:
dtype Attribute
<systemproperty> Element:
dtype Attribute
<aggregate> Element:
<Class> Element
<contents> Element:
dtype Attribute
• dateMethod - This attribute contains the name of the function that is run to
determine the current date. This date is used to evaluate effective and expiration
dates configured for the text in the com_receipt_text table.
• <code> - This element determines the text_code value searched for by the
database query.
- method - This attribute contains the name of the function that is performed on
the current object. The data returned is converted to a String and entered into
the query. If the method returns a NULL value, the value is entered as a zero-
length string. See “Call a Function (method)” for more information.
- text - This attribute contains either a CDATA string or a preconfigured text
variable that determines the text for the query. Contents determined by text
variables use translation keys and ITranslator to determine the query text.
• <subcode> - This element is used to determine the text_subcode value searched
for by the database query.
- method - This attribute contains the name of the function that is performed on
the current object. The data returned is converted to a String and entered into
the query. If the method returns a NULL value, the value is entered as a zero-
length string. See “Call a Function (method)” for more information.
- text - This attribute contains either a CDATA string or a preconfigured text
variable that determines the text for the query. Contents determined by text
variables use translation keys and ITranslator to determine the query text.
• style - This attribute determines the style of the text. The following values are
preconfigured for this attribute:
- BOLD - The field is printed using bold text.
- UNDERLINE - The field is printed with underlined text.
- STRONGUNDERLINE - The field is printed with text that is both bold and
underlined.
- ITALICS - The field is printed in italics.
- REVERSE - The field is printed with colors reversed. For example, the field is
printed with white text on a black background, rather than black text on a white
background.
• charsize - This attribute determines the size of the characters in the text. The
following values are preconfigured for this attribute:
- NORMAL - The characters are of normal size.
- DOUBLEHIGH - The characters are of normal width and double height.
- DOUBLEWIDE - The characters are of normal height and double width.
- DOUBLEHIGHDOUBLEWIDE - The characters are of both double height and
double width.
• alignment - The attribute determines the horizontal alignment of the text. The
following values are preconfigured for the attribute:
- LEFT - Field information begins on the left edge of the field. (default)
- RIGHT - Field information begins on the right edge of the field.
- CENTERED - Field information is centered within the field.
• <condition> - This element uses configurable logic to determine whether to
include data in a document. If this condition returns a “true” value, then the data is
displayed. If this condition returns a “false”, the data is not displayed. See “Apply a
Condition (<condition>)” for a full description of the <condition> element, its use,
and its structure.
• <left_margin> - This element determines the width and style of the left margin.
- dtype - This attribute indicates the type of data used for the element, which
affects the margin created. This following values are valid for this attribute:
* Integer - When the dtype attribute is set to this value, the number in the
element defines the number of spaces in the left margin.
* String - When the dtype attribute is set to this value, the string in the
element is used as the actual text in the left margin.
• <right_margin> - This element determines the width and style of the right
margin.
- dtype - This attribute indicates the type of data used for the element, which
affects the resulting margin. This following values are valid for this attribute:
* Integer - When the dtype attribute is set to this value, the number in the
element defines the number of spaces in the right margin.
* String - When the dtype attribute is set to this value, the string in the
element is used as the actual text in the right margin.
• <DateMethod> - This element contains the name of the function that is run to
determine the current date. This date is used to evaluate effective and expiration
dates configured for the text in the com_receipt_text table.
- dtype - This attribute indicates the type of data returned by the method. The
only valid value for this attribute is “String”.
• <code> - This element determines the text_code value searched for by the
database query.
• <text> - This element contains either a CDATA string or a preconfigured text
variable that determines the text for the query. Contents determined by text variables
use translation keys and ITranslator to determine the query text.
- dtype - Indicates the type of information for the query. The only valid value for
this attribute is “String”.
• <method> - This element contains the name of the function that is performed on the
current object. The data returned is converted to a String and entered into the query.
If the method returns a NULL value, the value is entered as a zero-length string. See
“Call a Function (method)” for more information.
- dtype - This attribute indicates the type of data that is returned by the function.
The only valid value for this attribute is “String”.
• <method_param> - This element defines a parameter that is passed to the function
called in the <method> element.
- dtype - This attribute indicates the type of data contained in the parameter.
• <systemproperty> - This attribute retrieves the value for the named system
property and returns that value for the query. Values can be accessed from master,
store, or station configurations using the full xpath of the configured value.
- dtype - This attribute indicates the type of data returned from the property.
• <aggregate> - This element is used to call a class that then retrieves information
from multiple locations.
• <Class> - This element contains the fully-qualified Java class name that is called
from within the <aggregate> element.
• <contents> - This element defines the text string that is passed to the Java class in
the <Class> element. The String can be either a CDATA string, or a preconfigured
text variable. Contents defined by text variables use translation keys and ITranslator
to determine the text displayed.
- dtype - This attribute indicates the type of data being sent by the <contents>
element. The only valid value for this attribute is “String”.
• <subcode> - This element is used to determine the text_subcode value searched
for by the database query.
Barcode (<barcode>)
A <barcode> element is used to print a value as a barcode.
The <barcode> element has the following organization:
<barcode> Element:
symbology Attribute
textposition Attribute
<field> Element:
See “Field (<field>)” for the organization of this element.
Code 39 EAN 13
MAXICODE UPC-A
PLANET UPC-E
Interleaved 2 of 5 UPC-D1
EAN 8 UPC-D5
• textposition - This attribute defines the location of barcode text in relation to the
barcode itself. This element has the following possible values:
* ABOVE - The text is placed above the barcode.
* BELOW - The text is placed below the barcode.
* NONE - There is no barcode text.
• <field> - This element defines the portion of the document that is reserved for the
barcode. See “Field (<field>)” for more information. The output of the <field> is
then formatted into a barcode.
The example below shows a full customer name that begins with a call to
getCustomerParty.
<call>
<method dtype=”String”>getCustomerParty</method>
<row>
<field>
<method dtype=”String”>getFirstName</method>
</field>
<field>
<text dtype=”String”><![CDATA[ ]]></text>
</field>
<field>
<method dtype=”String”>getLastName</method>
</field>
</row>
</call>
The example below shows the use of nested <call> elements to implement sections
through <sectionref>:
<call method="getRetailTransactionLineItems">
<call method="get">
<method_param dtype="Integer">0</method_param>
<sectionref>SINGLE_TAX_EXEMPT</sectionref>
<sectionref>MULTIPLE_TAX_EXEMPT</sectionref>
</call>
</call>
DocBuilder field
<field formatter="Quantity">
<aggregate class="dtv.pos.common.rcpt.SoldItemsCountDocBuilderField"/>
</field>
public AbstractDocBuilderField(
String argContents, String argStyle, Integer argLocation,
DocBuilderAlignmentType argAlignment, int argPriority,
IOutputFormatter argFormatter)
The valid “dtype” values for a method parameter are the configuration types that
implement dtv.pos.framework.config.IReflectionParameterCapable. The values are:
• String
• Boolean
• Integer
• PositiveInteger
• Class
• Color
• Date
• DoubleArray
• Float
• Icon
• IntegerArray.
Note: “Normal” is the default value for the printer. The actual value
can be found in the manufacturer’s guide for the specific device.
Overview
This chapter describes how hardware is configured and communication is handled in
Xstore Point of Service. This includes an overview of JavaPOS, the application interface
used by Xstore Point of Service, and a description of the files that configure each
peripheral in Xstore Point of Service.
enables the application to register the “listeners” that it needs to receive information
from a physical device.
<JposEntry logicalName="Epson-TM88IV-Drawer1-USB">
<creation
factoryClass="jp.co.epson.uposcommon.creator.EpsonJposServiceInstanceFactory
" serviceClass="jp.co.epson.upos.core.v1_13_0001.drw.StandardService"/>
<vendor name="SEIKO EPSON" url="http://www.epson.com"/>
<jpos category="CashDrawer" version="1.13"/>
<product description="EPSON Standard CashDrawer Device Service"
name="EPSON Services for JavaPOS(TM) Standard" url="http://www.epson.com"/>
<!--Other non JavaPOS required property (mostly vendor properties and bus
specific properties i.e. RS232 )-->
<prop name="OutputTimeout" type="String" value="500"/>
<prop name="epson.trace.file" type="String" value="trace.log"/>
<prop name="OutputBufferSize" type="String" value="65536"/>
HwsDevices.properties
The HwsDevices.properties file stores configurations for all devices that are
enabled and are used by the hardware service. Each configuration has the following
format:
<JPosEntry name> <FamilyType>:<Usage Code>[,<Usage
Code>][:<Implementation Class on mobile server>]
Where:
• <JPosEntry name> is the name of the JPOS device in the jpos.xml file.
• <FamilyType> is the family of devices to which it belongs (for example,
CashDrawer or MICR). This is the same family type used in the
HardwareConfig.xml file.
This configuration has the following possible values:
- Scanner
- POSPrinter
- CashDrawer
- MICR
- FiscalPrinter
- ElectronicJournal
- LineDisplay
- Biometrics
• <Usage Code>[,<Usage Code>] is a comma-separated list of codes identifying
the uses for the device. These is the same usage codes used in the
HardwareConfig.xml file.
• <Implementation Class on mobile server> is the full name of the class
used to interface with the device.
Examples
• Epson-TMH6000III-Drawer1-USB CashDrawer:CASHDRAWER
• Epson-TMH6000III-Printer-USB POSPrinter:RECEIPT,VALIDATION
• Epson-TMH6000III-MICR-USB MICR:MAIN_MICR
• Zebra-Scanner-USB Scanner:BARCODE_SCANNER
• Crossmatch-FingerprintReader-USB BIOMETRIC:FINGERPRINT:
dtv.hardware.biometric.crossmatch.CrossmatchBiometricDevice
• EftLink-LineDisplay-Proxy ServerSideCustomerDisplay:
CUST_DISPLAY2:dtv.hardware.eftlink.custdisplay.
EftLinkCustDisplay
HwsFamilyTypes.properties
The HwsFamilyTypes.properties file defines the default device handler class and
JavaPOS category mapping configurations for known hardware family types.
Example
Scanner oracle.retail.xstore.hardware.service.scanner.Scanner,
true,Scanner
ServerSideScanner java.lang.Object,true,Scanner
POSPrinter
oracle.retail.xstore.hardware.service.posprinter.PosPrinter,true,
POSPrinter
ServerSidePOSPrinter java.lang.Object,true,POSPrinter
CashDrawer
oracle.retail.xstore.hardware.service.cashdrawer.CashDrawer,true,
CashDrawer
ServerSideCashDrawer java.lang.Object,true,CashDrawer
MICR oracle.retail.xstore.hardware.service.micr.Micr,true,MICR
ServerSideMICR java.lang.Object,true,MICR
FISCAL
oracle.retail.xstore.hardware.service.fiscalprinter.FiscalPrinter
,true,FiscalPrinter
ServerSideFISCAL java.lang.Object,true,FiscalPrinter
ElectronicJournal
oracle.retail.xstore.hardware.service.electronicjournal.
ElectronicJournal,true,ElectronicJournal
ServerSideElectronicJournal java.lang.Object,true,POSPrinter
CustomerDisplay
oracle.retail.xstore.hardware.service.linedisplay.LineDisplay,
true,LineDisplay
ServerSideCustomerDisplay java.lang.Object,true,LineDisplay
BIOMETRIC
oracle.retail.xstore.hardware.service.biometrics.Biometrics,
true,Biometrics
ServerSideBIOMETRIC java.lang.Object,true,Biometrics
ServerSideLabelPrinter java.lang.Object,true,POSPrinter
HwsConfig.properties
The HwsConfig.properties file defines the general configuration of the hardware
service and connection details:
This file contains the following configurations:
• SSL Configurations
• Appx Configurations
SSL Configurations
The SSL prefixed keys configure the security for the connection between the hardware
service and the Xstore Point of Service Mobile server. Each key value is entered into a
setter method for the Jetty SslContextFactory. All values are of boolean type (true/
false) and are false by default.
• SSL.ValidatePeerCerts: Determines whether the hardware service will validate SSL
certificates of the peer (default: false).
• SSL.ValidateCerts: Determines whether the hardware service will validate SSL
certificates (default: false).
• SSL.NeedClientAuth: Determines whether the hardware service requires client
authorization (default: false).
• SSL.WantClientAuth: Determines whether the hardware service wants client
authorization (default: false).
• SSL.EnableOCSP: Determines whether CRL Distribution Points Support is enabled
(default: false).
• SSL.TrustAll: Determines whether the hardware service trusts all SSL certificates
when there is no keystore or truststore (default: false).
Appx Configurations
The Appx keys determine where the hardware service finds the configuration file
containing the server connection information. This connection information is written by
the Xstore Point of Service Mobile client. It is stored in a subdirectory of the Xstore Point
of Service Mobile client installation.
Configuration File
The configuration file is found at:
${Appx.AppData}\${Appx.Triggerfile}
where:
• Appx.AppData: Directory where the configuration file can be found (default:
${LOCALAPPDATA}\\Packages\\${appx.appid}\\LocalState)
where:
- LOCALAPPDATA: An environment variable (present on all Windows 10
systems) pointing to the users application data directory.
- Appx.AppId: Application identifier for the mobile client UWP app. This is a
unique ID of the form:
<Component_Id>_<Vendor_Id_Hash>
where:
* <Component_Id> is the is the fully-qualified class name for the client
application (see Appx.ComponentPrefix). This value is largely constant.
* <Vendor_Id_Hash> is a hash of the Vendor ID. This is unique to each
customer.
For example, the base version of mobile client uses
com.oracle.retail.xstore_f4h6hw8hbrhzm, where f4h6hw8hbrhzm is
a hash for Oracle.
• Appx.TriggerFile: Name of the configuration file (default:
mobileappdata.properties).
Registry
The hardware service is able to retrieve the correct application ID from the Windows
registry. This avoids the need for each configuration to configure the correct application
ID. To do that, it searches for the value of the Appx.ComponentPrefix setting in the
following registry path:
${Appx.RegistryRoot}\\${Appx.RegistryPath}
where:
• Appx.ComponentPrefix: The family name prefix of the mobile application, which is
also the fully-qualified class name for the client application. (default:
com.oracle.retail.xstore). This is used to look up the family name in the
registry.
• Appx.RegistryRoot: The registry root in which to look up the application family
name (default value is blank, which searches all the roots).
Possible values:
- HKCU
- HKLM
- HKCR
• Appx.RegistryPath: The registry path where the family name is set. (default:
SOFTWARE\\Classes\\Local Settings\\Software\\Microsoft\\
Windows\\CurrentVersion\\AppModel\\Repository\\Families)
HardwareConfig.xml
The file HardwareConfig.xml lists the devices that are available to the Xstore Point of
Service system, their usages, and the hardware options that are configurable.
The HardwareConfig.xml file has the following organization:
<Hardware> Element:
xmlns:xsi Attribute
xsi:noNamespaceSchemaLocation Attribute
<PlaySounds> Element:
dtype Attribute
<ForceDrawerClose> Element:
dtype Attribute
<ShowPrinterDialog> Element:
dtype Attribute
<RemotePrintPort> Element:
dtype Attribute
<PrintTargetFromRemote> Element:
dtype Attribute
<Device> Element:
See “Device (<Device>)” for the organization of this element.
<DeviceList> Element:
type Attribute
use Attribute
<DeviceRef> Element:
use Attribute
translationkey Attribute
literal Attribute
• <Hardware> - This element defines the hardware and hardware options used by
Xstore Point of Service, including definitions for peripheral devices. This element
has the following attributes:
- dtype - This attribute defines the type of data contained in the element. The
only valid value for this attribute is “Hardware”.
- xmlns:xsi - The XML schema definition.
- xsi:noNamespaceSchemaLocation - The name of the .xsd file associated
with the XML file.
• <PlaySounds> - This element determines whether Xstore Point of Service uses the
system sound card. This element has the following attribute:
- dtype - This attribute defines the type of data contained in the element. The
only valid value for this attribute is “Boolean”.
This element has the following possible values:
- use - This attribute indicates the manner in which the peripherals are used.
• <DeviceRef> - This element refers to a <Device> by its use. The hardware
peripheral indicated by the <Device> is then included in the selection list defined
by the <DeviceList> of which the <DeviceRef> is a sub-element. This element
has the following attributes:
- use - This attribute refers to a <Device> by the use value of the <Device>
included in the <DeviceList>.
- translationkey - This attribute contains a preconfigured, translatable text
variable used to display text in the output. The translated output uses
translation keys and internationalization settings to determine the text
displayed. The output of this element is displayed as the device name in the
device list.
- literal - This attribute contains a string that is displayed as the name of the
device in the device list.
Device (<Device>)
The <Device> element defines the properties of the peripheral hardware devices used
by Xstore Point of Service. These devices include hardware such as customer displays,
cash drawers, handhelds, pinpads, printers, scanners, and magnetic stripe readers.
These devices can be directly connected to the Xstore Point of Service system, or they can
be accessed through the network.
The <Device> element has the following organization:
<Device> Element:
type Attribute
use Attribute
<name> Element:
dtype Attribute
<host> Element:
dtype Attribute
<OpenPulseLevel> Element:
dtype Attribute
<Enabled> Element:
dtype Attribute
<RemoteHost> Element:
dtype Attribute
<RemotePort> Element:
dtype Attribute
<PollInterval> Element:
dtype Attribute
<impl> Element:
dtype Attribute
• <Device> - This element defines the peripheral devices available to Xstore Point of
Service. The element has the following attributes:
- type - This attribute indicates the type of peripheral that is being configured.
- use - This attribute indicates the manner in which the peripheral is used.
• <name> - This element defines the name used to refer to the device. For example,
this is the name used to configure the JPOS interface in the jpos.xml file. This
element has the following attribute:
- dtype - This attribute indicates the type of data contained in the element. The
only valid value for this attribute is “String”.
• <host> - Overrides the “host” property (<prop name=”host” .../>) for the
device in the jpos.xml file. This element overrides this specific hardware setting on
a per-device basis. (vendor/driver specific)
• <OpenPulseLevel> - Overrides the “OpenPulseLevel” property (<prop
name=”OpenPulseLevel” .../>) for the device in the jpos.xml file. This
element overrides this specific hardware setting on a per-device basis. (vendor/driver
specific)
• <Enabled> - This element determines whether the device is enabled for access. This
element has the following attribute:
- dtype - This attribute indicates the type of data contained in the element. The
only valid value for this attribute is “Boolean”.
This element has the following possible values:
* true - The device is enabled for access.
* false - The device is not enabled and Xstore Point of Service will not
attempt to access it.
• <RemoteHost> - This element defines the host to connect to when accessing a
network device, such as a remote printer. (vendor/driver specific)
This element has the following attribute:
- dtype - This attribute indicates the type of data contained in the element. The
only valid value for this attribute is “String”.
• <RemotePort> - This element defines the port to connect to on the <RemoteHost>
when accessing a network device. (vendor/driver specific)
This element has the following attribute:
- dtype - This attribute indicates the type of data contained in the element. The
only valid value for this attribute is “Integer”.
• <PollInterval> - This element defines the polling frequency used in the
connection to a <RemoteHost>. (vendor/driver specific)
This element has the following attribute:
- dtype - This attribute indicates the type of data contained in the element. The
only valid value for this attribute is “Integer”.
• <impl> - This element defines the fully-qualified name for the Java class used to
implement the device. This element has the following attribute:
- dtype - This attribute indicates the type of data contained in the element. The
only valid value for this attribute is “Class”.
Sample HardwareConfig.xml
<Hardware xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="HardwareConfig.xsd">
<PlaySounds dtype="Boolean">true</PlaySounds>
<ForceDrawerClose dtype="Boolean">true</ForceDrawerClose>
<ShowPrinterDialog dtype="Boolean">false</ShowPrinterDialog>
<RemotePrintPort dtype="Integer">${dtv.hardware.remotePrintPort}</
RemotePrintPort>
<PrintTargetFromRemote dtype="String">RECEIPT</PrintTargetFromRemote>
<Device type="POSPrinter" use="RECEIPT">
<name dtype="String">Generic-Printer-Log4j</name>
</Device>
<Device type="POSPrinter" use="RECEIPT_BACKUP">
<name dtype="String">Generic-Printer-Laser</name>
</Device>
<Device type="POSPrinter" use="RECEIPT1">
<name dtype="String">Generic-Printer-Log4j</name>
</Device>
<Device type="POSPrinter" use="RECEIPT2">
<name dtype="String">Generic-Printer-Log4j</name>
</Device>
<Device type="POSPrinter" use="RECEIPT3">
<name dtype="String">Generic-Printer-Log4j</name>
</Device>
<Device type="POSPrinter" use="RECEIPT4">
<name dtype="String">Generic-Printer-Log4j</name>
</Device>
<DeviceList type="POSPrinter" use="RECEIPT">
<DeviceRef use="RECEIPT1" translationkey="_RcptPrinter1"/>
<DeviceRef use="RECEIPT2" translationkey="_RcptPrinter2"/>
<DeviceRef use="RECEIPT3" translationkey="_RcptPrinter3"/>
<DeviceRef use="RECEIPT4" translationkey="_RcptPrinter4"/>
<DeviceRef use="RECEIPT5" translationkey="_RcptPrinter5"/>
</DeviceList>
<Device type="PinPad" use="MAIN_PINPAD">
<name dtype="String">Ingenico-65XX-PINPad-RS232</name>
<impl dtype="Class">dtv.hardware.ingenico.jpos.Ingenico65xxFormDevice</
impl>
<portName dtype="String">/dev/ttyS0</portName>
</Device>
.....
</Hardware>
Code 93 Barcodes
The ability to produce “Code 93” barcode format is an important feature in Xstore Point
of Service. Receipt printers and barcode scanners must be able to use this code because it
is the format used for transaction barcodes that are printed on a receipt. A receipt printer
must be able to print a Code 93 barcode that is 21 characters wide
Selecting a printer without sufficient Code 93 support may impose limitations. For
example, transaction sequence numbers may be limited to a maximum of 9999, register
numbers may be limited to a maximum of 99, and there may be other types of
undesirable restrictions.
dtvSignatureMessage Integer 1
DirectIOCommand
MICR Settings
Table 10-5: MICR Settings
MSR Settings
Table 10-6: MSR Settings
PINPad Settings
Table 10-7: PINPad Settings
Ingenico Settings
Table 10-8: Ingenico Settings
Overview
The Xstore Point of Service Reporting Framework provides users with an easy-to-use
method for retrieving information relevant to their business, and presenting that
information in a consistently formatted, concise, easily understood document. The
Reporting Framework does this through tools that build, process, and format the reports
that are then displayed or printed through Xstore Point of Service.
Data Templates
Data Templates are XML files that define:
• any prompts displayed in Xstore's UI when displaying a report
• any static text used in reports that comes from resource bundles
SQL Queries
SQL Queries referenced in XDT Data Templates are defined in the
ReportQueryConfig.xml files. XDT Data Templates can reference zero or more
named queries.
Note: The .rtf files are created and modified using Microsoft Word
and a BI Publisher MS Word plug-in: BI Publisher Desktop.
• config/config/dtv/res/config/query/ReportQueryConfig.xml:
Defines the queries referenced in the Data Template files.
• config/config/dtv/sql/mssql/query/ReportQueryConfig.xml: Defines
MS SQL Server-specific queries referenced in the Data Template.
• config/config/dtv/res/config/translations.properties: Static text
used in report UI prompts and the generated report.
• config/config/dtv/res/config/OpChainConfig.xml: References the
Report Definition's bean ID used in report-beans.xml.
• config/config/dtv/res/config/ActionConfig.xml: References keys in
translation.properties for report menu titles.
• xcenter-admin/src/main/SQL/data/xcenter_admin/dataupdate-
all.sql: Defines Viewer Menu Items.
• xcenter-admin/src/main/resources/xcenter/
translations.properties: Static text displayed in Xadmin report viewer
summarizing report's purpose.
ReportQueryConfig.xml
Queries must be defined within the file ReportQueryConfig.xml. A query in the
ReportQueryConfig.xml is referred to by the name assigned to it within the file.
The organization of the file ReportQueryConfig.xml is identical to that of the file
QueryConfig.xml. See QueryConfig.xml in Chapter 8, “Query Configuration” for
more information about this file.
Overview
The Xstore Point of Service Forms Framework allows users to create and configure forms
that can be used in the desktop version of Xstore Point of Service, Xstore Point of Service
Mobile on a handheld device, and Xstore Point of Service Mobile on a tablet.
FieldDefinitionConfig.xml
The FieldDefinitionConfig.xml file defines the fields that are used in the forms.
These field definitions are used to build layouts in FieldLayoutConfig.xml. The fields are
configured within a <FieldSet> element with the following structure.
<Field> Element:
name Attribute
type Attribute
resource Attribute
text Attribute
dataFieldRef Attribute
formatterRef Attribute
<Parameter> Element:
name Attribute
value Attribute
dtype Attribute
• <FieldSet> - (ROOT ELEMENT) Contains the set of all Field Definitions. Contains as
many <Field> sub-elements as necessary.
• <Field> - Defines one field. Each field can contain the following attributes:
- dataFieldRef - Restriction on the data that can be entered into the field. For
example, if this attribute is set to “Numeric”, the field will only accept
numbers.
Note: The valid values for this attribute are configured in the
DataFieldConfig.xml file.
- formatterRef - Defines the way the data in the field is presented. For
example, if this attribute is set to “DateMedium”, the field will display the data
as a date.
• <Parameter> - Defines additional configurations for the field.
- name - Name of the parameter.
- value - Value of the parameter.
Examples
Label Field
<Field type="Label" name="apartmentLabel" text="_aptLabel"/>
Text Field
<Field resource="address1" type="Text" name="address1"
dataFieldRef="Address"/>
List Field
GroupingList Field
Image Field
Table Field
Chart Field
Anchor Field
ProgressBar Field
Signature Field
MoreAuthInfo Field
FieldLayoutConfig.xml
The FieldLayoutConfig.xml file defines how fields (defined in
FieldDefinitionConfig.xml) are placed into rows and columns within a layout. These
layouts are then used by Form Definition Files to create pages that are displayed in
Xstore Point of Service. The fields are configured within a <FieldLayoutSet> element
with the following structure:
<FieldLayout> Element:
type Attribute
name Attribute
<Row> Element:
name Attribute
type Attribute
<Column> Element:
fill Attribute
start Attribute
width Attribute
fieldRef Attribute
verticalAlignment Attribute
horizontalAlignment Attribute
required Attribute
refreshOnChange Attribute
fontRef Attribute
visibilityGroup Attribute
fieldSubmitPriority Attribute
• <FieldLayoutSet> - (ROOT ELEMENT) Contains the set of all Field Layouts.
Contains as many <FieldLayout> sub-elements as necessary.
• <FieldLayout> - Defines one layout. Each layout includes the following attributes:
- name - Unique name used to refer to the layout.
- type - Type of layout. This attribute can have the following values:
* ListLayout - A layout that can contain one or more columns within each
row, with a defined width for each column.
* SimpleLayout - A layout that always has two dynamically-sized, equal-
width columns.
• <Row> - Defines one row within the layout.
For SimpleLayout layouts, this element will include two <Column> elements. For
<ListLayout> layouts, this element will include as many <Column> elements as
necessary.
- fill - Indicates whether the row should fill all available space in the form.
Default=false
- type - Type of layout. This attribute can have the following values:
* ListLayout - A layout that can contain one or more columns within the
row, with a defined width for each column.
* SimpleLayout - A layout that always has two dynamically-sized, equal-
width columns.
• <Column> - Defines one column within a row. This element includes the following
attributes:
- fill - Indicates whether the column should fill all available space in the form.
Default=false
- start - Starting point of the field within the layout. This is a numerical
percentage (0 to 100).
- width - Width of the field within the layout. This is a numerical percentage (0 to
100).
- fieldRef - The name of the field definition (from FieldDefinitionConfig.xml)
to insert into the layout.
- verticalAlignment - Vertical alignment of the field within the row. This
attribute can have the following values:
* Left
* Right
* Center
- horizontalAlignment - Horizontal alignment of the field within the column.
This attribute can have the following values:
* Top
* Bottom
* Center
- required - If this field is set to true, user must enter a value in the field.
- refreshOnChange - If this field is set to true, Xstore Mobile will send a
notification to the server when a user changes the value in the field.
- fontRef - Defines the font for the field (refers to a font defined in
FontConfig.xml).
- visibilityGroup - Refers to a condition that determines whether or not to
show the field within the layout.
- fieldSubmitPriority - Determines the order in which form fields are
processed in Xstore Point of Service Mobile. This is used to ensure that auto-
populated fields are handled properly. Default=0
Example
<Panel> Element:
startX Attribute
width Attribute
startY Attribute
height Attribute
FieldLayoutRef Attribute
padding Attribute
verticalAlignment Attribute
horizontalAlignment Attribute
<Page> Element:
name Attribute
text Attribute
displayOrder Attribute
<Panel> Element:
startX Attribute
width Attribute
startY Attribute
height Attribute
fieldLayoutRef Attribute
padding Attribute
<ActionGroups> Element:
view Attribute
edit Attribute
<ActionGroup> Element:
name Attribute
<Action> Element
• <FormSet> - (ROOT ELEMENT) Contains one <Form> sub-element that defines the
form.
• <Form> - Defines the form that is displayed on the screen. Contains one or zero
<Header> elements, as many <Page> elements as necessary, and as many
<ActionGroup> elements as necessary. Each form includes the following
attributes:
- name - Name of the form.
- type - Type of form. This attribute can have the following values:
* MULTI_PURPOSE_VIEW - A full-screen form.
* POPUP_VIEW_PANEL - A form that appears as a pop-up window.
* MESSAGE_AREA - A form in the message area of Xstore Point of Service.
* TRANSACTION_LIST_AREA - A form in the transaction area of Xstore Point
of Service. That is, it displays details of line items added to a transaction.
Overview
The Xstore Point of Service framework refactoring effort is a movement to make Xstore
Point of Service easier to understand and develop, and also to better promote shared
code with other Xstore Suite components (like Xstore Office) and other applications (like
Xstore for Grocery). As Xstore Point of Service evolves and its developer base grows, it's
more important than ever to embrace the use of established, standard technologies like
Spring while streamlining development patterns as much as possible. This will help on-
board and train new developers, reuse foundational Xstore Point of Service classes for
new development projects and software applications, and extend Xstore Point of
Service's lifespan as a relevant and major force in the retail POS market.
Benefits
Using the Spring framework in Xstore Point of Service has the following benefits for
developers:
• Exorcise the command framework. A Spring-backed, global scoping mechanism
allows developers to avoid excessive casting of variables, makes it easier to access
scoped data outside of operations and allows operations to be transposed between
OpChains. It also makes code more readable and streamlines classes like validation
and visibility rules.
• Use Spring for singleton management. By leveraging Spring beans for management
of singleton classes, Xstore Point of Service helpers are easier to read and extend,
and will no longer require static code to load instance specifiers from system
properties. All helpers and manager implementation classes are cleanly defined in a
single configuration file and accessed consistently from any other classes in the
application.
• Use Spring for services framework. Spring will streamlines the Xstore Point of
Service services framework for implementing web service clients in a more standard
way and make services easier to configure and use.
• Make Xstore Point of Service's workflow more transparent. Configuration-based
routing rules and conditions make it easier to understand the flow of an OpChain by
simply reading the OpChainConfig.xml file. See Chapter 3, “Operation Chains”
for more information about OpChains and the OpChainConfig.xml file.
• Separate flow and business logic to promote code reuse. Separating workers (as
business logic providers) from operations (as flow control mechanisms) promotes
more streamlined feature implementations whose core logic can be more easily
transferred between applications and components in the Xstore Suite.
Dependency Injection
Any XML file that lists fully-qualified class names that are reflectively instantiated in the
code and can be overridden at different points on the configuration path are attempts at
providing some sort of dependency injection. Spring simplifies dependency injection
across the application by providing a standard method for injecting dependencies,
rather than requiring developers to create their own processes.
Spring Beans
Xstore Point of Service uses Spring's XML-driven bean configurations to manage the
definition of all managed classes. The Spring XML files that are to be loaded by Xstore
Point of Service are governed by Xstore Point of Service's configuration path. This
approach makes the most sense for Xstore Point of Service, because developers are
already familiar with the concept of the configuration path, and it allows overrides of
base Spring files to be performed in the same manner as other XML files.
• The location of the files can be thought of as being similar to directory-based
configuration files. All files ending with .xml within a spring directory anywhere
in the configuration path will be processed and loaded.
• The name of each Spring bean file does not matter, with the exception that each file
should have a unique name.
Important: If two Spring bean files share the same name, the one that
comes later in the configuration path will completely replace the
earlier one. This will cause to Spring ignore all bean definitions in the
earlier one.
• workers.xml - Contains the definition of all worker and worker list beans. All
worker beans should be assigned a "prototype" scope.
• services.xml - Contains beans that identify the services available to Xstore Point
of Service using the service framework.
Overriding Files
In theory, a customer overlay may only need one Spring bean file that contains all of the
necessary overrides from across the base files and any additions. To ensure file names
remain unique, all customer Spring bean file names should start with the customer's 3-
character ID.
Example - Operation
A good example of the use of this annotation is on the Operation class. Operation is
not managed by Spring, but the class still needs injections processed. The Operation
class is annotated with @Configurable, so no classes that extend Operation need the
annotation. They all will be processed because the ancestor is annotated. Operation,
validation rule, visibility rule, worker, and run condition classes all have the annotation
specified on the abstract ancestor class, so they are all immediately available to have
injections processed.
@Configurable
public abstract class Operation
implements IOperationImpl, IDebuggable {
@Inject
@Inject
protected TransactionScope _transactionScope;
}
Application Mode
The name of this scope is applicationMode. It is used for beans that have an instance
tied to a particular application mode of Xstore Point of Service. The standard modes that
everyone knows to exist in Xstore Point of Service are Register and Back Office.
Any class that is assigned an application mode scope will have one managed instance
per application mode that is started. There are only two classes in Xstore Point of Service
that have application mode as their scope and there should not need to be many more. It
only exists because of the ability to jump directly into the register from within a back
office function.
Due to the nature of what classes with this scope represent, when injecting them into
classes in Xstore Point of Service, they should be wrapped in a Provider.
Training Mode
Officially named maybeTrainingMode, this scope is used for beans that represent the
implementations of service providers. Given how training mode works in Xstore Point of
Service, this scope is used to determine if the real implementation bean or a training
substitute bean should be provided when injection is requested. Since a number of
singleton helpers inject service interfaces (not really ideal, maybe this can be addressed
in the future) and whether or not you are in training mode can change on the fly when
Xstore Point of Service is running, each injection of a bean that is assigned to this scope
should be wrapped in a Provider.
Transaction
The name of this scope is transaction. The difference between this and the use of the
TransactionScope class that you inject in various places in Xstore Point of Service is
in how the object gets into scope. Because this is a Spring-managed scope, any beans
assigned to it are created by Spring.
The references are held for as long as TransactionScope holds them (see
“TransactionScope”). Beans that are assigned to this scope are things that you simply
want to be instantiated the first time they are requested and then referenced for the
duration of the transaction. The ReturnManager class is a good example of this. It
simply needs to exist and it is only relevant for as long as a sale transaction is in process.
Scoping/Value Keys
The primary use of a command in Xstore Point of Service is to temporarily hold onto a
value so that it can be accessed within different parts of an operation and across multiple
operations. Countless guessing at which command interface is relevant for your
operation and then casting to that interface to call a particular method that holds a
desired value has caused many issues over Xstore Point of Service's life and has severely
increased the complexity and decreased the ability to understand with any level of
confidence what will happen at any point. It has also made things such as validation
rules (both input driven and non-input driven) more complex than necessary, with
developers having to be aware of particular indices within an array in which a particular
value exists, based on the operation that put them there, and then casting the value in
that index to a particular class. The whole notion is fraught with fragility and nuances
and limits the usefulness and usability of validation rules.
With the advent of Xstore Point of Service, version 7.0, use of IXstCommand and all of its
extensions and implementations have been deprecated in favor of an all-new, Spring-
managed, scoped-value management mechanism. At its core it is a two-part system that
involves a scoped value container and a key for storing and accessing the contained
values. The intent is that common values, such as an item ID entered by a user,
regardless of where they are used within the application, can be accessible and
referenced in a consistent way across the application.
By having one means of getting a scoped value, developers can rely on it and not have to
guess about which value to get out of scope depending on what feature is currently
being used. The same value can be accessed in the same way from operations, validation
rules, visibility rules, etc., thereby increasing ease of use and understanding of these
concepts.
The design of the scoped value container is technically inspired by the concept of the
type-safe heterogenenous container. The key that is used to store and retrieve values
from the container is parameterized with the type of object that is being stored. Only
objects of a type matching the key may be put into the container using that key and the
values retrieved from the container will always be of the type on the key used to do the
retrieval. Therefore, you can always be sure of the type of an object and just use it the
way that it was intended. There is no more guessing what is the type of an object
represented by a key or casting an Object to a specific type.
The key to all of the this is a class called ValueKey. Any value that is that is put into
scope or retrieved from scope must use a ValueKey to do so. Every ValueKey that is
defined should be defined as a constant and placed in the same file. For ease of reference,
all of the ValueKey instances in base Xstore Point of Service are grouped together based
on the container in which they are used. This makes it easy for developers to determine
if a usable key already exists for a value that they want to store or retrieve before they go
and create a new one.
There are two different classes that define ValueKey instances in base Xstore Point of
Service, as there are two different containers that are based on different scoping
mechanisms. Any values that are to be used within the DefaultScope container are
defined in the ValueKeys class. Any values that are to be used within the
TransactionScope container are defined in the TransactionScopeKeys class.
There are comments that are invaluable to a developer in the ValueKeys class in base
Xstore Point of Service that contains rules for naming, use, and so on. At the risk of
duplicating and having to maintain the same information twice, that information is
excluded here. However, those comments should be read and committed to memory
absolutely by any developer who is programming Xstore Point of Service.
ValueKey instances that are created in a customer overlay should follow a similar
pattern as the base. They all should be defined as constants in a class that is named with
the 3-character customer code plus "ValueKeys" or "TransactionScopeKeys", depending
on their use. For instance, if the customer code is CST, then the class would be
CstValueKeys.
As briefly mentioned above, there are two containers that manage scoped values. The
general behavior of each is the same. They share a means of setting and retrieving values
and they both use ValueKey to do so. The difference is in the scope management and
when managed values are removed from the container. What follows is a description of
each value management container.
DefaultScope
This is the primary scope management class for any values that need to be held
temporarily for use within one or more operations and their corresponding validation
rules. As a general rule, only operations should ever put values into default scope. The
reason is that values in DefaultScope are most often values that were input by a user,
were selected by a user, or were derived from input by a user and this type of input
comes from operations. An example would be an item ID that was entered by a user.
Whether it was entered manually or via scanner, it will be put into default scope as the
entered item ID by the operation that captured the input. After it is put into scope (using
the ValueKeys.ENTERED_ITEM_ID key, by the way), it will be accessible to any other
class that needs to reference it.
As mentioned above, all ValueKey instances that are used with DefaultScope are
defined in base Xstore Point of Service in the ValueKeys class. Customer overlay
projects should define a CstValueKeys class to hold all of the customer-specific
ValueKey instances, where "Cst" is the customer's 3-character code.
Use
In most cases, the DefaultScope class does not need to be accessed directly. In the
aforementioned abstract classes that have the @Configurable annotation,
DefaultScope is also injected into them. Each of these ancestor classes has a
getScopedValue() method that can be used as a convenience for retrieving values
from DefaultScope. In addition, Operation also has a
setScopedValue(ValueKey) that is used to be put values into scope. When
available, these methods should be used to access DefaultScope and it should not be
accessed directly.
In classes where these methods are not available, direct injection and access of
DefaultScope is acceptable. Although the DefaultScope class can be injected
anywhere, it should not be injected or referenced in a singleton or a helper class. It is
only meant for use within temporary objects that are created and thrown away after they
have been used. This is in line with the type of values that it holds.
Removal of Values
In most cases, values that are put into DefaultScope do not need to be removed from it
manually. There is an auto-clearing mechanism in place that removes values from scope
when it has been determined that they are no longer necessary.
The removal of values revolves around the notion of default chains. Whenever a default
chain starts, the rollback level of it is captured. Any value that is set in DefaultScope is
associated with the current rollback level until another default chain starts, at which
point any new values set into DefaultScope will be associated with the new level.
Each time a default chain starts, the values in DefaultScope are examined and any
values that are associated with a rollback level that is greater than or equal to the
rollback level of the default chain that is starting will be removed. Any values that are
associated with a rollback level that is less than that of the default chain that is starting
will remain.
In some more rare cases, it is necessary to remove a value from DefaultScope
manually. These cases should be considered to be the exception. Normal functionality
should not manually remove values from any kind of scope. The most likely case for
manually removing a value from DefaultScope is when an operation is reversing. At
these times, the operation may want to remove values that it put into scope, if their
existence will not be cleaned up automatically, or if they will cause other issues by being
in scope when they should not be. For this purpose, there is
clearScopeValue(ValueKey) method on the Operation class.
Operation classes should be the only things that ever manually remove values from
DefaultScope. Unless there is an incredibly compelling reason that is documented in
the code that does it, the only place within operations where values should be removed
from DefaultScope is in the handleOpReverse() method.
Example
1. The SHIPPING chain is a default chain with a rollback level of 30. This is the initial
chain for the shipping feature that contains the functionality to select a document to
process. The document is put into DefaultScope at level 30.
2. The LINE_SHIPPING chain is a default chain with a rollback level of 50. When the
LINE_SHIPPING chain starts the first time, everything that was put into
DefaultScope in the SHIPPING chain will remain since its rollback level (30) is
less than the LINE_SHIPPING (50). Every value that is put into scope in the
LINE_SHIPPING chain will be associated with level 50.
3. When the LINE_SHIPPING chain completes, it starts again. When it starts, any
values that were put into DefaultScope during its last run are removed since the
rollback level of the chain and the values are equal.
4. When backing up out of shipping to the main menu, the rollback level of the main
menu (12) is less than that of the SHIPPING chain (30), so any values in
DefaultScope that were associated with the SHIPPING chain's rollback level (30)
will be removed.
TransactionScope
This class is meant for holding values that should be available for the entire duration of a
transaction. The primary example is the POS transaction itself. There are many fewer
cases where the need exists to store thing in TransactionScope. For most cases,
DefaultScope should be preferred. As mentioned above, any ValueKey instances
that are used to access TransactionScope are defined in TransactionScopeKeys
class in base Xstore Point of Service. Customer overlay projects should define a
CstTransactionScopeKeys class to hold all of the customer-specific ValueKey
instances that are used to access TransactionScope, where "Cst" is the customer's 3-
character code.
Use
The TransactionScope class can be injected anywhere that it is needed and its
methods for getting and setting values are always directly referenced. The most
important value that is stored in TransactionScope is the POS transaction itself.
Putting the current transaction into scope happens rather automatically, unless you take
explicit steps to prevent it. When using the TransactionHelper class to create a
transaction (as all transactions should do), the default behavior is to put the created
transaction into TransactionScope right after it has been created. Only one
transaction can be in scope at any time.
For the few cases in Xstore Point of Service where a transaction that is being created
should be not be placed into TransactionScope (for example, when it is a secondary
transaction that is created in the middle of a primary transaction, such as a.manual no
sale), a parameter can be passed to the TransactionHelper that can indicate not to
put the transaction being created into TransactionScope. Care should be taken when
using this parameter, as only the transaction in scope will be persisted when using the
standard PersistCurrentTransactionOp or
PersistCurrentTransactionWorker.
There are two convenience methods on the TransactionScope class that wrap the
getValue(ValueKey) method and provide the current transaction ValueKey. Both
are the intended method of retrieving the current transaction. The current transaction
should always be retrieved using these methods and directly using
getValue(ValueKey) to get the current transaction should be avoided.
• The getTransaction() method simply returns the current transaction as an
IPosTransaction. This method can be used when you simply want the current
transaction and you are indifferent to the type of transaction.
• The getTransaction(TransactionType) method accepts an additional
parameter that allows the user to specify the type of transaction that should be
retrieved from scope. This method can be used when you are interested in a
particular type of transaction.
For example:
1. A call is made to
TransactionHelper.createTransaction(TransactionType.RETAIL_SAL
E) and the created transaction is put into TransactionScope.
2. An operation makes a call to
TransactionScope.getValue(TransactionType), passing
TransactionType.RETAIL_SALE.
3. The operation returns an IRetailTransaction object, because that type of
transaction is in scope.
4. The next operation makes a call to
TransactionScope.getValue(TransactionType).
5. Although a transaction is in scope, the operation does not return it because it is not
of the requested type.
Removal of Values
As a general rule, values should not be removed from TransactionScope manually
unless some explicit, well-documented case requires otherwise. The POS transaction
value should never be removed from TransactionScope manually. You should
always rely on the inherent clearing mechanism to remove it at the appropriate time. The
removal of values from TransactionScope is being on the notion of transaction
completing. More specifically, it is based on the reception of events from the
OpChainProcessor that indicate that a transaction has terminated. When an OpChain
completes that has a signal on it with a value of TransactionComplete or
TransactionCancelled, the TransactionScope will pick up the signal event and
remove all of the current values. No value in TransactionScope remains after one of
these events has been processed. This signal should placed on OpChain that contain the
operation that persists the current transaction. The removal of values is based on the
completion of the chain instead of persistence itself because there are some things within
the chain that still need to be able to reference transaction-scoped values after the current
transaction has been persisted.
Management of Helpers/Singletons
Classes that are deemed to be helpers should be defined as singleton-scoped Spring
beans (Spring beans are singletons by default) and a reference to the helper class should
be injected anywhere that it is necessary using the standard Inject annotation.
To override the bean class in a customer overlay, put a bean configuration in the Spring
file in the customer overlay that defines a bean with the same ID as the base but with
your extended class instead of the base class. Below are examples of how to define and
use helper beans in Xstore Point of Service.
Use it in a class
@Inject
private CustomerHelper _customerHelper;
...
_customerHelper.searchForCustomers(...
Management of Services
The use of Spring-configured beans in Xstore Point of Service simplifies the creation of
new services.. When it comes to Spring service configurations, there are two types of
beans that are now configured.
Service Implementations
Beans that represent the actual service implementations are defined in the
services.xml Spring file. The service implementation to use when in training mode
also appears in this file. All service implementation beans that are defined should be
assigned to the maybeTrainingMode scope. In order to add a new service, simply create
the interface and implementation class for it, configure the bean in a Spring XML file
(services.xml in the base) and inject the interface with a Provider in any class where
it is needed.
To override a service implementation, configure a bean in the Spring file in a customer
overlay to have the same ID as the base bean and provide a different class. For service
implementations, the implementation override class does not need to extend the base
implementation class, it only needs to implement the service interface. Injections of
services into Xstore Point of Service client-side classes should reference the service
interface and never an implementation class.
Service Handlers
The configuration of ServiceHandlers is managed through Spring configuration files.
There is one Spring services-XXX.xml file for each service provider, where XXX
identifies the provider. See the Xstore Point of Service Services Guide for more information.
The ServiceHandlers.xml file maintains connection information (for example,
WSDL location) and parameters such as timeout values.
New Elements
As part of the Spring refactoring, several new elements have been added to
OpChainConfig.xml to improve the readability of the file and provide a better
understanding of the flow of Xstore Point of Service and what is happening at each step.
Some elements replace old ones and some are enhancements to existing ones.
Op
This element is replaces the Operation element.
ValidationOp
A validation operation is an operation that does not prompt the user for any input, but
validates against currently known data using the standard validation rule mechanism in
Xstore Point of Service.
The ValidationOp element include a new validationsBean attribute that identifies
the Spring bean containing the list of validation rules to apply. Along with the new
element come new rules for when to use it and what using it means.
• An operation class that implements IValidationOp directly (that is, not through
an extension interface like IPromptOp) should be configured with a
ValidationOp element.
• A ValidationOp is required to specify a validationsBean attribute, which
identifies the Spring bean that contains the list of validation rules to apply.
• No class needs to be specified for a ValidationOp if no custom logic is required
and validation rules only need to be applied against currently known data. If no
class is specified, then class that will be used is ValidationWithoutPromptOp.
This class is the old AbstractValidationWithoutPromptOp, now made
concrete due to the new way that validation rules work with Spring and
DefaultScope.
PromptOp
A prompt operation is an operation that prompts the user for one piece of data, whether
it is entered in a text field, selected from a list, or the confirmation from a button press. A
prompt operation has the ability to specify the prompt with which the user should be
presented and an optional set of rules to validate what was entered/selected.
The PromptOp element extends ValidationOp and introduces one additional key
attribute, which is used to override the default prompt key. With the Spring integration,
a set of rules exists for defining a prompt operation.
• A prompt operation should only prompt for one piece of data.
• A prompt operation class should implement the IPromptOp interface. All prompt
operations should extend AbstractPromptOp somewhere in the hierarchy. It has
all of the necessary underpinnings for the use of standard, accepted prompt
functionality.
• If a class attribute is not specified for a PromptOp element, then the class
PromptOp will be used.
• The validationsBean attribute determines the rules to apply to the PromptOp.
The value of this attribute indicates the ID of a Spring that defines the list of
validation rules that will be injected into the operation. The validationsBean
attribute is optional.
• A prompt operation always needs to define a default prompt key within the prompt
operation class using the method getDefaultPromptKey(). If the default prompt
key is not sufficient for a particular occurrence of the operation in
OpChainConfig.xml, an override can be specified on the PromptOp element
using the key attribute. This should always be configured by exception.
• The PromptKey parameter is deprecated and should not be used.
• The ValidationRuleSet parameter is deprecated and should not be used.
• The ValidationRuleConfig.xml file is also deprecated. A prompt operation
that needs to perform validation against input will have the list rules injected into
the operation.
WorkerOp
A worker operation is an operation whose primary purpose is to trigger running a
worker (or a list of workers via a Spring bean that itself is a worker). The WorkerOp
element extends the Op element and adds one attribute named workersBean, used to
specify the ID of the Spring bean that is either a worker or is a list of workers that should
be injected into the operation.
A worker operation should implement the IWorkerOp interface, which provides the
facility for allowing a worker to be injected. The workersBean attribute is required to
be present on a WorkerOp. No class needs to be specified for a WorkerOp if the only
desired functionality is to run the workers identified by the workersBean attribute. If
no class is specified, then the class that will be used is SimpleDoWorkOp.
OpChainRoute
The OpChainRoute directive both introduces conditional chain routing functionality in
its more complex forms, and replaces old standards like OpChainReference and
OpChainLink in its simpler forms.
The use of the condition attribute is shorthand for configuring a Choice element with
a condition attribute or a Condition element. If this attribute is present, then the
chainKey attribute is required.
If there is only one choice, then it is recommended that this shorthand form be used to
increase readability. If there are multiple choices, then it is recommended that each
choice be defined as a Choice element and that no shorthand is used. See the
condition attribute on the Choice element for additional details.
<xs:attribute name="chainType" type="xs:string" />
The use of the chainType attribute is shorthand for configuring a Choice element with
a chainType attribute.
If there is only one choice, then it is recommended that this shorthand form be used to
increase readability. If there are multiple choices, then it is recommended that each
choice be defined as an element and that no shorthand is used. See the chainType
attribute on the Choice element for additional details.
</xs:complexType>
<xs:complexType name="OpChainChoice_Type">
An element defined as an OpChainChoice_Type (the Choice element on
OpChainRoute) defines one possible path to take when evaluating an OpChainRoute.
There should always be at least one choice for each OpChainRoute element. If there is
only one simple choice, then it is recommended that the attributes on the
OpChainRoute element be used to define the choice.
<xs:sequence>
<xs:element name="Condition" type="Condition_Type" minOccurs="0"
/>
See the description of Condition_Type for details on the Condition element.
</xs:sequence>
<xs:attribute name="dtype" type="xs:string" fixed="OpChainChoice"
/>
<xs:attribute name="chainKey" type="xs:string" use="required" />
The "chainKey" attribute specifies the Op chain that is to be run, if the conditions are
right. This attribute is required on the Choice element.
<xs:attribute name="condition" type="xs:string" />
The condition attribute specifies the fully qualified class name of the class that is used
to determine if the chain specified by the chainKey attribute should be run.
When using this attribute, a special shorthand notation can be applied to it to indicate to
invert the result of the condition. This is done by specifying an exclamation point ( ! ) as
the first character in the attribute value, then appending the condition's class name to it.
This attribute is always optional. If no condition is specified, then a default condition
that indicates to always run the chain will be used.
<xs:attribute name="chainType" type="xs:string" />
The chainType attribute indicates the type of chain action to use when running the
chain. This is always an optional attribute. The normally accepted values are:
• STACK [DEFAULT]
• START
</xs:complexType>
<xs:complexType name="Condition_Type">
Using an element to specify a condition is done when the condition class that is being
configured needs to have parameters configured on it. Any conditions that do not
require parameters should be defined using the condition attribute on the Choice
element.
<xs:sequence>
<xs:element name="Parameter" type="Parameter_Type" minOccurs="0"
maxOccurs="unbounded"/>
This element specifies the name and value of a parameter that is to be set on the
configured condition class.
</xs:sequence>
<xs:attribute name="class" type="xs:string"/>
This attribute specifies the fully-qualified class name of the condition class.
</xs:complexType>
To summarize, using the OpChainRoute element, you can now specify within
OpChainConfig.xml an Op chain to run based on a certain condition. The first choice
that has its condition satisfied is the chain that will be run. Any choices following the
accepted choice will be skipped. In a case with many choices, the "catch all" choice, if one
exists, should be configured as the last one. An OpChainRoute can end up not routing
anywhere if no choice has a condition that is satisfied. Examples of OpChainRoute are
abundant in the base OpChainConfig.xml files.
• Replacing an OpChainReference element with an OpChainRoute
<OpChainReference chainKey="PRINT_RECEIPTS" />
becomes
<OpChainRoute chainKey="PRINT_RECEIPTS" />
• Replacing an OpChainLink element with an OpChainRoute
<OpChainLink chainKey="BACK_OFFICE_LOGIN" />
becomes
<OpChainRoute chainKey="BACK_OFFICE_LOGIN" chainType="START" /
>
<Choice chainKey="SALE_VOUCHER_START">
<Condition class="dtv.pos.register.IsNonPhysicalItem">
<Parameter name="ItemType" value="VOUCHER"/>
</Condition>
</Choice>
<Choice chainKey="CREDIT_PAYMENT">
<Condition class="dtv.pos.register.IsNonPhysicalItem">
<Parameter name="ItemType" value="CREDIT_PAYMENT" />
</Condition>
</Choice>
<Choice chainKey="SALE_WARRANTY">
<Condition class="dtv.pos.register.IsNonPhysicalItem">
<Parameter name="ItemType" value="WARRANTY"/>
</Condition>
</Choice>
<Choice chainKey="SALE_WARRANTY_GIFT">
<Condition class="dtv.pos.register.IsNonPhysicalItem">
<Parameter name="ItemType" value="WARRANTY_GIFT"/>
</Condition>
</Choice>
<Choice chainKey="SALE_WARRANTY_RENEW">
<Condition class="dtv.pos.register.IsNonPhysicalItem">
<Parameter name="ItemType" value="WARRANTY_RENEWAL"/>
</Condition>
</Choice>
<Choice chainKey="SALE_NON_PHYSICAL_FINISH"
condition="dtv.pos.register.IsNonPhysicalItem" />
</OpChainRoute>
Overview
This chapter provides a general overview of internationalization, localization, and
multilingualization, and describes how these concepts are implemented and configured
in Xstore Point of Service.
Internationalization is a general term used to describe the ability of a software
application to be customized for use in different locations by people from different
cultures who speak different languages. The implementation of internationalization in
Xstore Point of Service allows it to be quickly customized to almost any language, even
though the developers may not know any language other than their own native
language.
Internationalization 14-1
Internationalization (i18n)
Internationalization (i18n)
Internationalization refers to the process and methods that enable an application to be
used in a variety of geographic locations that have different languages and cultural
requirements. Although the source code is developed in one language, such as English,
the user interface is presented in the local language with sensitivity to cultural
requirements.
The abbreviation “i18n” is frequently used to signify internationalization, with the “18”
in the middle of “i18n” signifying the number of letters that were removed.1
Implementing i18n
Xstore Point of Service delivers the benefits of internationalization without requiring
changes to the source code. Through various files that contain “key/translation” pairs,
language-specific translations can be implemented in software created by a developer
who is not multilingual.
Each pair consists of a text key in the developer’s language followed by the translated
word or phrase in a different language. The key is a unique identifier used by Xstore
Point of Service to access the corresponding translation. Xstore Point of Service accesses
the correct translation at runtime.
Note: In Xstore Point of Service, all translation keys must begin with
the underscore (_) character.
The translation key is identical in all of the language-specific translation properties files,
but its corresponding translation varies by language. Each language has its own file with
all of the required key/translation pairs.
1. From the I18nGuy™ Web Site
Multilingualization (m17n)
In cases where several languages and character sets are required, multilingualization, or
“m17n”, is required. This methodology makes several different character sets from
several different languages available to users. Implementing m17n typically requires the
software to use Unicode or UTF-8 character sets.
Java Standards
Xstore Point of Service uses several Java standards in its implementation of i18n. Locales
are used to designate the language and country in which the application is to be used,
and Xstore Point of Service uses the language and country code standards defined by
Java. Xstore Point of Service also uses standard Java i18n methods and libraries.
Language Codes
Xstore Point of Service language codes combine an ISO-639-1 language code and an ISO-
3661-1 country code to identify the specific language files for the user interface. Samples
of some of the codes are specified in the table below:
Table 14-1: Sample Language Codes
Japanese ja_JP
Chinese zh_CN
Internationalization 14-3
Xstore Point of Service i18n Implementation
Language Files
For each language available in Xstore Point of Service, there is one corresponding file
that contains all the text items that a user will see. This includes all messages and
prompts in the system. Each text item in the file is indexed so that different translations
of the same message are found in a consistent manner.
Each language translation file is named using the format shown below. The file extension
indicates that the file is a “properties” file.
translations_[language code].properties
Note: The key (_pleaseWait) associated with each section of text does
not change. The Japanese translation file does not show actual
characters themselves, but lists the UTF-8 codes that correspond to the
Japanese characters.
Individual Customization
In addition to setting a default language for the Xstore Point of Service system, the
language can also be configured for each individual user. When a user logs in, the
interface’s language can be adjusted to match the needs or desires of that user. For
example, if a French-speaking Canadian were working in the United States, the system
could display prompts in French instead of the system’s default English language.
Note: To configure the language for a user, set the preferred locale for
an employee in the preferred_locale column in the crm_party table.
Also, verify the locale is listed in the AvailableLocales.xml file.
In Xstore Point of Service, you can set up an employee’s preferred
locale in the Employee Maintenance General tab, Language field.
Internationalization 14-5
Xstore Point of Service i18n Implementation
The first translations file that contains the requested key also contains the corresponding
translation string that will be used as the resulting output in the application. If there is
no corresponding key mapping in any of the translation files that is searched, a string in
the form “mr@[invalid translation key]” is used as the output.
Internationalization 14-7
Configuration Accelerators
When the application tries to convert a translation key into a locale-specific literal string,
it first consults translations.map.properties to determine the correct key to use.
If such an entry exists, the searched-for key in the locale-specific translations files will be
used as the mapped key rather than the one identified by the application. If no such
entry exists, then the application-specified key will serve as the effective key for
translation lookup purposes.
Example in translations.map.properties
_customerSearchName=_commonName
_employeeSearchName=_commonName
Example in translations_en.properties
_commonName=Name
Example in translations_es_MX.properties
_commonName=Nombre
In the preceding example, the principle of unique keys is preserved, but only a single
translation must be performed for each supported locale. Any number of labels, such as
“Name”, can similarly be accommodated by mapping their unique keys to the
_commonName effective key without requiring any additional translation work in any
language.
Whenever a divergent translation is needed for any of the commonly mapped keys,
those keys can be remapped in, or removed from, the
translations.map.properties file. If necessary, a new entry might also need to be
added to each locale-specific translation file.
Configuration Accelerators
For information about configuration accelerators (localization packs), including
procedures for applying them, see the Xstore Point of Service Configuration Accelerator
Guide. This document is available on My Oracle Support, Doc ID 1944671.1.
Overview
The SystemConfigMetadata.properties file contains critical information needed
by the Xstore Office System Config GUI. It is a counterpart to Xstore Point of Service
SystemConfig.xml file, which is the main file for storing system configuration
settings.
As there are multiple copies of SystemConfig.xml in Xstore Point of Service which
support base configurations and customer overrides (through the Xstore Point of Service
configuration path system), there are also multiple
SystemConfigMetadata.properties files. However, unlike SystemConfig.xml,
these metadata files are not governed/configurable by the configuration path. In fact,
there will only ever be exactly two copies of SystemConfigMetadata.properties:
Internationalization 14-9
Xstore Office and SystemConfigMetadata.properties