Foros de discusión
Getting customized portal preferences instead of default values
Wolfgang Duttlinger, modificado hace 11 años.
Getting customized portal preferences instead of default values
New Member Mensajes: 9 Fecha de incorporación: 30/08/12 Mensajes recientes
Hey there,
In the control panel under portal seetings -> authentication -> cas i made some configuration.
In a custom portlet i need to have access to these preferences I made in the control panel. I tried following code:
This code returns the default values of the properties instead of my configured preferences. Does anyone know how to get my customized values?
In the control panel under portal seetings -> authentication -> cas i made some configuration.
In a custom portlet i need to have access to these preferences I made in the control panel. I tried following code:
import java.io.IOException;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import com.liferay.util.bridges.mvc.MVCPortlet;
import com.liferay.portal.kernel.util.PrefsPropsUtil;
public class eClinicalLogin extends MVCPortlet {
@Override
public void doView(RenderRequest renderRequest,
RenderResponse renderResponse) throws IOException, PortletException {
try {
renderRequest.setAttribute("casServerUrl", PrefsPropsUtil.getString("cas.server.url"));
renderRequest.setAttribute("casServiceUrl", PrefsPropsUtil.getString("cas.service.url"));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
super.doView(renderRequest, renderResponse);
}
}
This code returns the default values of the properties instead of my configured preferences. Does anyone know how to get my customized values?
Hitoshi Ozawa, modificado hace 11 años.
RE: Getting customized portal preferences instead of default values
Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
I haven't checked for CAS settings but portal preferences are usually accessed by PortalPreferencesLocalServiceUtil http://docs.liferay.com/portal/6.1/javadocs/com/liferay/portal/service/PortalPreferencesLocalServiceUtil.html
Wolfgang Duttlinger, modificado hace 11 años.
RE: Getting customized portal preferences instead of default values
New Member Mensajes: 9 Fecha de incorporación: 30/08/12 Mensajes recientes
Thanks for your answer.
Actually i use Version 6.0.5 and it seems like PortalPreferencesLocalServiceUtil doesn't exist there.
I found a PortletPreferencesLocalServiceUtil, which doesn't seem to be the right one, too.
Do you have any further advice?
Best regards, Wolfgang
Actually i use Version 6.0.5 and it seems like PortalPreferencesLocalServiceUtil doesn't exist there.
I found a PortletPreferencesLocalServiceUtil, which doesn't seem to be the right one, too.
Do you have any further advice?
Best regards, Wolfgang