Liferay error page if at least one portlet is unavailable - jsf

I'm trying to setup a custom error page in Liferay portal if at least one portlet fails.
The portal always forwards to portlet_error.jsp and display a red zone in the portlet position.
How can I set a redirect or a forward to a page that fills the complete page layout?
Regards

Inside your JSP you can redirect to a page in Liferay, which can have just one portlet or the way you want it.
Or write your own servlet which in case of error redirects to page in liferay instead of a JSP

If the response is 404 then you can use this property in portal-ext.properties for add your custom page
layout.friendly.url.page.not.found=/html/portal/page_not_found.html

Related

How to set a custom 410 page on liferay

I want to set a custom 410 page on liferay. I have already configured that for a 404 page via the file portal-ext.properties
layout.friendly.url.page.not.found=/html/portal/404.html
But I don’t know how to do it for a 410 page.
Thanks for helping
There is no such configuration option. If you look at the code of PortalImpl.sendError you will see, that there is a special test for NoSuchLayoutException. All other errors are just redirected to the status page.
You could either create an EXT plugin and overwrite PortalImpl.sendError to do whatever you want. Or you create a hook and overwrite /html/portal/status.jsp.

WebSphere Portal - Retain friendly URL after Portlet Action/Render call

I have implemented friendly URL in WebSphere Portal 7.0. So lets say I have page with friendly URL "test" and a portlet added to the page. When I hit Portal URL /wps/myportal/test, the page is loaded with no junk characters(no state information). But as soon as I click on any button inside portlet(any action call to Portlet) I see that the junk characters comes back.
Is there a way to keep URL friendly all the time? How can we avoid generating junk characters on portlet action/render calls?
Note:- We have different portlets for different pages and they were developed based on different framework (Spring, Struts, JSR 286 etc)..
in 7.0 by default no, the action url is needed to tell portal what portlet to target. What you could do is use the resourceAction and do everything rest based and avoid the action url, or set up a servlet to handle actions for the portlet and handle urls through that as well in a rest manner.
You could also redirect after the action url back to a friendly url in your portlet code

How to stop the link from redirecting in Kentico CMS when the user log in as admin/CMS editor?

Is it possible / how to stop the link from redirecting in Kentico CMS when the user log in as admin/CMS editor?
If you want to prevent the logging to CMS (from /CMSPages/logon.aspx) you can create a custom login page and redirect user where you want.
Use the Logon Form web part to achive this. In the properties of that web part you can setup Default target URL, which leads users to approporiate page You want

Integerate JSP into Joomla as iframe

I have a Joomla (nginx + mysql) site running as UI and some JSP (tomcat + mysql) handling calculation logic.
I want to integrate JSP pages in to Joomla as iframe. I succeeded doing that, but the question is:
How do I make JSP pages NOT visitable to public but only visitable via Joomla site?
For example,
Joomla site is under mydomain.com/Joomla
JSP pages are under mydomain.com/JSP
When a user visit mydomain.com/JSP in the browser, the user cannot see the JSP page(see error or empty page instead).
But when the user open mydomain.com/Joomla in the browser and go to the page that contains the JSP site within an iframe, the user can see the JSP page there.
I am thinking about changing folder/file owner and permission. Am I on the right track? How should I approach exactly?
Thanks,
Milo
You need to change the way you're currently workin on.
1) Use composent JUMI to create virtual Joomla component based on your scripts.
2) On each page add this code at the very beginning of each of your scripts:
<?php
defined( '_JEXEC' ) or die ('Restricted Access');
?>
It'll prevent users for loading directly your scripts without any active Joomla session.

Programmatically get the url of a page in liferay

I want to create a link in a portlet so that I can navigate to a different page in the liferay portal. I order to do that I am looking for an API (can be liferay specific) that given a page name, would return it's url (it can be the friendlyURL as well).
Portal pages in Liferay are indeed called Layouts in APIs and DB tables. They're identified by plid field, can be obtained using LayoutLocalServiceUtil and related APIs, and also from some other calls like themeDisplay.getLayout().
However in order to build String containing URL to a page you'll have to concatenate friendly URL of portal, group and layout itself (i.e. /web/guest/home - web is portal URL for public pages, guest is friendly URL of guest group by default and home is friendly URL of home page/layout by default). This can be tricky, as you have to check whether this is a public or private page, etc.
And once you start using virtual hosts with friendly URLs for groups, things change. So this is not a good way.
To avoid manually creating URLs and have URLs that are guaranteed to be correct you should use com.liferay.portal.util.PortalUtil.getLayoutFriendlyURL(Layout layout, ThemeDisplay themeDisplay) a static method of PortalUtil - it'll do all the necessary work for you. Though you also need to provide ThemeDisplay and not only Layout.
The API to access pages in Liferay is the LayoutService. However, page names are not unique in Liferay and furthermore they are internationalized. So you need some unique property for a page to retrieve its url, besides its name.
If you really only have the page name, you can use LayoutLocalServiceUtil.getLayouts(...) to loop over all Layouts and check for some property (in this case its name).
At least in Liferay 6.1.20 one can use 'Link Portlet URLs to Page' to make links proceed to antoher page in your portal. It is under ´look and feel´ menu item of your portlet. For me this works fine.
cheers
try this one for current url
${themeDisplay.getURLCurrent()}
try this one for portal url
${themeDisplay.getPortalURL()}

Resources