如何以简单的编辑元数据表单显示/隐藏字段

发布于 2024-12-09 12:52:51 字数 1035 浏览 5 评论 0原文

在 share-config-custom.xml 中,我定义了以下内容:

<config evaluator="node-type" condition="zk:document">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="cm:description" force="true" />
<show id="zk:nummer" />
<show id="zk:registratieDatum" />
<show id="zk:zaakType" />
<show id="zk:documentType" />
<show id="zk:vertrouwelijkheid" />
<show id="zk:richting" />
<show id="zk:subject" />
<show id="zk:object" />
<show id="zk:perceel" />
<show id="cm:taggable" for-mode="edit" force="true" />
</field-visibility>
<appearance>
</appearance>
</form>
</forms>
</config>

表单在查看和编辑(完整元数据编辑)中显示良好,但在简单编辑模式下(在 docLibrary --> 编辑元数据)我也得到了许多领域。 我只想在简单模式下显示几个字段,在完整模式下显示完整堆栈。

我怎样才能实现这个目标?例如,简单模式下的 cm:content 仅包含名称、标题和内容。描述和完整模式下的完整堆栈。

重现这个非常简单: - 开始露天 - 添加内容 - 单击编辑元数据(在docLib中),您将看到一个简单的编辑表单 - 点击右上角,您将看到完整的编辑表格

我的问题: - 如何配置简单编辑表单?

谢谢!

In the share-config-custom.xml i've defined the following:

<config evaluator="node-type" condition="zk:document">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="cm:description" force="true" />
<show id="zk:nummer" />
<show id="zk:registratieDatum" />
<show id="zk:zaakType" />
<show id="zk:documentType" />
<show id="zk:vertrouwelijkheid" />
<show id="zk:richting" />
<show id="zk:subject" />
<show id="zk:object" />
<show id="zk:perceel" />
<show id="cm:taggable" for-mode="edit" force="true" />
</field-visibility>
<appearance>
</appearance>
</form>
</forms>
</config>

The form shows fine in View and Edit(full metadata edit), but in simple edit mode (on docLibrary --> edit metadata) I'm getting too many fields.
I want only to show a couple of fields in simple mode and the full stack in full mode.

How can I achieve this? e.g. like the cm:content in simple mode only name, title & description and in Full mode the full stack.

Very simple to reproduce this:
- Start Alfresco
- Add a content
- click on edit-metadata (in docLib), you will see a simple edit form
- click on the upper-right corner, you will see a full edit form

My question:
- How can I configure the simple edit form?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

征棹 2024-12-16 12:52:51

看一下原始的共享表单配置: tomcat/webapps/share/WEB-INF/classes/alfresco/share-form-config.xml

您可以看到简单的元数据对话框有一个单独的表单定义。除了您已经定义的正常表单之外,还可以使用 form id="doclib-simple-metadata" 来设置它。

  <config evaluator="node-type" condition="zk:document">
  <forms>
    <form>.... your full form here....</form>

    <form id="doclib-simple-metadata">
     <field-visibility>
        <show id="cm:name" />
        <show id="cm:title" force="true" />
        <show id="cm:description" force="true" />
        <!-- tags and categories -->
        <show id="cm:taggable" for-mode="edit" force="true" />
        <show id="cm:categories" />
     </field-visibility> 
   </form>
  </forms>
  </config>

Have a look at the original share form config: tomcat/webapps/share/WEB-INF/classes/alfresco/share-form-config.xml

There you can see that the simple metadata dialog has a separate form definition. It can be set by using the form id="doclib-simple-metadata" in addition to the normal form that you already have defined.

  <config evaluator="node-type" condition="zk:document">
  <forms>
    <form>.... your full form here....</form>

    <form id="doclib-simple-metadata">
     <field-visibility>
        <show id="cm:name" />
        <show id="cm:title" force="true" />
        <show id="cm:description" force="true" />
        <!-- tags and categories -->
        <show id="cm:taggable" for-mode="edit" force="true" />
        <show id="cm:categories" />
     </field-visibility> 
   </form>
  </forms>
  </config>
月朦胧 2024-12-16 12:52:51

你需要添加另一个formid(doclib-simple-metadata):

 <form id="doclib-simple-metadata">
        <field-visibility>
           <show id="cm:name" />
           <show id="cm:title" force="true" />
           <show id="cm:description" force="true" />
           <!-- tags and categories -->
           <show id="cm:taggable" for-mode="edit" force="true" />
           <show id="cm:categories" />
        </field-visibility>
        <edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
        <appearance>
           <field id="cm:title">
              <control template="/org/alfresco/components/form/controls/textfield.ftl" />
           </field>
           <field id="cm:description">
              <control>
                 <control-param name="activateLinks">true</control-param>
              </control>
           </field>
           <field id="cm:taggable">
              <control>
                 <control-param name="compactMode">true</control-param>
                 <control-param name="params">aspect=cm:taggable</control-param>
                 <control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
                 <control-param name="createNewItemIcon">tag</control-param>
              </control>
           </field>
           <field id="cm:categories">
              <control>
                 <control-param name="compactMode">true</control-param>
              </control>
           </field>
        </appearance>
     </form>

干杯,jan(@alfrescian)

you need to add another formid (doclib-simple-metadata):

 <form id="doclib-simple-metadata">
        <field-visibility>
           <show id="cm:name" />
           <show id="cm:title" force="true" />
           <show id="cm:description" force="true" />
           <!-- tags and categories -->
           <show id="cm:taggable" for-mode="edit" force="true" />
           <show id="cm:categories" />
        </field-visibility>
        <edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
        <appearance>
           <field id="cm:title">
              <control template="/org/alfresco/components/form/controls/textfield.ftl" />
           </field>
           <field id="cm:description">
              <control>
                 <control-param name="activateLinks">true</control-param>
              </control>
           </field>
           <field id="cm:taggable">
              <control>
                 <control-param name="compactMode">true</control-param>
                 <control-param name="params">aspect=cm:taggable</control-param>
                 <control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
                 <control-param name="createNewItemIcon">tag</control-param>
              </control>
           </field>
           <field id="cm:categories">
              <control>
                 <control-param name="compactMode">true</control-param>
              </control>
           </field>
        </appearance>
     </form>

Cheers, jan (@alfrescian)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文