Adding poseidon to existing project

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
brettw
Posts: 12
Joined: 08 Oct 2013, 01:40

26 Apr 2017, 07:34

hello,
I have just purchased the poseidon template and am having trouble adding it to an existing project. I have followed the instuctions:
"simply copy the poseidon-layout folder to your %WEB-APP-FOLDER%/resources folder so that final path would be %WEB-APP-FOLDER%/resources/poseidon-layout/"

It didn't work, so then, using the provided runnable war file and studying it, I've also taken other steps on my project such as:

- added the following context parameter:
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>poseidon-turquoise</param-value>
</context-param>

- Add the provided poseidon-theme-1.0.0.jar onto the classpath.

- Added WEB-INF/primefaces-poseidon.taglib.xml and referenced in web.xml

- Update faces-config with the following:
<component>
<component-type>org.primefaces.component.PoseidonMenu</component-type>
<component-class>org.primefaces.poseidon.component.menu.PoseidonMenu</component-class>
</component>

<render-kit>
<renderer>
<component-family>org.primefaces.component</component-family>
<renderer-type>org.primefaces.component.PoseidonMenuRenderer</renderer-type>
<renderer-class>org.primefaces.poseidon.component.menu.PoseidonMenuRenderer</renderer-class>
</renderer>
</render-kit>

Can you please advise if the extra steps above are needed.

After all this, It seems like the required resources are not event being requested by the page and I cannot see where they should be requested. See attached screenshot of the web app using the template. As an example, the request for javax.faces.resource/css/layout-turquoise.css.xhtml?ln=poseidon-layout does not even occur in my project but I can see that it does for the demo project.

Image

Thanks for any help

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

26 Apr 2017, 15:05

You need to provide layout-*.css from layout*.scss files. Please use the following code;

Code: Select all

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

brettw
Posts: 12
Joined: 08 Oct 2013, 01:40

28 Apr 2017, 04:37

Thanks for the response. Actually, the issue was that there is references to the GuestPreferences bean in the template and I hadn't copied that source code into the existing project. This means it did not know which theme was selected, it might be worth pointing this out in the documentation.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

01 May 2017, 11:26

Thanks for the update!

GuestPreferences is a simple session scoped bean to keep the user customizations of the layout, template xhtml files refer to this bean to dynamically change their behavior such as menu mode or theme. This bean is not necessary to run the Poseidon and only used for demo purposes. For example template.xhtml includes layout color depending on a user preference using an EL expression.

<h:outputStylesheet name="css/layout-#{guestPreferences.theme}.css" library="poseidon-layout" />
In your application, you may also need a similar bean to make the template dynamic or choose a static color with;

<h:outputStylesheet name="css/layout-blue.css" library="poseidon-layout" />

Post Reply

Return to “Poseidon - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests