Asset publisher : list icons should represent document type

thumbnail
M. Garcia, modified 14 Years ago. Regular Member Posts: 107 Join Date: 5/17/11 Recent Posts
Hello,

I was thinking about a trivial improvement of the Asset publisher.

The icon for a document in the asset publisher is always the same (the "paperclip").
Once you click on the document entry, it displays the icon corresponding to the document type.

I think it should be the case from the beginning, thus permitting the user to see what doc type it is from the list.

Should I make a JIRA ticket ? =)
thumbnail
Jorge Ferrer, modified 14 Years ago. Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Hi M. García,

That's a very good idea. It might require extending the Asset Framework (AssetRenderer in particular), but I think that's perfectly fine. Please go ahead and create a JIRA ticket for it. Next paste the link in this thread.

BTW, do you want to give it a try and implement it?
thumbnail
M. Garcia, modified 14 Years ago. Regular Member Posts: 107 Join Date: 5/17/11 Recent Posts
Here's the JIRA ticket : http://issues.liferay.com/browse/LPS-19499.

I'm quite busy lately so I can't give it a try at the moment.
If the issue's still there when I'll have more time then yes, I'll give it a try ;-).

(I potentially have a client which will need it soon, in which case I'll handle this, but it really depends on him ;-) )
thumbnail
Jorge Ferrer, modified 14 Years ago. Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Thanks!

I've added it to the Community Backlog so that other community members know they can also work on it.
thumbnail
M. Garcia, modified 14 Years ago. Regular Member Posts: 107 Join Date: 5/17/11 Recent Posts
Hello,

I managed to do this in an Asset Publisher Display Style hook.

I copied "title_list.jsp" from Asset Publisher display styles.
I modified it so that it uses document type icon.

It's been done in a simple way, because this display style I created is used for asset publisher displaying documents only.

So I think this is a good start, now it's just adding some asset type test (to determine whether it's a document, a web content, etc.) to perform like this only in the case of documents.

Instead of this :
...
			<liferay-ui:icon label="<%= true %>" message="<%= HtmlUtil.escape(title) %>" src="<%= assetRendererFactory.getIconPath(renderRequest) %>" url="<%= viewURL.toString() %>" />
...


Use this :
...
&lt;%
long docPK = assetEntry.getClassPK();
DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.getFileEntry(docPK);
String iconPath = themeDisplay.getPathThemeImages()+"/file_system/small/"+dlFileEntry.getIcon()+".png";
%&gt;

<liferay-ui:icon label="<%= true %>" message="<%= HtmlUtil.escape(title) %>" src="<%= iconPath %>" url="<%= viewURL.toString() %>" />
...



There you go ! =)
thumbnail
Jorge Ferrer, modified 14 Years ago. Liferay Legend Posts: 2871 Join Date: 8/31/06 Recent Posts
Thanks!
thumbnail
Juan Fernández, modified 14 Years ago. Liferay Legend Posts: 1261 Join Date: 10/2/08 Recent Posts
Hi M Garcia!
I have just added this improvement to trunk, so you can be proud your contribution has made its way to Liferay 6.1! emoticon
Now Liferay is a bit more "yours" than before
Thanks a lot for your contribution!
Juan