Fórum

Reject process action for nested portlet

haroon hussain, modificado 9 Anos atrás.

Reject process action for nested portlet

New Member Postagens: 6 Data de Entrada: 09/01/14 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 6 Data de Entrada: 09/01/14 Postagens Recentes
default resource property is not working
thumbnail
Juan Gonzalez, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 6 Data de Entrada: 09/01/14 Postagens Recentes
there is no list of portlets in whiteList property but only ture is added.
where should i add my portlet
thumbnail
Juan Gonzalez, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 6 Data de Entrada: 09/01/14 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 6 Data de Entrada: 09/01/14 Postagens Recentes
i addeed my portlet id in portal-ext.properties
still not getting " Reject process action"
thumbnail
Juan Gonzalez, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 6 Data de Entrada: 09/01/14 Postagens Recentes
still getting rejection

nothing works to access the action
thumbnail
Tomáš Polešovský, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Liferay Master Postagens: 676 Data de Entrada: 13/02/09 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 21 Data de Entrada: 21/09/12 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 21 Data de Entrada: 21/09/12 Postagens Recentes
I created this issue https://issues.liferay.com/browse/LPS-46371

Best,
Nicolas.
Nicolas Mugnier, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 21 Data de Entrada: 21/09/12 Postagens Recentes
No workaround or tips guys ?
This problem makes me crazy.
Best,
Nicolas.
Nicolas Mugnier, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 21 Data de Entrada: 21/09/12 Postagens Recentes
Get the same error with Liferay 6.2.1 ...
thumbnail
Sergio Romero Zayas, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
I have same problem.

Juan Gonzalez's solution does not work.
thumbnail
Sergio Romero Zayas, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 21 Data de Entrada: 21/09/12 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
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, modificado 9 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 3 Data de Entrada: 29/03/13 Postagens Recentes
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, modificado 8 Anos atrás.

RE: Reject process action for nested portlet

New Member Postagens: 5 Data de Entrada: 27/11/13 Postagens Recentes
http://www.liferay.com/it/community/wiki/-/wiki/Main/Authentication+Token to see more details
thumbnail
Juan Gonzalez, modificado 8 Anos atrás.

RE: Reject process action for nested portlet

Liferay Legend Postagens: 3089 Data de Entrada: 28/10/08 Postagens Recentes
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.