liferay-site-initializer

Create and debug Liferay Site Initializers that provision sites with pages, content, and objects.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/gweone/agent-plugins --skill liferay-site-initializer-gweone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: liferay-site-initializer
Source: https://github.com/gweone/agent-plugins/tree/main/plugin/sharpps-liferay/skills/liferay-site-initializer
Command: npx skills add https://github.com/gweone/agent-plugins --skill liferay-site-initializer-gweone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Provisioning a new Liferay site with pre-built content (pages, web content, documents, KB articles, objects, blueprints, taxonomies, fragments, roles) is error-prone: resource folder conventions are undocumented, token substitution order is opaque, and silent failures like misplaced metadata files produce misleading errors. This Skill encodes the verified contract of Liferay's BundleSiteInitializer engine so you can build, deploy, and debug site initializers correctly the first time. ## Core Features & Use Cases - Resource folder reference: Complete, source-verified table of every folder the engine supports under site-initializer/ (documents, journal-articles, knowledge-base-articles, object-definitions, sxp-blueprints, layouts, fragments, and more), including metadata file placement conventions. - Token substitution guide: Documents [$TOKEN$] and "[#TOKEN#]" replacement tokens (e.g. [$DOCUMENT_FILE_ENTRY_ID:...$], [$OBJECT_DEFINITION_ID:...$]) with dependency-order caveats, plus grep commands to verify against the actual portal source. - Known platform bugs and workarounds: Empirically confirmed issues such as the StructuredContentFolder viewableBy gap, DuplicateFolderNameException from misplaced metadata files, and the inability to target system-required sites, each with a tested fix. - Use Case: You add a journal-articles/ folder to a client extension site initializer and redeploy, but get DuplicateFolderNameException. The Skill tells you the metadata file must be a sibling of the folder directory, not inside it. ## Quick Start Ask the assistant to create a Liferay site initializer client extension that provisions a new site with a home page, web content articles, and a sample object definition.

Frequently Asked Questions about liferay-site-initializer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Liferay site initializer client extension?

Create a client-extensions/<name>/ directory with a client-extension.yaml declaring type: siteInitializer, a siteExternalReferenceCode, and an OAuth headless server entry. Place resource files under a site-initializer/ folder, then build and deploy the zip to the Liferay deploy directory.

What folders can a Liferay site initializer import?

The engine supports documents, journal-articles, knowledge-base-articles, object-definitions, object-entries, sxp-blueprints, layouts, fragments, ddm-structures, taxonomy-vocabularies, roles, user-accounts, and more. The full list is defined in BundleSiteInitializer's _createRMap method in the liferay-portal source.

Why does my site initializer fail with DuplicateFolderNameException?

This usually means the folder's metadata.json file is inside the folder directory instead of being a sibling next to it. The engine then misses the externalReferenceCode, fails to match the existing folder, and tries to create a duplicate. Move the metadata file up one level.

Can a Liferay site initializer create a custom Document Type?

No, BundleSiteInitializer has no creation path for DLFileEntryType. Use a type: batch client extension calling the DocumentDataDefinitionType and DocumentMetadataSet REST resources instead, which works fully declaratively without custom Java.

Can a site initializer update an existing Liferay site?

Yes, if siteExternalReferenceCode matches an existing ordinary site, the initializer updates it in place idempotently by ERC. It cannot target system-required sites like L_GUEST, Global, or Control Panel, which fail with NPE or RequiredGroupException.

How do I verify a Liferay site initializer actually ran?

Check bounded docker logs with --since or --tail for BundleSiteInitializer lines: 'Initializing <key> for group <id>', per-step 'Invoking' timings, and a final 'Initialized' message. Seeing only 'Processing <name>.zip' means the OSGi bundle install stalled, not a successful run.