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…')
 
Line 32: Line 32:
  
 
  Note: You must provide the following fields in stdMetadata to ensure success:
 
  Note: You must provide the following fields in stdMetadata to ensure success:
  # Name (this will be converted to a valid name for you)
+
  1. Name (this will be converted to a valid name for you)
  # Title (this is limited to 255 characters)
+
  2. Title (this is limited to 255 characters)
  # SubsiteID (where do you want your page to be created)
+
  3. SubsiteID (where do you want your page to be created)
  # TemplateID (the page your page should be created from
+
  4. TemplateID (the page your page should be created from
 
  All other field for Standard Metadata are optional
 
  All other field for Standard Metadata are optional

Revision as of 16:14, 22 November 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:
1. Name (this will be converted to a valid name for you)
2. Title (this is limited to 255 characters)
3. SubsiteID (where do you want your page to be created)
4. TemplateID (the page your page should be created from
All other field for Standard Metadata are optional