什么是露天的类型和方面?

编程入门 行业动态 更新时间:2024-10-07 10:12:53
本文介绍了什么是露天的类型和方面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

现在我开始与 alfresco 合作.但不清楚什么是类型和什么是方面?.请举例详细说明.

Right now am started working with alfresco. But am not clear about what is type and whats aspect?. please give in detail with example.

推荐答案

创建时的每个节点都有一个给定的类型,而且只有一种类型,例如文档"或文件夹".另一方面,一个节点可以有很多方面,例如可标记"或/和可版本化".

Each node on creation has a given type, and just one type, like 'document' or 'folder'. On other hand one node can have many aspects, like 'taggable' or/and 'versionable'.

一个节点的节点类型可以随时间变化,但一个节点只有一种类型,方面就像属性附件,你可以在创建时或运行时添加它们.

The node type of a node can change over time, but there is only one type for one node, the aspects are like property attachments, you can add them on creation or in runtime.

Aspects 也可以添加到许多类型的节点中,所以如果你想让你的模型有一个在许多类型中都存在的特殊属性,最好的方法是创建一个方面.然后为了维护你的代码,你只需要维护方面.

Aspects can be also added to many types of nodes, so if you want your model a have special property that will exist in many types, the best way is to create an aspect. Then to maintain your code you only have to maintain the aspect.

当然,您可以在 Alfresco 中创建自己的类型和方面,即自定义内容模型.

Of course you can create your own types and aspects in Alfresco, that is Customizing the content model.

以下是自定义内容模型的示例:

Here is an example of a custom content model:

i:status 是一个自定义方面.

<?xml version="1.0" encoding="UTF-8"?> <model xmlns="www.alfresco/model/dictionary/1.0" name="i:multimediaModel"> <description>Multimedia Model</description> <author>Pedro Costa</author> <version>1.0</version> <imports> <import uri="www.alfresco/model/dictionary/1.0" prefix="d"/> <import uri="www.alfresco/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>

更多推荐

什么是露天的类型和方面?

本文发布于:2023-11-28 11:02:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642137.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:露天   类型

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!