Announcement

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

    AutoDeriveSchema and i18n

    Hi, i'm looking into shortening my ds.xml files by trying out autoderiveschema. I am hoping to just have a JavaBean and no field definitions in the XML. However, i'm not sure how i can make the field titles localized? Is this possible?

    edit: Also just tried it and i get a classnotfound on DataSourceTools. Is the autoderiveschema/schemabean not available in the Pro version?

    #2
    You would need field definitions to have i18n titles, but you would be able to avoid specifying various other aspects of the field definitions (type, etc).

    The feature is available in the Pro version.

    Comment


      #3
      OK, so 2 questions:

      1. Do you mean that i would have to specify all fields, but only the title-field and the rest would automagically come from the bean?
      Code:
      <field name="idNumber">
                  <title>
                      <fmt:message key="idNumber"/>
                  </title>
              </field>
      Like this?

      2. Again, as i mentioned, i get classnotfoundexception on DataSourceTools, which seems to be an enterprise-only class. This is how i define the datasource:
      Code:
      <DataSource ID="mycooldatasource" xmlns:fmt="http://www.apache.org/internal/xmlbeans/wsdlsubst"
                  autoDeriveSchema="true" serverType="bean" schemaBean="com.ninja.beans.myNinjaTO">
      ---
      I debugged, and specifically, It's BasicDataSource that causes the ClassNotFound:
      Code:
      if (parentConfig == null) {
          Object[] params = new Object[]{soInstance.getClass().getName()};
      >>>>    parentConfig = (Map)Reflection.invokeNonVisibleStaticMethod("com.isomorphic.tools.DataSourceTools", "_getDataSourceConfigFromJavaClass", params);
      }

      Comment


        #4
        1. yes, like that. Although, since it seems likely that i18n titles might be the only thing forcing you to declare all fields, we're now considering adding some way to have titles looked up from bundles without requiring such a field definition

        2. sounds like isomorphic_tools.jar may be missing from your classpath?

        Comment


          #5
          re. last point thanks will look.

          Re point 1 sounds great, and please allow me to reiterate a suggestion i made back in 2018:

          https://forums.smartclient.com/forum...provement-idea

          Cheers

          Comment

          Working...
          X