From the RQL point of view RedDot CMS handle lists and contains very similar. Therefore I implemented the common functionality into the superclass MultiLink.
You can get a multi link on a page directly. See some examples regarding multi link handling on a page.
Page currentPg = project.getPageById(“4711”);
MultiLink multiLink = currentPg.getMultiLink(“multiLinkTemplateElementName”);
List multiLinks = currentPg.getMultiLinks();
boolean includeReferences = false;
List<MultiLink> multiLinks2 = currentPg.getMultiLinks(includeReferences);
List<MultiLink> linksToThisPage = currentPg.getMultiLinksToThisPage();
MultiLink mainMultiLink = currentPg.getMainMultiLink();
The first block let you get a multi link which is element of page currentPg. The second block will return multi links which reside on other pages. Please refer to javadoc for class Page and search for MultiLink on doc page.
After you know how to get a multi link I want to explain some of the functionality. The following methods can be called on instances of List and Container in the same way.
A multi link offers methods from the following areas:
- create and connect a page (5 methods)
- connect to an existing page (4 methods)
- move child pages from and to other multi links (not a standard method in RedDot CMS, but often needed) (10 methods)
- disconnect child pages (4 methods)
- access children itself and lists of child page attribute values (5 methods)
- referencing (3 methods)
- sort child pages by several criteria (11 methods)
- link and unlink workflow, authorisation and publication packages (5 methods)
- pre-assigned content class handling (e.g. check if content class is allowed or return all not allowed children) (6 methods)
For every area there are several methods available to address specific needs. Please get your own impression and examine the javadoc for class MultiLink. Only the subclass List is of further interest. It offers functions for target container editing in addition.