留言板

Reject process action for nested portlet

haroon hussain,修改在9 年前。

Reject process action for nested portlet

New Member 帖子: 6 加入日期: 14-1-9 最近的帖子
my style portlet is working fine as stand alone portlet
but when i embbed it in another portlet in it gives ( Reject process action for http://localhost:8080/web/guest/app on heliumstyle_WAR_heliumstyleportlet)
on all actions like render,process action
thumbnail
Jitendra Rajput,修改在9 年前。

RE: Reject process action for nested portlet

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
Set <add-default-resource>true</add-default-resource> in liferay-portlet.xml and then try .

Here is the description for add-default-resource tag from dtd.

<!--
If the add-default-resource value is set to false and the portlet does not
belong to the page but has been dynamically added, then the user will not have
permissions to view the portlet. If the add-default-resource value is set to
true, the default portlet resources and permissions are added to the page, and
the user can then view the portlet. This is useful (and necessary) for portlets
that need to be dynamically added to a page. However, to prevent security loop
holes, the default value is false.

The properties "portlet.add.default.resource.check.enabled" and
"portlet.add.default.resource.check.whitelist" in portal.properties allow
security checks to be configured around this behavior.
-->
<!ELEMENT add-default-resource (#PCDATA)>


HTH,
Jitendra
http://itsliferay.blogspot.in/
haroon hussain,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 6 加入日期: 14-1-9 最近的帖子
default resource property is not working
thumbnail
Juan Gonzalez,修改在9 年前。

RE: Reject process action for nested portlet

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Hi Haroon,

did you added your portlet to the add default resource whitelist?

portlet.add.default.resource.check.whitelist


in portal-ext.properties?

See this for the default values in 6.2.1 (you should add your portlet name after the other ones):

https://github.com/liferay/liferay-portal/blob/6.2.1-ga2/portal-impl/src/portal.properties#L545
haroon hussain,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 6 加入日期: 14-1-9 最近的帖子
there is no list of portlets in whiteList property but only ture is added.
where should i add my portlet
thumbnail
Juan Gonzalez,修改在9 年前。

RE: Reject process action for nested portlet

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Sorry, I don't understand your question.

You should add your portlet in that property just after the default portlet names (the ones in the link I've posted).
haroon hussain,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 6 加入日期: 14-1-9 最近的帖子
they define portlet ids in it. but when i try to get my portlet id it give me string id ( heliumstyle_WAR_heliumdataportlet ) , not an integer id
thumbnail
Juan Gonzalez,修改在9 年前。

RE: Reject process action for nested portlet

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
haroon hussain:
they define portlet ids in it. but when i try to get my portlet id it give me string id ( heliumstyle_WAR_heliumdataportlet ) , not an integer id


It doesn't have to be an integer. That's your portlet name.
haroon hussain,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 6 加入日期: 14-1-9 最近的帖子
i addeed my portlet id in portal-ext.properties
still not getting " Reject process action"
thumbnail
Juan Gonzalez,修改在9 年前。

RE: Reject process action for nested portlet

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
haroon hussain:
still not getting " Reject process action"


Still getting or not getting that error?

If the latter try to add add-default-resource in liferay-portlet.xml, as someone told you before.
haroon hussain,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 6 加入日期: 14-1-9 最近的帖子
still getting rejection

nothing works to access the action
thumbnail
Tomáš Polešovský,修改在9 年前。

RE: Reject process action for nested portlet

Liferay Master 帖子: 676 加入日期: 09-2-13 最近的帖子
Hi,

please can you provide:
1, what LR version do you use?
2, stacktrace of the rejecting exception
3, source code of how you embed the portlet into another portlet?

Thanks!
Nicolas Mugnier,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 21 加入日期: 12-9-21 最近的帖子
Tomáš Polešovský:
Hi,

please can you provide:
1, what LR version do you use?
2, stacktrace of the rejecting exception
3, source code of how you embed the portlet into another portlet?

Thanks!


Hello,

I'm also getting the error "Reject process action for ...". Error occurs when I call an ajax function in my nested portlet
I added the add-default-resource to true and the portlet ID to portlet.add.default.resource.check.whitelist.
But still does not work emoticon

1: liferay-portal-tomcat-6.2-ce-ga2-20140319114139101

2: 12:53:26,101 WARN [http-bio-8081-exec-11][SecurityPortletContainerWrapper:623] Reject process action for http://localhost:8081/web/guest/wizard on xxxxxxx_WAR_xxx

3:

	public static String renderPortlet(final PortletRequest request, final PortletResponse response,
			final String portletId, final String queryString) throws SystemException, IOException, ServletException,
			ValidatorException, PortletContainerException {
		// Get servlet request / response
		HttpServletRequest servletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
				.getHttpServletRequest(request));
		HttpServletResponse servletResponse = PortalUtil.getHttpServletResponse(response);
		// Get theme display
		final ThemeDisplay themeDisplay = (ThemeDisplay) servletRequest.getAttribute(WebKeys.THEME_DISPLAY);
		// Backup current state
		PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
		PortletDisplay portletDisplayClone = new PortletDisplay();
		portletDisplay.copyTo(portletDisplayClone);
		final Map<string, object> requestAttributeBackup = new HashMap<string, object>();
		for (final String key : Collections.list((Enumeration<string>) servletRequest.getAttributeNames())) {
			requestAttributeBackup.put(key, servletRequest.getAttribute(key));
		}
		// Render the portlet as a runtime portlet
		String result = "";
		try {
			com.liferay.portal.model.Portlet portlet = PortletLocalServiceUtil.getPortletById(
					PortalUtil.getCompanyId(request), portletId);
			portlet.setRenderWeight(0);
			servletRequest.setAttribute(WebKeys.RENDER_PORTLET_RESOURCE, Boolean.TRUE);
			String columnId = null;
			Integer columnPos = null;
			Integer columnCount = null;
			try {
				themeDisplay.setAjax(true);
				String ajaxId = request.getParameter("ajax_id");
				if (ajaxId != null) {
					servletResponse.setHeader("Ajax-ID", ajaxId);
				}
				servletRequest = PortletContainerUtil.setupOptionalRenderParameters(
						servletRequest, null, columnId, columnPos, columnCount);
				PortletContainerUtil.render(servletRequest, servletResponse, portlet);
//				StringBundler _result = render(portlet, columnId, columnCount, columnPos, servletRequest, servletResponse);
//				result = _result.toString(true);
				
			} catch (Exception e) {
				LOGGER.error("Cannot render the embedded portlet", e);
			}
		} finally {
			// Restore the state
			portletDisplay.copyFrom(portletDisplayClone);
			portletDisplayClone.recycle();
			for (final String key : Collections.list((Enumeration<string>) servletRequest.getAttributeNames())) {
				if (!requestAttributeBackup.containsKey(key)) {
					servletRequest.removeAttribute(key);
				}
			}
			for (final Map.Entry<string, object> entry : requestAttributeBackup.entrySet()) {
				servletRequest.setAttribute(entry.getKey(), entry.getValue());
			}
		}
		return result;
	}
</string,></string></string></string,></string,>


Best,
Nicolas.
Nicolas Mugnier,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 21 加入日期: 12-9-21 最近的帖子
I created this issue https://issues.liferay.com/browse/LPS-46371

Best,
Nicolas.
Nicolas Mugnier,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 21 加入日期: 12-9-21 最近的帖子
No workaround or tips guys ?
This problem makes me crazy.
Best,
Nicolas.
Nicolas Mugnier,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 21 加入日期: 12-9-21 最近的帖子
Get the same error with Liferay 6.2.1 ...
thumbnail
Sergio Romero Zayas,修改在9 年前。

RE: Reject process action for nested portlet

Regular Member 帖子: 151 加入日期: 08-4-14 最近的帖子
I have same problem.

Juan Gonzalez's solution does not work.
thumbnail
Sergio Romero Zayas,修改在9 年前。

RE: Reject process action for nested portlet

Regular Member 帖子: 151 加入日期: 08-4-14 最近的帖子
I try the solution Juan. But that does not work.

I get the same error.

.... [SecurityPortletContainerWrapper:623] Reject process action for http://....


My idea is to use FriendlyURL (routes) to access an action from the URL.

Any idea or workaround to solve the problem?

Need Help please!! emoticon
Nicolas Mugnier,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 21 加入日期: 12-9-21 最近的帖子
Sergio Romero Zayas:
I try the solution Juan. But that does not work.

I get the same error.

.... [SecurityPortletContainerWrapper:623] Reject process action for http://....


My idea is to use FriendlyURL (routes) to access an action from the URL.

Any idea or workaround to solve the problem?

Need Help please!! emoticon


Hi Sergio,

I managed to embed the portlet as follows:


		try {
			com.liferay.portal.model.Portlet portlet = PortletLocalServiceUtil.getPortletById(
					PortalUtil.getCompanyId(request), portletId);
			portlet.setRenderWeight(0);
			servletRequest.setAttribute(WebKeys.RENDER_PORTLET_RESOURCE, Boolean.TRUE);
			String columnId = null;
			Integer columnPos = null;
			Integer columnCount = null;
			try {
				String path = "/html/portal/load_render_portlet.jsp";
				servletRequest = PortletContainerUtil.setupOptionalRenderParameters(
						servletRequest, path, columnId, columnPos, columnCount);
				PortletContainerUtil.render(servletRequest, servletResponse, portlet);
			} catch (Exception e) {
				LOGGER.error("Cannot render the embedded portlet", e);
			}


The render path is very important !

I hope this help you.

Nicolas.
thumbnail
Sergio Romero Zayas,修改在9 年前。

RE: Reject process action for nested portlet

Regular Member 帖子: 151 加入日期: 08-4-14 最近的帖子
My error log, and your error are the same. But the origin of the problem is not.

I want to execute an action, but not from a form. I want to execute an action from a URL. FriendlyURL I use and why I have this error.

Thanks for your answer. But I'm not in the same problem.
marius salomeia,修改在9 年前。

RE: Reject process action for nested portlet

New Member 帖子: 3 加入日期: 13-3-29 最近的帖子
I had the same problem when trying to execute the portlet action using an ajax call. I solved it adding my portlet to the portlet whitelist using following portal-ext.property:
auth.token.ignore.portlets
Nicola Baiocco,修改在8 年前。

RE: Reject process action for nested portlet

New Member 帖子: 5 加入日期: 13-11-27 最近的帖子
http://www.liferay.com/it/community/wiki/-/wiki/Main/Authentication+Token to see more details
thumbnail
Juan Gonzalez,修改在8 年前。

RE: Reject process action for nested portlet

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Hi everyone,

I think your issue is now fixed under https://issues.liferay.com/browse/LPS-56769 and will be available as part of 6.2 GA5.