final OfficeMasterPage masterPage;
if ( !masterPageFactory.containsMasterPage("Standard", null, null) )
{
masterPage = masterPageFactory.createMasterPage("Standard", null, null);
final CSSNumericValue zeroLength = CSSNumericValue.createValue(CSSNumericType.CM, 0);
final String pageLayoutTemplate = masterPage.getPageLayout();
if ( pageLayoutTemplate == null )
{
// there is no pagelayout. Create one ..
final String derivedLayout = masterPageFactory.createPageStyle(getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength);