Getting project and language variants

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:

language_variant_codes

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.

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: