Before we can start how to publish a page via jRQL I need to introduce how to get project variants and language variants.
You can get a project variant in two different ways, it is straight forward:
ProjectVariant pv1 = project.getProjectVariantByGuid(“project variant guid”);
ProjectVariant pv2 = project.getProjectVariantByName(“project variant name”);
Accessing the language variant you want you have more possiblities:
LanguageVariant lv1 = project.getLanguageVariantByGuid(“language variant guid”);
LanguageVariant lv2 = project.getLanguageVariantByName(“language variant name”);
LanguageVariant lv3 = project.getLanguageVariantByLanguage(“3 letter language code”);
LanguageVariant lv4 = project.getLanguageVariantByRfcLanguageId(“2 letter language code”);
You can get a language variant by GUID and by name, but jRQL offers 2 other ways. See the following screenshot what I mean with 2 and 3 letter code:
I often use the last method add address the language variants I need with the self entered RFC language code (the part before the hyphen). So I’m sure what language I will get and are not depending on the internal 3 letter code RedDot CMS uses.
Read further in the next article how to publish a page.