<?xml version="1.0" encoding="UTF-8"?>
<doui:douiDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:doui="http://www.lumis.com.br/lumisportal/xsd/doui"
xmlns:control="http://www.lumis.com.br/douicontrols">
<service id="corporateHoteisAdmin4">
<sources>
<source id="default" type="table">
<table>tr3_hotel</table>
<fields>
<field id="hotelId" display="false" name="ID" dataType="string" isPrimaryKey="true"/>
<field id="nome" name="Nome" dataType="string" isPrimaryName="true" required="true" isSearchable="true"/>
<field id="introducao" name="Introdução" dataType="text" isSearchable="true" isIntroduction="true" display="false"/>
<field id="descricao" name="Descrição" dataType="html" isSearchable="true" display="false"/>
<field id="imagem" name="Imagem" dataType="image" doLookup="true"/>
<field id="lotado" name="Lotado" dataType="integer" display="true">
<options>
<option value="0">Não</option>
<option value="1">Sim</option>
</options>
</field>
<field id="cidadeId" name="Cidade" dataType="string" lookupRelationId="cidade" lookupFieldId="nome" includeAlways="true"/>
</fields>
<relations>
<relation id="cidade">
<relationField fieldId="cidadeId" foreignFieldId="cidadeId"/>
</relation>
</relations>
</source>
<source id="cidade" type="table">
<table>tr3_cidade</table>
<fields>
<field id="cidadeId" display="false" name="ID" dataType="string" isPrimaryKey="true"/>
<field id="nome" name="Nome" dataType="string" isPrimaryName="true" required="true"/>
<field id="uf" name="UF" dataType="string" display="true"/>
</fields>
</source>
<source id="uf">
<!-- Classe que irá popular o source -->
<dataProviderClassName>corporate.hoteisadmin4.UFDataProvider</dataProviderClassName>
<fields>
<field id="uf" name="UF" dataType="string" isPrimaryKey="true" isPrimaryName="true"/>
</fields>
</source>
</sources>
</service>
<interfaces>
<!-- Usuário final -->
<interface id="list">
<sources>
<source id="default">
<fields inherit="all">
<field id="introducao" display="true" />
<field id="imagem" display="false" />
<field id="lotado" display="false" />
<field id="cidadeId" doLookup="true" />
</fields>
<filters>
<filter id="lotado" hidden="true" value="0" />
</filters>
<orderBy>
<field id="cidadeId" direction="ascending" />
<field id="nome" direction="descending" />
</orderBy>
</source>
<source id="cidade" />
</sources>
<hyperLinks>
<hyperLink id="details" interfaceId="details" />
</hyperLinks>
<controls>
<control type="lum_form">
<control type="lum_interfaceHeader"/>
<control id="list" type="lum_list" dataId="hotelId" />
</control>
</controls>
</interface>
<interface id="details">
<sources>
<source id="default">
<fields inherit="all">
<field id="cidadeId" doLookup="true" />
<field id="introducao" display="true" />
<field id="descricao" display="true" />
<field id="lotado" display="false" />
</fields>
</source>
<source id="cidade" />
</sources>
<controls>
<control id="autoLayout" type="lum_autoLayoutDetails"/>
</controls>
</interface>
<!-- Administração de cidades -->
<interface id="adminCidade">
<sources>
<source id="cidade"/>
<source id="uf" />
</sources>
<hyperLinks/>
<controls>
<control type="lum_form">
<control type="lum_interfaceHeader"/>
<control type="lum_autoAdminListButtons"/>
<control type="lum_adminList" id="adminList" dataId="cidadeId"/>
</control>
</controls>
<processActions>
<processAction id="delete" type="tableDeleteData" sourceId="cidade">
<response type="doui_standardEmbedded"/>
</processAction>
</processActions>
</interface>
<interface id="addAdminCidade">
<sources>
<source id="cidade"/>
<source id="uf"/>
</sources>
<controls>
<control type="lum_form">
<control type="lum_propertyPage">
<control type="lum_controlGroup" title="Informações Básicas">
<control type="lum_table">
<tr>
<td>
<control type="lum_label" dataId="nome"/>
</td>
<td >
<control type="lum_inputText" id="nome"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="uf"/>
</td>
<td >
<control type="lum_dropDownList" id="uf" optionsSourceId="uf" sourceId="cidade" style="width:126px" renderBlankOption="false" valueFieldId="uf" textFieldId="uf"/>
</td>
</tr>
</control>
</control>
</control>
</control>
</controls>
<processActions>
<processAction id="commit" type="tableAddData">
<response type="doui_standardPopup" />
</processAction>
</processActions>
</interface>
<interface id="editAdminCidade">
<sources>
<source id="cidade">
<filters>
<filter id="cidadeId" required="true" hidden="true" />
</filters>
</source>
<source id="uf"/>
</sources>
<controls>
<control type="lum_form">
<control type="lum_filters" id="filters" />
<control type="lum_propertyPage">
<control type="lum_controlGroup" title="Informações Básicas">
<control type="lum_table">
<tr>
<td>
<control type="lum_label" dataId="nome" />
</td>
<td>
<control type="lum_inputText" id="nome"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="uf"/>
</td>
<td >
<control type="lum_dropDownList" id="uf" optionsSourceId="uf" sourceId="cidade" style="width:126px" renderBlankOption="false"/>
</td>
</tr>
</control>
</control>
</control>
</control>
</controls>
<processActions>
<processAction id="commit" type="tableUpdateData">
<response type="doui_standardPopup" />
</processAction>
</processActions>
</interface>
<!-- Administração de hotéis -->
<interface id="admin">
<sources>
<source id="default">
<fields inherit="all">
<field id="imagem" display="false" />
<field id="lotado" doOptionLookup="true" />
<field id="cidadeId" doLookup="true" />
</fields>
<filters>
<filter id="cidadeId" showItems="all" />
</filters>
<orderBy>
<field id="nome" direction="ascending" />
</orderBy>
</source>
<source id="cidade"/>
</sources>
<controls>
<control type="lum_form">
<control type="lum_interfaceHeader"/>
<control id="interfaceHeaderButtons" type="lum_interfaceHeaderButtons">
<control id="addButton" type="lum_addButton" />
<control id="editButton" type="lum_editButton" />
<control id="deleteButton" type="lum_deleteButton" />
<control id="lotadoButton" text="Definir como lotado" type="lum_button">
<image>corporate/client/images/Lotado.gif</image>
<onClick type="script">
<script>if(!confirm('Você tem certeza que quer definir o(s) item(s) selecionado(s) como lotado(s)?')) return;</script>
<validators>
<!--'adminList.tabulardata' utilizado como id do 'validator', é uma junção do id do controle, que renderiza a lista a ser validada,
com tabulardata, por ser a lista uma tabela. Portanto, o id do 'validator' é criado automaticamente, ao informar o id do controle que deseja-se validar.-->
<validator controlId="adminList.tabulardata" type="selectedMany" />
</validators>
</onClick>
<onClick type="processAction">
<!-- Definição para novo processAction que não é padrão.-->
<processActionId>lotar</processActionId>
</onClick>
</control>
</control>
<control type="lum_adminList" id="adminList" dataId="hotelId"/>
</control>
</controls>
<processActions>
<processAction id="delete" type="tableDeleteData" sourceId="default">
<response type="doui_standardEmbedded"/>
</processAction>
<!-- O id definido anteriormente indica que este é o processAction a ser executado pelo botão customizado lotadoButton.-->
<processAction id="lotar" sourceId="default" className="corporate.hoteisadmin4.HotelProcessActionHandler">
<response type="doui_standardEmbedded"/>
</processAction>
</processActions>
</interface>
<interface id="addAdmin">
<sources>
<source id="default" readData="never"/>
<source id="cidade"/>
</sources>
<controls>
<control type="lum_form">
<control type="lum_propertyPage">
<control type="lum_controlGroup" title="Informações Básicas">
<control type="lum_table">
<tr>
<td>
<control type="lum_label" dataId="nome"/>
</td>
<td>
<control type="lum_inputText" id="nome"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="introducao"/>
</td>
<td>
<control type="lum_inputTextArea" id="introducao" rows="2"/>
</td>
</tr>
<tr>
<td colspan="2">
<control type="lum_label" dataId="descricao"/>
</td>
</tr>
<tr>
<td colspan="2">
<control type="lum_inputHtmlEditor" id="descricao"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="imagem"/>
</td>
<td>
<control type="lum_imagePicker" id="imagem"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="cidadeId"/>
</td>
<td>
<control type="lum_dropDownList" id="cidadeId" optionsSourceId="cidade" sourceId="default" style="width:386px" renderBlankOption="false"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="lotado"/>
</td>
<td>
<control type="lum_checkBox" id="lotado"/>
</td>
</tr>
</control>
</control>
</control>
</control>
</controls>
<processActions>
<processAction id="commit" type="tableAddData" sourceId="default">
<response type="doui_standardPopup" />
</processAction>
</processActions>
</interface>
<interface id="editAdmin">
<sources>
<source id="default">
<filters>
<filter id="hotelId" required="true" hidden="true" />
</filters>
</source>
<source id="cidade"/>
</sources>
<controls>
<control type="lum_form">
<control type="lum_filters" id="filters" />
<control type="lum_propertyPage">
<control type="lum_controlGroup" title="Informações Básicas">
<control type="lum_table">
<tr>
<td>
<control type="lum_label" dataId="nome"/>
</td>
<td>
<control type="lum_inputText" id="nome"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="introducao"/>
</td>
<td>
<control type="lum_inputTextArea" id="introducao" rows="2"/>
</td>
</tr>
<tr>
<td colspan="2">
<control type="lum_label" dataId="descricao"/>
</td>
</tr>
<tr>
<td colspan="2">
<control type="lum_inputHtmlEditor" id="descricao"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="imagem"/>
</td>
<td>
<control type="lum_imagePicker" id="imagem"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="cidadeId"/>
</td>
<td>
<control type="lum_dropDownList" id="cidadeId" optionsSourceId="cidade" sourceId="default" style="width:386px" renderBlankOption="false"/>
</td>
</tr>
<tr>
<td>
<control type="lum_label" dataId="lotado"/>
</td>
<td>
<control type="lum_checkBox" id="lotado"/>
</td>
</tr>
</control>
</control>
</control>
</control>
</controls>
<processActions>
<processAction id="commit" type="tableUpdateData" sourceId="default">
<response type="doui_standardPopup" />
</processAction>
</processActions>
</interface>
</interfaces>
</doui:douiDefinition>
|