掲示板

How do I add an extra metadata field to Asset Framework?

10年前 に Alexander Ishmuradov によって更新されました。

How do I add an extra metadata field to Asset Framework?

Junior Member 投稿: 48 参加年月日: 13/03/18 最新の投稿
I'm trying to add additional metadata field "Creator" (means creator of document content) as described here: http://issues.liferay.com/browse/LPS-32721
But I faced with the problem: how can I read and write this value? I can store this in additional field using Structures&Templates. But how can I read these values ​​programmatically?

Ideally, I'd like to redefine AssetEntry class to use something like this in asset_metadata.jspf:
	else if (metadataFields[j].equals("creator")) {
		value = LanguageUtil.get(pageContext, "by") + StringPool.SPACE + HtmlUtil.escape(assetEntry.getCreator());
	}


--
Liferay 6.1.1 CE GA2
thumbnail
10年前 に Vilmos Papp によって更新されました。

RE: How do I add an extra metadata field to Asset Framework?

Liferay Master 投稿: 529 参加年月日: 10/10/21 最新の投稿
Hi Alexander,

As far as I can see it's a contributed solution and not commited (at least yet) to the current master branch. So my idea would be to ask this question from the contributor as he should have the whole concept about the working of it.

On the other hand, you could override AssetEntry in Hook or EXT plugin. I'm not sure whether hooks are capable to override the AssetEntry class, but you should check the hook DTD for possible overrides to be sure.

Regards,
Vilmos
10年前 に Alexander Ishmuradov によって更新されました。

RE: How do I add an extra metadata field to Asset Framework?

Junior Member 投稿: 48 参加年月日: 13/03/18 最新の投稿
Hi Vilmos,

Thank you for your response!

I've already found an elegant solution from another developer here: http://www.liferay.com/community/forums/-/message_boards/message/20924860