Page 1 of 3

California theme to maven project

Posted: 20 Sep 2018, 07:44
by techgeek
Hi

I've purchased california theme, but couldn't able to setup with primefaces + springboot maven project.

here is mvn dependency

Code: Select all

<dependency>
		<groupId>org.primefaces.themes</groupId>
		<artifactId>california</artifactId>
		<version>1.0.1</version>
	</dependency>
here is repo I've added

Code: Select all

<repository>
  			<id>prime-repo</id>
  			<name>Prime Repo</name>
  			<url>http://repository.primefaces.org</url>
  		</repository>

getting following error when run - mvn spring-boot:run

Code: Select all

[ERROR] Failed to execute goal on project jsf-primefaces-spring-boot: Could not resolve dependencies for project com.codenotfound:jsf-primefaces-spring-boot:jar:0.0.1-SNAPSHOT: Could not find artifact org.primefaces.themes:california:jar:1.0.1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

any help greatly appreciated.

Thanks.

Re: California theme to maven project

Posted: 20 Sep 2018, 20:55
by techgeek
I've installed theme jar locally and able to build mvn project

Code: Select all

mvn install:install-file -Dfile=<path-to-file> -DgroupId=org.primefaces.themes -DartifactId=california -Dversion=1.0.1 -Dpackaging=jar
and modified application.yml to point to california theme

Code: Select all

jsf:
  primefaces: 
    theme: california

server:
  context-path: /example
  port: 9090
but getting below error whenever I access page -> http://localhost:9090/example/helloworld.xhtml

Code: Select all

15:29:04.131 [http-nio-9090-exec-1] ERROR o.a.c.c.C.[.[.[.[FacesServlet] - Servlet.service() for servlet [FacesServlet] in context with path [/example] threw exception [Error loading css, cannot find "theme.css" resource of "primefaces-california" library] with root cause
javax.faces.FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-california" library
	at org.primefaces.renderkit.HeadRenderer.encodeCSS(HeadRenderer.java:149)
	at org.primefaces.renderkit.HeadRenderer.encodeBegin(HeadRenderer.java:81)
	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:865)

Re: California theme to maven project

Posted: 24 Sep 2018, 12:37
by huseyinT
You must generate CSS from the sass file.

In the documentation: http://primefaces.org/california/docs.xhtml

sass --update src/main/webapp/resources/ --sourcemap=none

Re: California theme to maven project

Posted: 25 Sep 2018, 08:13
by techgeek
I've updated application.yml to

Code: Select all

jsf:
  primefaces: 
    theme: california-blue

server:
  context-path: /example
  port: 9090
now page coming up without any error but not getting same look and feel like california live version.
https://primefaces.org/california/dashboard.xhtml

Could you please help, how to setup jar version of california theme in spring boot apps as there will not be web.xml or WEB-INF folder.

Re: California theme to maven project

Posted: 26 Sep 2018, 15:00
by mert.sincan
but not getting same look and feel like california live version.
Could you please attach a screenshot for us to replicate?
Could you please help, how to setup jar version of california theme in spring boot apps as there will not be web.xml or WEB-INF folder.
- Similar example; https://www.codenotfound.com/jsf-primef ... -boot.html

Best Regards,

Re: California theme to maven project

Posted: 26 Sep 2018, 19:41
by techgeek
I've followed same example for California theme, but no luck. I just tried email composition panel only as I couldn't able to fix whole dashboard page and here is the link for screen shots.

https://drive.google.com/drive/folders/ ... 1M3HO-BPTk

One is form live version and other one is from my local, you can see the difference.

https://www.codenotfound.com/jsf-primef ... -boot.html

If we get same look and feel as live version, we are more happy to have enterprise license :)

Re: California theme to maven project

Posted: 27 Sep 2018, 10:03
by mert.sincan
You must also add layout files. Then provide the CSS using the SASS command. Theme.jar/Theme files only are for Components. Your issue is related to Layout css.

Exp, please add this code into your page;

Code: Select all

.dashboard .resolution-center .ui-inputfield {
    display: block;
    margin-top: 5px;
    margin-bottom: 15px;
}

Re: California theme to maven project

Posted: 28 Sep 2018, 07:08
by techgeek
Finally I am able to get theme look. But still some styles are missing in data table (pagination and sort arrows are missing) added screen shot to google drive for your reference.

https://drive.google.com/drive/folders/ ... 1M3HO-BPTk

from california-layout-1.0.1.zip (which I downloaded), I converted resource/california-layout/css/layout-blue.scss to layout-blue.css and placed under my project resource/california-layout/css/layout-blue.css.

Could you please let me know what are all css and image files required to get California theme perfect with all widgets which are in live version? how to get them to make this work ?

Thanks for all your help.

Re: California theme to maven project

Posted: 28 Sep 2018, 08:42
by mert.sincan
Please add fontawesome in your project;

Code: Select all

<context-param>
        <param-name>primefaces.FONT_AWESOME</param-name>
        <param-value>true</param-value>
    </context-param>
Could you please let me know what are all css and image files required to get California theme perfect with all widgets which are in live version?
it is related to your project. Exp; If you want to use login.xhtml, please add login images.

Best Regards,

Re: California theme to maven project

Posted: 28 Sep 2018, 10:28
by techgeek
My project is JSF with SpringBoot, so there is no web.xml to add font-awesome.

I've tried this https://stackoverflow.com/questions/497 ... primefaces but no luck.

Please help how to set this in springboot app.