text: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <!--
  
      Licensed to Apereo under one or more contributor license
      agreements. See the NOTICE file distributed with this work
      for additional information regarding copyright ownership.
      Apereo licenses this file to you under the Apache License,
      Version 2.0 (the "License"); you may not use this file
      except in compliance with the License.  You may obtain a
      copy of the License at the following location:
  
        http://www.apache.org/licenses/LICENSE-2.0
  
      Unless required by applicable law or agreed to in writing,
      software distributed under the License is distributed on an
      "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
      KIND, either express or implied.  See the License for the
      specific language governing permissions and limitations
      under the License.
  
  -->
  <xs:schema
      xmlns="https://source.jasig.org/schemas/uportal/io/portlet-definition"
      targetNamespace="https://source.jasig.org/schemas/uportal/io/portlet-definition"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:up="https://source.jasig.org/schemas/uportal"
      xmlns:io="https://source.jasig.org/schemas/uportal/io"
      elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
  
      <xs:import namespace="https://source.jasig.org/schemas/uportal" schemaLocation="common-types-4.0.xsd"/>
      <xs:import namespace="https://source.jasig.org/schemas/uportal/io" schemaLocation="common-io-types-4.0.xsd"/>
  
      <xs:element name="portlet-definition">
          <xs:complexType>
              <xs:complexContent>
                  <xs:extension base="io:basePortalDataType50">
                      <xs:sequence>
                          <xs:element name="title" type="xs:string"/>
                          <!-- 'title' is the value that will be displayed in the portlet chrome and in
                              navigation menus.  'name' is intended primarily for internal or admin usage.
                              'name' can be used to distinguish between similar portlets that may share a title. -->
                          <xs:element name="name" type="xs:string"/>
                          <xs:element name="fname" type="up:fname-type"/>
                          <xs:element name="desc" type="xs:string" minOccurs="0"/>
                          <xs:element name="type" type="xs:string"/>
                          <xs:element name="timeout" type="xs:positiveInteger"/>
                          <xs:element name="actionTimeout" type="xs:positiveInteger" minOccurs="0"/>
                          <xs:element name="eventTimeout" type="xs:positiveInteger" minOccurs="0"/>
                          <xs:element name="renderTimeout" type="xs:positiveInteger" minOccurs="0"/>
                          <xs:element name="resourceTimeout" type="xs:positiveInteger" minOccurs="0"/>
                          
                          <xs:element name="portlet-descriptor" type="up:portlet-descriptor"/>
                          <xs:element name="lifecycle" type="lifecycle" minOccurs="0" maxOccurs="1"/>
  
                          <xs:element name="category" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                          <xs:element name="group" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                          <xs:element name="user" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                          <xs:element name="permissions" type="externalPermissions" minOccurs="0" maxOccurs="1"/>
                          <xs:element name="parameter" type="externalPortletParameter" minOccurs="0" maxOccurs="unbounded"/>
                          <xs:element name="portlet-preference" type="externalPortletPreference" minOccurs="0"
                              maxOccurs="unbounded"/>
                      </xs:sequence>
                  </xs:extension>
              </xs:complexContent>
          </xs:complexType>
          <xs:unique name="unique-category">
              <xs:selector xpath="category"/>
              <xs:field xpath="."/>
          </xs:unique>
          <xs:unique name="unique-group">
              <xs:selector xpath="group"/>
              <xs:field xpath="."/>
          </xs:unique>
          <xs:unique name="unique-user">
              <xs:selector xpath="user"/>
              <xs:field xpath="."/>
          </xs:unique>
          <xs:unique name="unique-parameter">
              <xs:selector xpath="parameter"/>
              <xs:field xpath="name"/>
          </xs:unique>
          <xs:unique name="unique-preference">
              <xs:selector xpath="portlet-preference"/>
              <xs:field xpath="name"/>
          </xs:unique>
          <xs:unique name="unique-permission-group">
              <xs:selector xpath="permissions/permission/group"/>
              <xs:field xpath="group"/>
          </xs:unique>
      </xs:element>
  
      <xs:complexType name="lifecycle">
          <xs:sequence>
              <xs:element name="entry" type="lifecycleEntry" minOccurs="0" maxOccurs="unbounded" />
          </xs:sequence>
      </xs:complexType>
  
      <xs:complexType name="lifecycleEntry">
          <xs:simpleContent>
              <!-- Date-time of the format [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]; see http://books.xmlschemata.org/relaxng/ch19-77049.html -->
              <xs:extension base="xs:dateTime">
                  <xs:attribute name="name" type="xs:string"/>
                  <!-- user attribute is optional. -->
                  <xs:attribute name="user" type="xs:string"/>
              </xs:extension>
          </xs:simpleContent>
      </xs:complexType>
  
      <xs:complexType name="externalPortletParameter">
          <xs:sequence>
              <xs:element name="name" type="xs:string"/>
              <xs:element name="value" type="xs:string" minOccurs="0"/>
              <xs:element name="description" type="xs:string" minOccurs="0"/>
          </xs:sequence>
      </xs:complexType>
  
      <xs:complexType name="externalPortletPreference">
          <xs:sequence>
              <xs:element name="name" type="xs:string"/>
              <xs:element name="readOnly" type="xs:boolean" default="false" minOccurs="0"/>
              <xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
      </xs:complexType>
  
      <!-- Portlet specific grants:
        - system:  The permission manager name
        - activity: The name of the permission to grant
        - group:  the list of groups that will be granted the permission
        -->
      <xs:complexType name="externalPermissionMemberList">
          <xs:sequence>
              <xs:element name="group" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:attribute name="system" type="xs:string" use="required"/>
          <xs:attribute name="activity" type="xs:string" use="required"/>
      </xs:complexType>
  
      <!-- optional top level permissions tag -->
      <xs:complexType name="externalPermissions">
          <xs:sequence>
              <xs:element name="permission" type="externalPermissionMemberList" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
      </xs:complexType>
  </xs:schema>
  