8 Replies Latest reply on May 13, 2013 1:54 AM by jamit

    Accessing Extension properties in the Translator.

    jamit

      Hi,

      I am trying to access in a translator which acts like a delegate translator using the delegate feature in vdb.(by extending the BaseDelegatingExecutionFactory)

      In short i am intercepting the call before going to the original translator.

       

      I have  set the extension properties(say "isCurrency =true/false"on  columns of view model )

      Now I have overidden the createResultSetExecution method and trying to access those properties as properties of columns within the method with following code snippet.

       

      final Table table = ((NamedTable)TableReference).getMetadataobject

      List<Column> columns = table.getColumns();

      for each(column:columns){

           column.getProperties()

      }

       

      But I get an empty properties object.

      Is there a way to access the extended props set on the model, at the translator level?

       

      Thanks

      Amit

       

      Message was edited by: Amit Jahagirdar

        • 1. Re: Accessing Extension properties in the Translator.
          rareddy

          That looks right, how are setting the extension properties, may be that is happening?

          • 2. Re: Accessing Extension properties in the Translator.
            jamit

            Hi Ramesh,

            Here is how I am setting the extn props:

            Extension properties are added via teiid designer by creating a mxd file and registering it.(The normal way as given in the teiid documentation for MED/mxd).

            Then applying it over the view model as column level properties.

            Then a static VDB is created using the Teiid Designer.

            The runtime folder has source and view model files,and in that I verified that the properties are set with spcified default values.

             

            But seemslike they are not accessible via the metadata object in the table reference.

             

            Amit

            • 3. Re: Accessing Extension properties in the Translator.
              rareddy

              May be default values not being read, can you set a property and see if you can read?

              • 4. Re: Accessing Extension properties in the Translator.
                jamit

                Thanks Ramesh.

                I tried that as well but no luck.

                I shall elaborate on that:

                I created a "isCurrency" property with default value as false.

                then for columns(in ViewModel) like Price,UnitPrice,Discount I applied this property with value as "true" using the teiid designer itself.

                Then a vdb was created and in that within the runtime folder,the file had those properties with default values and also the values that I had set for specific columns.

                So that part of the story is correct and works as expected.

                 

                So now the issue is, I dont know how can I get this extension property in the translator layer ( as described in the above dicussion)?

                Does the current teiid implementation qualifies that the extension properties are also treated equal, and are read as part of the metadata using column.getProperties()?

                 

                Thanks

                Amit

                • 5. Re: Accessing Extension properties in the Translator.
                  rareddy

                  Please attach a sample vdb and also which version are you using?

                  • 6. Re: Accessing Extension properties in the Translator.
                    jamit

                    Hi Ramesh,

                    PFA the vdb and the delegate translator code for your perusal.

                    I have a quick question:

                    I am having extension properties set at the column level on the view model of the static vdb and not on the source model.

                    My source model visibility is set to false and view model visibility is set to true.

                    Could this be the reason that i dont get the extension properties in the runtime metadata,..

                    In the documentation its mentioned that runtime metadata is subset of the actual metadata....So actual metadata would consist extensn props but subset has only source metadata.

                    kindly correct me if I am wrong.

                     

                    Also would like to know how it works in case of Dynamic vdbs.

                     

                    Thanks

                    Amit

                     

                    Message was edited by: Amit Jahagirdar

                    • 7. Re: Accessing Extension properties in the Translator.
                      rareddy

                      It needs to be on source model, not on view model. A translator is or source model conversation.  View model metadata is strictly for use by the Teiid engine purposes.

                      • 8. Re: Accessing Extension properties in the Translator.
                        jamit

                        Thanks a lot Ramesh.