|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataSourceDeclaration
Whether a DataSource is specified in XML or JS, identical requests will ultimately be
submitted to the server, so the server integration pattern is the same. However,
DataSources created in XML can be loaded and used by the Smart GWT Server,
enabling many features including synchronized client-server validation, request bundling,
file upload, and optional automatic SQL/Hibernate connectivity (see the
Server Summary
for details).
DataSources created on the client use the same style of creation as DataBound components:
isc.DataSource.create({ ID:"supplyItem", fields:[ {name:"itemName", ... } ... ] });Reference for all properties that can be set for DataSources, their fields and validators is given in the
DataSource
class reference.
XML DataSources use a direct analogue of this format:
<DataSource ID="supplyItem"> <fields> <field name="itemName" type="text" title="Item"/> <field name="SKU" type="text" title="SKU"> <validators> <validator type="integerRange" ... /> </validators> </field> </fields> </DataSource>XML DataSources are loaded via a special JSP tag supported by the Smart GWT Server:
<%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isomorphic" %> ... <SCRIPT> <isomorphic:loadDS ID="supplyItem"/> </SCRIPT>Alternatively, XML DataSources can be loaded by targeting a special servlet provided by the Smart GWT Server. This servlet yields exactly the same Javascript as the equivalent
<isomorphic:loadDS/>
, so the two methods are interchangeable. The
servlet-based method is ideal in environments where JSP tags cannot be used (SmartGWT is
one such environment). Example usage:
<SCRIPT SRC=isomorphic/DataSourceLoader?dataSource=supplyItem,employees,worldDS</SCRIPT>When loading an XML DataSource, by default, the ISC Server will look for a file named
<dataSourceId>.ds.xml
in the /shared/ds
subdirectory under
webroot. The location of this directory can be changed, or individual DataSources can be
placed in arbitrary locations. For more information, see
[webroot]/WEB-INF/classes/server.properties
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |