如何重命名现有的Hybris扩展名 [英] How to rename an existing Hybris extension
问题描述
我正在研究Hybris,并且使用hybris命令(ant extgen)以默认设置生成了一个新扩展名.在扩展生成期间,我没有更改默认值,就像让项目名称为"training"一样.我只是为了尝试而开始开发一些代码,但是现在我写了很多代码,而不是生成一个新的扩展,而是尝试将"training"重命名为一个更适合我的项目的新名称. /p>
我的问题是-是否有任何快捷方式将培训"重命名为新名称.重命名我不是指标准的intellij或eclipse模块重命名,而是要更新所有扩展名特定的属性,这些属性指的是扩展名"training".有任何hybris ant命令吗?
这是我能想到的方式.
您可以将扩展名声明为extgen
的模板,然后基于该扩展名使用新的名称和结构来生成新的扩展名.
让我以training
作为您要转换成其他名称的当前扩展名.以下是您需要执行的步骤.
- 确保您的扩展程序(培训)在 localextensions.xml 中
-
通过添加以下元标记来更新extensioninfo.xml以将扩展标记为模板
<meta key="extgen-template-extension" value="true"/>
看起来像
<coremodule generated="true" manager="org.training.jalo.TrainingManager" packageroot="org.training"/> <meta key="extgen-template-extension" value="true"/> <webmodule jspcompile="false" webroot="/training"/>
-
使用以下属性在培训扩展/文件夹内创建extgen.properties
请注意,如果您当前的扩展名使用其他名称,则在这种情况下进行培训时,您需要相应地更改以下值.
extgen.properties:
YEXTNAME_TOKEN=training
YMODULE_TOKEN=training
YMODULE_PACKAGE_ROOT=training
YMODULE_CLASS_PREFIX=training
YPACKAGE_TOKEN=org.training
YMANAGER_TOKEN=TrainingManager
YCLASSPREFIX_TOKEN=Training
YGENERATED_TOKEN=Generated -
运行 ant extgen ,然后从给定的选择选项中选择扩展程序(培训),并在提示时提供所需的名称和打包方式.
-
现在将培训扩展替换为localextensions.xml中新创建的扩展
-
在需要的地方进行测试和修补! :-)
I am working on Hybris and I generated a new extension using hybris command (ant extgen) with default settings. During extension generation, I did not change default values like I let the project name be "training". I started developing some code just for the sake of trying it but now I wrote quite a lot of code and instead of generating a new extension, I am trying to rename "training" to a new name which is more suitable for my project.
My question is - Is there any shortcut to rename "training" to a new name. By rename I don't mean standard intellij or eclipse module rename but also updating all extension specific properties which are referring to extension name "training". Is there any hybris ant command for it ?
Here is the way I can think of.
You can declare your extension as a template for extgen
and then generate a new extension based on it with a new name and structure.
Let me take training
as your current extension which you want to convert to some other name. Below are the steps you need to perform.
- Make sure your extension (training) is there in the localextensions.xml
Update extensioninfo.xml to mark the extension as a template by adding below meta tag
<meta key="extgen-template-extension" value="true"/>
Look like
<coremodule generated="true" manager="org.training.jalo.TrainingManager" packageroot="org.training"/> <meta key="extgen-template-extension" value="true"/> <webmodule jspcompile="false" webroot="/training"/>
Create an extgen.properties inside training extension/folder with below properties
Please note, If your current extension is with a different name then training in that case you need to change below values accordingly.
extgen.properties:
YEXTNAME_TOKEN=training
YMODULE_TOKEN=training
YMODULE_PACKAGE_ROOT=training
YMODULE_CLASS_PREFIX=training
YPACKAGE_TOKEN=org.training
YMANAGER_TOKEN=TrainingManager
YCLASSPREFIX_TOKEN=Training
YGENERATED_TOKEN=GeneratedRun ant extgen and select your extension (training) from the given selection option and give the name and package the way you want when it prompt for it.
Now replace training extension with the newly created extension inside localextensions.xml
Test and patch wherever needed! :-)
这篇关于如何重命名现有的Hybris扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!