Fórum

Getting customized portal preferences instead of default values

Wolfgang Duttlinger, modificado 11 Anos atrás.

Getting customized portal preferences instead of default values

New Member Postagens: 9 Data de Entrada: 30/08/12 Postagens Recentes
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:


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?
thumbnail
Hitoshi Ozawa, modificado 11 Anos atrás.

RE: Getting customized portal preferences instead of default values

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
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 11 Anos atrás.

RE: Getting customized portal preferences instead of default values

New Member Postagens: 9 Data de Entrada: 30/08/12 Postagens Recentes
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