[opencms-dev] Identifying siblings programmatically

Carl Alex Friis Nielsen cfn at kb.dk
Mon Apr 20 09:32:42 CEST 2009


You should be aware that in OpenCms all siblings are equal - none of them are considered more original than others, so if a resource has a sibling it is itself a sibling.
Examining id's is irrelevant, so just return the value of R.getSiblingCount() > 1

Cheers,

Carl

-----Oprindelig meddelelse-----
Fra: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] På vegne af Ludwig Hunecke
Sendt: 17. april 2009 18:46
Til: The OpenCms mailing list
Emne: [opencms-dev] Identifying siblings programmatically

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi mailing-list,

I've got a question about how to identify siblings programmatically.

Since there is no method like "isSibling()" in CmsResource, I  
currently identify if a resource R is a sibling with the following  
rules:

1. R.getSiblingCount() > 1 AND
2. R.structureId does _not_ equal R.resourceId

Do you think this is always valid?


Thanks a lot and have a nice weekend,
Ludwig

- --
Ludwig Hunecke
Kramerst. 18
D-38122 Braunschweig
Tel.: +49 (151) 14818950
GnuPG Key-ID: 8CEAB267



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iEYEARECAAYFAknosmoACgkQ3Nhv0YzqsmclGgCg4qOnsIbkcLksBUfW145YFqI0
NOcAoOv5YwguZOH3LMf6sN0dU+EAA/He
=UNYO
-----END PGP SIGNATURE-----

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list