Liferay 7 Eclipse IDE覆盖默认类别行为 [英] Liferay 7 Eclipse IDE override default categories behaviour

查看:141
本文介绍了Liferay 7 Eclipse IDE覆盖默认类别行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个Portlet来更改Liferay 7中的默认类别行为/界面.
我的目标是复制 assetcategory 表,展开和更改其列,并使用此新表作为Liferay后端中类别的参考.

因此,我的portlet必须更新三个关键点:

I need to create a portlet in order to change the default category behaviour/interface in Liferay 7.
My objective is to duplicate assetcategory table, expand and change its columns, and use this new table as a reference for categories within Liferay backend.

Therefore there are three key points my portlet has to update:

  1. 用于在其上创建/更新类别表的类别组织UI D B.我可以创建一个新的Liferay模块项目( panel-app 模板),该项目可以从侧面菜单显示UI后端界面并与数据库进行交互.
  2. 在网页内容中
  3. 覆盖默认的 类别选择 面板 属性面板(元数据>类别选择).我可以创建一个新的 Liferay模块项目片段以覆盖 com.liferay.asset.categories.selector.web ,但是我注意到我可以 仅选择一个文件路径(例如 META-INF/resources/view.jsp )
  4. 覆盖默认的资产发布者过滤器行为,以允许 我的自定义类别选择.我尚未对此进行调查 点.
  1. The category organization UI to create/update category tables on DB. I’m able to create a new Liferay module project (panel-app template) which can present the UI backend interface from the side menu and interact with the DB.
  2. Override default category selection panel within web content properties panel (metadata > category select). I can create a new Liferay module project fragment to override the com.liferay.asset.categories.selector.web, however I’ve noticed I can select only one file path (eg. META-INF/resources/view.jsp)
  3. Override default asset publisher filter behaviour in order to allow my custom categories selection. I’ve not yet investigated this point.

我目前停留在第2点,因为在创建了新的Liferay模块项目片段之后,将目标Host OSGI Bundle设置为 com.liferay.asset.categories.selector.web (我相信是正确的文件,如果不是,请纠正我),然后将覆盖的文件选择为 META-INF/resources/view.jsp ,我无法继续重绘类别选择界面.

这是我的尝试:

I’m currently stuck at point 2 because after creating a new Liferay module project fragment, set the target Host OSGI Bundle to com.liferay.asset.categories.selector.web (which I believe is the correct one, please correct me if it isn't) and selecting the overridden files as META-INF/resources/view.jsp, I can’t proceed to redraw the category selection interface.

Here my attempts:

  1. 更新代码 view.jsp (例如,添加一些文本字符串)我可以正确地进行 在portlet中看到它们.
  2. 删除/注释 view.jsp 中的所有代码,将显示错误: 资产类别选择器暂时不可用
  3. 选择所有三个可在主文件中覆盖的文件 Portlet向导( META-INF/resources/view.jsp init.jsp init-ext.jsp )和更新 view.jsp (如第一个示例) 发生在portlet中
  1. Updating the code view.jsp (eg. adding some text string) I can correctly see them in the portlet.
  2. Removing/commenting all the code in view.jsp an error is shown: Asset category selector is temporarily unavailable
  3. Selecting all three files available to be overridden in the main portlet wizard (META-INF/resources/view.jsp, init.jsp and init-ext.jsp) and updating view.jsp (like the first example) nothing happen in the portlet

下面的一些屏幕截图:

案例1

案例2

案例3

推荐答案

我需要创建一个Portlet来更改默认类别 Liferay 7中的行为/界面 assetcategory表,展开和更改其列,然后使用此新 表格作为Liferay后端中类别的参考.

I need to create a portlet in order to change the default category behaviour/interface in Liferay 7. My objective is to duplicate assetcategory table, expand and change its columns, and use this new table as a reference for categories within Liferay backend.

仅此一项听起来是一项艰巨的任务,比stackoverflow问题中的任务还大.

Just this alone sounds like a humongous task, bigger than what would fit into a stackoverflow question.

AssetCategories用于每种单一的内容类型,例如WebContent,Blog文章,留言板帖子,Wiki页面,知识库文章等.通过您自己的实现替换如此重要的组件将安全地破坏您的下一次升级体验,因为在那里您将不得不再次进行此操作,从而带来了代码,以在下一个版本中进行任何更改.并且此升级"包括安全补丁.

AssetCategories are used in every single content type, e.g. WebContent, Blog Articles, Message Board Posts, Wiki Pages, Knowledgebase Articles etc.. Replacing such a vital component by your own implementation is something that will safely ruin your next upgrade experience, because there you'd have to do this again, bringing your code to whatever changes will be made in the next version. And this "upgrade" includes Security Patches.

总的来说,您的前提听起来像一个 xy问题,而我宁愿建议您退出预期的解决方案,并寻找其他选项来满足您的业务需求.当然有一些.

Overall, your premise sounds to me like a x-y problem and I'd rather recommend that you step back from your intended solution and look for other options to meet your business requirements. There surely are some.

我的建议:与其添加一个非常重要的通用组件,不如将其添加到平台中,而是以特定于业务的方式重新实现它.如果您需要不同于Asset Publisher提供的筛选条件:构建您自己的Asset Publisher,并在此处实施特定于业务的规则.或者,再考虑以不同于当前组织内容的方式组织内容.

My recommendation: Rather add something to the platform than ripping out a very central and generic component, reimplementing it in a business-specific manner. If you need a different filtering than Asset Publisher provides: Build your own Asset Publisher and implement the business specific rules there. Or think again about organizing your content in a different way than you currently organize it.

除非您已经是Liferay Core Developer,并要求您提供有关如何更改下一个版本的实现的提示.但是您的问题历史记录看起来不太像.

Unless you're already a Liferay Core Developer and are asking for a hint on how to change the implementation for the next version. But your question history here doesn't look like it.

这篇关于Liferay 7 Eclipse IDE覆盖默认类别行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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