为资产发布者portlet添加定制过滤器? [英] Adding custom filter for asset publisher portlet?

查看:107
本文介绍了为资产发布者portlet添加定制过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们创建了带有自定义属性的新模板和结构,用于提交Web内容.该结构具有一些列表属性,例如:

We have created a new template and structure with custom attributes for submitting web content. The structure has few list attributes like:

<dynamic-element name='size' type='list' index-type='' repeatable='false'>
<meta-data>…</meta-data>
<dynamic-element name='Less_than_5_000' type='Less_than_5_000' index-type=''     repeatable='false'>  </dynamic-element>
<dynamic-element name='5_000_to_10_000_employees' type='5_000_to_10_000_employees' index-type='' repeatable='false'> </dynamic-element>
<dynamic-element name='10_000_to_20_000_employess' type='10_000_to_20_000_employess' index-type='' repeatable='false'></dynamic-element>
</dynamic-element>
<dynamic-element name='location' type='list' index-type='' repeatable='false'>
<meta-data>…</meta-data>
<dynamic-element name='Central_West' type='Central_West' index-type='' repeatable='false'>  </dynamic-element>
<dynamic-element name='South' type='South' index-type='' repeatable='false'>      </dynamic-element>

为了显示这些内容,我正在使用Asset-publisher,类别导航和标签Portlet.这要求在发布内容时创建和分配类别.资产发布者Portlet提供了根据类别过滤内容的功能,并且不支持基于自定义属性(如上述结构中定义的自定义属性)的过滤. 有没有一种方法可以使用资产发布者根据结构中定义的自定义属性显示内容? 例如我们可以– 一种.显示员工少于5000"的所有内容? b.是否显示员工少于5000"且位置为南部"的所有内容?

To display these contents I am using Asset-publisher, category navigation and tags portlet. This requires categories creation and assignment when content is published. The Asset publisher portlet provides capability to filter content on the basis of categories and does not support filtering based on custom attributes like one defined in structure above. Is there a way to display content based on custom attributed defined in structure using asset publisher? For example can we – a. Display all contents where employees are "Less than 5000"? b. Display all contents where employees are "Less than 5000" and Location is "South"?

推荐答案

例如,我完全不了解您要使用该结构做什么.恕我直言,类型"Less_than_5_000"显示出对结构的一些错误理解:而是有一个"companySize"字段,可能作为选项列表.

I completely don't understand what you're trying to do with that structure, e.g. the type "Less_than_5_000" IMHO shows some wrong understanding of structures: Rather have a field "companySize", maybe as an option list.

如果您需要更多有关查找内容的指示,请参见

If you need more pointers on finding your content, there's a nice blog post on how to use the Templates to interface with Liferay's API, also you might want to think about automatically tagging/categorizing your content based on some criteria - e.g. by overriding the Web Content Services: Whenever an article is stored you could run your own code and categorize the article automatically in order to use the stock AssetPublisher.

当然,您也可以自定义AssetPublisher或提供一个完全符合您想要的功能的portlet:使其尽可能简单以满足您的需求.应该是小号&利用Liferay的API,易于维护的portlet可以过滤您需要的文章.

Also, of course, you could customize AssetPublisher or provide a simple portlet that does exactly what you want: Make it as simple as possible to meet exactly your needs. Should be a small & easy to maintain portlet that filters the articles you need, utilizing Liferay's API.

这篇关于为资产发布者portlet添加定制过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆