Inmagic® DB/Text® WebPublisher PRO
Inmagic® DB/Text® WebPublisher PRO Lite Version
1.0 Technical Notes
Copyright © 2002 Inmagic, Inc. All Rights Reserved.
Contents
Using Valid and Well-Formed XML
Required Namespaces
Using Valid Tag Names for Fields
Preserving White Space
Submitting Actions to WebPublisher PRO
Using the Query Command
Using the Update Command
Using the Insert Command
Using the Delete Command
Using the Batch_Delete Command
Accepting and Overriding Validation
Stripping Leading Spaces
Using <MatchFields> and <KeyFields>
<MatchFields>
<KeyFields>
Record Indexing
WebPublisher PRO Schemas
Using an HTML Query Screen
Contacting Inmagic, Inc.
Welcome
Congratulations on your purchase of DB/Text WebPublisher PRO!
DB/Text WebPublisher PRO lets you add, update, and delete records in DB/TextWorks® textbases from a Web browser, making your textbases interactive over your corporate intranet, extranet, or the Internet.
WebPublisher PRO combines the searching power of DB/Text® WebPublisher with Extensible Markup Language (XML) and Simple Object Access Protocol (SOAP) capabilities. This allows you to integrate your DB/TextWorks textbases with other applications and create interactive forms using standard third-party tools (such as, Microsoft FrontPage).
To help you get started with WebPublisher PRO, we have created a
Web tutorial, which is installed with the software. The tutorial walks you through adding a record via the Web to the Cars textbase, which is also installed with WebPublisher PRO and WebPublisher PRO Lite.
Crew-Noble, also provides consulting services (service@crewnoble.com). If you are an information professional with an idea—but not the XML skills to make it happen—we can help design screens and forms for you.
Note to WebPublisher PRO Lite Customers: These technical notes apply to your application, but you can only use the power of the product on a single textbase.
Audience
Before your users can start searching, editing, and deleting records over the Web, you must first design an interface that will allow for XML to be submitted and returned.
The designer and end users require the following:
WebPublisher PRO designer: Must have knowledge of XML and the ability to design a Web interface. Experience with Extensible Stylesheet Language transforms is useful, but not required. Use a third-party tool, such as Microsoft FrontPage or Microsoft ASP.NET, to design the Web interface. In 2003, Inmagic will provide an XML Forms Library, which will be accessible via the Web. The Forms Library will contain templates you can use to make the design process easier. In addition, an XSL transform for SOAP will soon be available on our Web site so you can enable WebPublisher PRO to accept SOAP calls.
WebPublisher PRO end users: To use the read-write capabilities of WebPublisher PRO, users need an Internet/intranet connection and, if the interface is client-based, Microsoft Internet Explorer.
Getting Started
Before you start designing an interface for WebPublisher PRO, take some time to familiarize yourself with the read-write features available to you.
We have provided the following to help you get started:
Tutorial
Schema Documentation
This document
There are three general phases you need to follow when you design an interface to let WebPublisher PRO end users edit, add, and delete records via the Web.
Phase 1: Create the XML query
Using the <Query> tag as the root element, develop a request to WebPublisher PRO asking it to perform an action (for example, a
query, insert, update, or delete). The action you request will be enclosed in the <AC> element.
There are numerous ways to build your XML query, including using JavaScript in an .ASP page, which is displayed via an HTML page. You can even type the XML in Microsoft Notepad.
For more information about the actions you can submit and for sample code, see Submitting Actions to WebPublisher PRO.
Phase 2: Send the XML query to WebPublisher PRO
Once you have a valid, well-formed query, you must send it to WebPublisher PRO. There are a variety of ways you can do this.
For example, you can use Microsoft XML Core Services 4.0 (MSXML4), which was installed with WebPublisher PRO. MSXML4 has an HTTP response-and-request mechanism. You can also use other methods, such as Microsoft ASP.NET or SOAP.
Phase 3: Get a response back in XML
When you submit an action in XML (for example, a query, insert, update, or delete), WebPublisher PRO returns results in XML format.
The XML returned is enclosed in the <inm:Results> root element. The "inm" prefix is used in all element names in a WebPublisher PRO response.
For more information about WebPublisher PRO responses and sample output code, see Submitting Actions to WebPublisher PRO.
Note: If you only want to search for records, you can submit queries with a standard HTML query screen and get results back in HTML or XML format. You will not be able to modify the records using standard HTML WebPublisher commands.
Tutorial
During installation, an interactive tutorial is placed in the SAMPLE folder of the installation directory. You can use this tutorial to help you get started with WebPublisher PRO. The tutorial is made up of two files, ADDPRODUCT.HTM and ADDRECTUTORIAL.ASP. Created with Microsoft ASP, this tutorial lets you add records via the Web to the Cars textbase, which is also installed with WebPublisher PRO.
Note: During WebPublisher PRO Lite installation, the Cars textbase is specified by default as the textbase that can be searched/modified on the Web. Because WebPublisher PRO Lite allows for only one textbase to be Web enabled, you should accept the default if you plan to use the tutorial. You can change the textbase later.
An HTML document (WebPublisher PRO Tutorial.htm) provides information about and instructions for the tutorial.
During installation, if you are using IIS, the SAMPLE folder is given read and execute scripts access. If you are using other HTTP server software, you must give the folder this access, as it will not be done automatically.
Note: To use the read-write features of WebPublisher PRO, you must use Windows Explorer to give your IUSR account write permission to the directory containing the textbase(s) you plan to modify/delete. That means to use the tutorial, you must give your IUSR account write permission to the SAMPLE folder, as both the tutorial files and the Cars textbase reside there.
Use the tutorial to familiarize yourself with the read-write features of WebPublisher PRO. When you are ready to design your own interface, you can create it from scratch or modify the tutorial source code to meet your needs.
Input Schema Documentation
Before you start developing an interface, take some time to familiarize yourself with the structure of the WebPublisher PRO input schema. An HTML version of the schema documentation outlines all of the elements and attributes that can be submitted to WebPublisher PRO in XML.
The schema documentation is located at http://support.inmagic.com/webpublisher.
For more information about the input schema, as well as the two WebPublisher PRO output schemas, see the Schema section. For sample input code, see Submitting Actions to WebPublisher PRO.
Using Valid and Well-Formed XML
When submitting XML to WebPublisher PRO, all elements and attributes must be both:
- Valid. Elements, attributes, and attribute values must follow the format specified in the WebPublisher PRO schema. All are case sensitive. For example, <ac>update</ac> is not valid because the <AC> element is uppercase in the schema.
- Well Formed. All XML must follow the standard established by the World Wide Web Consortium (
www.w3c.org). Note that the W3C standard requires starting and ending tags to match, including case. That means that <AC>update</aC> is not well formed.
Important! Keep in mind that XML can be well formed but not valid. For example, <ac>update</ac> is well formed by the standard of the W3C because the starting and ending tags match. However, it is not valid because the <AC> element is uppercase in the WebPublisher PRO schema. The same holds true for attributes and their values. For example, <AC VALIDATION="Override"></AC> is well formed, but not valid. This is because the attribute "VALIDATION" and value "Override" are defined as lowercase in the WebPublisher PRO schema.
Required Namespace
Any action submitted to WebPublisher PRO must use the following namespace in the <Query> tag:
"http://www.inmagic.com/webpublisher/query".
For example:
<Query xmlns="http://www.inmagic.com/webpublisher/query">
Using Valid Tag Names for Fields
When submitting field names to WebPublisher PRO in XML, all tags must be valid.
Field names containing characters that are unacceptable in XML should be modified as follows when being used as XML tags or when referring to the field name in a <MatchField> or <KeyField> tag:
- Replace spaces with hyphens. For example, if a field in your textbase is named date added, you must use <date-added>.
- Replace extended characters with the equivalent character without the diacritic. If you are unsure of how WebPublisher PRO will treat your special case field names, ask the software to return a
tb_schema_query (that is, submit the
following
action: <AC>tb_schema_query<AC>) and review the field names listed there. For example:
<?xml version="1.0"?>
<Query xmlns="http://www.inmagic.com/webpublisher/query">
<AC>tb_schema_query</AC>
<TN>cars</TN>
</Query>
Precede digits at the beginning of a field name with an underscore. For example, if a field in your textbase is named 1st qtr, you must use <_1st-qtr>.
Convert a hyphen at the beginning of a field name to an underscore. For example, if a field in your textbase is named -AU-, you must use <_AU->
Preserving White Space
If you want to preserve white space in the content of a field, wrap the content in CDATA.
For example:
<?xml version="1.0"?>
<Query xmlns="http://www.inmagic.com/webpublisher/query">
<AC trim="y" validation="none">insert</AC>
<TN>cars</TN>
<KeyFields>
<KeyField>Product-Number</KeyField>
</KeyFields>
<Recordset>
<Record>
<Product-Number>DH0001</Product-Number>
<Name>Honda Civic</Name>
<Description><![CDATA[ This model car has a working
radio. Sold in California only.]]></Description>
<Colors>Blue</Colors>
</Record>
</Recordset>
</Query>
Submitting Actions to WebPublisher PRO
Any "action" you want WebPublisher PRO to perform is enclosed between the opening <AC> tag and closing </AC> tag.
The recognized actions are:
query. Searches for records in a textbase.
update. Modifies one or more existing records in the textbase. Update works like the DB/TextWorks® import feature in that it checks for matching records, then replaces fields when a match is found. If no match is found, the information is added as a new record.
insert. Adds one or more records to the textbase.
delete. Deletes one or more records from the textbase.
batch_delete. Deletes records from the textbase that satisfy a query.
tb_schema_query. Generates the output schema for the specified textbase. All fields in the textbase are included, except those hidden by a password.
rf_schema_query. Generates the output schema for the specified report form. A query must be specified. Only fields specified in the <RF> form are included.
tb_schema_output. Generates the output schema for results returned after a record has been modified using
insert, update, delete, or batch_delete. Provides information about the textbase that you need to know when modifying records.
schema_input. Generates the input schema.
All actions are submitted within the <Query> root element. All results, except for those that return schemas, are returned within the <inm:Results> root element.
Important! Do not confuse the <Query> root element with the <AC>query</AC> command. The <Query> root element tells WebPublisher PRO that you are asking it to do something (for example, delete a record). The
query command is used within the <AC> element to tell WebPublisher PRO that you are searching for records.
Using the Query Command
Use the query command to search for records in a particular textbase and return record information in XML format.
Note: You can search a textbase with standard HTML WebPublisher commands or with an XML interface. However, you cannot modify records (that is,
insert, update, delete, or batch_delete) using standard WebPublisher commands; you must use XML input.
Sample input for a query:
Note that the proper namespace must be included in the <Query> root element.
<?xml version="1.0"?>
<Query xmlns="http://www.inmagic.com/webpublisher/query">
<AC>query</AC>
<TN>cars</TN>
<QY>Find Name =supra</QY>
<KeyFields>
<KeyField>Name</KeyField>
<KeyField>Retail-Price</KeyField>
<KeyField>Dealer-Price</KeyField>
<KeyField>Features</KeyField>
</KeyFields>
</Query>
Sample output from a query:
<?xml version="1.0" standalone="yes"?>
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/query">
<inm:QY>Find Name =supra</inm:QY>
<inm:Recordset AC="query" setCount="2">
<inm:Record>
<inm:Name>Supra</inm:Name>
<inm:Retail-Price>266</inm:Retail-Price>
<inm:Dealer-Price>133</inm:Dealer-Price>
<inm:Features>Cleaning kit</inm:Features>
<inm:Features>Independent suspension</inm:Features>
<inm:Features>Interchangeable wheels</inm:Features>
<inm:Features>Oil-filled shocks</inm:Features>
<inm:Features>Tube tires</inm:Features>
<inm:Features>Variable speed</inm:Features>
</inm:Record>
<inm:Record>
<inm:Name>Supra</inm:Name>
<inm:Retail-Price>428</inm:Retail-Price>
<inm:Dealer-Price>214</inm:Dealer-Price>
<inm:Features>Cleaning kit</inm:Features>
<inm:Features>Independent suspension</inm:Features>
<inm:Features>Interchangeable wheels</inm:Features>
<inm:Features>Oil-filled shocks</inm:Features>
<inm:Features>Tube tires</inm:Features>
<inm:Features>Variable speed</inm:Features>
</inm:Record>
</inm:Recordset>
</inm:Results>
Sample error output from a query:
<?xml version="1.0" standalone="yes"?>
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/query">
<inm:QY>Find name =volkswagen</inm:QY>
<inm:Error code="110" extra="">No records found by latest query.</inm:Error>
<inm:Recordset AC="query" setCount="0">
</inm:Recordset>
</inm:Results>
Notes about the query command
- There is an optional attribute for the <Query> root element called detail. This attribute specifies the amount of <Query> information that you want returned when you perform an action (<AC>) that searches the textbase (that is,
query or batch_delete). The detail attribute can have the following values:
- "qy"
returns only the search criteria submitted in the <QY> element. This value is the default.
- "full"
returns all XML input submitted. (That is, all XML contained in the <Query> root element.)
- "off"
turns this feature off.
Using the Update Command
Use the update command to update one or more records in a particular textbase.
Sample input for an update:
Note that the proper namespace must be included in the <Query> root element.
<?xml version="1.0"?>
<Query xmlns="http://www.inmagic.com/webpublisher/query">
<AC>update</AC>
<TN>cars</TN>
<MatchFields>
<MatchField>Product-Number</MatchField>
</MatchFields>
<KeyFields>
<KeyField>Product-Number</KeyField>
</KeyFields>
<Recordset>
<Record>
<Product-Number>AP3673</Product-Number>
<Retail-Price>320</Retail-Price>
</Record>
</Recordset>
</Query>
Note: The <AC> element can contain the optional validation attribute, which lets you specify whether validation lists can be overridden or updated.
Sample output from an update:
<?xml version="1.0" standalone="yes"?>
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/records-processed">
<inm:Records-Processed AC="update" succeeded="1" failed="0" amended="1">
<inm:Record-Processed result="amended">
<Product-Number>AP3673</Product-Number>
</inm:Record-Processed>
</inm:Records-Processed>
</inm:Results>
Sample error output from an update:
<?xml version="1.0" standalone="yes"?>
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/records-processed">
<inm:Records-Processed AC="update" succeeded="0" failed="1" amended="0">
<inm:Record-Processed result="rejected">
<Product-Number>AP3673</Product-Number>
<inm:Record-Error code="16458">Found multiple records in
textbase that match the record in the incoming
data.</inm:Record-Error>
</inm:Record-Processed>
</inm:Records-Processed>
</inm:Results>
Notes about the update command
- Whenever any records are processed, the <inm:Records-Processed> element contains the succeeded and failed attributes. This lets you know how many records were successfully processed and how many failed. The sum of the succeeded and failed attributes is equal to the total number of records submitted for processing. The <inm:Records-Processed> element may also include the amended attribute. The amended attribute shows the number of records that were updated. If the succeeded attribute is not equal to the amended attribute, then the difference is the number of new records that were added (because no match was found).
- One or more <inm:Record-Processed> elements are nested within the parent <inm:Records-Processed> element. Each <inm:Record-Processed> element represents an individual record. It will have a result attribute, which can have the following values:
- "added" if the record was added as a new record.
- "amended" if the record matched an existing record and was updated with the new information you supplied.
- "rejected" if the update failed to happen. To find out why a record is rejected, refer to the <inm:Record-Error> element. One reason this may happen is if multiple records matching the record you want to update are found.
- You must specify one or more fields with the <MatchFields> element. If you do not, WebPublisher PRO will display an error message.
- You can specify up to five (5) MatchFields when doing an
update.
- Use the <KeyFields> element to specify which fields you want included in the confirmation information returned in the XML output.
Using the Insert Command
Use the insert command to add one or more records to a particular textbase. The insert command works like
update. However, when submitting an insert, the software does not attempt to match records prior to adding the new record. That means you do not use the <MatchFields> element when doing an
insert.
Sample input for an insert:
Note that the proper namespace must be included in the <Query> root element.
<Query xmlns="http://www.inmagic.com/webpublisher/query">
<AC>insert</AC>
<TN>cars</TN>
<KeyFields>
<KeyField>Product-Number</KeyField>
</KeyFields>
<Recordset>
<Record>
<Product-Number>AP7707</Product-Number>
<Name>Mini Cooper</Name>
<Features>Display case</Features>
<Features>Glass</Features>
<Colors>Chili Red</Colors>
<Colors>Silk Green</Colors>
<Type>Assembled Painted</Type>
<Scale>1:10</Scale>
<Date-Released>10/07/2002</Date-Released>
<Retail-Price>430</Retail-Price>
<Club-Price>330</Club-Price>
</Record>
</Recordset>
</Query>
Sample output from an insert:
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/records-processed">
<inm:Records-Processed AC="insert" succeeded="1" failed="0">
<inm:Record-Processed result="added">
<inm:Product-Number>AP7707</inm:Product-Number>
</inm:Record-Processed>
</inm:Records-Processed>
</inm:Results>
Sample error output from an insert:
<?xml version="1.0" standalone="yes"?>
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/records-processed">
<inm:Error code="16473" extra="">Unknown KeyField name:
'Product-ID'.</inm:Error>
<inm:Records-Processed AC="update" succeeded="0" failed="0">
</inm:Records-Processed>
</inm:Results>
Notes about the insert command
If your textbase has an Automatic ID field, WebPublisher PRO will not automatically populate this field when creating a new record with the
insert command.
To have the next available ID entered by the application, apply Unique Entries Only validation to the Automatic ID field in DB/TextWorks. Then, when submitting an
insert, supply a value for the Automatic ID field that already exists in the textbase and is lower than the ID you want to add. Because you are entering a value that already exists, WebPublisher PRO will automatically increment the field contents to the next available ID.
Using the Delete Command
Use the delete command to remove one or more records from a particular textbase.
Sample input for a delete:
Note that the proper namespace
must be included in the <Query> root element.
<?xml version="1.0"?>
<Query xmlns="http://www.inmagic.com/webpublisher/query">
<AC>delete</AC>
<TN>cars</TN>
<MatchFields>
<MatchField>Product-Number</MatchField>
</MatchFields>
<KeyFields>
<KeyField>Product-Number</KeyField>
</KeyFields>
<Recordset>
<Record>
<Product-Number>AP3673</Product-Number>
</Record>
<Record>
<Product-Number>AP3674</Product-Number>
</Record>
</Recordset>
</Query>
Sample output from a delete, including one error:
<?xml version="1.0" standalone="yes"?>
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/records-processed">
<inm:Records-Processed AC="delete" succeeded="1" failed="1">
<inm:Record-Processed result="deleted">
<inm:Product-Number>AP3673</inm:Product-Number>
</inm:Record-Processed>
<inm:Record-Processed result="rejected">
<inm:Product-Number>AP3674</inm:Product-Number>
<inm:Record-Error code="16459">Found no matching record in
textbase to delete.</inm:Record-Error>
</inm:Record-Processed>
</inm:Records-Processed>
</inm:Results>
Notes about the delete command
- You can only delete records if you have full access to all fields in the textbase.
- In the above output example, one record was deleted because it was found in the textbase as a unique record. The other record was not deleted because it was not found in the textbase. Because of this, the <inm:Records-Processed> element contains the attributes succeeded="1" failed="1".
Note also that the <Record-Processed> element has a
result attribute, which can have the following values:
- "deleted"
if the record was deleted.
- "rejected"
if the record was not deleted for the specified reason.
- When deleting records, only specify <KeyFields> that also appear in the <Record> element. Because the record is deleted, WebPublisher PRO cannot retrieve information from the textbase record, so it displays the field content from the input record.
Using the Batch_Delete Command
Use the batch_delete command to delete records from the textbase that satisfy a query.
Sample input from a batch_delete:
Note that the proper namespace must be included in the <Query> root element.
<?xml version="1.0"?>
<Query xmlns="http://www.inmagic.com/webpublisher/query" detail="full">
<AC>batch_delete</AC>
<TN>cars</TN>
<QY>Find Product-Number =KU*</QY>
<KeyFields>
<KeyField>Product-Number</KeyField>
</KeyFields>
</Query>
Sample output from a batch_delete:
<?xml version="1.0" standalone="yes"?>
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/records-processed">
<inm:QY>Find Product-Number =KU*</inm:QY>
<inm:Records-Processed AC="batch_delete" succeeded="8" failed="0">
<inm:Record-Processed result="deleted">
<inm:Product-Number>KU1045</inm:Product-Number>
</inm:Record-Processed>
<inm:Record-Processed result="deleted">
<inm:Product-Number>KU1087</inm:Product-Number>
</inm:Record-Processed>
<inm:Record-Processed result="deleted">
<inm:Product-Number>KU4333</inm:Product-Number>
</inm:Record-Processed>
<inm:Record-Processed result="deleted">
<inm:Product-Number>KU1655</inm:Product-Number>
</inm:Record-Processed>
<inm:Record-Processed result="deleted">
<inm:Product-Number>KU2001</inm:Product-Number>
</inm:Record-Processed>
<inm:Record-Processed result="deleted">
<inm:Product-Number>KU2023</inm:Product-Number>
</inm:Record-Processed>
<inm:Record-Processed result="deleted">
<inm:Product-Number>KU2528</inm:Product-Number>
</inm:Record-Processed>
<inm:Record-Processed result="deleted">
<inm:Product-Number>KU2909</inm:Product-Number>
</inm:Record-Processed>
</inm:Records-Processed>
</inm:Results>
Sample error output from a batch_delete:
<?xml version="1.0" standalone="yes"?>
<inm:Results productTitle="Inmagic DB/Text WebPublisher PRO" productVersion="1.0"
xmlns:inm="http://www.inmagic.com/webpublisher/records-processed">
<inm:QY>Find Product-Number =KU*</inm:QY>
<inm:Error code="110" extra="">No records found by latest query.</inm:Error>
<inm:Records-Processed AC="batch_delete" succeeded="0" failed="0">
</inm:Records-Processed>
</inm:Results>
Notes about the batch_delete command
- You can only delete records if you have full access to all fields in the textbase.
- For batch_delete, the result attribute within the <Record-Processed> element can have values in addition to those listed above for delete:
- "skipped-locked" if the record was not deleted because someone else was editing it.
- "skipped-no-write-access" if the record was not deleted because you do not have write-access to it (for example, if the textbase has record-level security, and your password only grants you read access to that record).
- "skipped-no-match" if the record was found, but was already deleted by the time
batch_delete got to it.
Accepting and Overriding Validation
If a field entry in the incoming record is not in the validation list for that field or it violates range/mask validation, you can add the entry to the field in the record with or without adding it to the validation list.
To do this, use the validation attribute in the <AC> element.
Note: The field must have the appropriate settings specified in DB/TextWorks (for example, on the Edit Fields dialog box, Validation tab, select the User May Override Content Validation check box). When doing an
update, the password specified (if any) must allow the editing of validation lists.
The validation attribute can have the following values:
- "none" to do nothing. This is the default value.
- "override" to accept the entry, but not add it to the validation list.
- "update" to accept the entry and add it to the validation list.
In the following example, the validation attribute is set to "override":
<Query xmlns="http://www.inmagic.com/webpublisher/query">
<AC validation="override">update</AC>
<TN>cars</TN>
<MatchFields>
<MatchField>Product-Number</MatchField>
</MatchFields>
<Recordset>
<Record>
<Product-Number>AP3673</Product-Number>
<Features>Working radio</Features>
</Record>
</Recordset>
</Query>
If you want to update the validation list to include the entry, set the validation attribute to "update." In the sample code above, you would change
<AC validation="override">update</AC>
to
<AC validation="update">update</AC>
Stripping Leading Spaces
When doing an insert or update, you can specify whether WebPublisher PRO strips leading spaces. Leading spaces are spaces in a record at the beginning of a field entry.
To specify whether leading spaces are stripped, use the trim attribute in the <AC> element. The trim attribute can have the following values:
- "y" to have leading spaces stripped.
- "n" to keep leading spaces intact. This is the default value.
For example:
<AC trim="y">insert</AC>
Note: The trim attribute is only necessary if you use CDATA to preserve white space (spaces, carriage returns) at the beginning/end of field content. Using CDATA is recommended, especially if your data is likely to include characters significant to XML (for example, an ampersand or less than sign). If you do not use CDATA, leading spaces are automatically removed, and the trim attribute is unnecessary.
Using <MatchFields> and <KeyFields>
The <MatchFields> and <KeyFields> elements used with WebPublisher PRO have distinct and specific functions. However, it is often the case that the same set of fields isappropriate to be both <MatchFields> and <KeyFields>, serving as record identifiers.
<MatchFields>
The <MatchFields> element is used to specify one or more fields on which you want WebPublisher PRO to match when modifying or deleting records.
Use the <MatchFields> element when doing an
update or delete.
For example, when doing an update, WebPublisher PRO looks for records that match based on the field(s) you specify. If a match is found, the record information is updated. If a match is not found, the record is added as a new record.
When updating or deleting records, you must specify one or more <MatchField> elements within the <MatchFields> parent element. If you do not, WebPublisher PRO will return an error.
<KeyFields>
The <KeyFields> element is used to specify the fields you want returned after an action is submitted to WebPublisher PRO.
Nested within the parent <KeyFields> element are one or more <KeyField> child elements, each representing a field name.
Fields are returned in the order in which the <KeyField> elements were specified in the XML input.
If a field listed as a <KeyField> has multiple entries, all of the entries will be returned.
Note: If you are submitting a
query, records are sorted using the textbase default sort. If you want to specify a different sort, use the <RF> element to specify a report form containing the appropriate compulsory form sort. In addition, the <RF> element lets you display secondary textbase fields (if the form specified includes them). Only fields specified in the report form are displayed.
Record Indexing
When adding, modifying, or deleting records, WebPublisher PRO always uses Shared Immediate indexing, regardless of the indexing mode specified as the textbase default.
WebPublisher PRO Schemas
WebPublisher PRO uses three schemas, one for input and two for output. These schemas describe the structure of the data that can be submitted to and returned by WebPublisher PRO.
Input Schema
This input schema shows the structure of the XML that can be submitted to WebPublisher PRO for searching, adding, editing, and deleting records from a textbase via the Web.
Any read-write actions you submit to WebPublisher PRO must be enclosed in the <Query> root element and include the appropriate
namespace.
Schema documentation, in HTML format, is provided for this input schema at http://support.inmagic.com/webpublisher.
Output Schemas
WebPublisher PRO has two output schemas:
- Query output schema. When you search for records using WebPublisher PRO, results are returned within the <inm:Recordset> root element. There are two "flavors" of the query output schema that detail the tags that can be included in the root element. They can be generated using the <AC> element:
- tb_schema_query. This command generates the output schema for the specified textbase. All fields in the textbase are included, except those hidden by a password.
- rf_schema_query. This command generates the output schema for the specified report form. A query must be specified. Only fields specified in the form are included.
- Modify output schema. When submitting a request to WebPublisher PRO to modify the textbase in some way (that is, by adding, editing, or deleting records), results are returned within the <inm:Records-Processed> root element. To generate the modify output schema, which details the tags that can be included in the root element, use the
tb_schema_output command.
The two output schemas used by WebPublisher PRO do not have schema documentation provided, as they are not used by the designer or end user to enter information. Rather, these schemas are used by outside applications to understand the XML returned by WebPublisher PRO.
Using an HTML Query Screen
When submitting a query to WebPublisher PRO, you can submit it in XML (as explained above) or you can submit it using standard WebPublisher query syntax (as a canned query or in an HTML query screen).
Home page | Inmagic
software | Crew-Noble services | Training
Dates
About Crew-Noble | What's new? | Contact us
Crew-Noble Information Services
323 El Pintado Heights Drive, Danville, CA 94526-1412
Phone: (925) 837-1399 Fax: (925) 820-9114
Revised: 03/16/04
|