Alfrescoのタイプとアスペクトとは何ですか?
-
28-09-2019 - |
質問
現在、Alfrescoで働き始めました。しかし、タイプとどのような側面とは何ですか?例で詳しく説明してください。
解決
作成に関する各ノードには、特定のタイプがあり、「ドキュメント」や「フォルダー」などの1つのタイプのみがあります。一方、1つのノードには、「タグ」などの多くの側面があります。 または 「バージョン可能」。
ノードタイプのノードは時間とともに変更できますが、1つのノードには1つのタイプしかありません。アスペクトはプロパティアタッチメントのようなもので、作成またはランタイムで追加できます。
アスペクトも多くのタイプのノードに追加することができるため、モデルAが必要な場合は、多くのタイプに存在する特別なプロパティを持っている場合、最良の方法はアスペクトを作成することです。次に、コードを維持するには、アスペクトを維持するだけです。
もちろん、コンテンツモデルをカスタマイズするAlfrescoで独自のタイプとアスペクトを作成できます。
カスタムコンテンツモデルの例は次のとおりです。
I:ステータスはカスタムアスペクトです。
<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="http://www.alfresco.org/model/dictionary/1.0" name="i:multimediaModel">
<description>Multimedia Model</description>
<author>Pedro Costa</author>
<version>1.0</version>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<namespaces>
<namespace uri="pt.i.model" prefix="i"/>
</namespaces>
<constraints>
<constraint name="i:status_constraint" type="LIST">
<parameter name="allowedValues">
<list>
<value>Draft</value>
<value>Pending</value>
<value>Current</value>
<value>Archived</value>
</list>
</parameter>
</constraint>
</constraints>
<types>
<type name="i:multimedia">
<title>Multimedia Metadata Model</title>
<parent>cm:content</parent>
<archive>true</archive>
<properties>
<property name="i:insertDate">
<title>Multimedia insert date</title>
<description>
Multimedia insert date can be diferent of the
insert date in alfresco, this apllies to multimedia
created before database migration to alfresco
</description>
<type>d:datetime</type>
<mandatory>false</mandatory>
</property>
<property name="i:multimediaFormat">
<title>Multimedia Format</title>
<description>Multimedia Format, file type</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="i:contentLength">
<title>Content Length</title>
<description>The file size in bytes</description>
<type>d:long</type>
<mandatory>false</mandatory>
</property>
<property name="i:copyright">
<title>Copyright</title>
<description>Copyright</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
<mandatory-aspects>
<aspect>cm:taggable</aspect>
<aspect>cm:auditable</aspect>
<aspect>i:status</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="i:status">
<title>Multimedia Status</title>
<properties>
<property name="i:status">
<title>Status</title>
<type>d:text</type>
<default>Draft</default>
<constraints>
<constraint ref="i:status_constraint" />
</constraints>
</property>
</properties>
</aspect>
</aspects>
</model>
他のヒント
長い答えも便利ですが、より短い答えを作成しようとします。
ご存知のように、モデルはリポジトリに保存するデータの「タイプ」を定義します。したがって、タイプは、保存するオブジェクトの形式です。名前、タイトル、デフォルトモデルの説明、「myType:anlight」、 "mytype:date"などのプロパティとともに、カスタムモデルで類似しています。したがって、Alfrescoの各ドキュメントは特定のタイプです(「ユーザー」タイプ、「フォルダー」タイプ、デフォルトモデルの「コンテンツ」タイプ)。
アスペクト - それは、追加のプロパティセットとして最もよく説明されるものです。
したがって、「請求書」というタイプがある場合があります。金額、期日、受取人などのプロパティがあります。
ただし、ベンダー名やベンダーアカウント番号などの追加データを使用して、「ベンダー」という側面を持つこともできます。
そのため、請求書にアスペクトを追加できます。ベンダー名などのプロパティを請求書に追加することができます。ただし、この側面を「フォルダー」またはAlfrescoのスペースに追加することもできます。たとえば、ベンダーや契約、またはその他のドキュメントのスペースを確保できます。 "。