1

Based on my previous question, I want to specify a part of it which I strongly believe can be a good guide to solve my problem, since the answer to the whole question is probably composed of many parts.

When I define an "association" in an "aspect" (or a type) in Alfresco Content Model, what is actually the "target class"? Could it be another aspect? When I want to associate two aspects as two tables in a regular Database, how this can be done? How can I define the properties in the second aspect? Could someone provide an example of associating two aspects? If the purpose of the association is not that which serves my above requirement, then what does it actually serves?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
arjacsoh
  • 8,932
  • 28
  • 106
  • 166

1 Answers1

1

When you define an association, its target should be a node type. So node1 is associated to node2 somehow. That node is a valid node (aspect is just a set of properties/assocs over that node2).

Aspect is not a node type, it is merely a few more properties. You can add aspects to types, you can even define mandatory-aspects in type definition. But I think you want to associate node to node.

Now, you want to define an aspect that would be a table in another database? As in, not Alfresco? I believe the proper use case here should be that those tables get a dedicated type, not an aspect.

See what you can read from here and ask more questions on this.

In the mean time, it would help if you clarify a bit what is it that you want to do exactly?

Zlatko
  • 18,936
  • 14
  • 70
  • 123
  • I have to create an aspect (that is the demand based on the project architecture) which must "contain" two other aspects which hold some properties as well. I perceived it as defining associations between them as we do in the common relational databases. I can see though from your link that Aspects cannot contain associations, that is a feature, which belongs exclusively to Types. Am I right? Should I resign from the approach of creating a "large" Aspect? – arjacsoh Mar 22 '13 at 13:05
  • The target type of an association has to be a type, its possible to use an aspect as source of an association. – billerby Mar 22 '13 at 13:10
  • @arjacsoh No, you can create associations even within aspects. example http://pastebin.com/BVLhtzJQ – Zlatko Mar 22 '13 at 13:14
  • Now, you have the create the "aspect"? Is that a technical demand or a functional? Because if it's a functional request, you'll achieve it by having your own doc type. Additionally, aspects can have other aspects as parents, so if you chain them and use the endleaf as your targeted aspect, you'll have all the props from all three available. Because I'm pretty positive that technically you can't add an aspect to an aspect in Alfresco. You can only apply aspects to nodes (which all have their type). – Zlatko Mar 22 '13 at 13:18
  • @zladuric: Ok, what you state is pretty positive. My real problem is presented on http://stackoverflow.com/questions/15567171/create-an-aspect-in-alfresco-content-model. The answer seems satisfactory. Could I change the "Type" with an "Aspect" without the functionality being affected? Have you another suggestion on modifying the xml file provided in the answer, so as it to be done with an "Aspect"? Using an Aspect is a functional demand. – arjacsoh Mar 22 '13 at 13:24
  • Yes, you can change the to element. – Zlatko Mar 25 '13 at 13:04