what is type and aspect in 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.

Answers


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 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.

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 is a custom aspect.

<?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>

Need Your Help

How do you copy from a rectangular source region to a non-rectangular/non-paralellogram destination region in .NET?

c# .net graphics

I know how to use the DrawImage() method of the Graphics object to copy from a rectangular source region to a rectangular destination region, and how to copy to a paralellogram region defined by a

Correct way to expose a cancellable Task API

c# task-parallel-library async-await

If I want to expose an API which internally Schedules a sequence of Tasks that should be cancellable by the user.

Specializing groups of functions for generic types

c++ c++11 template-specialization sfinae enable-if

The fallowing code works with gcc 4.7. The idea is i have these generic functions, which work on sequences, pointers, tupples, pairs, user-defined types, and whatnot. If one of these functions is d...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.