Мне нужно создать модель, как таблицы SQL на свежем воздухе

Мне нужно создать модель для городов, которая содержит только поля id, название города, например таблицу sql, но без создания файла, который не наследует какую-либо модель Alfresco (содержимое, папка и т. Д.). Я могу это сделать? или обязательно наследовать от моделей Alfresco

3 ответа

Решение

Посмотрев определение sys:base (корневой объект):

<type name="sys:base">
  <title>Base</title>
  <mandatory-aspects>
    <aspect>sys:referenceable</aspect>
    <aspect>sys:localized</aspect>
  </mandatory-aspects>
</type>

Я бы сказал, что можно создать тип, не наследуя что-либо.

Но лучшим вариантом будет попытка.

В любом случае вы можете наследовать от sys:base.

Вы можете использовать такого рода данные, чтобы добиться этого.

<description>Cities Data List Content model</description>
<version>1.0</version>

<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"/>
    <!-- Import Alfresco Data List Model Definitions -->
    <import uri="http://www.alfresco.org/model/datalist/1.0"   prefix="dl" />
</imports>


<namespaces>
    <namespace uri="<<Your uri>>" prefix="cities"/>
</namespaces>

<types>
    <!--
        Data List Item Type for the custom cities list
        -->
    <type name="cities:cityListItem">
        <title>Cities List Item</title>
        <parent>dl:dataListItem</parent>
        <properties>
            <property name="cities:cityName">
                <type>d:text</type>
                <mandatory>true</mandatory>
            </property>
            <property name="cities:cityID">
                <type>d:int</type>
                <mandatory>true</mandatory>
            </property>
            <property name="cities:cityDescription">
                <type>d:text</type>
            </property>

        </properties>

    </type>
</types>

Позже вы можете добавить дополнительные настройки, связанные с этим списком данных, как вы можете увидеть здесь: https://docs.alfresco.com/5.1/references/dev-extension-points-data-lists.html

Я бы предложил использовать AttributeService.

http://docs.alfresco.com/5.2/references/dev-services-attribute.html

Другие вопросы по тегам