(go back to full page)


Enterprise Data Services  
home > documentation > Users Guide > Enterprise Data Services
Save & ShareSave & Share  SubscribeSubscribe

The Enterprise Data Services (EDS) allow developers to easily connect to databases through client-side dojo.data stores. Within the EDS, there are three components that make it easy to pull data from a database and present it within a Dojo Component.

  1. Client-Side nexaweb.eds.ServiceRequest - The Service Request is a dojo.data store that will automatically fetch information from the server as a standard dojo.data.ItemFileReadStore.
  2. Server-Side Configuration - Configure the connection to the database and the SQL that will be used to interact with the database for each service request.
  3. Dojo Component - Need a Dojo Component that accepts a dojo.data store.
information Helpful Tip
You will need to create an IMB Session for the Enterprise Data Services to work properly.

Service Request Creation

 
 
<script type="text/xml" dojoType="dojoe.XmlScript">
   <declarations>				
       <nexaweb.eds.ServiceRequest 
           dataRequestId="selectWishes" 
           id="selectWishesSR" jsId="selectWishesSR"/>
 
      <nexaweb.eds.ServiceRequest 
          dataRequestId="insertWish" 
          id="insertWishSR" jsId="insertWishSR">
         <parameters>
            <parameter><![CDATA[{0}]]></parameter>
         </parameters>
     </nexaweb.eds.ServiceRequest>
  </declarations>				
</script>
 
 

nexaweb-data.xml Snippet

 
 
<dataRequestDefinition id="insertWish">
	<serviceResourceReference dataServiceId="Sql" 
		serviceResourceId="insertWish_Statement"/>
</dataRequestDefinition>
 
<dataRequestDefinition id="selectWishes">
	<serviceResourceReference dataServiceId="Sql" 
		serviceResourceId="selectWishes_Statement"/>
</dataRequestDefinition>
 
 

nexaweb-sql.xml Snippet

 
 
<connectionDefinitions>
   <connectionDefinition id="engineering" 
         driver="com.mysql.jdbc.Driver" 
         url="jdbc:mysql://server_name/engineering?user=username&password=pwd"/>
</connectionDefinitions>
 
<statementDefinitions>
   <sqlStatement connectionId="engineering" id="insertWish_Statement">
	<statement>
		INSERT INTO WISH_LIST (WISH_ITEM) values (''{0}'')			
	</statement>
   </sqlStatement>
 
   <sqlSelect connectionId="engineering" id="selectWishes_Statement">
	<table>WISH_LIST</table>
   </sqlSelect>
</statementDefinitions>
 
 

information Helpful Tip
statementDefinitions use Java's MessageFormatting to do the parameter substitution, so you will need to escape ' and {} or else it won't work properly.


There is much more information on EDS located in the Nexaweb Dev Center, click here to read more.
(go back to full page)


home | download | get started | samples
dojo.E is licensed under the Apache 2.0 License
© 2005-2008 Nexaweb Technologies Inc. All Rights Reserved.