<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2018 Anyware Services

   Licensed 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

       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.
   -->

<extension class="org.ametys.cms.contenttype.DefaultContentType">
	<content-type extends="org.ametys.plugins.userdirectory.Content.user">  
	                  
		<label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_LABEL</label>
		<description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_DESC</description>
		<default-title i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_DEFAULT_TITLE</default-title>
		<icons>
			<glyph>ametysicon-body-people</glyph>
		</icons>
		<css>
			<file plugin="core-ui">font/ametys/AmetysIcon.css</file>
		</css>
        
        <tags>
            <tag>private</tag>
        </tags>
	   
	   <attribute name="title" type="string">
           <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_TITLE</label>
           <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_TITLE_DESC</description>
           <validation>
               <mandatory />
           </validation>
       </attribute>
       
       <attribute name="login" type="string">
	       <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_LOGIN</label>
	       <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_LOGIN_DESC</description>
	       <validation>
	           <mandatory />
	       </validation>
	   </attribute>
	   
	   <attribute name="firstname" type="string">
           <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_FIRSTNAME</label>
           <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_FIRSTNAME_DESC</description>
       </attribute>
	   
	   <attribute name="lastname" type="string">
	       <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_LASTNAME</label>
	       <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_LASTNAME_DESC</description>
	   </attribute>
	   
	   <attribute name="illustration" type="composite">
	       <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_ILLUSTRATION</label>
	       <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_ILLUSTRATION_DESC</description>
	       <attribute name="image" type="file">
	           <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_IMAGE</label>
	           <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_IMAGE_DESC</description>
	           <widget>edition.file</widget>
	           <widget-params>
	               <param name="allowSources">external,resource</param>
	               <param name="filter">image</param>
	           </widget-params>
	       </attribute>
	       <attribute name="alt-text" type="string">
	           <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_IMAGE_ALT</label>
	           <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_IMAGE_ALT_DESC</description>
	       </attribute>
	   </attribute>
	   
       <attribute name="role" type="string">
           <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_ROLE</label>
           <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_ROLE_DESC</description>
       </attribute>
       <attribute name="phone" type="string">
           <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_PHONE</label>
           <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_MOBILE_DESC</description>
       </attribute>
	   <attribute name="mobilePhone" type="string">
	       <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_MOBILE_PHONE</label>
	       <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_MOBILE_PHONE_DESC</description>
	   </attribute>
	   
	    <attribute name="mail" type="string">
	       <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_MAIL</label>
	       <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_MAIL_DESC</description>
	   </attribute>
	   
       <attribute name="officeAddress" type="string">
           <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_OFFICE_ADDRESS</label>
           <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_OFFICE_ADDRESS_DESC</description>
           <widget>edition.textarea</widget>
       </attribute>
       
       <attribute name="interests" type="rich-text">
	       <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_INTERESTS</label>
	       <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_INTERESTS_DESC</description>
	   </attribute>
       
	   <dublin-core/>
	   
	   <!-- Main -->
	   <view name="main">
	       <attribute-ref name="title" />
	       <attribute-ref name="login" />
           <attribute-ref name="firstname" />
           <attribute-ref name="lastname" />
           <attribute-ref name="illustration" >
	           <attribute-ref name="image" />
	           <attribute-ref name="alt-text" />
           </attribute-ref>
           <attribute-ref name="role"/>
           <attribute-ref name="phone" />
           <attribute-ref name="mobilePhone" />
           <attribute-ref name="mail" />
           <attribute-ref name="officeAddress" />
           <attribute-ref name="interests" />
           <dublin-core/>
	       <label i18n="true">plugin.web:PLUGINS_WEB_VIEW_MAIN</label>
	       <description i18n="true">plugin.web:PLUGINS_WEB_VIEW_MAIN_DESC</description>
	   </view>
	   
	   <!-- Creation -->
	   <view name="creation" type="edition">
           <attribute-ref name="login" />
           <attribute-ref name="firstname" />
           <attribute-ref name="lastname" />
       </view>
	   
	   <!-- Search -->
	   <view name="search" type="view" internal="true">
           <attribute-ref name="title" />
           <attribute-ref name="login" />
           <attribute-ref name="firstname" />
           <attribute-ref name="lastname" />
	   </view>
	   
	   <!-- Abstract view -->
	   <view name="abstract" type="view">
	       <attribute-ref name="title" />
           <attribute-ref name="login" />
           <attribute-ref name="firstname" />
           <attribute-ref name="lastname" />
           <attribute-ref name="illustration" >
	           <attribute-ref name="image" />
	           <attribute-ref name="alt-text" />
           </attribute-ref>
           <attribute-ref name="role"/>
           <attribute-ref name="phone" />
           <attribute-ref name="mobilePhone" />
            <attribute-ref name="mail" />
           <label i18n="true">plugin.web:PLUGINS_WEB_VIEW_ABSTRACT</label>
	       <description i18n="true">plugin.web:PLUGINS_WEB_VIEW_ABSTRACT_DESC</description>
	   </view>
	   
	   <!-- Link view -->
	   <view name="link" type="view">
	       <attribute-ref name="title" />
           <attribute-ref name="login" />
           <attribute-ref name="firstname" />
           <attribute-ref name="lastname" />
           <attribute-ref name="illustration" >
               <attribute-ref name="image" />
               <attribute-ref name="alt-text" />
           </attribute-ref>
	       <label i18n="true">plugin.web:PLUGINS_WEB_VIEW_LINK</label>
	       <description i18n="true">plugin.web:PLUGINS_WEB_VIEW_LINK_DESC</description>
	   </view>
	   
	   <!-- Details -->
       <view name="details" type="view" internal="true">
           <attribute-ref name="title" />
           <attribute-ref name="firstname" />
           <attribute-ref name="lastname" />
           <dublin-core/>
       </view>
	   
	   <!-- Index -->
	   <view name="index" type="view" internal="true">
	       <attribute-ref name="title" />
           <attribute-ref name="firstname" />
           <attribute-ref name="lastname" />
	       <dublin-core/>
	   </view>
       
       <!-- Organization chart -->
        <view name="organizationChart" type="view">
           <attribute-ref name="firstname" />
           <attribute-ref name="lastname" />
           <attribute-ref name="illustration" >
               <attribute-ref name="image" />
               <attribute-ref name="alt-text" />
           </attribute-ref>
            <label i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_VIEW_CHART</label>
            <description i18n="true">plugin.user-directory:PLUGINS_USER_DIRECTORY_CONTENT_TYPES_UD_USER_VIEW_CHART_DESC</description>
        </view>
	</content-type>
</extension>
