6 Replies Latest reply: Oct 1, 2012 12:27 AM by RMishra RSS

    a query in RepositoryFormHandler

      Why is the requireIdOnCreate parameter in RepositoryFormHandler throwing error if set to true?
      Even when a unique ID is specified it throws error.

      Reference from ATG Page Developers Guide:
      A boolean, specifies whether an item ID must be user-supplied when an item is created. If set to true (the
      default), an error is thrown when the form is submitted and no ID exists for the new item. If set to false,
      the repository or database automatically generates the item ID.
        • 1. Re: a query in RepositoryFormHandler
          Nitin Khare
          You will encounter error if you are not passing repositoryId to RepositoryFormHandler when requireIdOnCreate is set to true. By default requireIdOnCreate is true and so RepositoryFormHandler expects that you would be passing in a unique repositoryId to it along with other data while submitting your form. It will assign the passed repositoryId to the new item that it is going to create. Make sure that you pass the repositoryId parameter from your form to your RepositoryFormHandler component something like:

          <dsp:input type="hidden" bean="atg/dynamo/droplet/RepositoryFormHandler.repositoryId" value="UNIQUE_ID_VALUE"/>

          You can make requireIdOnCreate as false if you want auto-generated id to be used when new repository item gets created.
          • 2. Re: a query in RepositoryFormHandler
            Thank u Nitin for the timely help.
            • 3. Re: a query in RepositoryFormHandler
              Hi Nitin ,
              Can you tell me when will we use RepositoryFormHandler and When ProfileFormHandler or B2CProfileFormHandler?
              • 4. Re: a query in RepositoryFormHandler
                Nitin Khare
                RepositoryFormHandler - It is like a RepositoryItem CRUD handler which provides operations for creating new repository items, updating existing items, and deleting items from the repository. You may use it when your form is directly dealing with a RepositoryItem.

                ProfileFormHandler - It provides convenient methods for operating on the user's profile. It can be used to add new profiles, edit the current profile, login and logout.

                B2CProfileFormHandler - It is a subclass of ProfileFromHandler and adds some commerce specific operations. The commerce specific additional functionality it provides:
                1. During login, the active promotions from the anonymous user copied into the list of active promotions of the persistent user.
                2. After the login, the session-scope PricingModelHolder is reinitialized to cache all the promotions for that user.
                3. During the user registration and login, any shopping cart created while user was anonymous is changed to be persistent.
                4. When user logs in any old shopping cart (Order in INCOMPLETE state) can be loaded into the user's session.
                5. Checks whether the user has requested that his billing address be used as the shipping address. If so then copy the billing address field values into the shipping address.
                • 5. Re: a query in RepositoryFormHandler
                  Hi Nitin,

                  can you please differentiate

                  B2CProfileFormHandler and CommerceProfileFormHandler
                  • 6. Re: a query in RepositoryFormHandler
                    CommerceProfileFormHandler : Have some important methods like postLoginUser (after shopping when anonymous user login then after login it will merge all cart items to user's current order).
                    And also have some other methods that used in B2CProfileFormHandler like setters/getters for OrderManager, PromotionTools, ShoppingCart etc.
                    B2CProfileFormHandler :used to manage commerce uesr profile by methods like handleNewAddress, handleEditAddress, handleUpdateAddress, handleUpdateAddressAndMakeDefault, handleChangeAddressNickname, handleRemoveAddress, handleSelectDefaultAddress, handleSetExpressCheckout, handleCreateNewCreditCard, handleRemoveCard ect.