Невозможно изменить тип документа в общедоступной папке - PullRequest
0 голосов
/ 10 апреля 2019

У меня есть два вопроса о двух пользовательских типах контента, которые я создал под названием my: whitepaper и my: bc:

Когда я пытаюсь изменить тип документа и выбираю свой: whitepaper нестандартный тип, он работает, но не с моим: 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

1 Ответ

1 голос
/ 17 апреля 2019

Я не могу воспроизвести эту проблему в проекте, созданном с помощью SDK 3.0.1, принимая все значения по умолчанию (Repo 5.2.f / Share 5.2.e) с вашей моделью содержимого и конфигурацией Share. Я могу изменить объекты cm: content на объекты my: bc. При настройке правил я могу выбрать ваши пользовательские типы в действии Specialize Type, см. Скриншот ниже: Specialize Type action allows your custom types.

Итак, либо у вас есть другие материалы, добавленные в вашу конфигурацию, которые не были включены в приведенные выше фрагменты, либо вы неправильно развернули свои настройки.

Возможно, вы захотите загрузить новый проект и добавить файлы, как я, а затем запустить его со встроенным Tomcat, чтобы убедиться, что вы можете изменить типы и успешно настроить правила. Затем вы можете сравнить то, что есть в этом проекте, с тем, что есть в вашем первоначальном проекте, чтобы увидеть, где вы ошиблись.

...