2 Replies Latest reply on Jan 7, 2011 3:15 AM by pin7

    ParsleyModuleDescriptor setup




      Is there a way to set ParsleyModuleDescriptor url property dynamically? (I mean, not in context)



        • 1. Re: ParsleyModuleDescriptor setup
          yderidde Level 1



          Basically I never had a use case yet where I needed to actually update the url of a module descriptor dynamically outside of my context as I mostly use the context as an application configuration.

          However I do sometimes use in my context a binding expression for the url property for example to build a URL dynamically etc ... But from what I understand you want to change the URL dynamically from outside the context after it has been created, right ?


          Unfortunately the url property of the ParsleyModuleManager is private and therefore you will not be able to change it after injecting it from the context to your class. One solution would be to bypass the definition of the Module Descriptor in the context and create a new instance of ParsleyModuleManager in your class but this is kind of hacky and i'm not sure about how things are going to behave.


          I'm wondering why you need to dynamically change the url of a module outside of the context ? I would like to understand your usecase. If we find it is a valid use-case that we did not think about, I will create an enhancement request to add this feature into the lib




          • 2. Re: ParsleyModuleDescriptor setup
            pin7 Level 1



            For example, I have an app on a number of social networks, modules reside on servers different for each network. After configuration, app sends to my main server network id, so server returns from which url to load modules. Another usecase maybe if app has a large traffic, server may go down, so in this case I'd like to switch url property of descriptor to another domain.


            In a few words, there might be another usecases where switching or setting url property outside of context may be very useful. Hope this feature would be included in future releases.