我需要在露天创建一个像 sql table 这样的模型

I need to create a model like a sql table on alfresco

我需要为仅包含字段 ID、城市名称的城市创建一个模型,例如 sql table 但不创建不继承任何 Alfresco 模型的文件(内容,文件夹等)。我能做到吗?或者必须继承 Alfresco 模型

通过查看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