The idea is to solve the problem when the Chinese title found. And thought, I will not do it myself
A DataSource definition. SmartGWT Lane, DataSource is the core of its metadata.
Here, DataSource actually two,
One is the client com.smartgwt.client.data.DataSource, this part is open source, you can freely create their own.
The other is server-side com.isomorphic.datasource.DataSource, this is inside the SmartGwtEE
Content, non-open source, but only in the Server-side use, not clients.
And I want to do dynamic DataSource, refers to the client to define a DataSource, where java classes can be used to describe the
Various Field, including the type or something. While in the service side, according to the client-defined DataSource automatically generate a service-side
DataSource, so can the need for a flexible definition, and all definitions are carried out through the java code, but also the
To compile-time checking, you can also bypass the issue of Chinese garbage.
Of course, now the Chinese garbage issue is resolved, this requirement becomes less urgent. The idea of recording what the future when the need arises again
To use this idea to achieve dynamic DataSource.
1. Server.properties inside the definition of the default datasource repo:
2. MyDSRepo inherited from FileSystemDSRepo, this is actually SmartGWT default DSRepo
3. In the public DataSource loadDS (String dsName) methods among the judging is not dynamic DataSource,
If so, then according to the client DataSource Class whether there is change, to decide whether to generate a new ds.xml file,
And then to the super to load.
How to determine whether the client DataSource Class has changed, is a problem. Of course, may not generate ds.xml file, but this
DSRepo will not be able to use the cache mechanism. The specific implementation, such as when required to say, at present did not come across such a demand, but have to say,
SmartGwtEE or for the expansion has left a variety of mechanisms.