Relationship between aspects and properties
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2007 07:40 PM
Hello,
Can someone explain the difference - and the relationships - between Aspects and Properties?
I understand that both are used to customize the metadata associated to content in the Alfresco repository.
So, let's say that I want to classify all my documents, in a given Space, with two additional metadata "fields"… like "Customer ID" and "Customer Name".
Both metadata should be visible in the Web Client, so users will be able to enter the value of the fields as required.
To do this, is it required to create a new Aspect with two Properties?
Can someone explain the difference - and the relationships - between Aspects and Properties?
I understand that both are used to customize the metadata associated to content in the Alfresco repository.
So, let's say that I want to classify all my documents, in a given Space, with two additional metadata "fields"… like "Customer ID" and "Customer Name".
Both metadata should be visible in the Web Client, so users will be able to enter the value of the fields as required.
To do this, is it required to create a new Aspect with two Properties?
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2007 03:08 AM
Correct. This is the right way to apply custom fields to different content types (orders, offers, etc.).
Without a CustomerRelated aspect you should add the same fields to each content type. And this should be avoided like the plague :lol:
Without a CustomerRelated aspect you should add the same fields to each content type. And this should be avoided like the plague :lol:
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2007 03:47 AM
Ok, cool.
Now, two other related questions:
1) Is it possible - for instance in a JavaScript - to define a Property (and store values in it) without having defined an Aspect that "owns" the property?
2) Is it possible to define new custom Aspects (and hence new cstom Properties) via API, or the only way to do this is to manually edit the customModel.xml and web-client-config-custom.xml files?
3) How do you control and define the list of "content types"?
I know these questions may seem a bit silly, but I'm a newbie…
Now, two other related questions:
1) Is it possible - for instance in a JavaScript - to define a Property (and store values in it) without having defined an Aspect that "owns" the property?
2) Is it possible to define new custom Aspects (and hence new cstom Properties) via API, or the only way to do this is to manually edit the customModel.xml and web-client-config-custom.xml files?
3) How do you control and define the list of "content types"?
I know these questions may seem a bit silly, but I'm a newbie…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2007 06:31 AM
1) You don't need to "define" ad-hoc properties, you can add values with any QName you like to a node. It is best to define the properties you want in models as they you can add constraints and they can be displayed in the web-client etc. I would only use ad-hoc properties for storing hidden data etc.
2) You need to manually edit the files yes. We have recently added the ability (in 2.2 dev code) to change models and config without restarting the server.
3) The same model and config files as 2).
Thanks,
Kevin
2) You need to manually edit the files yes. We have recently added the ability (in 2.2 dev code) to change models and config without restarting the server.
3) The same model and config files as 2).
Thanks,
Kevin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2007 05:14 PM
1) You don't need to "define" ad-hoc properties, you can add values with any QName you like to a node. It is best to define the properties you want in models as they you can add constraints and they can be displayed in the web-client etc. I would only use ad-hoc properties for storing hidden data etc.
Ok, thanks.
So if I understand well, up to version 2.1 Properties can be added dynamically to any node (document or folder) by using Java or JavaScript, while Aspects and Content Types must be defined by editing configuration files.
Another question (but I guess that I already know the answer)… can a certain Property name be repeated in two different aspects?
The scenario is:
Aspect "CustomerOrder" has properties called "OrderDate" and "OrderNumber".
Aspect "SupplierOrder should have properties with identical names.
Can this be done, or it is necessary to use different names ("CustOrderDate", "CustOrderNumber", "SuppOrderDate", "SuppOrderNumber")?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2007 09:45 PM
It is entirely possible for two aspects to have the same property name if they have different name spaces.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2007 09:47 PM
1) You don't need to "define" ad-hoc properties, you can add values with any QName you like to a node. It is best to define the properties you want in models as they you can add constraints and they can be displayed in the web-client etc. I would only use ad-hoc properties for storing hidden data etc.
Kevin, I know that you CAN do this but would you want to? Isn't this akin to black metadata (where sneaky programmers stick data in a file after the end of file marker)? When would this be a good practice?