Foren

Portlet Version Information

thumbnail
Brett Lewinski, geändert vor 11 Jahren.

Portlet Version Information

Junior Member Beiträge: 54 Beitrittsdatum: 04.05.11 Neueste Beiträge
Hello -

Wondering if anyone has seen this before. We have developed a few custom hooks and portlets. In each of these we add a version and a build number to the Implementation-Version attribute in the MANIFEST.MF file for inclusion in the war. This information is showing up in the Control Panel -> Update Manager (under the Installed Version column) for some of the custom plugins, for others it either doesn't update or simple displays 6.0.12 and we want this to be displayed here. It appears as if this is not updated or not read or something, I can't put my finger on it. Has anyone out there seen this before? If so any info would be much appreciated.

Thanks in advance!
Brett
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Portlet Version Information

Liferay Legend Beiträge: 14918 Beitrittsdatum: 02.09.06 Neueste Beiträge
I thought the version was supposed to come from the liferay-plugin-package.properties file, not from some value in the manifest of a jar...
thumbnail
Brett Lewinski, geändert vor 11 Jahren.

RE: Portlet Version Information

Junior Member Beiträge: 54 Beitrittsdatum: 04.05.11 Neueste Beiträge
It is coming from the MANIFEST.MF in the war not a jar file. For some of our portlets (wars) we do not have a liferay-plugin-package.properties and the info in the MANIFEST.MF is displaying fine in the Update Manager.
thumbnail
Brett Lewinski, geändert vor 11 Jahren.

RE: Portlet Version Information

Junior Member Beiträge: 54 Beitrittsdatum: 04.05.11 Neueste Beiträge
Here is an update on our findings. Turns out if the portlet (war) has a liferay-plugin-package.properties file the version information will be read from there. If the liferay-plugin-package.properties file doesn't exist (in our case it didn't) it is read from the MANIFEST.MF file. For our particular issues it turns out that an administrator re-packaged the war before it was deployed thus creating a new MANIFEST.MF file without the version information. That issue is solved for us.

I do have a follow up question though. If we decide to go the liferay-plugin-package.properties route vs using the MANIFEST.MF file what attribute needs to get set so that our version info (1.0.1 Build 1234) is displayed on the Update Manager page under the Installed Version column?

Any info would be appreciated.

Thanks
Brett
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: Portlet Version Information

Liferay Legend Beiträge: 14918 Beitrittsdatum: 02.09.06 Neueste Beiträge
It's the "module-incremental-version" key, and you can use any string you want there.

Note that the liferay-plugin-package.properties file can be used for a couple of better things than just versioning:

1. For required deployment contexts, the IDE will include the service jar from the given project. This is extremely useful for using services defined in another plugin. Liferay will also not load the plugin until the other ones (the required ones) have been successfully loaded, helping to ensure that you get some control over portlet startup order.

2. For the portal dependency jars, you can leave the jar out of your own WEB-INF/lib directory if it is available in the portal. This is great because it can really slim down your WAR deployment artifact. At deployment time, Liferay will pull the portal dependency jar and add it automagically to your exploded WAR's WEB-INF/lib directory. This can also be used to ensure that your plugins have the same version(s) of the jars as the portal and you don't have a mix of different versions used across different plugins.
thumbnail
Brett Lewinski, geändert vor 11 Jahren.

RE: Portlet Version Information

Junior Member Beiträge: 54 Beitrittsdatum: 04.05.11 Neueste Beiträge
David -

Thanks for the info, we will definitely investigate the advantages of doing things this way. From time to time we come across issues regarding shared jars and jars used across multiple portlets etc. This may have the potential to help us, I do need to look into it further though.

On another note I updated the module-incremental-version key with version 1.0 Build 1288 and on the Control Panel -> Update Manager it is still showing 6.0.12 not the 1.0 Build 1288 as we desire.

Any ideas of why it may not be picking it up, I uninstalled and reinstalled the hook with no difference.

thanks again, your help is very much appreciated.

Brett
thumbnail
Riccardo Rotondo, geändert vor 10 Jahren.

RE: Portlet Version Information

Junior Member Beiträge: 29 Beitrittsdatum: 11.06.10 Neueste Beiträge
Hi to all,

is there any way to show the portlet version in a jsp page?

Looking around I found this object:


<%@page import="com.liferay.portal.model.Portlet"%>
<%@page import="com.liferay.portal.service.PortletLocalServiceUtil"%>
<%@include file="../init.jsp" %>

<portlet:defineobjects />

&lt;%
Portlet dataPortlet = 
        PortletLocalServiceUtil.getPortletById("DataPortlet_WAR_einfrsrvportlet");
%&gt;

but then I don't find any method for Portlet object to the get the portlet version.

Any hint?

Cheers,
Riccardo
thumbnail
Brett Lewinski, geändert vor 10 Jahren.

RE: Portlet Version Information

Junior Member Beiträge: 54 Beitrittsdatum: 04.05.11 Neueste Beiträge
Riccardo -

Not sure about how to get it in a jsp page, that wasn't our requirement. All we needed to do was display it in the Control Panel on the Update Manager. We accomplished this by using the MANIFEST.MF for our custom portlets.

If you find the answer to your query I'd be interested in hearing what it is.

Brett