dw.experience
Class Page
Object
dw.experience.Page
 ======================
 PAGE DESIGNER BETA API
 ======================
 
This class represents a page designer managed page. A page comprises of multiple regions that hold components, which themselves again can have regions holding components, i.e. spanning a hierarchical tree of components. Using the PageMgr.renderPage(String, String) a page can be rendered. As such page implements a render function for creating render output the render function of the page itself will also want to access its various properties like the SEO title etc.
Properties
description  :  String  (Read Only)
The description of this page.
ID  :  String  (Read Only)
The id of this page.
name  :  String  (Read Only)
The name of this page.
pageDescription  :  String  (Read Only)
The SEO description of this page.
pageKeywords  :  String  (Read Only)
The SEO keywords of this page.
pageTitle  :  String  (Read Only)
The SEO title of this page.
typeID  :  String  (Read Only)
The type id of this page.
visible  :  boolean  (Read Only)
Returns true if the page is currently visible which is the case if:
  • page is published
  • all visibility rules apply, requiring that
    • schedule matches
    • customer group matches
If any of these is not the case then false will be returned.

As visibility is driven by the merchant configured dynamic visibility rules, e.g. scheduling and custom segmentation, this call should NOT happen in a pagecached context outside of the processing induced by PageMgr.renderPage(String, String).
Use hasVisibilityRules() prior to calling this method in order to check for the existence of visibility rules. If there are visibility rules then do not apply pagecaching. Otherwise the visibility decision making would end up in the pagecache and any subsequent call would just return from the pagecache instead of performing the isVisible() check again as desired.

   ...
   var page = PageMgr.getPage(pageID);
   if(page.hasVisibilityRules())
   {
      // pagecaching is NOT ok here
      if(page.isVisible())
      {
         response.writer.print(PageMgr.renderPage(pageID, {});
      }
   }
   else
   {
       // pagecaching is ok here, but requires a pagecache refresh if merchants start adding visibility rules to the page
   }
   ...
 

Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
getDescription() : String
Returns the description of this page.
getID() : String
Returns the id of this page.
getName() : String
Returns the name of this page.
getPageDescription() : String
Returns the SEO description of this page.
getPageKeywords() : String
Returns the SEO keywords of this page.
getPageTitle() : String
Returns the SEO title of this page.
getRegion(id : String) : Region
Returns the page region that matches the given id.
getTypeID() : String
Returns the type id of this page.
hasVisibilityRules() : boolean
Returns true if the page has visibility rules (scheduling, customer groups) applied, otherwise false.
isVisible() : boolean
Returns true if the page is currently visible which is the case if:
  • page is published
  • all visibility rules apply, requiring that
    • schedule matches
    • customer group matches
If any of these is not the case then false will be returned.
Methods inherited from class Object
Method Detail
getDescription
getDescription() : String
Returns the description of this page.
Returns:
the page description

getID
getID() : String
Returns the id of this page.
Returns:
the page id

getName
getName() : String
Returns the name of this page.
Returns:
the page name

getPageDescription
getPageDescription() : String
Returns the SEO description of this page.
Returns:
the page SEO description

getPageKeywords
getPageKeywords() : String
Returns the SEO keywords of this page.
Returns:
the page SEO keywords

getPageTitle
getPageTitle() : String
Returns the SEO title of this page.
Returns:
the page SEO title

getRegion
getRegion(id : String) : Region
Returns the page region that matches the given id.
Parameters:
id - the id of the desired page region
Returns:
the region, or null if not found.

getTypeID
getTypeID() : String
Returns the type id of this page.
Returns:
the page type id

hasVisibilityRules
hasVisibilityRules() : boolean
Returns true if the page has visibility rules (scheduling, customer groups) applied, otherwise false. Use this method prior to isVisible(), so you do not call the latter in a pagecached context.
Returns:
true if the page has visibility rules (scheduling, customer groups) applied, otherwise false.

isVisible
isVisible() : boolean
Returns true if the page is currently visible which is the case if:
  • page is published
  • all visibility rules apply, requiring that
    • schedule matches
    • customer group matches
If any of these is not the case then false will be returned.

As visibility is driven by the merchant configured dynamic visibility rules, e.g. scheduling and custom segmentation, this call should NOT happen in a pagecached context outside of the processing induced by PageMgr.renderPage(String, String).
Use hasVisibilityRules() prior to calling this method in order to check for the existence of visibility rules. If there are visibility rules then do not apply pagecaching. Otherwise the visibility decision making would end up in the pagecache and any subsequent call would just return from the pagecache instead of performing the isVisible() check again as desired.

   ...
   var page = PageMgr.getPage(pageID);
   if(page.hasVisibilityRules())
   {
      // pagecaching is NOT ok here
      if(page.isVisible())
      {
         response.writer.print(PageMgr.renderPage(pageID, {});
      }
   }
   else
   {
       // pagecaching is ok here, but requires a pagecache refresh if merchants start adding visibility rules to the page
   }
   ...
 

Returns:
true if the page is currently visible (published and visibility rules apply), otherwise false (unpublished and/or visibility rules don't apply)
See Also: