Understanding URI Template Expressions and Expansions
When building URI templates it is necessary to know these terms:
| Field or Control | Description |
|---|---|
|
Expression |
The text between ‘{‘and ‘}’, including the enclosing braces. |
|
Expansion |
The string result obtained from a template expression after processing it according to its expression type, list of variables names, and value modifiers. |
PeopleSoft supports the URI template expressions shown in the table. The table summarizes each type of template expression by its associated operator. The example expansions are based on the following variables and values:
var := “value”
tools := “tools rules!”
empty := “”
list := [ “val1”, “val2”, “val3” ]
path := “/foo/bar”
x := 1024
y := 768In each code example, the values in the first column are the expressions and the values in the second column are the expansions.
| Expression Type | Operator | Description |
|---|---|---|
|
Form-Style (Continuation.) |
|
Form-style query continuation
|
|
Form-Style (Expansion.) |
|
Form-style query expansion.
Note that the expansion process omits the equal sign ( = ) when the variable value is empty. |
|
Fragment. |
|
Fragment expansion with comma-separated values.
|
|
Label. |
|
Label expansion, dot-prefixed
|
|
Path-Segment. |
|
Path-segments, slash-separated
|
|
Path-Style. |
|
Path-style parameters, semicolon-prefixed.
Note that the expansion process omits the equal sign ( = ) when the variable value is empty. |
|
Reserved. |
|
Reserved expansion with comma-separated values.
|
|
Simple String. |
NA |
Simple expansion with comma-separated values.
|
Note the following about the operators, expressions, and expansions shown in the table:
-
The operator’s associated delimiter (“;”, “?”,”/”,”.”,”#”) is omitted when none of the listed variables are defined.
-
Multiple variables and list values have their values joined with a comma (“,”) if there is no predefined joining mechanism for the operator.
-
The operators plus ( + ) and fragment ( # ) substitute non-encoded reserved characters found inside the variables value; the other operators pct-encode reserved characters found in the variable values prior to expansion.
-
The explode modifier (“*”) indicates that the variable represents a composite value that may be substituted in full or partial forms, depending on the variables type or schema. The asterisk (“*”) indicates that just the component names and values are included in the expansion.