无法更改alfresco共享中的文档类型

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

我有两个关于我创建的自定义内容类型的问题,名为my:whitepaper和my:bc:

当我尝试在文档上更改类型并选择我的:白皮书自定义类型时,它可以工作,但不能用我的:bc。

  • 当我选择我的时候:bc它给我一条错误信息:无法更改文件类型'test.pdf'。

enter image description here

  • 在“管理规则” - >“特殊类型”中,我看不到我的bc类型:enter image description here

'test.pdf'文档的类型是cm:content:enter image description here

这是我的:

定制模型的context.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

    <!-- Registration of new models --> 
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/customModel.xml</value>
            </list>
        </property>
        <property name="labels">
            <list>
                <value>alfresco/extension/custom-model-messages</value>
            </list>
        </property>
    </bean>

</beans>

custom-model-messages.properties:

type.my_whitepaper= piece Comptable
type.my_whitepaper.title= piece Comptable
type.my_whitepaper.property.my_product= Ecriture Comptable

type.my_bc=bc
type.my_bc.title=bc

customModel.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!-- Definition of new Model -->

<!-- The important part here is the name - Note: the use of the my: namespace 
    which is defined further on in the document -->
<model name="my:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

    <!-- Optional meta-data about the model -->
    <description>Example Custom Model</description>
    <author>Alfresco Documentation Team</author>
    <version>1.0</version>

    <!-- Imports are required to allow references to definitions in other models -->
    <imports>
        <!-- Import Alfresco Dictionary Definitions -->
        <import uri="http://www.alfresco.org/model/dictionary/1.0"
            prefix="d" />
        <!-- Import Alfresco Content Domain Model Definitions -->
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
    </imports>

    <!-- Introduction of new namespaces defined by this model -->
    <!-- NOTE: The following namespace my.new.model should be changed to reflect 
        your own namespace -->
    <namespaces>
        <namespace uri="http://www.mycompany.com/model/content/1.0" prefix="my" />
    </namespaces>



    <types>
        <!-- Enterprise-wide generic document type -->
        <type name="my:doc">
            <title>MyCompany Generic Document</title>
            <parent>cm:content</parent>

        </type>


        <type name="my:marketingDoc">
            <title>MyCompany Marketing Document</title>
            <parent>my:doc</parent>
            <properties>
                <property name="my:product">
                    <title>écriture comptable</title>
                    <type>d:text</type>
                </property>
                <property name="cm:author">
                    <title>auteur</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>
        <type name="my:bc">
            <title>Bon de commande</title>
            <parent>my:marketingDoc</parent>

        </type>
        <type name="my:whitepaper">
            <title>une piece Comptable</title>
            <parent>my:marketingDoc</parent>
        </type>


    </types>
</model> 

共享配置,custom.xml:

     <types>
         <type name="cm:content">
            <subtype name="smf:smartFolderTemplate" />
            <subtype name="my:whitepaper" />
            <subtype name="my:bc" />
         </type>

         <type name="cm:folder">
         </type>

         <type name="trx:transferTarget">
            <subtype name="trx:fileTransferTarget" />
         </type>

      </types>

   <!-- custom content comptable -->
   <config evaluator="model-type" condition="my:whitepaper">
        <forms>
            <form>
                <field-visibility>
                    <show id="cm:name" />
                    <show id="my:product" />
               <show id="cm:author" />
                    <show id="cm:title" force="true" />
                    <show id="cm:description" force="true" />
             <!--   <show id="my:relatedDocuments" />-->
                </field-visibility>
            </form>
        </forms>
    </config>


    <config evaluator="node-type" condition="my:whitepaper">
        <forms>
            <form>
                <field-visibility>
                    <show id="cm:name" />
                    <show id="my:product" />
               <show id="cm:author" />
                    <show id="cm:title" force="true" />
                    <show id="cm:description" force="true" />
          <!--     <show id="my:relatedDocuments" /> -->
                </field-visibility>
            </form>
        </forms>
    </config>

<!-- custom Bon commande -->

   <config evaluator="model-type" condition="my:bc">
      <forms>
         <form>
            <field-visibility>
               <show id="cm:name" />
               <show id="my:product" />
               <show id="cm:author" />
               <show id="cm:title" force="true" />
               <show id="cm:description" force="true" />
             <!--   <show id="my:relatedDocuments" />-->
            </field-visibility>
         </form>
      </forms>
   </config>


   <config evaluator="node-type" condition="my:bc">
      <forms>
         <form>
            <field-visibility>
               <show id="cm:name" />
               <show id="my:product" />
               <show id="cm:author" />
               <show id="cm:title" force="true" />
               <show id="cm:description" force="true" />
          <!--     <show id="my:relatedDocuments" /> -->
            </field-visibility>
         </form>
      </forms>
   </config>

日志:

  • 日志:alfresco.log和catalina.out不显示任何内容。
  • 浏览器的开发者工具显示了这一点:

enter image description here

alfresco alfresco-share
1个回答
1
投票

我无法在使用SDK 3.0.1生成的项目中重现此问题,将所有默认值(Repo 5.2.f / Share 5.2.e)与您的内容模型和共享配置一起使用。我可以将cm:content对象更改为my:bc对象。配置规则时,我可以在Specialize Type操作中选择您的自定义类型,请参阅下面的屏幕截图:Specialize Type action allows your custom types

因此,要么您在配置中添加了一些其他内容,这些内容未包含在上述代码段中,或者您尚未正确部署自定义项。

您可能希望引导新项目并按原样放入文件,然后使用嵌入式Tomcat运行它,以确保您可以更改类型并成功配置规则。然后,您可以比较该项目中的内容与原始项目中的内容,以查看出错的位置。

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