<?xml version="1.0" encoding="UTF-8" ?>
<!--
	Copyright 2010 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.
	-->
	<cms:content-type
		xmlns:cms="http://www.ametys.org/schema/cms">
			
	<!-- +
		 | HEADER
		 + -->
			
		<cms:label i18n="true">CONTENT_SMALLADS_LABEL</cms:label>
			<cms:description i18n="true">CONTENT_SMALLADS_DESCRIPTION</cms:description>
			<cms:default-title i18n="true">CONTENT_SMALLADS_DEFAULT_TITLE</cms:default-title>
			
			<cms:icons>
				<cms:glyph>ametysicon-list4</cms:glyph>
			</cms:icons>
			
	
			<cms:right>Web_Right_Smallads_Create</cms:right>
			
			<cms:metadata name="title" type="string">
				<label i18n="true">plugin.news:CONTENT_NEWS_TITLE</label>
				<description i18n="true">plugin.news:CONTENT_NEWS_TITLE_DESC</description>
				<validation>
					<mandatory />
				</validation>
			</cms:metadata>
			
			<cms:metadata name="document-subtitle" type="string">
				<label i18n="true">plugin.news:CONTENT_NEWS_SUBTITLE</label>
				<description i18n="true">plugin.news:CONTENT_NEWS_SUBTITLE_DESC</description>
			</cms:metadata>
			
			<cms:metadata name="abstract" type="string">
				<label i18n="true">plugin.news:CONTENT_NEWS_ABSTRACT</label>
				<description i18n="true">plugin.news:CONTENT_NEWS_ABSTRACT_DESC</description>
				<widget>edition.textarea</widget>
			</cms:metadata>

			<cms:metadata name="start-date" type="date">
				<label i18n="true">plugin.news:CONTENT_NEWS_START_DATE</label>
				<description i18n="true">plugin.news:CONTENT_NEWS_START_DATE_DESC</description>
				<validation>
					<invalidText i18n="true">plugin.news:CONTENT_NEWS_DATE_INVALID_FORMAT</invalidText>
				</validation>
			</cms:metadata>
			<cms:metadata name="end-date" type="date">
				<label i18n="true">plugin.news:CONTENT_NEWS_END_DATE</label>
				<description i18n="true">plugin.news:CONTENT_NEWS_END_DATE_DESC</description>
				<validation>
					<invalidText i18n="true">plugin.news:CONTENT_NEWS_DATE_INVALID_FORMAT</invalidText>
				</validation>
			</cms:metadata>

			<cms:metadata name="content" type="rich-text">
				<label i18n="true">plugin.news:CONTENT_NEWS_CONTENT</label>
				<description i18n="true">plugin.news:CONTENT_NEWS_CONTENT_DESC</description>
				<validation>
					<mandatory />
				</validation>
			</cms:metadata>
			
			<cms:metadata name="comment" type="boolean">
				<label i18n="true">plugin.news:CONTENT_NEWS_COMMENT</label>
				<description i18n="true">plugin.news:CONTENT_NEWS_COMMENT_DESC</description>
				<cms:default-value>false</cms:default-value>
			</cms:metadata>

			<cms:metadata name="contact" type="composite">
				<label i18n="true">plugin.news:CONTENT_NEWS_AUTHOR</label>
				<description i18n="true">plugin.news:CONTENT_NEWS_AUTHOR_DESC</description>
				<cms:metadata name="name" type="string">
					<label i18n="true">plugin.news:CONTENT_NEWS_AUTHOR</label>
					<description i18n="true">plugin.news:CONTENT_NEWS_AUTHOR_DESC</description>
				</cms:metadata>
				<cms:metadata name="mail" type="string">
					<label i18n="true">plugin.news:CONTENT_NEWS_AUTHOR_MAIL</label>
					<description i18n="true">plugin.news:CONTENT_NEWS_AUTHOR_MAIL_DESC</description>
					<validation>
						<regexp>^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,4}$</regexp>
						<invalidText i18n="true">plugin.web:PLUGINS_WEB_REGEXP_INVALID_MAIL</invalidText>
					</validation>
				</cms:metadata>
			</cms:metadata>
			
			<cms:dublin-core/>

			<!-- Full view -->
			<cms:metadata-set name="main" type="view">
				<cms:metadata-ref name="title" />
				<cms:metadata-ref name="document-subtitle" />
				<cms:metadata-ref name="start-date" />
				<cms:metadata-ref name="end-date" />
				<cms:metadata-ref name="abstract" />
				<cms:metadata-ref name="content" />
				<cms:metadata-ref name="comment" />
				<cms:metadata-ref name="contact">
					<cms:metadata-ref name="name" />
					<cms:metadata-ref name="mail" />
				</cms:metadata-ref>
				<cms:dublin-core/>
				<cms:label i18n="true">plugin.web:PLUGINS_WEB_VIEW_MAIN</cms:label>
				<cms:description i18n="true">plugin.web:PLUGINS_WEB_VIEW_MAIN_DESC</cms:description>
			</cms:metadata-set>

			<!-- Index -->
			<cms:metadata-set name="index" type="view" internal="true">
				<cms:metadata-ref name="title" />
				<cms:metadata-ref name="document-subtitle" />
				<cms:metadata-ref name="start-date" />
				<cms:metadata-ref name="end-date" />
				<cms:metadata-ref name="abstract" />
				<cms:metadata-ref name="content" />
				<cms:metadata-ref name="comment" />
				<cms:metadata-ref name="contact">
					<cms:metadata-ref name="name" />
					<cms:metadata-ref name="mail" />
				</cms:metadata-ref>
				<cms:dublin-core/>
			</cms:metadata-set>
			
			<!-- Abstract view -->
			<cms:metadata-set name="abstract" type="view">
				<cms:metadata-ref name="title" />
				<cms:metadata-ref name="start-date" />
				<cms:metadata-ref name="end-date" />
				<cms:metadata-ref name="abstract" />
                      <cms:metadata-ref name="content" />
				<cms:label i18n="true">plugin.web:PLUGINS_WEB_VIEW_ABSTRACT</cms:label>
				<cms:description i18n="true">plugin.web:PLUGINS_WEB_VIEW_ABSTRACT_DESC</cms:description>
			</cms:metadata-set>
			
			<!-- Link view -->
			<cms:metadata-set name="link" type="view">
				<cms:metadata-ref name="title" />
				<cms:metadata-ref name="document-subtitle" />
				<cms:metadata-ref name="start-date" />
				<cms:metadata-ref name="end-date" />
				<cms:label i18n="true">plugin.web:PLUGINS_WEB_VIEW_LINK</cms:label>
				<cms:description i18n="true">plugin.web:PLUGINS_WEB_VIEW_LINK_DESC</cms:description>
			</cms:metadata-set>

			<!-- Edition -->
			<cms:metadata-set name="main" type="edition">
				<cms:metadata-ref name="title" />
				<cms:metadata-ref name="document-subtitle" />
				<cms:metadata-ref name="start-date" />
				<cms:metadata-ref name="end-date" />
				<cms:metadata-ref name="abstract" />
				<cms:metadata-ref name="content" />
				<cms:metadata-ref name="comment" />
				<cms:metadata-ref name="contact">
					<cms:metadata-ref name="name" />
					<cms:metadata-ref name="mail" />
				</cms:metadata-ref>
				<cms:dublin-core/>
			</cms:metadata-set>

			<!-- Property view -->
			<cms:metadata-set name="details" type="view" internal="true">
				<cms:metadata-ref name="title" />
				<cms:metadata-ref name="document-subtitle" />
				<cms:metadata-ref name="start-date" />
				<cms:metadata-ref name="end-date" />
				<cms:dublin-core/>
			</cms:metadata-set>
				
		</cms:content-type>
