summaryrefslogtreecommitdiffstats
path: root/policy_metadata/xsl_metadata.rng
blob: b5445ca23f52a81e81d2381b7add4f5d58743d70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0" encoding="utf-8"?>
<!--
Author: Sumit Bose <sbose@redhat.com>

Copyright (C) 2008  Red Hat
see file 'COPYING' for use and warranty information

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; version 2 only

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns:a="http://freeipa.org/xml/rng/ns/annotations/1.0"
xmlns:md="http://freeipa.org/xsl/metadata/1.0"
xmlns:pa="http://freeipa.org/xml/rng/ns/plugable_architecture/1.0">


  <start ns="http://freeipa.org/xsl/metadata/1.0">

    <a:doc>With the md:output_handler element it is possible to define how the
    policy data is processed after the XSLT transformation is applied. The idea
    is that a driver program or script can access this metadata information with
    a suitable XPath and can handle the output of the transformation
    accordingly.</a:doc>
    <element name="md:output_handler">
      <oneOrMore>
        <choice>

          <a:doc>md:file is the typical output handler for IPA config policies.
          The driver program will created a file and write the output of the
          transformation to this this or merge with the content of the local
          file depending on the information provided by the policy.</a:doc>
          <element name="md:file">
            <ref name="selector"/>
            <ref name="file_properties"/>
          </element>

          <a:doc>The md:exec_with_args will use a line of the output of the
          transformation a command line argument of a program.</a:doc>
          <element name="md:exec_with_args">
            <ref name="selector"/>
            <ref name="exec_properties"/>
          </element>

          <a:doc>The result of the XSLT transformation will be piped by the
          driver to stdin of another program when using
          md:exec_with_stdin_pipe.</a:doc>
          <element name="md:exec_with_stdin_pipe">
            <ref name="selector"/>
            <ref name="exec_properties"/>
          </element>

          <a:doc>Maybe we will have a separate output handler to write to the
          client's ldb.</a:doc>
          <element name="md:ldb">
            <ref name="selector"/>
          </element>

          <a:doc>The following is a dummy element to catch all elements from
          different namespaces, e.g. comments and documentation</a:doc>
          <element>
            <anyName>
              <except>
                <nsName/>
                <nsName ns=""/>
              </except>
            </anyName>
            <text/>
          </element>

        </choice>
      </oneOrMore>
    </element>
  </start>

  <a:doc>It is possible to generate more than one type of output for more than
  one output handler. To switch between different types of output a parameter
  with different values can be used. The driver program can access the name of
  the parameter (md:param_name) and the value (md:param_value) of the current
  output handler with suitable XPath statements.</a:doc>
  <define name="selector">
    <optional>
      <attribute name="md:param_name">
        <text/>
      </attribute>
      <attribute name="md:param_value">
        <text/>
      </attribute>
    </optional>
  </define>

  <a:doc></a:doc>
  <define name="file_properties">
    <attribute name="md:name">
      <text/>
    </attribute>
    <optional>
      <attribute name="md:owner">
        <text/>
      </attribute>
    </optional>
    <optional>
      <attribute name="md:group">
        <text/>
      </attribute>
    </optional>
    <optional>
      <attribute name="md:permission">
        <text/>
      </attribute>
    </optional>
    <optional>
      <attribute name="md:selinux_context">
        <text/>
      </attribute>
    </optional>
  </define>

  <a:doc></a:doc>
  <define name="exec_properties">
    <attribute name="md:command">
      </text>
    </attribute>
    <optional>
      <attribute name="md:arguments">
        </text>
      </attribute>
    </optional>
  </define>

</grammar>