Has anyone done this? I saw where ocpsoft.com has a sitemap.xml and was curious how it was generated, if it was created dynamically, etc. My guess is it may be generated from a WordPress plug-in or similar but thought I’d ask.
Ultimately, I was thinking of creating a class that read all of the url-mappings from pretty-config, iterated through each, built out full links using the url-mapping patterns (maybe via getPattern() ?), then utilizing those links to generate a sitemap.xml and populate a sitemap.jspx page.
AFAIK the sitemap on ocpsoft.com is created by a WordPress plugin.
Creating a sitemap using PrettyFaces is definitively possible this way. But I think this can only work for mappings without any path parameters. As soon as a mapping contains one or more path parameters the sitemap won’t be able to tell which values to insert there.
Thanks Christian. Below is the approach I am taking at the moment. I am planning on retrieving the param names from the patterns via regex and exploding the urls dynamically for each mapping. Wish me luck!
How is this EJB packaged? Is it inside the WAR or in a separate JAR inside an EAR? However I’m note sure this will work correctly as PrettyContext.getCurrentInstance() is using FacesContext.getCurrentInstance() internally which may not work from EJBs.
But there are other ways of obtaining the PrettyConfig instance. For example:
However, you will need to have access to the ServletContext in this case. Please be aware that PrettyFaces always initializes itself for one web application, so you will definitively have to use something like the ServletContext to access the PrettyFaces configuration.