<?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="app-builder-grid" title="App builder" model="com.axelor.studio.db.AppBuilder">
		<toolbar>
	 		<button name="exportAppBuildersBtn" title="Export" onClick="action-export-studio-app-builders" />
	   		<button name="importAppBuildersBtn" title="Import" onClick="action-studio-open-import-bpm-form" />
  	  	</toolbar>
		<field name="name" />
		<field name="code" />
	</grid>
	
	<form name="app-builder-form" title="App builder" model="com.axelor.studio.db.AppBuilder" width="large">
		<panel name="mainPanel">
			<field name="image" widget="Image" colSpan="2"/>
			<panel name="detailPanel" colSpan="8">
				<field name="code" colSpan="3" />
				<field name="name" colSpan="8" />
				<field name="dependsOnSet" colSpan="12" widget="TagSelect" canNew="false" canEdit="false" />
				<field name="sequence" />
			</panel>
			<field name="description" widget="html" colSpan="12"/>
		</panel>
	</form>
	
	<form name="import-bpm-form" title="Import BPM" model="com.axelor.studio.db.AppBuilder" >
		<panel name="mainPanel"> 
			<field name="dataFile" type="many-to-one" target="com.axelor.meta.db.MetaFile" widget="binary-link" title="Data file"/>
			<button name="importUsersBtn" title="Import" onClick="action-studio-app-builder-method-import-bpm" showIf="dataFile != null" colSpan="4" />
			<field name="importLog" type="text" colSpan="12" readonly="true" title="Import log"/>
		</panel>	
	</form> 
	
	<action-export name="action-export-studio-app-builders" output="${date}${time}" download="true">
	  <export name="BPM-${__datetime__.format(java.time.format.DateTimeFormatter.ofPattern('ddMMyyyyHHmmSS'))}.xml"
	    	  template="data-export/export-bpm.tmpl"
	          engine="groovy"/>
  	</action-export>
  	
  	<action-view name="action-studio-open-import-bpm-form" title="Import BPM" model="com.axelor.studio.db.AppBuilder">
    	<view type="form" name="import-bpm-form"/>
    	<view-param name="popup" value="true"/>
    	<view-param name="popup-save" value="false"/>
    	<view-param name="show-confirm" value="false"/>
    	<view-param name="show-toolbar" value="false"/>
    </action-view>
  	
  	<action-method name="action-studio-app-builder-method-import-bpm">
  		<call class="com.axelor.studio.web.AppBuilderController" method="importBpm"/>
  	</action-method>
       
</object-views>
