I couldn't understand the need for a parbase component in CQ5. From what I read on http://dev.day.com/docs/en/cq/current/wcm/default_components/designmode.html, parbase is a component that can extend from other components. But all components can extend other components by specifying sling:resourceSuperType property. So what is the need for a parbase component?
Thanks in Advance.
Solved! Go to Solution.
The primary purpose of the parbase is to provide a location for common selector based scripts that are shared by multiple components. If you look at the scripts contained in /libs/foundation/components/parbase you will see the image script (which happens to be a servlet) and the scaffolding scripts. Both of these provide common functionality that doesn't change from component to component. By having a parbase component and having most of your components inherit from it (either directly or indirectly) you would have to duplicate the image script in multiple locations. Generally all components end up inheriting from parbase, even if they have one or more components in between.
The primary purpose of the parbase is to provide a location for common selector based scripts that are shared by multiple components. If you look at the scripts contained in /libs/foundation/components/parbase you will see the image script (which happens to be a servlet) and the scaffolding scripts. Both of these provide common functionality that doesn't change from component to component. By having a parbase component and having most of your components inherit from it (either directly or indirectly) you would have to duplicate the image script in multiple locations. Generally all components end up inheriting from parbase, even if they have one or more components in between.
orotas wrote...
The primary purpose of the parbase is to provide a location for common selector based scripts that are shared by multiple components. If you look at the scripts contained in /libs/foundation/components/parbase you will see the image script (which happens to be a servlet) and the scaffolding scripts. Both of these provide common functionality that doesn't change from component to component. By having a parbase component and having most of your components inherit from it (either directly or indirectly) you would have to duplicate the image script in multiple locations. Generally all components end up inheriting from parbase, even if they have one or more components in between.
Thanks orotas for your reply. I still cant understand how it is different from sling:resourceSuperType?
Views
Replies
Total Likes
It isn't any different than the sling:resourceSuperType - if you want utilize the parbase you declare it as your component's sling:resourceSuperType. There is nothing special about the parbase - it's just component that happens to serve a special purpose in you component hierarchy. I'd say 90% of component's declare parbase to be their sling:resourceSuperType.
Views
Likes
Replies
Views
Likes
Replies