Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DataSource and multiple "custom" non-CRUD operations

    Hi there,
    I defined a ds.xml like this:
    Code:
    <DataSource ID="dpDistribution" schemaBean="it.onetech.dtproviding.server.entity.Distribution">
    	<serverObject lookupStyle="spring" bean="distributionDao" />
    	<operationBindings>
    		<binding operationType="custom" serverMethod="dropDocument">
    			<serverObject lookupStyle="spring" bean="distributionDao" />
    		</binding>
    		<binding operationType="custom" serverMethod="updateDistribution">
    			<serverObject lookupStyle="spring" bean="distributionDao" />
    		</binding>
    	</operationBindings>
    </DataSource>
    My application invoke "updateDistribution" associated method without problems, but doesn't the same for "dropDocument". If modify the xml maintaing only one binding (doesn't care which of two, I've tried both), all works correctly.

    There is a way to define multiple "custom" (identified as operationType="custom") operations into same DataSource?
    I miss something?

    Thanks,

    Luca.

    Edit: (basically, the last "operationType=custom" bind overwrite all previusly setted)
    Last edited by l.arcangeli; 7 Jun 2013, 05:21.

    #2
    Solved:

    I miss "operationId" attribute into .dx.xml mapping file:

    Code:
    <DataSource ID="dpDistribution" schemaBean="it.onetech.dtproviding.server.entity.Distribution">
    	<serverObject lookupStyle="spring" bean="distributionDao" />
    	<operationBindings>
    		<binding operationType="custom" operationId="dropDocument" serverMethod="dropDocument">
    			<serverObject lookupStyle="spring" bean="distributionDao" />
    		</binding>
    		<binding operationType="custom" operationId="updateDistribution" serverMethod="updateDistribution">
    			<serverObject lookupStyle="spring" bean="distributionDao" />
    		</binding>
    	</operationBindings>
    </DataSource>
    Now both operations are working with no exceptions.

    Luca.

    Comment

    Working...
    X