Get GUIDs from all jRQL objects

The Management Server (MS) internally uses global unique identifier (GUID) as the primary key to all records. These GUIDs therefore are very important and you often need to get it back from jRQL objects to use it further, maybe in own RQL commands.

For every jRQL class which is tight to a MS object deliver the object’s GUID from a method of this style:
.get<class name>Guid();

Let me give some examples:
Project > getProjectGuid()
Template > getTemplateGuid()
TemplateElement > getTemplateElementGuid()
Page > getPageGuid()
AuthorizationPackage > getAuthorizationPackageGuid()
PublicationPackage > getPublicationPackageGuid()

Special are the main classes CmsClient and Project, because they encapsulate the session information additionally. For you own RQL command (or other reasons) you can get the session information back as following:
CmsClient > getLogonGuid()
Project > getSessionKey()

Please have in mind, that a session key is only available if you enter a MS project like it is in SmartTree and SmartEdit. Project still can be used in jRQL as it would be in ServerManager. In that case no session key is available and using a method requiring a session key will throw a MissingSessionKeyException.

Post a comment or leave a trackback: Trackback URL.


Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: