vaadin / vaadin/framework

ProductionMode in Annotations with Vaadin 8 OSGi Liferay portlet

Open
#12,543 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation question
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

I was unable to find documentation about how to turn productionMode on with Vaadin 8 OSGi Liferay Portlets using Annotations. The document I refer to is https://vaadin.com/docs/v8/framework/portal/portal-osgi.

However, after some debugging with Vaadin 8.14.3 server's checkProductionMode method it seemed that there are (at least) two options to choose from to get a Liferay OSGi portlet with Annotations to turn productionMode on.

  1. Turn on production mode globally by adding JVM parameter
    -Dvaadin.productionMode=true

or

  1. Turn on production mode for a single portlet by adding productionMode property into @Component annotation. A sample @Component annotation with production mode turned on would look like this:
@Component(service = UI.class, property = {
        "com.liferay.portlet.display-category=category.vaadin",
        "javax.portlet.name=my.vaadin.app.app.1.0.0",
        "javax.portlet.display-name=Tutorial Portlet",
        "javax.portlet.security-role-ref=power-user,user",
        "javax.portlet.init-param.productionMode=true",
        "com.vaadin.osgi.liferay.portlet-ui=true"},
        scope = ServiceScope.PROTOTYPE)

@VaadinLiferayPortletConfiguration does not support productionMode parameter and adding productionMode property into the @Component annotation when using @VaadinLiferayPortletConfiguration had no affect.

I also noticed that if a Liferay page contained multiple Vaadin portlets, turning productionMode to false in one portlet enabled debug mode for all portlets on that page.

I used Liferay 7.3.5 & Vaadin 8.14.3 and Liferay 7.4.3.10 & Vaaadin 8.16.0 in my tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Vaadin 8 portal OSGi documentation and review the @Component and @VaadinLiferayPortletConfiguration annotation examples described in the issue. Document the supported ways to enable productionMode for Liferay OSGi portlets, including the global JVM property and per-portlet setting, and clarify the reported multi-portlet behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.