<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ $Revision$
  ~ $Date$
  ~
  ~ Copyright (C) 1999-2006 Jive Software. All rights reserved.
  ~
  ~ This software is the proprietary information of Jive Software. Use is subject to license terms.
  ~
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:include schemaLocation="http://www.jivesoftware.com/schemas/clearspace/1_1/ui-components.xsd"/>     
    <xs:element name="plugin">
        <xs:annotation>
            <xs:documentation>The top level xml element.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:choice maxOccurs="unbounded">
                    <xs:element name="class" type="xs:string" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>The name of the class that implements
                                com.jivesoftware.base.plugin.Plugin for this plugin.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>The name of this plugin as it should be displayed when
                                viewed in the admin tool. </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>A short description of the purpose of this
                            plugin</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="author" type="xs:string" minOccurs="1" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>The name of the invidual or company that created this
                                plugin. </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="version" type="xs:string" minOccurs="1" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>The version of this plugin.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="minServerVersion" type="xs:string" minOccurs="1" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>The minimum version of the server that this plugin
                                requires. </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="databaseKey" type="xs:string" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>The jive database key. Used in the jiveVersion table
                                to store schema version information. Only required if the plugin has
                                a db schema. </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="databaseVersion" type="xs:integer" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>
                                The version of the database schema of this current
                                plugin version. Only required if the plugin has a db scema.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element ref="components" minOccurs="0" maxOccurs="1">
                        <xs:annotation>
                            <xs:documentation>
                                Used to define integration points into the Clearspace User Interface.
                                See the ui-components.xsd for information on each of the elements.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>                    
                    <xs:element ref="filter" minOccurs="0" maxOccurs="unbounded">
                        <xs:annotation>
                            <xs:documentation>
                                 Used to define a custom filter or macro. See the render or macro documentation for more details. 
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element ref="css" minOccurs="0" maxOccurs="unbounded" />
                    <xs:element ref="javascript" minOccurs="0" maxOccurs="unbounded" />
                    <xs:element ref="webservice" minOccurs="0" maxOccurs="unbounded" />
                </xs:choice>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="webservice">
        <xs:annotation>
            <xs:documentation>Used to install a custom webservice.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="class" use="required">
                <xs:annotation>
                    <xs:documentation>
                        The name of the webservice or macro to be installed.
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="filter">
        <xs:annotation>
            <xs:documentation>Used to install a custom filter or macro.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="class" use="required">
                <xs:annotation>
                    <xs:documentation>
                        The name of the filter or macro to be installed. The filter or
                        macro must extend either com.jivesoftware.community.renderer.BaseFilter or
                        com.jivesoftware.community.renderer.BaseMacro. 
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="css">
        <xs:annotation>
            <xs:documentation>
                Used to define custom CSS information from a plugin.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="src" use="required" type="xs:string">
                <xs:annotation>
                    <xs:documentation>
                        A path to the CSS file based from the root of the src (ie. /resources/plugin.css ). 
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="javascript">
        <xs:annotation>
            <xs:documentation>
                Used to define custom Javascript information from a plugin.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="src" use="required" type="xs:string">
                <xs:annotation>
                    <xs:documentation>
                        A path to the javascript file based from the root of the src (ie. /resources/plugin.js ).
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
</xs:schema>

