13 Replies Latest reply on Feb 13, 2013 5:16 PM by Barry LaFond

    View model level custom extnsion property doesn't show up on view model

    H B Newbie

      Hi,

       

      We created a simple MXD (test.mdx) to have a custom property on view model level using Teiid designer 8.0 final. We registered the test.mdx and applied it to the view.  But  this custom extension property doesn't show up on property panel at  all. Is there anything wrong?

       

       

      Following is created mdx file:

       

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>

      <modelExtension xmlns:p="http://www.jboss.org/teiiddesigner/ext/2012" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" metamodelUri="http://www.metamatrix.com/metamodels/Relational" namespacePrefix="ds" namespaceUri="com.lgc" version="1" xsi:schemaLocation="http://www.jboss.org/teiiddesigner/ext/2012 http://www.jboss.org/teiiddesigner/ext/2012/modelExtension.xsd" xmlns="http://www.jboss.org/teiiddesigner/ext/2012">

          <p:modelType>VIRTUAL</p:modelType>

          <p:extendedMetaclass name="org.teiid.designer.metamodels.relational.impl.ViewImpl">

              <p:property advanced="false" index="true" masked="false" name="lgcName" required="true" type="string"/>

          </p:extendedMetaclass>

      </modelExtension>

       

      I have attached screen shot for the reference.

       

      mdx.jpg

        • 1. Re: View model level custom extnsion property doesn't show up on view model
          Ramesh Reddy Master

          1) Right click on your model, select "Manage Model Extension Definitions"

          2) Then add the your mxd file to list of extensions.

           

          Once you do that they will show up on your table or column whatever.

           

          Ramesh..

          • 2. Re: View model level custom extnsion property doesn't show up on view model
            H B Newbie

            Did just like you said.

             

            The problem seems that  if extended property is on model view level (extendedMetaclass name="org.teiid.designer.metamodels.relational.impl.ViewImpl), it will not show up on my view at all.

             

            • 3. Re: View model level custom extnsion property doesn't show up on view model
              Ramesh Reddy Master

              Haifen,

               

              Looks like you are right. So, you can open a JIRA for Teiid Designer for this. Also, there is no really any difference between "BaseTable" and "View" in a view model. So I suggest create the extension property on the "BaseTable" and that seems to work.

               

              Ramesh..

              • 4. Re: View model level custom extnsion property doesn't show up on view model
                Dan Florian Newbie

                Hello Haifen,

                 

                In the screen shot you provided it looks like the model itself, the GISWellProdView.xmi file, is selected. Since extension properties pertain to model objects and not model themselves, your added property should not show here. So in order for you to see your extension property, you must first create a View object in your model and select it in the diagram. Give that a try and see if that works. And as Ramesh said, go ahead and change the extended class to BaseTable.

                 

                Hope that helps,

                 

                Dan

                • 5. Re: View model level custom extnsion property doesn't show up on view model
                  Ramesh Reddy Master

                  Dan,

                   

                  When I tried what you are suggesting it did not work when I created a extension property for "View" and applied on View Table. The same worked fine when I created the extension property on the "BaseTable".

                   

                  Thanks

                   

                  Ramesh..

                  • 6. Re: View model level custom extnsion property doesn't show up on view model
                    Dan Florian Newbie

                    Hi Ramesh,

                     

                    Just tried it and it works for me.

                     

                    Here is what I did:

                     

                    1. Created a new Model Extension Definition (*.mxd) using the MED editor. (File -> New -> Teiid Model Extension Defn)

                    2. Added "View" to the MED as an "Extended Model Object"

                    3. Added an extension property to the view. (make sure you assign an ID)

                    4. Saved the MED editor.

                    5. Added this new MED to the MED registry. (use the toolbar button at the top of the editor)

                    6. Created a new View model. (File -> New -> Teiid Metadata Model) ** make sure a View Model

                    7. Selected model *.xmi file in Model Explorer -> Modeling -> Manage Model Extension Definitions

                    8. Added the new MED I created to the model.

                    9. In the Model Editor, selected the view object in the model diagram.

                    10. Noticed the new extension property is showing in the Properties View.

                     

                    Did your steps differ from these? I'll be glad to test your scenario.

                     

                    If Designer should not have View as an object that can have extension properties go ahead and create JIRA for that.

                     

                    Thanks,

                     

                    Dan

                    • 7. Re: View model level custom extnsion property doesn't show up on view model
                      Ramesh Reddy Master

                      same as above, except my view was already created before the MED

                      • 8. Re: View model level custom extnsion property doesn't show up on view model
                        Dan Florian Newbie

                        Ramesh,

                         

                        I tried it this way (which I hope is the same way you tried):

                         

                        I first created the View model with a View model object. Then I created the MED and added it to the registry. Lastly I applied the MED to the model. When I select the View model object in the Model Editor's diagram, the extension property shows fine in the Properties View. I guess I will need more detailed steps from you in how I can reproduce. Either post steps here and I will verify and write issue, or you can just write up the issue yourself. Not sure what is going on Ramesh. Btw, I'm using latest code base (master branch). If you are using something else let me know.

                         

                        Hopefully Haifen will have better luck than you:-)

                         

                        Thanks,

                         

                        Dan

                        • 9. Re: View model level custom extnsion property doesn't show up on view model
                          H B Newbie

                          Dan,

                           

                          I just went through same steps as you did. I didn't see any extended property on view model level.  I am using Teiid Designer 8.0 final.

                          • 10. Re: View model level custom extnsion property doesn't show up on view model
                            Dan Florian Newbie

                            Haifen,

                             

                            I started a new Eclipse 4.2.1 workspace and installed the JBossAS Tools feature. I then installed the Designer 8.0.0.Final zip that I had downloaded. After restarting I ran through the above scenario and everything works fine. In the attached screen shot notice (1) the "elvis:extProp" extension property displayed in the Properties View, (2) the View "MyView" is selected in the "View Model" Model Editor, and (3) the "elvis" namespace is registered in the "Model Extension Registry" View.

                             

                            Let me know if I need to do something else to reproduce what you are seeing. If things don't work out for you please create an issue and detail as much about your Designer installation, platform, and the steps you took. Please attach either (1) your model project or (2) your model XMI file along with the MXD file.

                             

                            Hopefully we will figure this out soon for you.

                             

                            Regards,

                             

                            Dan

                             

                            MedExample.png

                            • 11. Re: View model level custom extnsion property doesn't show up on view model
                              Barry LaFond Master

                              I just tried this with my 8.0 installed kit and it works just fine.

                               

                              I think there may be confusion here around "View" model and a "view" in a View model.  It's unfortunate that we still carry around the the ability to create a "View" AND a "Table" in a virtual model because from a Teiid standpoint, they are they same.  In 8.1, we're removing the ability to create a "view" in a view model.

                               

                              So it looks like you created an extension property for a "org.teiid.designer.metamodels.relational.impl.ViewImpl" object but are expecting the properties to be applied to your WELL_PROD Base Table, which is a different object type.

                               

                              Change your MXD to apply to the "Base Table" type instead of "View" and it should work like it should.

                               

                              Barry

                              • 12. Re: View model level custom extnsion property doesn't show up on view model
                                H B Newbie

                                Barry,

                                 

                                Thanks for explaining.

                                 

                                Actually we are looking for extending "View Model" level properties, not "base table" or "view object", since extended properties will apply to model and not just individual objects/tables.

                                 

                                From VDB point , we need add additional properties  such as:

                                <property name="lgc.isLgcDataSourceModel" value="true"/>

                                 

                                <property name="lgcDataModel"  value="GIS"/>

                                 

                                into virtual model in vdb.xml,    so it will be something like:

                                 

                                <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

                                <vdb version="1" name="GisWellProduct">

                                     ...

                                     ...

                                </model>

                                 

                                <model visible="true" type="VIRTUAL" name="GisWellProdView" path="/GISData/views/GisWellProdView.xmi">

                                 

                                <property name="isLgcDataSourceModel" value="true"/>

                                 

                                <property name="lgcDataModel"  value="GIS"/>

                                <property value="3612860219" name="checksum"/>

                                <property value="Relational" name="modelClass"/>

                                <property value="false" name="builtIn"/>

                                <property value="2564931039.INDEX" name="indexName"/>

                                <property value="/GISData/sources/GisWellProd.xmi" name="imports"/>

                                </model>

                                </vdb>

                                 

                                Is there any way to use mdx so manually edit will not be needed?

                                • 13. Re: View model level custom extnsion property doesn't show up on view model
                                  Barry LaFond Master

                                  We have a future JIRA to allow adding generic properties to a VDB, but that would be cumbersome.

                                   

                                  Looks like you need to add extension properties to a model AND ability to inject those properties into generated vdb.xml for that model.

                                   

                                  Unfortunately, our Model Extension Definition framework only allows managing extension properties to objects inside a model, not the model itself.

                                   

                                  Please log a JIRA (https://issues.jboss.org/browse/TEIIDDES) including the above requirements.

                                   

                                  Thx

                                   

                                  Barry