Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProductionMode in Annotations with Vaadin 8 OSGi Liferay portlet #12543

Open
mikke-alekstra opened this issue Jun 22, 2022 · 1 comment
Open

Comments

@mikke-alekstra
Copy link

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.

@TatuLund
Copy link
Contributor

For me use of @Component sounds the like the better option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants