7 Replies Latest reply: Oct 7, 2011 4:48 AM by Manan Joshi RSS

    Preserving persistance implementing class id

    dvkkk Community Member

      Hi,

       

      I was suggested by Adobe to preserve the persistance implementaton class id while splitting the CS4 project into model and ui plugin for CS5 or to give conversion provider if the persitant data format ge changed. But I have doubt what to do if a class which is UI related is conataing such implementation. Since, that Boss class including the aggregated interfaces and implementations will be moved into UI pluging which will be having a new implementation id based on the new plugin prefix id of the UI plugin.

      So how we can handle this case.

       

      Thanks a lot!

        • 1. Re: Preserving persistance implementing class id
          Manan Joshi Community Member

          Could you please give an example of the actual problem that you are facing, that would allow me to answer this better.

          However if you are placing a persistent interface in a boss class that has both UI implementations and the persistent implementations then you can split the boss class definition into two. The definition in the UI plugin will have the UI implementations and the model definition will have the persistent implementation. This way you will be using the ID of the model for the persistent implementation.

           

          Manan Joshi

           

          - Efficient InDesign Solutions -

          MetaDesign Solutions

          http://metadesignsolutions.com/services/indesign-development.php

          • 2. Re: Preserving persistance implementing class id
            dvkkk Community Member

            Thanks for your time and knowledge!

             

            Class

            {

                      kMyRevisionPrefPanelDialogBoss,

                      kPrimaryResourcePanelWidgetBoss,

                      {

                                                         IID_IPANELCREATOR,               kMyRevisionPrfPanelCreatorImpl,

                                                         IID_IK2SERVICEPROVIDER,      kDialogPanelServiceImpl,

                                                         IID_IDIALOGCONTROLLER,        kMyRevisionPrefPanelControllerImpl,

                                                         IID_IOBSERVER,                        kMyRevisionPrefPanelObserverImpl,

                                                         IID_ITABLECELLDATA,               kMyRevisionTableCellDataImpl,

                      }

            },

             

            Here kMyRevisionTableCellDataImpl is persist implementation.

            I need to preserver it's Id. Since This implementation now comes in the UI part so it's implementaion gets changed here.

            • 3. Re: Preserving persistance implementing class id
              Manan Joshi Community Member

              For this scenario what you could do is split this boss class into two parts as i mentioned before. In the model you could place the following defenition

               

              Class

              {

                        kMyRevisionPrefPanelDialogBoss,

                        kPrimaryResourcePanelWidgetBoss,

                        {

               

                             IID_ITABLECELLDATA,               kMyRevisionTableCellDataImpl,

                        }

              },

               

              and the UI plugin will have the class decleration as

               

              Class

              {

                        kMyRevisionPrefPanelDialogBoss,

                        kPrimaryResourcePanelWidgetBoss,

                        {

                                                           IID_IPANELCREATOR,               kMyRevisionPrfPanelCreatorImpl,

                                                           IID_IK2SERVICEPROVIDER,      kDialogPanelServiceImpl,

                                                           IID_IDIALOGCONTROLLER,        kMyRevisionPrefPanelControllerImpl,

                                                           IID_IOBSERVER,                        kMyRevisionPrefPanelObserverImpl,

                        }

              },

               

               

              for this to work you will have to declare the ID of the UI plugin in the model plugin's id.h so that the we have the definition for the kMyRevisionPrefPanelDialogBoss, you would also need the declaration of the boss class kMyRevisionPrefPanelDialogBoss ID in the model plugin. Once this is done you can give the kMyRevisionTableCellDataImpl class your implementation with the model plugin ID. I think this should work fine. Let me know when your findings.

               

              Infact on second thoughts you could declare the boss class in the model plugin itself and include the model's ID.h in the UI plugin. The class definition in this case will also remain as i have exmplefied above. This should simplify the process.

               

              Anyhow i have a query what specifically are you trying to achieve using a persistent implementation in a UI boss class.

               

              Manan Joshi

               

              - Efficient InDesign Solutions -

              MetaDesign Solutions

              http://metadesignsolutions.com/services/indesign-development.php

              • 4. Re: Preserving persistance implementing class id
                dvkkk Community Member

                Thank you agin for your time...!!

                 

                 

                Will this work??

                 

                Addin

                {

                          kMyRevisionPrefPanelDialogBoss,

                          kInvalidClass,

                          {

                 

                               IID_ITABLECELLDATA,               kMyRevisionTableCellDataImpl,

                          }

                },

                 

                 

                Class

                {

                          kMyRevisionPrefPanelDialogBoss,

                          kPrimaryResourcePanelWidgetBoss,

                          {

                                                             IID_IPANELCREATOR,               kMyRevisionPrfPanelCreatorImpl,

                                                             IID_IK2SERVICEPROVIDER,      kDialogPanelServiceImpl,

                                                             IID_IDIALOGCONTROLLER,        kMyRevisionPrefPanelControllerImpl,

                                                             IID_IOBSERVER,                        kMyRevisionPrefPanelObserverImpl,

                          }

                },

                • 5. Re: Preserving persistance implementing class id
                  Manan Joshi Community Member

                  Yes this should work, sorry i erroroneously wrote Class in place of an AddIn. Try this out this will work.

                   

                  Manan

                  • 6. Re: Preserving persistance implementing class id
                    dvkkk Community Member

                    Thank Manan!!

                    • 7. Re: Preserving persistance implementing class id
                      Manan Joshi Community Member

                      My pleasure.

                       

                      Manan Joshi

                       

                      - Efficient InDesign Solutions -

                      MetaDesign Solutions

                      http://metadesignsolutions.com/services/indesign-development.php