내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

What is the use of Parbase component?

Avatar

Level 2

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. 

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 8

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. 

원본 게시물의 솔루션 보기

3 답변 개

Avatar

정확한 답변 작성자:
Level 8

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. 

Avatar

Level 2

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?

Avatar

Level 8

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.