5 Replies Latest reply: Oct 9, 2012 9:47 AM by Nooruddin Shaik RSS



      can any one resolve my problem
      i have doubt in registration page while submiting the form that is ProfileFormHandler.value.firstName
      how frame work will do this one here value is type of Dictonary so how it will create corresponding key and value pairs
        • 1. Re: ProfileFormHandler
          Nooruddin Shaik
          When you say ProfileFormHandler.value.firstName, ProfileFormHandler calls userRepositoryItem.setPropertyValue(<dictionary-key>,<dictionary-value>) for all the keys in the dictionary.

          • 2. Re: ProfileFormHandler
            can u tell me program point of view with necessary code
            i didnt get where it will perform in code mean ProfileFormHandler class can u explanation with example
            • 3. Re: ProfileFormHandler
              Nitin Khare
              ATG provides a functionality called DynamicBeans where a Java object can expose properties which are determined at run-time. So if an object X is a Dynamic Bean then you can access a property like X.myProperty even if there is no getMyProperty() present in the class of object X. There are certain classes and interfaces which ATG automatically registers as DynamicBeans including: java.lang.Object, java.util.Map, atg.repository.RepositoryItem, atg.userprofiling.Profile etc. So that is why you can use some thing like <dsp:valueof bean="Profile.firstName"/> without any problem even if firstName is present as a property in the Profile object.

              Now you can register other objects as Dynamic Bean also. To make any object as a Dynamic Bean you need to register that class with an implementation of DynamicPropertyMapper interface by calling DynamicBeans.registerPropertyMapper() within a static block so that it can execute as soon as class is loaded. E.g.
              static {
                  DynamicBeans.registerPropertyMapper(ProfileFormHashtable.class, new ProfileFormHashtablePropertyMapper());
              This is the code snippet which is actually present in ProfileForm. It registers ProfileFormHashtable class as a Dynamic Bean with the ProfileFormHashtablePropertyMapper class instance to be used as DynamicPropertyMapper for doing get/set on properties that are actually not declared as bean properties of ProfileFormHashtable object.

              The "value" dictionary used in ProfileFormHandler (extends ProfileForm) is actually nothing but instance of ProfileFormHashtable object and being a dynamic bean it allows you to use ProfileFormHandler.value.firstName where firstName is the name of dynamic property used as the key for ProfileFormHandler. ProfileFormHashtablePropertyMapper implementation handles getPropertyValue() and setPropertyValue() calls to actually do the operations on underlying profile RepositoryItem using key as property name and value as the property value.
              • 4. Re: ProfileFormHandler
                can u tel me i which class this is performed
                • 5. Re: ProfileFormHandler
                  Nooruddin Shaik
                  ProfileForm.updateProfileAttributes() loops over the dictionary and sets the properties in user repositoryItem.