[4.0.1] Intuitive Relationships (Feature Request)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[4.0.1] Intuitive Relationships (Feature Request)

Nathan Keiter
I'm working on an internal application that utilizes 31 Content Types and 50 Relationships.


As I enumerate the relationship names in my OSGI plugin config file I am realizing that these could be intuitively absorbed by the core API.


[cid:7ba21624-3fd5-4358-8e60-6e1b3ab8b4e0]


[cid:8df13951-2ac5-4654-99fa-43ddd88827f6]


Instead of Map<Relationship, List<Contentlet>>


Simply a single List<Contentlet> could be used to contain all of the related content of various types.


Then somewhere in the core business logic it would just do a contentlet.getStructure() on the current contentlet and each contentlet in the list. (Sorting the list on structure name or id would probably be a good idea here.)


It could then dynamically create both possible "parent-child" names and search to see if one of them exists as a relationship. (Try to fetch from relationship cache.)


For example "A-B" and "B-A".


Relationship relationship = CacheLocator.getRelationshipCache.getRelationshipByName(

"A-B" ) != null ?

CacheLocator.getRelationshipCache.getRelationshipByName( "A-B" ) :

CacheLocator.getRelationshipCache.getRelationshipByName( "B-A" );


if ( relationship != null )

{

    // continue processing, set this as the Relationship between these two contentlets.

}


Whichever one exists (I don't think it's possible for both to exist) would then be the relationship to use.


In this way the "Relationship" could be intuitively discovered and we wouldn't have to enumerate every single relationship and pre-fetch them from cache and create very tedious manual maps of type Map<Relationship, List<Contentlet>> for each defined relationship of the content type.


Nathan I. Keiter | Lead Network Applications Programmer | Administrative Advisory Council Member | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1504034122688.43921%40gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

Screen Shot 2017-08-29 at 2.44.11 PM.png (560K) Download Attachment
Screen Shot 2017-08-29 at 2.58.05 PM.png (291K) Download Attachment