XML specifications
OperaJM and operac.exe use XML for native data import and export. Choose an XML parser and use the response structure documented for the command you invoke.
Default measurement units
Use these units for measured values in OperaJM XML unless a field or response specifies another unit.
| Measurement | Default unit |
|---|---|
| Length | Millimeters (mm) |
| Area | Square meters (m²) |
| Weight | Kilograms (kg) |
| Volume | Cubic meters (m³) |
For field-specific units and stock counts, see job materials response.
Multilingual and formatted descriptions
OperaJM item descriptions can contain multiple language variants. Use the same element name for each variant, such as <cmp_description>. The xml:lang attribute identifies a language-specific value. The default="yes" attribute identifies the predefined description. The supplied job sample included a default entry without an explicit xml:lang.
An element whose name ends in _description_HTML contains the same description with HTML formatting, such as <b> or <i>. In the job sample, the HTML tags were escaped as XML text. An XML parser decodes the entities to give the HTML string.
<component>
<cmp_description default="yes">Fixed window</cmp_description>
<cmp_description xml:lang="it">Finestra fissa</cmp_description>
<cmp_description_HTML default="yes"><b>Fixed</b> window</cmp_description_HTML>
<cmp_description_HTML xml:lang="it">Finestra <i>fissa</i></cmp_description_HTML>
</component>
Read all matching elements when you need to preserve translations. Select the requested xml:lang value when it is present, and use the entry marked default="yes" when you need the predefined description.
OperaJM text formatting tags
OperaJM documents these tags for descriptions and document text. When putting them in an XML text value, escape the markup as in the example above. Opera Wiki formatting guide
| Formatting | Tags |
|---|---|
| Bold and italic | <b>, <strong>, <i>, <em> |
| Highlight | <mark> or <mark color="red"> |
| Subscript and superscript | <sub>, <sup> |
| Underline and strikethrough | <u>, <ins>, <s>, <del> |
| Smaller, larger, or monospaced text | <small>, <big>, <tt> |
| Font family and color | <font face="Times New Roman"> and <font color="red"> |
Archive statistics response
operac -sx returns a stats document. The XPath /stats/archives/archive selects its archive entries.
| Child element | Meaning |
|---|---|
archive_name |
Archive name, such as OPERASIS. |
archive_description |
Human-readable description, such as Window Systems. |
archive_record_count |
Record count, when present. |
archive_software_version |
Opera software version recorded for the archive. |
archive_id |
Short archive ID, when present, such as SIS. |
The response from build 3.10.1.81 included entries with no archive_id and entries with no archive_record_count. When reading the XML, handle both fields as optional.
Archive export response
On build 3.10.1.81, successful operac -e<arch> exports returned a jobs document with archive data under /jobs/job. In this envelope, archive_name is a display label such as Window Systems. In archive statistics, the same element contains a table code such as OPERASIS.
For a systems export, /jobs/job/systems_fields/field contains definitions with field_name and any supplied field_type. The records are under /jobs/job/systems/system. Record elements such as ID can appear alongside the declared fields. Use the field metadata and record structure for the requested archive.
Archive selection from XML
When the import switch is -i with no archive selector, operac determines the target archives from the collection tags directly under /jobs/job. The current matching list is limited to these ten tags. Use their spelling and casing exactly as shown.
Collection tag under /jobs/job |
Archive selector |
|---|---|
systems |
sis |
series |
ser |
catalogs |
cat |
profiles |
pro |
accessorys |
cmp |
pricelist_revisions |
rpl |
pricelist_revision_sources |
spl |
pricelist_revision_prices |
vpl |
customers |
ana |
customer_options |
oan |
Place collections for several archives in the same job element to import their data from one XML file. This example shows the structure. Replace the comments with records in each archive's XML format.
<jobs>
<job>
<profiles>
<!-- Profile records go here. -->
</profiles>
<customers>
<!-- Customer records go here. -->
</customers>
<customer_options>
<!-- Customer option records go here. -->
</customer_options>
</job>
</jobs>
Archive import matching
Most archive rows have a primary key in <ID> and an archive-specific unique name. For example, profiles use <pro_name> and systems use <sis_name>.
| Fields supplied in the XML row | Import behavior |
|---|---|
<ID> for an existing row |
Overwrites the row identified by that primary key. |
Unique name that matches an existing row, with <ID> omitted |
Updates the matching row. |
Unique name that is absent from the archive, with <ID> omitted |
Adds a row with that name. |
Use the name field and omit <ID> for routine updates. Use the archive import command with the XML format for the target archive.
For child archive imports, use the archive hierarchy to identify the parent archive and check the child archive's XML format for the parent reference.
Profile price imports
When importing profile prices into OPERAPRP, include a <pro_name> child in every <profile_price> element. Its value is the name of the parent profile in OPERAPRO. A profile can have multiple price rows, each carrying that same profile name.
Job list response
The job list commands return records at /jobs/job. The combination of <job_id> and <job_year> uniquely identifies a job. The number can recur in a different year. Use this pair for lookups and comparisons.
<job_id>1</job_id>
<job_year>2023</job_year>
The -lcom- response includes a job-level <MD5> for change detection. The -lcom-- response omits it.
Job materials response
-gm returns materials at two levels. Each materials section contains material entries.
| Level | XML path | Profile quantity |
|---|---|---|
| Job | /jobs/job/materials |
For stock entries with <mat_unit>pc</mat_unit>, the quantity counts complete stock bars after job-wide cutting optimization. |
| Typology | /jobs/job/job_components/component/materials |
The profile length used by that typology. Read its unit from <mat_unit>. |
For a profile material whose quantity represents a length, read its unit from <mat_unit>. If the unit is pc, the quantity is a count of stock bars. The <mat_width> field gives the length of one bar and is always in millimeters.
When a material entry has <mat_type>accessory</mat_type>, read the quantity's unit from that entry's <mat_unit>.
See Profile quantities and stock lengths for how to compare the two levels for profiles. For panels and glass, stock-sheet optimization applies to material purchased in stock sizes for in-house cutting.
Job creation input
A job creation XML request includes job header details and a <job_components> list. Set <cmp_type> on every component using the job component types. For a window_type row that reuses an existing model, set <cmp_name> to its typology name or configured customer code. An unmatched value creates an empty typology without an error. Use the typology and color exports to resolve cmp_name and col_name before creating the job XML. See create-job invocation and response for the operac -n file argument and the returned job and component identifiers. The XML can also carry configured custom field values on the header and individual job rows. See base component configuration for typology references, required and optional inputs, and the XML template.
Job export example structure
The OperaJM job-to-CSV export example uses a jobs root and iterates through each job and its job_components/component entries. The stylesheet reads these paths relative to the enclosing nodes:
| Relative to | Element or path | Used for |
|---|---|---|
job |
job_id and job_year |
Job identifier and year |
job |
job_customer/cst_code |
Customer code |
component |
cmp_position |
Line position |
component |
cmp_description |
Line description |
component |
cmp_quantity |
Quantity |
component |
cmp_price |
Price |
These paths describe the source example for a named job export. Use the response contract for the specific CLI command or export activity you integrate.