<configure
	xmlns="http://namespaces.zope.org/zope"
	xmlns:browser="http://namespaces.zope.org/browser"
	xmlns:i18n="http://namespaces.zope.org/i18n"
	xmlns:z3c="http://namespaces.zope.org/z3c"
	i18n_domain="ztfy.myams">

	<!-- Registered translations -->
	<i18n:registerTranslations directory="locales" />


	<!-- Main skin interface -->
	<interface
		name="MyAMS"
		interface=".layer.MyAMSkin"
		type="zope.publisher.interfaces.browser.IBrowserSkinType" />


	<!-- Configuration interfaces -->
	<adapter
		factory=".configuration.MyAMSConfigurationFactory"
		trusted="true" />

	<class class=".configuration.MyAMSConfiguration">
		<implements
			interface="zope.annotation.interfaces.IAttributeAnnotatable" />
		<require
			interface=".interfaces.configuration.IMyAMSConfiguration"
			permission="zope.Public" />
		<require
			set_schema=".interfaces.configuration.IMyAMSConfiguration"
			permission="zope.ManageServices" />
	</class>


	<include package=".browser" />
	<include package=".tal" />
	<include package=".json" />

	<include package=".viewlet.toplinks" />
	<include package=".viewlet.shortcuts" />
	<include package=".viewlet.search" />
	<include package=".viewlet.flags" />
	<include package=".viewlet.menu" />


	<!-- Default layouts, views and templates -->
	<z3c:layout
		for="*"
		template="templates/layout.pt"
		layer=".layer.MyAMSLayer" />

	<z3c:layout
		for=".interfaces.IFullPage"
		template="templates/fullpage-layout.pt"
		layer=".layer.MyAMSLayer" />

	<z3c:layout
		for=".interfaces.IModalFullPage"
		template="templates/fullpage-modal-layout.pt"
		layer=".layer.MyAMSLayer" />

	<z3c:layout
		for=".interfaces.IInnerPage"
		template="templates/inner-layout.pt"
		layer=".layer.MyAMSLayer" />

	<z3c:layout
		for=".interfaces.IModalPage"
		template="templates/modal-layout.pt"
		layer=".layer.MyAMSLayer" />


	<z3c:pagelet
		name="index.html"
		for="*"
		class=".page.BaseIndexPage"
		layer=".layer.MyAMSLayer"
		permission="zope.View" />

	<z3c:template
		template="templates/index.pt"
		for=".page.BaseIndexPage"
		layer=".layer.MyAMSLayer" />


	<!-- Re-define default files view for MyAMS layer -->
	<browser:page
		for="zope.app.file.interfaces.IFile"
		name="index.html"
		class="ztfy.file.browser.FileView"
		attribute="show"
		layer=".layer.MyAMSLayer"
		permission="zope.View" />


	<!-- Custom boolean terms factory -->
	<adapter factory=".terms.BoolTerms" />


	<!-- Exceptions views -->
	<browser:page
		name="error"
		for="zope.interface.common.interfaces.IException"
		class=".page.ExceptionView"
		layer=".layer.MyAMSLayer"
		permission="zope.Public" />

	<browser:page
		name="error"
		for="zope.exceptions.interfaces.IUserError"
		class=".page.ExceptionView"
		layer=".layer.MyAMSLayer"
		permission="zope.Public" />

	<browser:page
		name="error"
		for="zope.publisher.interfaces.INotFound"
		class=".page.ExceptionView"
		layer=".layer.MyAMSLayer"
		permission="zope.Public" />

	<browser:page
		name="index.html"
		for="zope.security.interfaces.IUnauthorized"
		class=".page.UnauthorizedExceptionView"
		layer=".layer.MyAMSLayer"
		permission="zope.Public" />

	<browser:page
		name="index.html"
		for="zope.security.interfaces.IUnauthorized"
		class=".page.UnauthorizedExceptionView"
		layer="z3c.jsonrpc.interfaces.IJSONRPCRequest"
		permission="zope.Public" />

	<browser:page
		name="error"
		for="zope.security.interfaces.IUnauthorized"
		class=".page.UnauthorizedExceptionView"
		layer=".layer.MyAMSLayer"
		permission="zope.Public" />


	<!-- Forms layouts, views and templates -->
	<z3c:template
		for="z3c.form.interfaces.IInputForm"
		template="templates/forms/form.pt"
		layer=".layer.MyAMSLayer" />

	<z3c:template
		for=".interfaces.IInnerForm"
		template="templates/forms/inner-form.pt"
		layer=".layer.MyAMSLayer" />

	<z3c:layout
		for="ztfy.baseskin.interfaces.IDialog"
		template="templates/modal-layout.pt"
		layer=".layer.MyAMSLayer" />

	<z3c:widgetTemplate
		mode="display"
		template="templates/forms/button-display.pt"
		widget="z3c.form.interfaces.IButtonWidget"
		layer=".layer.MyAMSLayer" />

	<z3c:widgetTemplate
		mode="input"
		template="templates/forms/button-input.pt"
		widget="z3c.form.interfaces.IButtonWidget"
		layer=".layer.MyAMSLayer" />

	<z3c:widgetTemplate
		mode="display"
		template="templates/forms/submit-display.pt"
		widget="z3c.form.interfaces.ISubmitWidget"
		layer=".layer.MyAMSLayer" />

	<z3c:widgetTemplate
		mode="input"
		template="templates/forms/submit-input.pt"
		widget="z3c.form.interfaces.ISubmitWidget"
		layer=".layer.MyAMSLayer" />

	<z3c:widgetTemplate
		mode="display"
		template="templates/forms/reset-display.pt"
		widget="ztfy.baseskin.interfaces.form.IResetWidget"
		layer=".layer.MyAMSLayer" />

	<z3c:widgetTemplate
		mode="input"
		template="templates/forms/reset-input.pt"
		widget="ztfy.baseskin.interfaces.form.IResetWidget"
		layer=".layer.MyAMSLayer" />

	<z3c:widgetTemplate
		mode="display"
		template="templates/forms/close-display.pt"
		widget="ztfy.baseskin.interfaces.form.ICloseWidget"
		layer=".layer.MyAMSLayer" />

	<z3c:widgetTemplate
		mode="input"
		template="templates/forms/close-input.pt"
		widget="ztfy.baseskin.interfaces.form.ICloseWidget"
		layer=".layer.MyAMSLayer" />


	<z3c:widgetTemplate
		mode="input"
		template="templates/forms/radio-input.pt"
		widget="z3c.form.interfaces.IRadioWidget"
		layer=".layer.MyAMSLayer" />


	<!-- Login forms -->
	<z3c:pagelet
		name="login.html"
		for="*"
		class=".login.LoginView"
		layer=".layer.MyAMSLayer"
		permission="zope.Public" />

	<z3c:pagelet
		name="login-dialog.html"
		for="*"
		class=".login.LoginDialogView"
		layer=".layer.MyAMSLayer"
		permission="zope.Public" />

	<adapter
		name="form_prefix"
		factory=".login.LoginViewFormPrefix"
		permission="zope.View" />

	<z3c:template
		template="templates/forms/login-form-prefix.pt"
		for=".login.LoginViewFormPrefix"
		layer=".layer.MyAMSLayer" />

	<adapter
		name="form_suffix"
		factory=".login.LoginViewFormSuffix"
		permission="zope.View" />

	<z3c:template
		template="templates/forms/login-form-suffix.pt"
		for=".login.LoginViewFormSuffix"
		layer=".layer.MyAMSLayer" />

	<browser:page
		name="logout.html"
		for="*"
		class=".login.LogoutView"
		layer=".layer.MyAMSLayer"
		permission="zope.Public" />

</configure>
