<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<object-views xmlns="http://axelor.com/xml/ns/object-views"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_5.2.xsd">
	
	
	<grid name="ebics-certificate-grid" title="Ebics certificate" model="com.axelor.apps.bankpayment.db.EbicsCertificate" >
		<field name="typeSelect" />
		<field name="subject" />
		<field name="issuer" />
		<field name="validFrom" />
		<field name="validTo" />
	</grid>
	
	<form name="ebics-certificate-form" title="Ebics certificate" model="com.axelor.apps.bankpayment.db.EbicsCertificate" onNew="action-ebics-certificate-record-default">
		<panel name="mainPanel">
			<field name="typeSelect" />
			<field name="ebicsBank" hideIf="typeSelect == 'signature'"/>
			<field name="certificate" colSpan="3"/>
			<button name="loadCertificateBtn"  onClick="save,action-ebics-certificate-method-load-certificate,save" title="Load certificate" colSpan="3"/>
			<panel name="informationPanel" title="Information" readonly="true" colSpan="12">
				<field name="subject" colSpan="12" />
				<field name="issuer" colSpan="12" />
				<field name="validFrom" />
				<field name="validTo" />
				<field name="initLetterEditionDate" />
				<field name="privateKey" />
				<field name="publicKeyModulus" hidden="true"/>
				<field name="publicKeyExponent" hidden="true"/>
				<field name="fullName" hidden="true" />
				<field name="pemString" hidden="true" />
				<field name="sha2has" hidden="true" />
			</panel>
		</panel>
	</form>
	
	<form name="ebics-certificate-confirmation-form" title="Certificate confirmation" model="com.axelor.apps.bankpayment.db.EbicsCertificate"
		editable="false" onNew="action-ebics-certificate-confirmation-set-default">
		<panel name="mainPanel">
			<field name="url" type="string" title="URL" />
			<field name="hostId" type="string" title="Host Id" />
			<field name="e002Hash" type="string" widget="text" title="Hash E002" />
			<field name="x002Hash" type="string" widget="text" title="Hash X002" />
			<button name="addCertificatesBtn" title="OK" onClick="action-ebics-certificate-method-add-certificates" colSpan="2" />
			<field name="certificateE002" type="string" hidden="true" />
			<field name="certificateX002" type="string" hidden="true" />
			<field name="ebicsBank" type="many-to-one" target="com.axelor.apps.bankpayment.db.EbicsBank" hidden="true" />
		</panel>
	</form>
	
	<action-record name="action-ebics-certificate-record-default" model="com.axelor.apps.bankpayment.db.EbicsCertificate">
		<field name="typeSelect" expr="eval: EbicsCertificateRepository.TYPE_SIGNATURE"/>
	</action-record>
	
	<action-method name="action-ebics-certificate-method-add-certificates">
		<call class="com.axelor.apps.bankpayment.ebics.web.EbicsController" method="addCertificates"/>
	</action-method>
	
	<action-method name="action-ebics-certificate-method-load-certificate">
    	<call class="com.axelor.apps.bankpayment.ebics.web.EbicsController" method="loadCertificate" />
    </action-method>
    
	<action-attrs name="action-ebics-certificate-confirmation-set-default">
		<attribute name="value" for="url" expr="eval:url"/>
		<attribute name="value" for="hostId" expr="eval:hostId"/>
		<attribute name="value" for="e002Hash" expr="eval:e002Hash"/>
		<attribute name="value" for="x002Hash" expr="eval:x002Hash"/>
		<attribute name="value" for="certificateE002" expr="eval:certificateE002"/>
		<attribute name="value" for="certificateX002" expr="eval:certificateX002" />
		<attribute name="value" for="bankId" expr="eval:bankId" />
	</action-attrs>
	
</object-views>
