掲示板

Getting customized portal preferences instead of default values

11年前 に Wolfgang Duttlinger によって更新されました。

Getting customized portal preferences instead of default values

New Member 投稿: 9 参加年月日: 12/08/30 最新の投稿
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
11年前 に Hitoshi Ozawa によって更新されました。

RE: Getting customized portal preferences instead of default values

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
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
11年前 に Wolfgang Duttlinger によって更新されました。

RE: Getting customized portal preferences instead of default values

New Member 投稿: 9 参加年月日: 12/08/30 最新の投稿
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