Recently, we were faced with a challenge. We were trying to add a new page to Liferay with a specific name friendly URL but when we went to add the page we saw an error indicating the URL was already in use.
This particular site has hundreds of pages and the friendly URL didn’t appear to match any existing pages. We spent a few minutes clicking through trying to locate the conflicting page without any luck. We followed the link lead to a PDF on the site but the page name used to configure it still wasn’t obvious. We needed a better approach to solve this.
Enter Liferay’s scripting console.
In version 6.0, Liferay added a scripting console to the Server Administration section of the control panel. This is a powerful tool that we frequently use during development, debugging and prototyping. This was the perfect place to run a quick query to figure this out.
We wrote a simple groovy script. Given a friendly URL this script will return the associated page name.