Forums de discussion
Refresh portlet ( asset publisher )
Soukaina HAJI, modifié il y a 9 années.
Refresh portlet ( asset publisher )
Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
Hello
I need to refresh a portlet (asset publisher ) every 5 minutes
Liferay 6.2 ce ga2
Thank you
I need to refresh a portlet (asset publisher ) every 5 minutes
Liferay 6.2 ce ga2
Thank you
David H Nebinger, modifié il y a 9 années.
RE: Refresh portlet ( asset publisher )
Liferay Legend Publications: 14917 Date d'inscription: 02/09/06 Publications récentes
javascript.
Soukaina HAJI, modifié il y a 9 années.
RE: Refresh portlet ( asset publisher )
Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
I know It would be some script in javascript or alloyUi ...
I think I found this file add_asset_redirect.jsp which contain the script to refresh the portlet :
So I inserted a timer in there but it doesnt work :
thank you
I think I found this file add_asset_redirect.jsp which contain the script to refresh the portlet :
<%
String redirect = request.getParameter("redirect");
redirect = PortalUtil.escapeRedirect(redirect);
Portlet selPortlet = PortletLocalServiceUtil.getPortletById(company.getCompanyId(), portletDisplay.getId());
%>
<aui:script use="aui-base">
Liferay.fire(
'closeWindow',
{
id: '<portlet:namespace />editAsset',
portletAjaxable: <%= selPortlet.isAjaxable() %>,
<c:choose>
<c:when test="<%= redirect != null %>">
redirect: '<%= HtmlUtil.escapeJS(redirect) %>'
</c:when>
<c:otherwise>
refresh: '<%= portletDisplay.getId() %>'
</c:otherwise>
</c:choose>
}
);
</aui:script>
So I inserted a timer in there but it doesnt work :
<%
String redirect = request.getParameter("redirect");
redirect = PortalUtil.escapeRedirect(redirect);
Portlet selPortlet = PortletLocalServiceUtil.getPortletById(company.getCompanyId(), portletDisplay.getId());
%>
<aui:script use="aui-base">
YUI().use("console", "console-filters", "substitute", "node-event-simulate",
function(Y) {
var doSomething = function(e) {
id: '<portlet:namespace />editAsset',
portletAjaxable: <%= selPortlet.isAjaxable() %>,
<c:choose>
<c:when test="<%= redirect != null %>">
redirect: '<%= HtmlUtil.escapeJS(redirect) %>'
</c:when>
<c:otherwise>
refresh: '<%= portletDisplay.getId() %>'
</c:otherwise>
</c:choose>
}
};
IntervalId = setInterval(doSomething, 1000);
});
</aui:script>
thank you
David H Nebinger, modifié il y a 9 années.
RE: Refresh portlet ( asset publisher )
Liferay Legend Publications: 14917 Date d'inscription: 02/09/06 Publications récentes
have you set a breakpoint inside of the script to see if the timer's working? And why throw YUI into the mix, I think you should stick with AUI.
Soukaina HAJI, modifié il y a 9 années.
RE: Refresh portlet ( asset publisher )
Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
The solution:
Step1 : Go to "Admin" > "site administration" > "Private pages" >
Step 2 : Insert the following script in Javascript" in the right side:
Hope it helps
Step1 : Go to "Admin" > "site administration" > "Private pages" >
Step 2 : Insert the following script in Javascript" in the right side:
function refreshPortlet(){
Liferay.Portlet.refresh('.portlet-asset-publisher');
setInterval(refreshPortlet, 300000);
}
refreshPortlet();
Hope it helps