







































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The Liferay Developer Certification Ultimate Exam provides in-depth preparation for developers working with the Liferay digital experience platform. Topics include portal development, OSGi modules, service builder, themes, workflows, APIs, permissions, content management, and application deployment. This exam preparation guide supports software developers seeking certification and expertise in enterprise portal solutions using Liferay technologies.
Typology: Exams
1 / 47
This page cannot be seen from the preview
Don't miss anything!








































Question 1. Which Blade CLI command creates a new Liferay module project of type “mvc-portlet”? A) blade create -t mvc-portlet my-portlet B) blade init -p mvc-portlet my-portlet C) blade generate mvc-portlet my-portlet D) blade new -type mvc-portlet my-portlet Answer: A Explanation: blade create -t mvc-portlet generates a skeleton MVC portlet module using the specified template. Question 2. In a Liferay workspace, which directory typically contains the “bnd.bnd” file for an OSGi module? A) modules//src/main/resources B) modules//src/main/bnd C) modules//src/main/java D) modules//bnd.bnd Answer: D Explanation: The “bnd.bnd” manifest file resides at the root of the module directory (e.g., modules/my-module/bnd.bnd). Question 3. Which OSGi bundle lifecycle state indicates that the bundle’s Activator has been executed and the bundle is ready to provide services? A) Installed B) Resolved C) Starting D) Active Answer: D Explanation: The Active state means the bundle has started successfully, its Activator (if any) has run, and it can register or consume OSGi services. Question 4. What annotation is used to inject a reference to another OSGi service in a Declarative Services component?
A) @Inject B) @Reference C) @Autowired D) @ServiceReference Answer: B Explanation: @Reference tells DS to bind a service implementation to the annotated field or method. Question 5. In a Service Builder entity, which attribute defines a many-to-many relationship? A) type="many-to-one" B) type="one-to-many" C) type="many-to-many" D) type="one-to-one" Answer: C Explanation: type="many-to-many" in entity definition creates a junction table and appropriate finder methods. Question 6. Which Service Builder generated class contains permission-checked remote methods? A) LocalServiceImpl B) LocalServiceUtil C) ServiceImpl D) ServiceUtil Answer: C Explanation: The *ServiceImpl class implements the remote service interface and includes permission checks automatically. Question 7. When overriding a Service Builder method, which annotation should you add to keep the method exposed as a remote service? A) @Override B) @Component
Answer: C Explanation: The Resource phase is intended for serving binary resources and AJAX-style responses. Question 11. Which method in a Portlet class is called when a public render parameter changes? A) doView B) processAction C) render D) doDispatch Answer: C Explanation: The render method is invoked after the public render parameter is updated, allowing the view to reflect the new value. Question 12. What is the purpose of client-extension.yaml in a Liferay client extension? A) Define OSGi service dependencies B) Configure the extension’s type, context, and module paths C) List Maven dependencies for the extension D) Set up database tables for the extension Answer: B Explanation: client-extension.yaml describes the client extension (type, name, scope, entry points) and where its assets are located. Question 13. Which of the following is NOT a valid Liferay client-extension type? A) custom-element B) theme-css C) theme-js D) service-wrapper Answer: D Explanation: service-wrapper is an OSGi server-side concept, not a client-extension type.
Question 14. When consuming Liferay’s headless REST API, which OAuth2 grant type is recommended for server-to-server communication? A) Authorization Code B) Implicit C) Client Credentials D) Resource Owner Password Credentials Answer: C Explanation: The Client Credentials grant allows a backend service to obtain an access token without user interaction. Question 15. Which Liferay object type allows creation of a data model without writing Java code? A) Service Builder Entity B) Liferay Object (formerly “Object Definition”) C) Custom Entity D) OSGi Service Component Answer: B Explanation: Liferay Objects enable declarative definition of entities, fields, and relationships via the UI, bypassing Service Builder. Question 16. In an OSGi fragment, which header in bnd.bnd specifies the host bundle to extend? A) Fragment-Host B) Host-Bundle C) Extend-Host D) Bundle-Host Answer: A Explanation: Fragment-Host: tells the OSGi framework which bundle the fragment will attach to.
A) hasPermission B) isPermissionGranted C) hasAccessPermission D) hasResourcePermission Answer: A Explanation: permissionChecker.hasPermission(companyId, resourceName, primKey, actionId) returns true if the user can perform the action. Question 21. When defining a custom resource permission, which XML file registers the permission logic? A) portlet.xml B) resource-actions/default.xml C) liferay-service.xml D) service.xml Answer: B Explanation: resource-actions/default.xml (or a role-specific file) declares actions and default permissions for a resource. Question 22. Which Gradle plugin is required to build Liferay OSGi modules? A) com.liferay.portal.tools.bundle B) com.liferay.gradle.plugins.osgi C) com.liferay.gradle.plugins.workspace D) com.liferay.gradle.plugins.bnd Answer: C Explanation: com.liferay.gradle.plugins.workspace provides tasks for building Liferay modules and managing the workspace. Question 23. In Gulp, which task is commonly used to compile SCSS files for a Liferay theme? A) gulp compile-scss B) gulp sass
C) gulp theme-scss D) gulp liferay-sass Answer: B Explanation: The gulp sass task (often defined in the theme’s gulpfile) processes SCSS into CSS. Question 24. Which method of DynamicQuery adds a “LIKE” constraint on a string column? A) addLike B) like C) add(RestrictionsFactoryUtil.like) D) add(RestrictionsFactoryUtil.ilike) Answer: C Explanation: dynamicQuery.add(RestrictionsFactoryUtil.like("columnName", pattern)) creates a LIKE predicate. Question 25. What is the default scope of a Liferay Object when created via the UI? A) Global (system) B) Site (group) C) Organization D) Personal Answer: B Explanation: By default, Liferay Objects are scoped to a site (group), making them available to pages within that site. Question 26. Which lifecycle method of a Declarative Services component is invoked after all required references are bound? A) @Activate B) @Modified C) @Deactivate D) @Reference
Explanation: content/Language.properties within a module holds key-value pairs for localization. Question 30. Which method of ThemeDisplay returns the current site’s groupId? A) getSiteGroupId() B) getScopeGroupId() C) getGroupId() D) getCurrentGroupId() Answer: B Explanation: themeDisplay.getScopeGroupId() returns the group (site) ID that the current request is scoped to. Question 31. When using @Component(service = Foo.class), what does the service attribute specify? A) The OSGi bundle that provides the component B) The list of interfaces the component will be registered under C) The lifecycle of the component D) The component’s configuration PID Answer: B Explanation: service = Foo.class tells DS to register the component as an OSGi service under the Foo interface. Question 32. Which Liferay tag renders a list of assets according to an ADT (Application Display Template)? A) B) C) D) Answer: D Explanation: `` can be configured to use an ADT for rendering assets.
Question 33. In a Service Builder finder, which return type is used to retrieve a paginated list of entities? A) List B) List[] C) List\ with start and end parameters D) Entity[] Answer: C Explanation: Finder methods can accept int start, int end to support pagination, returning a List. Question 34. Which OSGi command lists all installed bundles in the Gogo shell? A) bundle:list B) ss C) lb D) bundles Answer: C Explanation: The lb (list bundles) command displays bundle IDs, states, and symbolic names. Question 35. Which annotation makes a Service Builder method transactional with rollback on RuntimeException? A) @Transactional(rollbackFor = RuntimeException.class) B) @Transactional(rollbackFor = Exception.class) C) @Transactional D) @Transactional(propagation = Propagation.REQUIRED) Answer: C Explanation: By default, Service Builder methods are annotated with @Transactional, which rolls back on unchecked exceptions. Question 36. Which configuration property disables CSRF protection for a specific portlet action URL?
C) To list the services that the bundle provides D) To enable automatic service registration Answer: B Explanation: -servicewrapper (or service.wrapper) tells the framework that the bundle is a wrapper for an existing service. Question 40. Which Java class provides utility methods to fetch the current user’s theme display in a JSP? A) ThemeDisplayUtil B) ThemeDisplayFactory C) ThemeDisplayHelper D) ThemeDisplay Answer: D Explanation: In JSPs, themeDisplay is an implicit object of type ThemeDisplay. Question 41. Which Liferay tag creates a breadcrumb navigation based on the current layout hierarchy? A) B) C) D) Answer: A Explanation: `` renders the navigation trail for the current page. Question 42. Which Maven scope should be used for Liferay API dependencies that are provided by the portal at runtime? A) compile B) provided C) runtime D) test
Answer: B Explanation: provided indicates the dependency is available in the runtime environment (the Liferay portal) and should not be packaged. Question 43. In a portlet’s processAction method, which object is used to store data that survives a redirect to the render phase? A) ActionRequest attributes B) PortletSession C) RenderRequest attributes D) ActionResponse parameters Answer: B Explanation: The PortletSession can store attributes that persist across the action-render cycle. Question 44. Which Liferay configuration key determines the default number of items per page in a Search Container? A) search.container.page.size B) search.container.default.delta C) search.container.max.items D) search.container.pagination.limit Answer: B Explanation: search.container.default.delta defines the default “delta” (items per page) for SearchContainer. Question 45. Which tag library prefix is used for Liferay UI tags in JSPs? A) liferay-ui B) liferay-frontend C) liferay-theme D) liferay-portlet Answer: A Explanation: Liferay UI tags are accessed via the liferay-ui prefix (e.g., ``).
Question 49. Which Gogo command refreshes a bundle after its JAR has been replaced on disk? A) refresh B) update C) restart D) reinstall Answer: A Explanation: refresh forces the framework to reload the bundle’s classes. Question 50. Which annotation marks a Service Builder entity as “searchable” for the portal’s indexing framework? A) @Indexable B) @Searchable C) @Entity(searchable = true) D) @IndexedEntity Answer: A Explanation: @Indexable on the generated model’s getter methods indicates fields to be indexed. Question 51. Which Liferay client-extension type is used to embed a React component as a custom element? A) custom-element B) theme-js C) custom-element-react D) client-react Answer: A Explanation: The custom-element type allows you to register a Web Component (e.g., a React-based element) that can be placed on pages. Question 52. Which portal property controls the maximum size (in bytes) of a file uploaded via a portlet?
A) upload.max.size B) portal.upload.max.size C) upload.servlet.request.max.size D) portal.upload.max.file.size Answer: C Explanation: upload.servlet.request.max.size defines the maximum request size for file uploads. Question 53. In a Liferay theme’s portal_normal.ftl, which variable provides the current layout’s friendly URL? A) layout.friendlyURL B) themeDisplay.getLayoutFriendlyURL() C) friendlyURL D) layoutFriendlyURL Answer: B Explanation: The themeDisplay object’s method getLayoutFriendlyURL() returns the friendly URL of the current layout. Question 54. Which method of PortletURL generates a URL that triggers a resource request? A) setResourceID B) setParameter C) setResourceID and setCacheability D) setResourceID only Answer: C Explanation: To create a resource URL, you call setResourceID and optionally setCacheability before converting to string. Question 55. Which Liferay tag displays a list of recent blog entries using the Asset Publisher? A) B) with appropriate configuration
Answer: B Explanation: creates a modal dialog that can load content from a URL or JSP. **Question 59.** Which configuration file is used to define a new headless API endpoint in Liferay? A) rest-config.xml B) application-context.xml C) web.xml D) api-config.yaml Answer: D Explanation: `api-config.yaml` (or `headless-api.yaml` in newer versions) declares custom REST/GraphQL endpoints. **Question 60.** Which method of `UserLocalService` retrieves a user by screen name? A) getUserByScreenName(long companyId, String screenName) B) fetchUserByScreenName(long companyId, String screenName) C) getUserByEmailAddress(long companyId, String email) D) findUserByScreenName(String screenName) Answer: A Explanation: `UserLocalService.getUserByScreenName` throws a `PortalException` if not found; `fetch...` returns null. **Question 61.** Which Liferay tag library provides the component? A) liferay-ui B) liferay-frontend C) clay D) liferay-clay Answer: C Explanation: The Clay taglib is accessed via the clay prefix (e.g., ``).
Question 62. Which property in bnd.bnd controls whether a bundle’s classes are exported? A) Export-Package B) Provide-Capability C) Bundle-Export D) Export-Class Answer: A Explanation: Export-Package lists packages that other bundles may import. Question 63. Which Service Builder finder method signature would you use to retrieve entities ordered by a custom column? A) findByCustomColumn(String value, OrderByComparator obc) B) findByCustomColumn(String value, int start, int end) C) findByCustomColumn(String value) D) findByCustomColumn(String value, int start, int end, OrderByComparator obc) Answer: D Explanation: The full signature includes pagination (start, end) and an OrderByComparator for custom ordering. Question 64. Which Liferay UI tag renders a “Star” rating widget for an asset? A) B) C) D) Answer: A Explanation: `` displays the star rating component for assets. Question 65. Which Gogo shell command displays the current state of the OSGi framework (e.g., started, stopped)?