Difference between revisions of "CCAPI Page"

From ADF Docs
Jump to: navigation, search
(Overview)
 
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
 +
 +
IMPORTANT: With the release of CommonSpot 11 and ADF 2.7 it is recommended to use the CommonSpot Custom Data API or the ADF's ceRecordAPI wrappers to 'populate custom elements' instead of using CCAPI. See the [[ceRecordAPI Reference]] for more info.
 +
 
The Create Page library utility allows you to easily create and delete CommonSpot pages using the CCAPI.  The utility works similarly to the standard out of the box CCAPI samples found in the /commonspot/samples/contentCreationAPI/ directory except it is simpler to use.
 
The Create Page library utility allows you to easily create and delete CommonSpot pages using the CCAPI.  The utility works similarly to the standard out of the box CCAPI samples found in the /commonspot/samples/contentCreationAPI/ directory except it is simpler to use.
  

Latest revision as of 21:11, 5 February 2025

Overview

IMPORTANT: With the release of CommonSpot 11 and ADF 2.7 it is recommended to use the CommonSpot Custom Data API or the ADF's ceRecordAPI wrappers to 'populate custom elements' instead of using CCAPI. See the ceRecordAPI Reference for more info.

The Create Page library utility allows you to easily create and delete CommonSpot pages using the CCAPI. The utility works similarly to the standard out of the box CCAPI samples found in the /commonspot/samples/contentCreationAPI/ directory except it is simpler to use.

Example Usage

<cfscript>
  // create the standard metadata
  stdMetadata = structNew();
  stdMetadata["name"] = "My Page Name";
  stdMetadata["title"] = "My Page Title";
  stdMetadata["templateID"]= 1023;
  stdMetadata["subsiteID"] = 12;
  custMetadata = structNew();
  custMetadata["formName"] = structNew();
  custMetadata["formName"]["fieldName"] = "value 1";
  // create the page CFC
  csPage = server.ADF.getBean("CSPage_1_0");
  // create the page
  csPage.createPage(stdMetadata, custMetadata);
</cfscript>
<cfscript>
  // create the deleted page data
  tmp = structNew();
  tmp["pageID"] = 22323;
  tmp["subsiteID"] = 122;
  // create the page CFC
  csPage = server.ADF.getBean("CSPage_1_0");
  // create the page
  csPage.deletePage(tmp);
</cfscript>


Note: You must provide the following fields in stdMetadata to ensure success:

  • Name (this will be converted to a valid name for you)
  • Title (this is limited to 255 characters)
  • SubsiteID (where do you want your page to be created)
  • TemplateID (the page your page should be created from

All other field for Standard Metadata are optional.