Publish a page – basic style

You can immediately publish a page you have under your fingertips with directly available method on a page.

The easiest way to publish a page in one language and one project variant without following pages goes  like this:

String logonGuid="0904ABF0E43443D2881FE7481339650E";
String sessionKey="490EC675042F4C5A8A6DF1ED63ADD7A6";
String projectGuid="268F46EF5EB74A75824856D3DA1C6597";

CmsClient client = new CmsClient(logonGuid);
Project project = client.getProject(sessionKey, projectGuid);

ProjectVariant projectVariant = project.getProjectVariantByName(“project variant name”);
LanguageVariant languageVariant = project.getLanguageVariantByRfcLanguageId(“en”);
boolean withFollowingPages = false;

Page currentPg = project.getPageById(“34009”);
currentPg.publish(withFollowingPages, projectVariant, languageVariant);

This publish() method will not send an e-mail to the author per default. It return a PublishingJob instance.

There are several publish methods available on page to handle publishing of related pages and sending an e-mail or not. And of course publish for more project variants. Please check the javadoc for other publish methods (in most cases sufficient) or see the article how to configure a PublishingJob manually.

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 )

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: