Forums de discussion

Refresh asset publisher

thumbnail
Soukaina HAJI, modifié il y a 9 années.

Refresh asset publisher

Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
Hello,
I need to refresh the asset publisher every 2minutes instead of refreshing the page every time ..

Liferay-version : liferay-portal-6.2-ce-ga2
Tomcat : tomcat-7.0.42

thank you
thumbnail
Pankaj Kathiriya, modifié il y a 9 années.

RE: Refresh asset publisher (Réponse)

Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
Using setInterval javascript method and Liferay.Portlet.refresh("#p_p_id<portlet:namespace/>"), you can achieve that.

For Example:

function refreshPortlet(){
Liferay.Portlet.refresh("#p_p_id_19_");
setInterval(refreshPortlet, 10000);
}
refreshPortlet();

above code will refresh Message board portlet every 10 seconds.

Hope this will help.
thumbnail
Soukaina HAJI, modifié il y a 9 années.

RE: Refresh asset publisher

Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
Ok thank you, but where should I put this function ?
thumbnail
Pankaj Kathiriya, modifié il y a 9 années.

RE: Refresh asset publisher

Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
There are many options available to you.
You may add this javascript to page-level, under Site Pages > Edit page > add javascript to Javascript tab.
Or you may add javascript in theme component.

You have to check for feasibility of it.
thumbnail
Soukaina HAJI, modifié il y a 9 années.

RE: Refresh asset publisher

Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
I put it in the java script field but still not working !
thumbnail
Pankaj Kathiriya, modifié il y a 9 années.

RE: Refresh asset publisher

Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
You can place js code in jsp of asset-publisher-portlet by overriding it with hook.
thumbnail
Soukaina HAJI, modifié il y a 9 années.

RE: Refresh asset publisher

Regular Member Publications: 195 Date d'inscription: 17/06/14 Publications récentes
Step1 : Go to "Admin" > "site administration" > "Private pages" >
Step1 2 : Insert the following script in Javascript" in the right side:

function refreshPortlet(){
          Liferay.Portlet.refresh('.portlet-asset-publisher');
setInterval(refreshPortlet, 300000); 
}
refreshPortlet();