#
# Schema for sample app metadata files (sample.meta)
# 
# $Id: sample.rnc,v 1.1 2007-12-05 01:00:19 kohsuke Exp $
# 
# 
start = sample

sample = 
    element sample {
        # does this sample require additional memory?
        attribute hog { "true" }?,
        
        # when the sample was added
        attribute since { "1.0" | "1.0.1" | "1.0.2" | "1.0.3" | "1.0.4" |
                        "2.0" | "2.0.1" | "2.1" },

        # boolean exclude switch
        attribute exclude { "true" }?,

        # name of the sample app.
        # should be no longer than 10 words
        element title { text }, 
        
        # short 1 or 2 sentence description. This is also used
        # to generate documentation
        element description { text }, 
        
        # switch to process readme file (standard filename TBD)
        element readme { empty }?, 
        
        # controls the creation of project files for Ant, etc
        element project { 
            # optional jar file dependencies
            element depends { 
                # one or more jar files
                element jar { 
                    # relative pathname to jar file
                    attribute name { text }, 
                    # optional URL where to download the jar from.
                    # this is used for documentation purpose, and
                    # it could be a web site or the actual jar location
                    # (if the location is assumed to be stable)
                    attribute from { text }? 
                }+ 
            }? &

            # optional custom datatype converter source code that needs
            # to be compiled before xjc is run.  syntax should follow 
            # ant <fileset>
            element datatypeConverterSrc {
                anyElement+
            }* &
                
            # optional xjc invocations - follows XJCTask syntax
            # but @targetDir will be controlld by the directory structure.
            # <produces> will be also controlled by the directory structure.
            element xjc {
              attribute * - target { text }*,
              element * - produces { anyContent }*
            }* &

            # optional schema generation - follows schemagen task syntax
            # @destdir is controlled by the directory structure,
            element schemagen {
              attribute * - destdir { text }*,
              element * {anyContent}*
            }* &

            # switch to enable javadoc generation into docs/api subdirectory
            element javadoc { empty }? &
            
            # optional java command to launch the sample
            element java {
                # the name of the class containing the main method
                attribute mainClass { text },
                
                # zero or more optional command line args
                element arg {
                    attribute value {text}|
                    attribute path  {text}
                }*
            }? 
        }, 
        
        # optional test automation 
        element test { 
            # the name of the file containing golden results
            attribute goldenFile { text } 
        }? 
    }

# define a wildcard type
anyElement = element * { anyContent }
anyContent = ( attribute * { text } | text | anyElement )*
