2
0
Fork 0
imxmi/tests/resources/vasc/tables.xml
2008-09-13 17:04:49 +02:00

237 lines
6.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xtes xmlns="http://xtes.idcanet.com/eld/xtes-lang.eld"
xmlns:x4o="http://x4o.idcanet.com/eld/x4o-lang.eld"
>
<!--
- View
- States
- Tables
- Columns
Master
- Details
-->
<x4o:bean el.id="dataSource" bean.class="com.id.."/>
<x4o:bean el.id="tableController" bean.class="com.id.."/>
<v:vascView name="test1">
<v:vascTableController>
</v:vascTableController>
<v:vascBackendController>
<v:vascJDBCQueryController>
<x4o:property name="list">select id,name,blog_status_id,description,slug from blog_post</x4o:property>
<x4o:property name="update">update (id,name,blog_status_id,description,slug) values(?,?,?,?,?) from blog_post where id=?</x4o:property>
<x4o:property name="create">instert into (id,name,blog_status_id,description,slug) values(?,?,?,?,?) from blog_post where id=?</x4o:property>
<x4o:property name="delete">delete from blog_post where id=?</x4o:property>
</v:vascJDBCQueryController>
</v:vascBackendController>
<v:vascField name="">
<v:vascFieldOptions/>
<v:vascFieldChoises/>
</v:vascField>
<v:vascField name="">
<v:vascUserRoles list="admin"/>
</v:vascField>
</v:vascView>
<x4o:template el.id="ldapServerTemplate">
<v:ldapConnection name="main">
<x4o:property name="connectionUrl" value="ldaps://ldap.office.mbuyu.nl"/>
</v:ldapConnection>
</x4o:template>
<v:ldapConnection el.id="sudoers" x4o.templates="ldapServerTemplate">
<x4o:property name="user" value="uid=admin-sudo,ou=services,dc=m4n,dc=nl"/>
<x4o:property name="pass" value="adminSudo"/>
<x4o:property name="baseDn" value="ou=sudoers,dc=m4n,dc=nl"/>
</v:ldapConnection>
<x4o:template el.id="sudoTemplate">
<v:field name="user" backendName="cn" readOnly="true"/>
<v:field name="description" backendName="description"/>
<v:field name="sudoCommand" fieldEditor="listField"/>
<v:field name="sudoHost" fieldEditor="listField"/>
<v:field name="sudoUser" fieldEditor="listField"/>
</x4o:template>
<x4o:template el.id="sambaUserSchema">
<v:field name="sambaSID" fieldEditor="textField" edit="false" list="false" view="false" create="false" defaultValue="S-1-5-21-1200182392-965607725-1867741125-514"/>
<v:field name="sambaGroupType" v.defaultValue="2"/>
</x4o:template>
<v:viewController name="ldapUsers" primaryKey="user">
<x4o:templateTag template="${posixUserSchema}"/>
<x4o:templateTag template="${sambaUserSchema}">
<!-- template overrideing -->
<v:field name="sambaGroupType" v.defaultValue="3"/>
</x4o:templateTag>
<!-- redifine overrideing -->
<v:field name="sambaGroupType" v.defaultValue="4"/>
</v:viewController>
<vasc:fieldType name="EmailField2">
<vasc:fieldHint key="validate" default="true"/>
<vasc:fieldHint key="timeout" default="200"/>
</vasc:fieldType>
<vasc:fieldType name="listField">
<vasc:fieldHint key="validate" default="true"/>
<vasc:fieldHint key="timeout" default="200"/>
</vasc:fieldType>
<v:viewController name="sudoers" primaryKey="user">
<v:field name="user" backendName="cn" readOnly="true"/>
<v:field name="description" backendName="description">
<v:roles edit="admin" list="all"/>
</v:field>
<v:field name="sudoCommand" fieldType="listField"/>
<v:field name="sudoHost" fieldType="listField"/>
<v:field name="sudoUser" fieldType="listField">
<v:fieldType>
<vasc:fieldHint key="timeout" default="200"/>
</v:fieldType>
</v:field>
<v:field name="sambaSID" fieldEditor="textField" edit="false" list="false" view="false" create="false" defaultValue="S-1-5-21-1200182392-965607725-1867741125-514"/>
<v:field name="sambaGroupType" v.defaultValue="2"/>
<v:field name="gidNumber" v.defaultValue="nextUidNumber();"/>
<v:field name="objectclass" v.defaultValue="{posixGroup,sambaGroupMapping,top}"/>
<v:fieldSet name="extraOptions" optional="true">
<v:field name="sudoHost" defaultValue="localhost"/>
</v:fieldSet>
<v:ldapNextIdFunction name="nextUidNumber" ldapFilter="(&(objectClass=posixGroup))" ldapAttribute="gidnumber"/>
<v:listeners hook="post_create">
<etc:loginToFtpServer/>
</v:listeners>
<v:link fieldName="user" viewController="ldapUsers" parameterName="user_cn"/>
<v:link fieldName="gidNumber" viewController="ldapGroups" parameterName="group_key,${baseDn}"/>
<v:detail fieldName="gidNumber" detailController="${ldapGroups}"/>
<!-- default are oke here
<v:createView allField="true"/>
<v:editView allField="true" inverse="true">
<v:fieldName name="description"/>
</v:editView>
-->
<v:ldapBackend ldapConnection="${sudoers}">
<x4o:property name="list_filter">(&(objectClass=sudoRole))</x4o:property>
<x4o:property name="delete">${baseDn},cn=%s</x4o:property>
<x4o:property name="new_classes">sudoRole,top</x4o:property>
</v:ldapBackend>
</v:viewController>
<jsf-vasc:viewManager controller="${sudoers}">
</jsf-vasc:viewManager>
<table
name = "myTable1"
vascDataSource = "${dataSource}"
vascRecordBeanCreatorClass="com.id.models.User"
vascTextValue="${vascI18nController}"
vascTableController = "${tableController}"
UIIdentifierVascTableColomn = "${idColumn}"
>
<actions:addRowAction/>
<actions:DeleteRowAction/>
<actions:editRowAction/>
<action:csvExportAction/>
<action:xmlExportAction/>
<action:refreshDataAction/>
<option:comboBoxOption />
<colum el.id="idColumn"
name="test"
toolTip="test"
defaultValue="true"
width="30"
helpId="test"
image="ergens"
editDisplay="true"
editReadonly="false"
listDisplay="true"
>
<bind:beanColumnValue />
<ui:vascToggle />
</colum>
</table>
<view>
</view>
<!--
<xslt>
# Convert from xml -> csv and html or xitext
</xslt>
-->
<query name="limit">
<sql>
LIMIT <parameter name="limit"/>
</sql>
<parameterValue name="limit" value="10" defaultValue="200" type="parameter"/>
</query>
<query name="paging" type="hql">
<sql>
OFFSET <parameter name="offset"/>
<include name="limit"/>
</sql>
<parameterValue name="offset" value="0" defaultValue="0" type="parameter"/>
</query>
<query name="baseSelect">
<x4o:property name="executionTimeout" value="200"/>
<x4o:property name="cacheTimeout" value="99"/>
<x4o:property name="jdniConnection" value="somewhere"/>
<sql>
SELECT
USERS.USERNAME AS USERNAME
USERS.PASSWD AS PASSWORD
FROM
USERS
</sql>
<comment>Bla bla</comment>
<comment>Also see this site http://www.google.com</comment>
</query>
<query name="testUsers2" type="hql">
<x4o:property name="persistanceSession" value="sessionName"/>
<sql>
<!-- SOME COMMENT -->
<include name="baseSelect"/>
<parameter name="extra_where"/>
AND role is in <parameter name="roles"/>
<include name="paging"/>
</sql>
<parameterValue name="extra_where" defaultValue="WHERE true=true" type="raw"/>
<parameterValue name="roles" value="1,12,99,200" type="parameterList"/>
<parameterValue name="limit" value="15"/>
<parameterValue name="offset" value="25"/>
</query>
</xtes>