Umut5
(Umut Atmaca)
August 17, 2015, 11:36am
1
I have two different UI project (Project A, Project B )
These two projects have two different Theme (Theme A, Theme B )
I want to be inherited from a common(Base) theme.
Would you advise me to do?
At the same time , these two projects are using the UI controls project. (Controls.jar)
anezthes
(Joacim Päivärinne)
August 18, 2015, 8:24am
2
Hey Umut,
That should definitely doable. Import the base theme’s main mixin in theme A and B.
I’d recommend you read up on imports and mixins over at http://sass-lang.com/guide .
Just be diligent with how you structure and maintain your themes.
Umut5
(Umut Atmaca)
August 18, 2015, 10:56am
3
Thank you Joacim,
But, I want to learn directory structure.
How should directory structure be?
Normally, Theme of web project would be (src/main/webapp/VAADIN/themes/BaseTheme) here.
But, Base proect is a .jar project, so directory structure have not webapp folder.
|____Controls
| |____pom.xml
| |____src
| | |____main
| | | |____resources
| | | |____java
|____UI A
| |____pom.xml
| |____src
| | |____main
| | | |____resources
| | | |____java
| | | |____webapp
| | | | |___META-INF
| | | | |___WEB-INF
| | | | |___VAADIN
| | | | | |___themes
| | | | | | |___MyTheme A (MyTheme A should inherited from a comman(Base) theme)
|____UI B
| |____pom.xml
| |____src
| | |____main
| | | |____resources
| | | |____webapp
| | | |____java
| | | | |___META-INF
| | | | |___WEB-INF
| | | | |___VAADIN
| | | | | |___themes
| | | | | | |___MyTheme B (MyTheme B should inherited from a comman(Base) theme)
anezthes
(Joacim Päivärinne)
August 21, 2015, 9:59am
5
Not sure how you’d access a theme from a JAR, or what requirements you’d need to place on the structure.
Perhaps this will prove useful:
https://vaadin.com/wiki/-/wiki/Main/Creating+a+reusable+Vaadin+theme+in+Eclipse/
Henri2
(Henri Sara)
August 21, 2015, 10:11am
6
The vaadin-themes JAR just has the structure /VAADIN/themes/… under the root of the JAR, and applications access the common themes from there.
In practice, to get it into a Maven JAR project, if I recall correctly, it should be enough to put the files under /src/main/resources/VAADIN/themes/mybasetheme/… in case of a project with packaging=jar, and …/webapp/… in case of a WAR project.
You can also customize what the Maven packaging plugins (jar and war plugins) do or even use the assembly plugin if the default layout is not ok for you, but easier to use the default locations.
Umut5
(Umut Atmaca)
August 31, 2015, 8:19am
7
Thank you Henri and Joacim,
/src/main/resources/VAADIN/themes/mybasetheme/…
This method was successful
But, This method has opened other problems
When the project is compiled each wants “mvn clean install” for root project
Do you have a suggestion for this problem?