cancel
Showing results for 
Search instead for 
Did you mean: 

References, Predicates, Nodes and the like

mwildam
Champ in-the-making
Champ in-the-making
Hi,

while struggling with the API I do encounter a lot of different objects/classes that basically seem to be very similar (or invented for similar reasons). There is for example:
  • Reference

  • Predicate

  • Node
I looked at http://wiki.alfresco.com/wiki/Web_Service_Data_Types and all I interpret from that is that Predicate is the more generalized class that also includes a reference to a query rather than just to a single document - is my interpretation correct?

Is this a historical thing that there are different classes for the similar thing?

I do further not really understand why certain methods can handle predicates and other "just" references. Why - for example - can't I specify a single reference when creating an association from document A to document B. It wants a Predicate there.

Maybe, somebody can clear my view a little?
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
A predicate is a group of references.

A reference is available only in the Web Services API and it is a node reference that you can instance using a UUID or a Path, that's why you have some optional arguments in the constructor of the Reference object.

A node is a node reference, but using Web Services API you will work only using references and/or a predicate to invoke methods, because it is useful to use a predicate of nodes.

I do further not really understand why certain methods can handle predicates and other "just" references. Why - for example - can't I specify a single reference when creating an association from document A to document B. It wants a Predicate there.
Yes, because in this way you can associate one or many nodes to that parent node.

Hope this helps.