• Stars
    star
    156
  • Rank 239,589 (Top 5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sample Projects for Liferay Portal

Liferay's sample projects provides bootstrap project environments for all major build tools in common use for Java projects so that Liferay development can start quickly and easily. These templates can be copied freely and contributions are welcome. See the Contribution Guidelines for more information on how to contribute new sample projects and/or documentation.

Build Tools

The template projects are categorized under two build tools:

  • liferay-workspace - A set of Liferay projects configured to work in a Liferay Workspace environment.
  • liferay-workspace-test-integration-sample - A Liferay project configured to execute Integration Tests.
  • maven - A set of Liferay projects that can be bootstrapped onto the Maven development environment.

Usage

The projects follow the Liferay Workspace project style for gradle and maven.

  • liferay-workspace - in gradle.properties, Set liferay.workspace.product to the target product version.
  • liferay-workspace-test-integration-sample - The test project is in modules/sample/sample-test folder. Run gradlew buildService testIntegration in modules/sample.
  • maven - Set the corresponding release.portal.bom found in dependencyManagement

Contribution Guidelines

When contributing a new sample, you must include accompanying documentation.

Sample Code

You can contribute additional template samples by creating the project for one of the possible build tools and sending a pull request to liferay/liferay-blade-samples. A repository admin will review the submission and replicate the project for the other supported build tools, once the submission is approved.

Sample Docs

You can contribute documentation by adding a README.markdown file to the root folder of a sample project. This article should include the following sections:

  • What does this sample do when it's deployed?
  • What API(s) and/or code components does this sample highlight?
  • How does this sample leverage the API(s) and/or code component?

For example, the Resource Bundle Override article explains the resource-bundle-override sample using the aforementioned sections.

Frameworks

The template projects also demonstrate how to use various frameworks:

  • Blueprint
  • Declarative Services (DS)
  • OSGi API

A Note on Blueprint

Liferay does not provide a Blueprint implementation out of the box. To use the Blueprint modules provided in Blade, you must deploy a Blueprint implementation such as Apache Aries - Blueprint. Three bundles are needed:

Simply download the bundles from mvnrepository and drop them in your osgi/modules folder before deploying Blueprint bundles.

Liferay Extension Points and Template Projects

Apps

Action Command Portlet

Template project description: Demonstrates the MVCActionCommand extension point. It integrates the action command named greet with portlet greeter. To see how this example works, a portlet plugin with a portlet named greeter (javax.portlet.name='greeter') should be deployed. The command adds a key greeting_message to Liferay SessionMessages, along with a session attribute GREETER_MESSAGE. You can independently deploy the bundle blade.portlet.actioncommand (i.e., refresh the bundle without the need to redeploy the Portlet plugin).

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/action-command-portlet
Maven ./maven/apps/action-command-portlet

Blueprint Portlet

Template project description: Demonstrates how to use the Blueprint framework for registering a Liferay MVC portlet.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/blueprint-portlet
Maven ./maven/apps/blueprint-portlet

Configuration Action

Template project description: Demonstrates the ConfigurationAction integration point.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/configuration-action
Maven ./maven/apps/configuration-action

Control Panel Portlet

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/control-panel-portlet
Maven ./maven/apps/control-panel-portlet

DS Portlet

Template project description: Demonstrates how to use the DS (Declarative Services) framework for registering a Liferay MVC portlet.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/ds-portlet
Maven ./maven/apps/ds-portlet

Filter Portlet

Template project description: Demonstrates how to apply PortletFilters.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/filter-portlet
Maven ./maven/apps/filter-portlet

FreeMarker Portlet

Template project description: Demonstrates a simple FreeMarker portlet.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/freemarker-portlet
Maven ./maven/apps/freemarker-portlet

Greedy Policy Option Portlet

Refer to this sample's Readmes for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/greedy-policy-option-portlet
Maven ./maven/apps/greedy-policy-option-portlet

JSP Portlet

Template project description: Demonstrates a simple JSP portlet.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/jsp-portlet
Maven ./maven/apps/jsp-portlet

JSP Portlet with Notification Framework

Template project description: Demonstrates a simple JSP portlet and the usage of Liferay's Notification framework.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/notification-portlet

JSP WAR Portlet

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/wars/jsp-war-portlet
Maven ./maven/apps/jsp-portlet

OSGi Portlet

Template project description: Demonstrates how to use the raw OSGI APIs for registering a Liferay MVC portlet.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/osgi-portlet
Maven ./maven/apps/osgi-portlet

Render Command Portlet

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/render-command-portlet
Maven ./maven/apps/render-command-portlet

Resource Command Portlet

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/resource-command-portlet
Maven ./maven/apps/resource-command-portlet

REST

Extension point description: Lets developers create custom JAX-RS standard based RESTful services.

Template project description: Demonstrates how to create a JAX-RS service that lists Liferay users.

Then you can access the service via http://localhost:8080/o/users/list/.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/rest
Maven ./maven/apps/rest

Sample Verifier

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/sample-verifier
Maven ./maven/apps/sample-verifier

Service Builder

ADQ

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/service-builder/adq
Maven ./maven/apps/service-builder/adq

Basic

Template project description: Demonstrates how to create a Service Builder project separated into three bundles:

  • api bundle is for interfaces
  • service bundle is for implementations
  • web bundle is a portlet calling the generated services
Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/service-builder/basic
Maven ./maven/apps/service-builder/basic

JDBC

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/service-builder/jdbc
Maven ./maven/apps/service-builder/jdbc

JNDI

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/service-builder/jndi
Maven ./maven/apps/service-builder/jndi

Shared Language Keys

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/shared-language-keys
Maven ./maven/apps/shared-language-keys

Simulation Panel App

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/apps/simulation-panel-app
Maven ./maven/apps/simulation-panel-app

Spring MVC Portlet

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/wars/springmvc-portlet
Maven ./maven/apps/springmvc-portlet

Ext

Login Web Ext

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/ext/login-web-ext

Extensions

Auth Failure

Template project description: Demonstrates a hook for auth.failure and auth.max.failures.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/auth-failure
Maven ./maven/extensions/auth-failure

Authenticator Shiro

Template project description: Uses Apache Shiro for hooking auth.pipeline.pre.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/authenticator-shiro
Maven ./maven/extensions/authenticator-shiro

Auto Login

Template project description: Demonstrates the AutoLogin integration point.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/auto-login
Maven ./maven/extensions/auto-login

Control Menu Entry

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/control-menu-entry
Maven ./maven/extensions/control-menu-entry

Doclib Resource Command Override

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/doclib-resource-command-override
Maven ./maven/extensions/doclib-resource-command-override

Document Action

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/document-action
Maven ./maven/extensions/document-action

Gogo Command

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/gogo
Maven ./maven/extensions/gogo

Index Settings Contributor

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/index-settings-contributor
Maven ./maven/extensions/index-settings-contributor

Indexer Post Processor

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/indexer-post-processor
Maven ./maven/extensions/indexer-post-processor

Lifecycle Login Pre-action

Extension point description: Demonstrates how to implement a Liferay com.liferay.portal.kernel.events.LifecycleAction. This API replaces all the legacy lifecycle events such as com.liferay.portal.kernel.events.Action, com.liferay.portal.kernel.events.SessionAction, and com.liferay.portal.kernel.events.SimpleAction. Connecting a LifecycleAction to a particular event is determined by the OSGi service property key. The following keys are supported:

  • application.shutdown.events - fired during destruction of company instances at portal shutdown.
  • application.startup.events - fired during initialization of company instances at portal start, or when a new instance is created.
  • global.shutdown.events - fired during destruction of the portal's main servlet.
  • global.startup.events - fire during initialization of the portal's main servlet.
  • layout.configuration.action.delete - fired during destruction of a page (Layout).
  • layout.configuration.action.update - fired during initialization of a page (Layout).
  • login.events.post - fired immediately following login.
  • login.events.pre - fired immediately prior to login.
  • logout.events.post - fired immediately following logout.
  • logout.events.pre - fired immediately prior to logout.
  • servlet.service.events.post - fired following requests to the portal (including all portlet container requests).
  • servlet.service.events.pre - fired prior to requests to the portal (including all portlet container requests & post login).
  • servlet.session.create.events - fired during creation of a portal's HTTP session.
  • servlet.session.destroy.events - fired during destruction of a portal's HTTP session.

Template project description: Demonstrates a hook for login.events.pre.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/lifecycle-login-preaction
Maven ./maven/extensions/lifecycle-login-preaction

Model Listener

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/model-listener
Maven ./maven/extensions/model-listener

Poll Processor

Template project description: Demonstrates how to make a hook for a PollerProcessor.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/poll-processor
Maven ./maven/extensions/poll-processor

Portlet Configuration Icon

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/portlet-configuration-icon
Maven ./maven/extensions/portlet-configuration-icon

Portlet Toolbar Contributor

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/portlet-toolbar-contributor
Maven ./maven/extensions/portlet-toolbar-contributor

Resource Bundle

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/resource-bundle
Maven ./maven/extensions/resource-bundle

Screen Name Validator

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/screen-name-validator
Maven ./maven/extensions/screen-name-validator

Search Keyword Query Contributor

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/search-keyword-query-contributor
Maven ./maven/extensions/search-keyword-query-contributor

Search Model Pre-Filter Contributor

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/search-model-pre-filter-contributor
Maven ./maven/extensions/search-model-pre-filter-contributor

Servlet

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/extensions/servlet
Maven ./maven/extensions/servlet

User Service Wrapper

Template project description: Demonstrates how to wrap the UserLocalService with custom a UserLocalServiceWrapper.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/user-service-wrapper
Maven ./maven/user-service-wrapper

Overrides

Module JSP Override

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/overrides/module-jsp-override
Maven ./maven/overrides/module-jsp-override

Portlet Form Taglib Override

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/overrides/portlet-form-taglib-override
Maven ./maven/overrides/portlet-form-taglib-override

Themes

Simple Theme

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/wars/simple-theme
Maven ./maven/themes/simple-theme

Template Context Contributor

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/themes/template-context-contributor
Maven ./maven/themes/template-context-contributor

Theme Contributor

Refer to this sample's Readme for more information.

Build tool Link to project's source code
Liferay Workspace ./liferay-workspace/themes/theme-contributor
Maven ./maven/themes/theme-contributor

Liferay Extension Points Without Template Projects

This project does not yet have template projects for the following extension points. We encourage you to contribute some!

  • com.liferay.mail.util.Hook
  • com.liferay.portal.kernel.atom.AtomCollectionAdapter
  • com.liferay.portal.kernel.format.PhoneNumberFormat
  • com.liferay.portal.kernel.lar.PortletDataHandler
  • com.liferay.portal.kernel.lar.StagedModelDataHandler
  • com.liferay.portal.kernel.lock.LockListener
  • com.liferay.portal.kernel.notifications.UserNotificationHandler
  • com.liferay.portal.kernel.pop.MessageListener
  • com.liferay.portal.kernel.portlet.PortletLayoutListener
  • com.liferay.portal.kernel.sanitizer.Sanitizer
  • com.liferay.portal.kernel.scheduler.SchedulerEntry
  • com.liferay.portal.kernel.search.Indexer
  • com.liferay.portal.kernel.search.OpenSearch
  • com.liferay.portal.kernel.servlet.URLEncoder
  • com.liferay.portal.kernel.template.TemplateHandler
  • com.liferay.portal.kernel.template.TemplateManager
  • com.liferay.portal.kernel.trash.TrashHandler
  • com.liferay.portal.kernel.upgrade.UpgradeProcess (call the Release service)
  • com.liferay.portal.kernel.webdav.WebDAVStorage
  • com.liferay.portal.kernel.workflow.WorkflowHandler
  • com.liferay.portal.kernel.xmlrpc.Method
  • com.liferay.portal.model.ModelListener
  • com.liferay.portal.security.auth.AuthToken
  • com.liferay.portal.security.auth.AuthVerifierConfiguration
  • com.liferay.portal.security.auth.AutoLogin
  • com.liferay.portal.security.auth.EmailAddressGenerator
  • com.liferay.portal.security.auth.EmailAddressValidator
  • com.liferay.portal.security.auth.FullNameGenerator
  • com.liferay.portal.security.auth.FullNameValidator
  • com.liferay.portal.security.auth.ScreenNameGenerator
  • com.liferay.portal.security.auth.ScreenNameValidator
  • com.liferay.portal.security.ldap.AttributesTransformer
  • com.liferay.portal.security.membershippolicy.OrganizationMembershipPolicy
  • com.liferay.portal.security.membershippolicy.RoleMembershipPolicy
  • com.liferay.portal.security.membershippolicy.SiteMembershipPolicy
  • com.liferay.portal.security.membershippolicy.UserGroupMembershipPolicy
  • com.liferay.portal.security.permission.BaseModelPermissionChecker
  • com.liferay.portal.security.permission.PermissionPropagator
  • com.liferay.portal.security.pwd.Toolkit
  • com.liferay.portal.verify.VerifyProcess
  • com.liferay.portlet.asset.model.AssetRendererFactory
  • com.liferay.portlet.ControlPanelEntry
  • com.liferay.portlet.DefaultControlPanelEntryFactory
  • com.liferay.portlet.dynamicdatamapping.render.DDMFormFieldRenderer
  • com.liferay.portlet.dynamicdatamapping.util.DDMDisplay
  • com.liferay.portlet.expando.model.CustomAttributesDisplay
  • com.liferay.portlet.social.model.SocialActivityInterpreter
  • com.liferay.portlet.social.model.SocialRequestInterpreter
  • java.util.ResourceBundle
  • javax.portlet.filter.ActionFilter
  • javax.portlet.filter.EventFilter
  • javax.portlet.filter.RenderFilter
  • javax.portlet.filter.ResourceFilter
  • javax.portlet.PreferencesValidator
  • javax.servlet.Filter (Liferay InvokerFilterChain Filters)

License

License

References

OSGI R5

OSGI Compendium R5

Blueprint

More Repositories

1

liferay-portal

Java
2,082
star
2

senna.js

🌱 A blazing-fast Single Page Application engine
JavaScript
1,723
star
3

alloy-ui

Repo Moved. AlloyUI is a framework built on top of YUI3 (JavaScript) that uses Bootstrap 3 (HTML/CSS) to provide a simple API for building high scalable applications
JavaScript
1,548
star
4

alloy-editor

WYSIWYG editor based on CKEditor with completely rewritten UI
JavaScript
1,387
star
5

liferay-plugins

Java
511
star
6

liferay-docs

Java
217
star
7

clay

A web implementation of the Lexicon Experience Language
SCSS
206
star
8

liferay-nativity

Liferay Nativity is a cross-platform library for adding icon overlays and context menus to file browsers.
Objective-C
164
star
9

sennajs.com

🌱 Website of Senna.js library
JavaScript
140
star
10

liferay-ide

Java
130
star
11

electric

⚑ Create beautiful documentation for your projects
JavaScript
118
star
12

git-tools

Python
88
star
13

liferay-faces

Java
83
star
14

soy-cheat-sheet

A quick reference guide for Soy templates (aka. Google Closure templates)
80
star
15

liferay-frontend-projects

A monorepo containing assorted Frontend Infrastructure Team projects
JavaScript
69
star
16

liferay-screens

Java
65
star
17

liferay-docker

Shell
59
star
18

liferay-js-toolkit

JavaScript
52
star
19

liferay-maven-support

pom
Java
52
star
20

com-liferay-commerce

Java
48
star
21

liferay-mobile-sdk

Objective-C
47
star
22

liferay-frontend-guidelines

JavaScript
38
star
23

alloyui.com

Website for AlloyUI
HTML
35
star
24

liferay-blade-cli

Java
32
star
25

generator-liferay-fragments

Yeoman generator for creating and maintaining Liferay Fragment projects
TypeScript
30
star
26

generator-liferay-theme

27
star
27

liferay-js-themes-toolkit

JavaScript
26
star
28

lexicon-site

Website of Lexicon Experience Language
CSS
25
star
29

liferay-intellij-plugin

Java
25
star
30

liferay-frontend-source-formatter

Runs common checks against your files to check for issues according to Liferay's formatting guidelines
JavaScript
23
star
31

liferay-theme-tasks

A set of tasks for building and deploying Liferay Portal themes.
18
star
32

liferay-amd-loader

JavaScript
18
star
33

liferay-npm-tools

Collection of tools for using npm in Liferay
JavaScript
18
star
34

liferay-apps-content-targeting

Java
18
star
35

portletmvc4spring

Java
17
star
36

liferay-code-samples

Java
13
star
37

liferay-aui-upgrade-tool

Upgrade themes/plugins from Liferay Portal 6.1 to 6.2
JavaScript
13
star
38

alloyeditor.com

Website of Alloy Editor
JavaScript
11
star
39

liferay-faces-bridge-impl

Java
9
star
40

enablement-bootcamp-clarity

SCSS
9
star
41

liferay-ckeditor

HTML
8
star
42

liferay-faces-portal

Java
7
star
43

liferay-osgi-watch

JavaScript
6
star
44

evolvable-apis.org

HTML
6
star
45

liferay-faces-showcase

Java
6
star
46

alloy-taglibs

JSP Taglibs for AlloyUI project
Java
6
star
47

frontend-training-docs

FreeMarker
5
star
48

liferay-docs-dxp-cloud

Shell
5
star
49

alloy-apidocs-theme

API Docs Theme for AlloyUI
JavaScript
5
star
50

liferay-faces-alloy

Java
5
star
51

eslint-config-liferay

ESLint shareable config for the Liferay JavaScript Style
JavaScript
5
star
52

liferay-faces-bridge-api

Java
4
star
53

vulcan-site

HTML
4
star
54

liferay-module-config-generator

JavaScript
4
star
55

liferay-cli

Go
4
star
56

liferay-faces-util

Java
3
star
57

liferay-gulp-tasks

Gulp tasks to be shared between Liferay projects
JavaScript
3
star
58

web-dev-email-templates

HTML
3
star
59

liferay-faces-bridge-ext

Java
3
star
60

headlessapis.wedeploy.io

JavaScript
3
star
61

lfris-marketing-docs

JavaScript
3
star
62

liferay-binaries-cache-2020

2
star
63

liferay-localdev

Shell
2
star
64

apioarchitect.wedeploy.io

HTML
2
star
65

portalmigration.wedeploy.io

CSS
2
star
66

liferay-binaries-cache-2017

2
star
67

liferay-etl-mulesoft

Java
2
star
68

liferay-npm-sdk-assistant

A tool to ease management of projects using Liferay's npm SDK.
JavaScript
1
star
69

liferay-central-test-2

Java
1
star
70

liferay-faces-clay

Java
1
star
71

liferay-faces-maven

Java
1
star
72

lexiconcss

CSS
1
star
73

liferay-circles-of-success

1
star
74

liferay-central-test-1

Java
1
star