【问题标题】:Alfresco share UI form for custom model用于自定义模型的 Alfresco 共享 UI 表单
【发布时间】:2016-12-27 19:26:10
【问题描述】:

我使用的是 Alfresco one 5.1 企业版。我使用 Alfresco 中的模型管理器创建了一个自定义内容模型,它具有一些与之关联的自定义属性(ds:prority、ds:action、ds:actionText、ds:linkURL 等)。我想自定义共享 UI 以将这些自定义属性与默认的 cm:content 属性(cm:content、cm:description、cm:title 等)一起包含。我指的是 Jeff Potts 在ecmarchitect 上的帖子,以使用自定义模型并共享 UI 自定义。

现在我的问题是,我可以使用在 Alfresco 模型管理器中创建的模型并创建自定义共享表单以及这些自定义属性。此过程的所有示例我都看到在 Alfresco repo AMP 中完成内容模型定义,然后在 Alfresco 共享 amp 中完成共享表单自定义。我可以单独创建共享 AMP(用于我的共享 UI 自定义)并仍然参考我已经在 Alfresco 模型管理器中创建的模型吗?

【问题讨论】:

    标签: alfresco alfresco-share


    【解决方案1】:

    您可以使用模型控制台列出创建和部署的模型。

    http://IP:Port/alfresco/s/enterprise/admin/admin-repoconsole

    命令:show models

    如果您能够看到您的模型的加载 (isLoaded) 状态为“是”,那么您可以部署在共享放大器上应该没问题。 您是否在开发机器或生产机器中创建了此模型? 如果是开发机器,则需要 Repo amp 将模型部署到生产机器中。

    ##
    ##  Model Admin Commands
    ##
    
    ok> show models
    
        Show deployed models - that are stored in the repository data dictionary.
    
    ok> deploy model 
    
        Upload model to repository and load into runtime data dictionary. This will also
        set the repository model as active. 
    
        If a model is already deployed then it will be updated and re-deployed.
    
        e.g. deploy model alfresco/extension/exampleModel.xml
    
    ok> undeploy model 
    
        Permanently delete model from repository (all versions) and unload from runtime data dictionary.
    
        e.g. undeploy model exampleModel.xml
    
    ok> activate model 
    
        Set repository model to active and load into runtime data dictionary.
    
        e.g. activate model exampleModel.xml
    
    ok> deactivate model 
    
        Set repository model to inactive and unload from runtime data dictionary. 
    
        e.g. deactivate model exampleModel.xml
    

    当您使用的是企业版时,您还可以与 Alfresco 支持人员取得联系。

    希望对你有所帮助。

    【讨论】:

    • 感谢@Muralidharan 的更新。您提供的 admin-console repo URL 没有解决问题。我必须使用localhost:8080/alfresco/service/admin/admin-repoconsole,是的,我的模型已经部署在 Prod 和 dev 中使用。所以是的,我有一个
    • localhost:8080/alfresco 在此处导航,您应该能够获得 Repo 控制台的正确 url。
    • 我没有收到您的询问。 “如果是开发机器,你需要 Repo amp 将模型部署到生产机器中。”该模型已经在开发和生产中使用。我尝试使用所有 3 种表单的配置(默认,doclib-simple-metadata 和 doclib-inline-edit)部署共享放大器。我更新了 doclib-inline-edit 表单的配置,因为当我选择“在 Alfresco 中编辑”时需要查看属性,但我没有看到使用字段更新的表单。请注意,我的内容已更新为模型类型
    • 你能发布共享配置文件吗?
    • 我用我的答案更新了我的帖子。配置条件的问题。我之前给出了 cm:content 并没有反映这些字段。有一次,当我将类型更改为我的模型时,它开始反映字段
    【解决方案2】:

    正如 Murali 所指出的,一旦模型处于活动状态,我们就可以按照 Jeff Potts 教程中指出的那样创建共享 AMP,使用 maven 目标(mvn 包)创建共享放大器存档并部署与 alfresco amps_share 文件夹 (/alfresco_one/amps_share) 相同,然后使用 /bin/apply_amps.sh 中的 apply_amps.sh 命令应用相同的内容,然后重新启动 alfresco。

    注意我的要求,我需要自定义属性成为仅共享的内联编辑屏幕的一部分。所以我添加了

    <config evaluator="node-type" condition="<my model>">
    ...
       <form id="doclib-inline-edit">
       ...
       <show id="my:property" force="true" /> 
       ...
    ...
    </config>
    

    最初我在条件评估器中有 cm:content 并且它不起作用。只有在将其更新为我的型号名称后,它才开始反映更改。

    注意:如果不重新启动 Alfresco,更改不会反映。

    【讨论】:

    • 是的,应用 amps 后,您需要重新启动 tomcat 以反映更改。
    猜你喜欢
    • 2015-08-22
    • 1970-01-01
    • 1970-01-01
    • 2021-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    相关资源
    最近更新 更多