Difference between revisions of "CCAPI Page"

From ADF Docs
Jump to: navigation, search
(Created page with '== Overview == 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 bo…')
 
 
(One intermediate revision by the same user not shown)
Line 31: Line 31:
 
  </cfscript>
 
  </cfscript>
  
Note: You must provide the following fields in stdMetadata to ensure success:
+
 
# Name (this will be converted to a valid name for you)
+
Note: You must provide the following fields in stdMetadata to ensure success:
# Title (this is limited to 255 characters)
+
* Name (this will be converted to a valid name for you)
# SubsiteID (where do you want your page to be created)
+
* Title (this is limited to 255 characters)
# TemplateID (the page your page should be created from
+
* SubsiteID (where do you want your page to be created)
All other field for Standard Metadata are optional
+
* TemplateID (the page your page should be created from
 +
 
 +
All other field for Standard Metadata are optional.
 +
 
 +
[[Category:CCAPI]]

Latest revision as of 22:49, 20 December 2009

Overview

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.