map_app

NAML documentation   Watch a video
   Usages of this macro
... in url_mapper.naml
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<macro name="map_app" requires="url_mapper">
    <n.regex
Binary
Namespace: BasicNamespace
Parameters: pattern, text, do
 text="[n.path
Binary
Namespace: UrlMapperNamespace
/]">
        <pattern>
            -f(\d+)(?:p(\d+))?(?:a(\d+))?(?:i(\d+))?(?:d(\d+))?(?:ef\d+)?(?:\.([a-z]+))?\.html$
        </pattern>
        <do>
            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.find
Binary
Namespace: RegexNamespace
>
                <then>
                    <n.set_parameter_to_found
Macro
Requires: url_mapper, regex
Parameters: name, group
 name="node" group="1" />
                    <n.set_parameter_if_found
Macro
Requires: url_mapper, regex
Parameters: name, group
 name="priority" group="2" />
                    <n.set_parameter_if_found
Macro
Requires: url_mapper, regex
Parameters: name, group
 name="assignee" group="3" />
                    <n.set_parameter_if_found
Macro
Requires: url_mapper, regex
Parameters: name, group
 name="index_record" group="4" />
                    <n.set_parameter_if_found
Macro
Requires: url_mapper, regex
Parameters: name, group
 name="date" group="5" />
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.did_find
Macro
Requires: regex
Parameters: group
 group="6">
                        <then>
                            <n.set_parameter
Binary
Namespace: UrlMapperNamespace
Parameters: name, value
. name="macro">
                                view_<n.found
Binary
Namespace: RegexNamespace
Parameters: group
 group="6"/>
                            </n.set_parameter.>
                        </then>
                        <else>
                            <n.set_parameter
Binary
Namespace: UrlMapperNamespace
Parameters: name, value
 name="macro" value="view_app" />
                        </else>
                    </n.if.did_find>
                    <n.exit
Binary
Namespace: BasicNamespace
/>
                </then>
            </n.if.find>
        </do>
    </n.regex>
</macro>
Feedback, Links, Privacy, Rules, Support, About