如何为 STORE 的每个新工件创建自定义资产属性.hbs? [英] How to create a custom asset-attributes.hbs for each new artifact for the STORE?

查看:15
本文介绍了如何为 STORE 的每个新工件创建自定义资产属性.hbs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WSO2 Governance Registry 5.2.0.

Im using WSO2 Governance Registry 5.2.0.

当我创建一个新的工件类型时,它包含许多新字段(您在 CARBON ADMIN CONSOLE 中创建和定义此 XML).因此,在 PUBLISHER 中,您可以看到新字段、创建和查阅工件的新项目.

When I create a new artifact type, it containt a lot of new fields (You create and define this XML in the CARBON ADMIN CONSOLE). So in the PUBLISHER you can see the new fields, create and consult a new item of the artifact.

但问题出在商店中,我看不到这个新字段.所以为了做到这一点,我通过修改使自定义字段可用GREG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/app/greg-store-defaults/themes/store/partials/asset-attributes.hbs 文件.感谢 Malintha 的博客

But the problem is in the STORE, I cannot see the this new fields. So in order to do this, I made the custom fields available by modifying GREG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/app/greg-store-defaults/themes/store/partials/asset-attributes.hbs file. Thanks to Malintha's Blog,

这也许是一个答案,但如果我必须为每个工件编辑文件以添加字段,情况会变得更糟,随着时间的推移,编辑这个文件会变得更糟......

This is perhaps an answer, but it will get much worse if for each artifact I have to edit the file to add the fields, editing this file will get a lot worse over the time...

所以我的问题是:有没有办法为我创建的每个新工件创建自定义主题(*.hbs 等)?

So my question is: Is there a way to create a custom theme (*.hbs, etc) for each new artifact I create?

谢谢!

推荐答案

据我了解,您在项目的开发阶段必须创建注册表扩展(RXT)并在 G-Reg Store 中显示数据.据我所知,没有简单的动态方法可以做到这一点,要么你必须扩展默认的 hbs 文件.就像您使用 Malintha 的博客一样.如果要进行细微更改,这没关系,但这不是推荐的方式,因为如果需要迁移,例如迁移到所有新的 WSO2 G-Reg 5.3.0 如果您在 G-Reg 5.2.0 中更新了开箱即用的文件,您可能会遇到很多麻烦,因此我建议您编写资产扩展(GREG_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets) 用于您要介绍的每个 rxt.有很多博客文章可以帮助您.

As far as I understand your in the development phase of the project that you have to create registry extensions(RXTs) and showing up the data in G-Reg Store. As far as I know there is no easy dynamic way that you can do this, either you have to extend the default hbs files. Like you have done using Malintha's blog. This is okay if there is a minor change to be done, However this is not the recommended way because if there is a migration to do such as moving to all new WSO2 G-Reg 5.3.0 you might face lot of trouble if you updated the out of the box files in G-Reg 5.2.0, Therefore I suggest you to write asset extensions(GREG_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets) for each and every rxt that you are going to introduce. There is plenty of blog posts that can help you.

请找到以下博客文章列表(如果我发现了,我会更新列表).

  1. 添加新的资产类型

如何查看json有效载荷发送到 GREG 5.1.0 中的 Store UI

如何扩展资产商店在 WSO2 GREG 5.1.0 中查看

WSO2GREG-5.2.0- 将扩展写入复制更多神器存储中的元数据

覆盖GREG的默认外观" -5.3.0

注意:

  • 5.1.0和5.2.0没有太大区别.(5.2.0更稳定)

  • There is no much difference between 5.1.0 and 5.2.0.(5.2.0 is more stable)

你可以通过简单地扩展restservice.rxt和相关的资产扩展(GREG_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets/restservice)来开始(学习)创建一个新的扩展,我更喜欢你使用 这篇 博文并从那里开始.

You can start(learn) creating a new extension by simply extending restservice.rxt and the relevant asset extension(GREG_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets/restservice), I prefer you to use this blog post and start from there.

如果有很多开发工作要做,我希望您从 他们是官方门户,如果不是,您可以始终坚持使用 stackoverflow.

If there is a lot of development to be done I prefer you to seek help from WSO2 experts from they're official portal, if not you can always stick to stackoverflow.

这篇关于如何为 STORE 的每个新工件创建自定义资产属性.hbs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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