Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
M. Garcia
Asset publisher : list icons should represent document type
July 25, 2011 2:54 AM
Answer

M. Garcia

Rank: Regular Member

Posts: 107

Join Date: May 17, 2011

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 ? =)
Jorge Ferrer
RE: Asset publisher : list icons should represent document type
August 2, 2011 12:11 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2768

Join Date: August 31, 2006

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?
M. Garcia
RE: Asset publisher : list icons should represent document type
August 2, 2011 1:45 AM
Answer

M. Garcia

Rank: Regular Member

Posts: 107

Join Date: May 17, 2011

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 ;-) )
Jorge Ferrer
RE: Asset publisher : list icons should represent document type
August 2, 2011 10:40 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2768

Join Date: August 31, 2006

Recent Posts

Thanks!

I've added it to the Community Backlog so that other community members know they can also work on it.
M. Garcia
RE: Asset publisher : list icons should represent document type
August 3, 2011 2:42 AM
Answer

M. Garcia

Rank: Regular Member

Posts: 107

Join Date: May 17, 2011

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 :
1...
2            <liferay-ui:icon
3                label="<%= true %>"
4                message="<%= HtmlUtil.escape(title) %>"
5                src="<%= assetRendererFactory.getIconPath(renderRequest) %>"
6                url="<%= viewURL.toString() %>"
7            />
8...


Use this :
 1...
 2<%
 3long docPK = assetEntry.getClassPK();
 4DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.getFileEntry(docPK);
 5String iconPath = themeDisplay.getPathThemeImages()+"/file_system/small/"+dlFileEntry.getIcon()+".png";
 6%>
 7
 8<liferay-ui:icon
 9                label="<%= true %>"
10                message="<%= HtmlUtil.escape(title) %>"
11                src="<%= iconPath %>"
12                url="<%= viewURL.toString() %>"
13            />
14...



There you go ! =)
Jorge Ferrer
RE: Asset publisher : list icons should represent document type
September 2, 2011 4:44 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2768

Join Date: August 31, 2006

Recent Posts

Thanks!
Juan Fernández
RE: Asset publisher : list icons should represent document type
September 8, 2011 12:09 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1262

Join Date: October 2, 2008

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