Thursday 26 November 2015

How to resolve unable to start atg wizard(Plug-in "atg.project" was unable to instantiate class "atg.eclipse.project.wizard.ProjectWizard".)

How to resolve:

When we are creating new atg project will get below error some times..

The selected wizard could not be started.
Plug-in "atg.project" was unable to instantiate class "atg.eclipse.project.wizard.ProjectWizard".
atg/applauncher/AppLauncherException

Step1 : In Eclipse got Window-->Preferences -->ATG Preferences

In ATG Prefeernces please select/browse the exact path of ATG Root Directory



Step 2.Select the Perspective as ATG 





Step 3: Copy the ATGUpdateSite.jar file from D:\project\ATG\ATG11.1\Eclipse\ATGUpdateSite.jar
to D:\project\Eclipse\plugins Folder

Note : Restart your eclipse if its already opened.

































Wednesday 4 November 2015

IsEmpty and IsNull in ATG

Java differences 


StringUtils.isEmpty()   : checks empty or null)

StringUtils.isEmpty("")        = true
StringUtils.isEmpty(null)      = true
StringUtils.isEmpty(" ")       = false
StringUtils.isEmpty("hoo")     = false
StringUtils.isEmpty("  omg  ") = false




StringUtils.isBlank() : checks white space,null ,empty

 StringUtils.isBlank(null)      = true
 StringUtils.isBlank("")        = true
 StringUtils.isBlank(" ")       = true
 StringUtils.isBlank("hoo")     = false
 StringUtils.isBlank("  omg  ") = false

ATG Droplets


isEmpty Droplet in Atg  :
                            Here we are checking hobbies are empty or not in MyProfile.

 <dsp:importbean bean="atg/dynamo/droplet/IsEmpty"/>
  <dsp:importbean bean="atg/dynamo/droplet/ForEach"/>
 <dsp:droplet name="IsEmpty">
   <dsp:param name="value" bean="MyProfile.hobbies"/>
   <dsp:oparam name="false">
      Your hobbies are:
        <dsp:droplet name="ForEach">
           <dsp:param name="array" bean="MyProfile.hobbies"/>
           <dsp:oparam name="output">
              <dsp:valueof param="element"/>
           </dsp:oparam>
        </dsp:droplet>
   </dsp:oparam>
   <dsp:oparam name="true">
      All work and no play makes Jack a dull boy.
   </dsp:oparam>
</dsp:droplet>


IsNull Droplet in Atg :
                                     Here we are checking email is null or not in MyProfileFormHandler,if its null
we are updating it with the user provided value.

 <dsp:importbean bean="atg/dynamo/droplet/IsNull"/>
  <dsp:droplet name="IsNull">
  <dsp:param bean="MyProfile.email" name="value"/>
  <dsp:oparam name="true">
    <dsp:form action="address_book.jsp" method="POST">
      My email address:
      <dsp:input type="text" bean="MyProfileFormHandler.email"/>
      <dsp:input type="submit" bean="MyProfileFormHandler.update value="Update"/>
    </dsp:form>
  </dsp:oparam>
</dsp:droplet>



Order pipeline chain differances

LoadOrder : 

                                      When an Order is loaded from the Order Repository, the loadOrder() method in the OrderManager calls into the PipelineManager to execute the loadOrder pipeline, which creates and loads the Order object, as well as its OrderPriceInfo and TaxPriceInfo objects.
 


RefreshOrder:

       When an Order property is accessed (for example, by callinggetCommerceItems() or getPriceInfo()), the refreshOrder pipeline is invoked, which creates and loads the rest of the contained objects in the Order.


UpdateOrder:

                
                                        Updates the order in the repository with any changes that may have been made during the execution of this chain (splitting of shipping groups, update of states, etc.).


ProcessOrder

                                        When ever you are committing the order using commitorder() that time processorder pipeline chain will call.