Hi Jelmer,
I was unable to find any message / forum / wiki in which there is any sample code for client side ipc for asset publisher.
So I tried doing a server side redirect... but was unsuccessful.
The following is my liferay-portlet.xml
The portlet is "abc-quiz" displays the quiz question. Parameter needs to be passed to this portlet.
The portlet "question-admin" is where asset publisher is present.
1<liferay-portlet-app>
2
3 <portlet>
4 <portlet-name>abc-quiz</portlet-name>
5 <icon>/icon.png</icon>
6 <instanceable>true</instanceable>
7 <header-portlet-css>/css/quiz_main.css</header-portlet-css>
8 <footer-portlet-javascript>/js/quiz_main.js</footer-portlet-javascript>
9 </portlet>
10
11 <portlet>
12 <portlet-name>question-admin</portlet-name>
13 <icon>/icon.png</icon>
14 <control-panel-entry-category>content</control-panel-entry-category>
15 <control-panel-entry-weight>1.5</control-panel-entry-weight>
16 <asset-renderer-factory>
17 com.abc.portal.quiz.asset.QuestionAssetRendererFactory
18 </asset-renderer-factory>
19 <instanceable>false</instanceable>
20 <header-portlet-css>/css/question-admin.css</header-portlet-css>
21 <header-portlet-javascript>/js/test.js</header-portlet-javascript>
22 </portlet>
23 .
24 .
25 .
26</liferay-portlet-app>
The class QuestionAssetRenderer does the rendering, with the various getters and setters.
1
2
3
4public class QuestionAssetRenderer extends BaseAssetRenderer
5{
6.
7.
8.
9
10 public String render(RenderRequest request, RenderResponse response, String template) throws Exception
11 {
12 HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request);
13 httpRequest = PortalUtil.getOriginalServletRequest(httpRequest);
14 httpRequest.setAttribute("QUESTION_ID", _question.getQuestionId());
15 PortletURL portletURL = PortletURLFactoryUtil.create(httpRequest ,"abcquiz_WAR_quizportlet_INSTANCE_c9mX", 20701 ,PortletRequest.RENDER_PHASE);
16
17 String path = portletURL.toString();
18 return path ;
19
20 }
21}
I know I've hard-coded a few values for portletURL, but that's for the time being.
The control is still not going to the desired (2nd) portlet.
Can you please advise.
Thanks
Bitte melden Sie sich an, um diesen Inhalt als unangebracht zu kennzeichnen.