Understanding Snippets Keywords


As discussed, snippet files include keywords to pull the values of object properties and data and write those values into the mobile output. The table below shows variable tag replacement keywords available within the system, what they are used for, and where they may be used. The target use is not necessarily limited but keep in mind that not all keywords make sense to use in all snippets. If a keyword does not have meaning for the particular object but is used in the object's snippet, the mobile output will display the keyword.

Special note on keyword processing, A keyword followed by two periods (..) indicates the end of a keyword. This syntax is required when you want to append the result of a keyword with other text without an intervening space. For example, suppose you place something like this in your snippet:

src ="documaker.bitmap.filename…jpg"

Notice in this case that although there are three periods in a row, the keyword processing stops at the second period. Since the keyword is followed by two periods in sequence, these will be stripped from the output and the remainder of the line will stay intact. So in this example if the bitmap has the filename of "alamere", the result written from snippet will be src="alamere.jpg". Note that the period in the snippet output is actually the third one in the snippet definition above.

Here is another example, Suppose you wish to append an object's name content together with the suffix "MAIN".

documaker.nameMAIN - results in unknown keyword results in no output.

Without a space, this looks like a single keyword and will be misinterpreted. With a space between the keyword and suffix, the space is maintained but you still do not end up with the desired results:

docmaker.nameMAIN - this unknown keyword results in no output, which is not the desired result.

A single period will be misintepreted as a keyword (as in documaker.name.MAIN) since we allow single periods between the words in keywords. Therefore, use two periods to indicate the end of a keyword as in this example:

documaker.name..MAIN results in "ObjectNameMAIN" with no spacing.

Finally, note that this double-period method is only required when you are trying to append the keyword to text that is alphanumeric and/or a period. Any other non alpha character will not be included in the keyword and would be assumed as text.

For example, documaker.name+MAIN will result in "ObjectName+MAIN" as the plus-sign is not alphanumeric or a period and is considered normal text.

Keyword Description Default Snippet Target Use
documaker.groups Process through each group within the formset and then when processing execute the default snippet or the named context snippet group.xml master.xml
documaker.forms Process through each form within the formset and then when processing execute the default snippet or the named context snippet form.xml group.xml master.xml
documaker.pages Process through each page within the formset and then when processing execute the default snippet or the named context snippet page.xml form.xml
group.xml master.xml
documaker.sections Process through each section within the formset and then when processing execute the default snippet or the named context snippet section.xml form.xml
group.xml master.xml
page.xml
documaker.section.type The section type attribute indicates the type of the section being used. Returned values are either: Group Begin, Group End, Subform Begin, Subform End, Subform, or Placeholder. If no value is returned, the section listed is a standard section in the form. section.xml section.xml or where processing section contents
documaker.recip Output the name of the recipient for the current generation of output. n/a Any (usually master.xml)
documaker.fonts Process through each font used within the formset and then when processing execute the default snippet or the named context snippet font.xml master.xml
documaker.fields Process through each field within the formset and then when processing execute the default snippet or the named context snippet field.xml section.xml
page.xml
form.xml
group.xml master.xml
documaker.field.type Output the field type as an abbreviated word string. n/a field.xml
documaker.field.length Output the defined field entry length. n/a field.xml
documaker.field.disponly Will return 1 if the field attribute for display only is set. Otherwise 0 is returned. n/a field.xml
documaker.field.required Will return 1 if the field attribute for required is set. Otherwise 0 is returned. n/a field.xml
documaker.name Used within an object level snippet, returns the name of the object n/a Any
documaker.description Used with any object snippet that allows the object to define a description. n/a master.xml
form.xml
field.xml and any other object that can define a description.
documaker.descname If the object has a description attribute, it is returned. If it the description is empty or undefined, the name of the object is returned. The theory is that if you are building a list of descriptive results, you might want the item’s name if it did not have any other description defined. n/a Any
documaker.name.parent This will return the name of the parent that controls the object being processed by the snippet. For instance, Stext elements often will not have names, so the documaker.name keyword would return no value. However since a text element generally “belongs” to a section or is defined within a text area, the documaker.name.parent keyword will return that parent name. This will make it possible to find all similar objects with the same parent name. n/a Any
documaker.name.section This will return the name section that contains the object being processed. If you include this keyword at an object level above sections – like page or form – no value will be returned. If you include this keyword in a section snippet, the result is the same response as the documaker.name keyword. n/a Any object snippet descendant descendant to a section.
documaker.name.form This will return the name form that contains the object being processed. If you include this keyword at an object level above forms – like group or formset – no value will be returned. If you include this keyword in a section snippet, the result is the same response as the documaker.name keyword. n/a Any object snippet descendant to a form.
documaker.name.group This will return the name forms list grouping that contains the object being processed. If you include this keyword at an object level above groups – like formset– no value will be returned. If you include this keyword in a group snippet, the result is the same response as the documaker.name keyword. n/a Any object snippet descendant to a group.
documaker.text Used within an object level snippet, returns the text content of the object n/a field.xml
stext.xml
note.xml,
note_memo.xml, note_bookmark.xml
documaker.base64 Used within a bitmap, barcode, or vector object level snippet, returns the a base-64 encoded bitmap representation of the object n/a bitmap.xml barcode.xml
documaker.font.id Used within an object level snippet, returns the font ID of the object. n/a font.xml
Any object snippet descendant to a section that utilizes a font.
documaker.font.style Used within an object level snippet, returns the font style name of the font associated with that object. n/a font.xml
Any object snippet descendant to a section that utilizes a font.
documaker.font.weight Used within an object level snippet, returns the font weight of the font associated with that object. n/a font.xml
Any object snippet descendant to a section that utilizes a font.
documaker.bitmaps Iterate and output each bitmap/logo on a section by utilizing the bitmap snippet. bitmap.xml section.xml
documaker.bitmap.filename Output the filename associated with the bitmap object.   bitmap.xml
documaker.charts Iterate and output each chart on a section by utilizing the chart snippet. chart.xml section.xml
documaker.chart.id Returns an ID comprised of the chart name plus a sequence to make unique. The name should be compatible as an HTML/XML entity name with illegal characters changed to underscore. n/a chart.xml
documaker.chart.json.v1 JSON (tree) of chart attributes and data contents. n/a chart.xml
documaker.chart.json.v1.escaped This will return the same data as the documaker.table.json.v1 except that HTML character entity replacements will be performed on the data. Where regular JSON data might appear as this:

“Description”: “My description here”,
The keyword will result in this output. "Description":
"My description here",
n/a chart.xml
documaker.tables Iteration of tables calling related snippet. table.xml section.xml
documaker.table.json.v1 JSON (tree) of table attributes and cell contents n/a table.xml
documaker.table.json.v1.escaped This will return the same data as the documaker.chart.json.v1 except that HTML character entity replacements will be performed on the data. Where regular JSON data might appear as this:

“Title”: “My Chart here”,
The keyword will result in this output.
"Title":
"My Chart here",
n/a table.xml
documaker.contents Processes through all of the objects in the object being processed by the snippet. For example, if called from the documaker.section snippet, processes through all of the objects on the section and calls the default snippet for each object accordingly. Any descendant snippet from page or section page.xml
section.xml
documaker.stexts Process through each independent stext or text labels within the formset (or within the particular object being processed)_ and ignore the text elements within a text area. stext.xml section.xml
documaker.textareas Process through each text area and output their contents by calling the snippets associated with the children contained within. So a text area output will use the same stext snippet for text elements that was utilized for individual stext snippets. textarea.xml section.xml
documaker.id Returns a unique ID/name for the object. Replaces all invalid characters with an underscore and makes each ID unique by adding an _# where # is a sequence value. n/a Any
documaker.version Returns the Documaker version and build number as a string of text. n/a master.xml
documaker.height Returns the height (in FAP units) of the object currently being addressed. n/a Any object snippet descendant to a form where the object has a height.
documaker.width Returns the width (in FAP units) of the object currently being addressed. n/a Any object snippet descendant to a form where the object has a width.
documaker.color Returns the color of the object currently being addressed. The color is expressed as a 6-digit hexadecimal value of the form #000000. n/a Any snippet utilized by an object that defines a color attribute.
documaker.alttext Returns any accessibility alternate text string associated with object that can define such. The alternate text is meant to be used by reader applications for objects that might not be text objects. n/a Any snippet utilized by an object that defines alternate text.
documaker.skipread Returns 1 for objects that define the accessibility attribute for skip reading. This is used by reader applications to know not to read anything related to this object. n/a Any snippet utilized by an object that defines the skip reading attribute. section.xml
documaker.memo.date The date associated with the note memo n/a note_memo.xml, note.xm
documaker.memo.to The recipient line associated with the note memo n/a note_memo.xml, note.xml
documaker.memo.from The sender line associated with the note memo. n/a note_memo.xml, note.xml
documaker.memo.subject The subject line associated with the note memo n/a note_memo.xml, note.xml
documaker.bookmark.level The level number associated with the bookmark. n/a note_bookmark.xml, note.xml
documaker.bookmark.toc 1 or 0 to indicate if the bookmark Table of Contents property is checked. n/a note_bookmark.xml, note.xml
documaker.bookmark.figure 1 or 0 to indicate if the bookmark Table of Figures property is checked. n/a note_bookmark.xml, note.xml
documaker.bookmark.index 1 or 0 to indicate if the bookmark Index property is checked. n/a note_bookmark.xml, note.xml
documaker.bookmark.index.main if the bookmark Index property is checked, this outputs the text associated with the main subject property. n/a note_bookmark.xml, note.xml
documaker.bookmark.index.subentry if the bookmark Index property is checked, this outputs the text associated with the subentry property n/a note_bookmark.xml, note.xml
documaker.link.name Contains the hyperlink name (used by Target and hyperlinks). n/a bitmap.xml, stext.xml, field.xml
documaker.link.type Contains a number representing the type of hyperlink (1 = target, 2 = external, 4 = internal). n/a bitmap.xml, stext.xml, field.xml
documaker.link.options Contains a number representing the border style (0 = none, 1 = solid box, 2 = dashed box, 3 = underline). n/a bitmap.xml, stext.xml, field.xml
documaker.link.href This will reflect the URL of the link. Possible values: An absolute URL - points to another web site (like href="http://www.example.com/default.htm") A relative URL - points to a file within a web site (like href="default.htm") Link to an element with a specified id within the page (like href="#top") Other protocols (like https://, ftp://, mailto:, file:, etc..) A script (like href="javascript:alert('Hello');") n/a bitmap.xml, stext.xml, field.xml
documaker.link.params Use this field when producing HTML output to specify additional parameters to an external (HREF) type link, such as a target frame or mouse-over behavior.
For example: target="new"
n/a bitmap.xml, stext.xml, field.xml
documaker.form.metadata Process through user attribute collection within form and then when processing execute the default snippet or the named context snippet. n/a form.xml
documaker.metadata.key This will return the key from user attribute collection element. metadata_form.xml form.xml
group.xml master.xml
documaker.metadata.value This will return the value from user attribute collection element. metadata_form.xml form.xml
group.xml master.xml
documaker.readonce 1 indicates the section has been set for Read Once
0 indicates the section has not been set for Read Once
n/a section.xml