Separate classes for page elements

For most content and structural elements of a page separate classes exists. The following page element types are supported by jRQL:

Affix Diese Klasse beschreibt ein Prefix oder Suffix eines Projektes.
Container Diese Klasse beschreibt einen RedDot MultiLink Container.
DynamicTextAnchor Diese Klasse beschreibt einen RedDot Dynamic Anchor (Text oder Bild).
Frame Insert the type’s description here.
ImageElement Diese Klasse beschreibt ein Image-Element einer Seite.
List Diese Klasse beschreibt einen RedDot MultiLink List.
MediaElement Diese Klasse beschreibt ein Media-Element einer Seite.
MultiLink Diese Klasse beschreibt einen RedDot MultiLink (Container or Liste).
Note Diese Klasse beschreibt eine Bemerkung zu einer Seite.
OptionList Diese Klasse beschreibt das Seitenelement Optionsliste.
StandardFieldDateElement Diese Klasse beschreibt ein RedDot Standardfeld Date (type=5).
StandardFieldNumericElement Diese Klasse beschreibt ein RedDot Standardfeld Numeric (type=48).
StandardFieldTextElement Diese Klasse beschreibt ein RedDot Standardfeld (type=1).
StandardFieldUserDefinedElement Diese Klasse beschreibt ein RedDot Standardfeld user defined (type=999).
TextAnchor Insert the type’s description here.
TextElement Diese Klasse beschreibt ein RedDot Textelement (type=31 oder type=32).

These classes offers always the full set of available functions. The most often used, like getting and setting a value are supported directly on Page. If you miss a method on Page, please check these classes directly.

You can always get the element instances of a page with a simple get method, like

OptionList optList = currentPg.getOptionList("content class element name");
optList.selectDefault();

These lines change the option list value on currentPg to it’s default value defined in the content class element. This method is only available on the optList element, but not as special method on Page.

In addition you can ask every page element object for the corresponding content class element. In jRQL they are called TemplateElement like in old version of RedDot CMS (was renamed later to content class elements).

From my most often used elements you can get the underlaying content class element (=tempate element) simply with the  method getTemplateElement():

currentPg.getContainer("content class element name").getTemplateElement();
currentPg.getImageElement("content class element name").getTemplateElement();
currentPg.getList("content class element name").getTemplateElement();
currentPg.getMediaElement("content class element name").getTemplateElement();
currentPg.getMultiLink("content class element name").getTemplateElement();
currentPg.getOptionList("content class element name").getTemplateElement();
currentPg.getStandardFieldDateElement("content class element name").getTemplateElement();
currentPg.getStandardFieldNumericElement("content class element name").getTemplateElement();
currentPg.getStandardFieldTextElement("content class element name").getTemplateElement();
currentPg.getStandardFieldUserDefinedElement("content class element name").getTemplateElement();

Like the template elements shadowing the page element the content class (=template) is backing the page currentPg.  To get the underlaying content class from a page use this method:

You can ask the currentPg itself for its content class:

Page currentPg = project.getPageById("34009");
Template template = currentPg.getTemplate();
System.out.println(currentPg.getTemplateName());

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: