How to find out if I'm using a theme in my vaadin application - pom.xml

I've just created a vaadin application, the simplest one you can create, and I was wondering, how do I find out if I have a theme in it and which one it is? The reason for that is that I'm deploying my application to Jenkins and it doesn't like something in my pom.xml file, which I commented out:
compile-theme</goal> -->
With this commented out it works but I need to now whether it is safe to do so. I know that if I don't have a theme it's OK to do it, but I'm trying to find out whether I do have a theme. My understanding is that a theme should be inluded to the pom.xml file under but I can't find any there:
<properties>
<vaadin.version>7.6.5</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
<jetty.plugin.version>9.2.3.v20140905</jetty.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
Does it mean that I'm not using any theme?
thanks

Specifying the theme for a Vaadin application can be done with the #Theme annotation on your UI class:
#Theme("demo")
public class DemoUI extends UI {
...
The theme is not configured in your build configuration (pom.xml).
If you do not specify a theme to be used anywhere, Vaadin will transparently use a default theme (reindeer or valo). So every Vaadin app will use a theme even if it is not specifically configured.
If you want to check the theme which is currently used by your Vaadin application, you can do so using the debug mode. Open the debug window and activate the general info tab. There you can see the currently active theme, the used widget set, the current Vaadin version and more.
Regarding the compile-theme goal in your build configuration: It is safe to comment this goal out as long as you don't use a custom theme which needs compiling. If you use one of Vaadin's built-in themes, you don't need this goal to be active. Check the documentation about Vaadin themes for details.

Related

How to get Vaadin Valo Facebook Theme

So, I'm new to Vaadin, but am interested in using the "Facebook" theme as shown in their demo from here: https://demo.vaadin.com/valo-theme/#!buttons-and-links (and then choose "Facebook" in the top right corner). But, when downloading the latest Vaadin 12 system, I can't figure out how to get the "Facebook" them. The documentation only seems to imply that "Light" and "Material" are available....How do I get the Facebook theme if that's what I've determine is the "best" for my app?
The test app you linked ( https://demo.vaadin.com/valo-theme/#!buttons-and-links ) demonstrates features of Valo theme in Vaadin 7 & 8. So this is not directly applicable for Vaadin 10+, e.g. Vaadin 12. In Vaadin 12 there is a new theme system called Lumo. And as you have noticed there are two base variants of it. That "facebook" variant for Vaadin 8 is implemented by just setting few internal SASS variables of Valo (see: https://github.com/vaadin/valo-demo/blob/master/src/main/webapp/VAADIN/themes/tests-valo-facebook/_variables.scss )
In Lumo theming system you can achieve something similar by using the CSS custom properties. You can find some information about used custom properties here: https://cdn.vaadin.com/vaadin-lumo-styles/1.3.3/demo/customization.html So by setting selected properties in similar fashion, you could most likely achieve something similar.

Vaadin7 themes in Websphere Portal

I would deploy my Vaadin custom themes in Websphere and reference them in some vaadin portlets deployed in Websphere Portal.
I'm using Websphere 8.5 and Vaadin 7. I found a lot of topic about the Tomcat and Liferay combination but nothing usefull for Websphere.
I also tried to set the vaadin.resources.path variable in the 'WP PortletContainerService' in Resources>Resource Environment>Resource Environment Providers and I set a resource with name 'std.portalcontext.vaadin.resources.path' but I can't see it in UI.
​Thank you.
Setting that property on the portletcontainerservice is not going to help you because it is not one of the properties that the WebSphere Portal container is going to recognize as a property. I think you may have to do something like this https://vaadin.com/forum/#!/thread/2732876/2732875 specifically these https://vaadin.com/wiki?p_p_id=36&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=row-1&p_p_col_pos=1&p_p_col_count=3&_36_struts_action=%2Fwiki%2Fview&p_r_p_185834411_nodeName=vaadin.com+wiki&p_r_p_185834411_title=Developing+portlets+for+the+Websphere+Portal+Server
The main thing to do is this
In the portlet tag you have to set a value for the portlet-class. For this simple we can use the default Vaadin portlet class com.vaadin.server.VaadinPortlet; you also have to name you UI class as a portlet init parameter.
To let WPS find the Vaadin javascript and theme resources you have to use the portlet init parameter vaadin.resources.path. The value PORTLET_CONTEXT is a Vaadin constant value that makes the vaadin resources available in the portlets resource path.
Run the Maven build with clean package as goals and deploy the created war file in the portal administration. Create a blank portal page and add your portlet to the page. Your "Click me" portlet should look like this:

web.xml vs. annotation in Vaadin

I'm using Vaadin 7.4.3, tomcat 8. During the wizard to create Vaadin 7 project in eclipse, it has a checkbox called "Generate web.xml deployment descriptor".
The new way is to use annotation instead of specify it in the web.xml. Are there any configurations that I have to use web.xml because there's no annotation for it? Is it a good practice to always generate the web.xml even if you might not use it for Vaadin 7.1 projects and up?
Thanks
Yes, there are for sure some aspects of app that cannot be configured using annotations (i.e. there is no annotation to state that you want to have your session cookies "http-only" ).
I would recommend you to create web.xml file when it is needed. Sooner or later it would probably will be used, but don't worry too much in advance. It is not a dark magic to create web.xml file in existing project :)

Alter Vaadin Dashboard theme to show SplitPanel splitter

I am new to Vaadin and created a web application based on the Vaadin Dashboard theme. However, in my application I am using a VerticalSplitPanel but it does not show the splitter! It is impossible to resize the splitpanel.
After doing some research on the web, I found out that the Dashboard theme is limited in terms of styles of components since the theme only implements styles of components shown in the Dashboard demo application.
My question now is, is it possible to modify the Dashboard theme to allow styles for the splitpanel and thus allowing me to view the splitter? If yes, can someone give me a hint how and where I can do this (keep in mind I'm very new to vaadin!)
The dashboard demo is really a nice startup to get some ideas for your app but i wouldn't suggest to use it as template to start your development on.
If what you are looking for is the "graphic look and feel" know that this feel is natively present in the Valo theme. For reference you can browse the Valo-Demo project on github ( https://github.com/vaadin/valo-demo ): for exemple the left menu css styles are in the css of Valo, they are only modified in the dashboard demo.
If what you are interest in is the functionality of the "dashboard" page (there you see the sparks, the charts, notes and so on) keep in mind that is made with a CssLayout, which is a powerful way to make custom layouts but of course you have to work out everything.
Probably a SplitPanel inside this layout gets something overwritten or not everything is implemented in the css.
In the end you can try PortalLayout add-on in Vaadin directory to achieve something similar or add the missing styles by yourself.
Cheers.

create application without any theme

Hi I am new to Vaadin and I was looking about the theme.
In Vaadin, is it possible to to develop application without any theme?
I will apply theme only if any theming is required. So that it should look
normal html components.Currently I am using vaadin7 and I know how to customize
themes to the components which I dont need. I need to develop the applications without having any themes.
You can create a "empty" theme and use this one. (Means, one which does not inherit from any other theme)
https://vaadin.com/book/-/page/themes.html
But be aware that the themes also influence the way the vaadin buttons are drawn, scroll behaviour of panels, and many many other things.
To prevent breaking basic stuff, there exists a base theme which only holds the minimal css/sass rules for vaadin.
Look in section 8.4.4. Built-in Themes
of https://vaadin.com/book/-/page/themes.creating.html

Resources