使用Moqui创建自定义组件并使用MoquiConf.xml进行安装

问题描述 投票:0回答:1

我对moqui还是相当陌生,并寻求使用moqui创建自定义组件并使用MoquiConf.xml将应用程序安装到webroot上的帮助。>

我已阅读https://www.moqui.org/MakingAppsWithMoqui-1.0.pdf并创建了教程组件,并使用https://www.moqui.org/MakingAppsWithMoqui-1.0.pdf中的以下部分成功安装了该组件>

在apps.xml文件的subscreens元素下添加subscreens-item元素,如:

 location="component://tutorial/screen/tutorial.xml"/>

但是根据下面Moqui文档的阅读,我的理解->https://www.moqui.org/docs/framework/User+Interface/XML+Screen是我应该能够在我的自定义组件目录中使用MoquiConf.xml-> screen-facade挂载自定义组件,而不必在webroot下的apps.xml中进行更改(我真的很喜欢这个想法)对于#4(Moqui Conf XML文件),您可以将这些元素放在任何已合并到该运行时配置的Moqui Conf XML文件中。执行此操作的主要方法是在组件目录中的MoquiConf.xml文件中,因此配置与屏幕位于同一组件中,并且您无需在其他地方修改和维护文件。在“运行和部署”说明中查看有关Moqui Conf XML选项的更多详细信息。这是来自moqui / example组件中MoquiConf.xml文件的示例:

<screen-facade>
    <screen location="component://webroot/screen/webroot/apps.xml">
        <subscreens-item name="example" menu-title="Example" menu-index="97" 
            location="component://example/screen/ExampleApp.xml"/>
    </screen>
</screen-facade>

但是我无法使它正常工作,我在教程组件中尝试了MoquiConf.xml方法,并且还制作了示例组件的副本,但仍然不高兴,感谢任何指针

[我通过尝试教程项目获得的配置组件/教程/MoquiConf.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!-- No copyright or license for configuration file, details here are not considered a creative work. -->
<moqui-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/moqui-conf-2.1.xsd">
    <screen-facade>
        <screen location="component://webroot/screen/webroot/apps.xml">
            <subscreens-item name="tutorial" menu-title="Tutorial" menu-index="98" location="component://tutorial/screen/tutorial.xml"/>
        </screen>
    </screen-facade>
</moqui-conf>

component / tutorial / screen / tutorial.xml

<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.1.xsd"
        require-authentication="false" include-child-content="true" menu-image="glyphicon glyphicon-wrench" menu-image-type="icon">
    <subscreens default-item="hello">
    </subscreens>
    <widgets>
        <label type="h1" text="Hello world with Sub Screens!"/>
        <subscreens-panel id="hello-app" type="popup"/>
        <subscreens-active/>
    </widgets>
</screen>

component / tutorial / screen / tutorial / hello.xml

<screen>
 <widgets>
     <render-mode>
         <text type="html"
 location="component://tutorial/screen/tutorial/hello.html"/>
     </render-mode>
 </widgets>
</screen>

component / tutorial / screen / tutorial / hello.html

<h1>Hello world! (from the hello.html file)</h1>

使用上面的MoquiConf.xml配置,该Tutorial组件甚至不会在Applications-> AppList(菜单)中显示,但是当我使用base-component / webroot / screen / webroot / apps.xml中的以下更改进行加载时,该Tutorial组件可以工作

<subscreens default-item="AppList">
        <subscreens-item name="tutorial" menu-title="Tutorial"
                 location="component://tutorial/screen/tutorial.xml"/>
    </subscreens>

很确定我缺少配置,因为上面的代码似乎可以在示例,工具和其他组件中正常工作,感谢任何指针

我对moqui还是相当陌生,并寻求使用moqui创建自定义组件并使用我已阅读https://www.moqui.org / ...的MoquiConf.xml将应用程序安装在webroot上的]] >

抱歉,我能够使用在线教程-> David的评论中包含moqui.org/docs/framework/Quick+Tutorial,并成功完成了该教程,谢谢David。

components config screen mount moqui
1个回答
0
投票

抱歉,我能够使用在线教程-> David的评论中包含moqui.org/docs/framework/Quick+Tutorial,并成功完成了该教程,谢谢David。

© www.soinside.com 2019 - 2024. All rights reserved.