var rtnStruct = structNew();
// TODO the element names should all be constants
var postArray = application.ptBlog2.ceData.getCEData("Posts2", "postID", arguments.postID);
if( arrayLen(postArray) )
{
rtnStruct = postArray[1].values;
rtnStruct.dataPageID = postArray[1].pageID;
}
var rtnStruct = structNew();
// TODO the element names should all be constants
var postArray = application.ptBlog2.ceData.getCEData("Posts2", "postPageID", arguments.pageID);
if( arrayLen(postArray) )
{
rtnStruct = postArray[1].values;
rtnStruct.dataPageID = postArray[1].pageID;
}
return application.ptBlog2.ceData.getCEData("Posts2", "blogID", arguments.blogID);
// TODO this needs to be converted to use variables. when the bug is fixed
var result = structNew();
var pageData = StructNew();
var pageCreationResults = StructNew();
if( not structKeyExists(arguments, "custMetadata") or (structKeyExists(arguments, "custMetadata") and not listLen(structKeyList(arguments.custMetadata)) ) )
arguments.custMetadata = structNew();
//result = application.ptBlog2.CSPage.createPage(arguments.stdMetadata, arguments.custMetadata);
pageData = arguments.stdMetadata;
// Verify that we create a page with a unique page name and page title.
pageData['name'] = application.ptBlog2.csData.createUniquePageName(csPageName=pageData.name,
csSubsiteID=pageData.subsiteID);
pageData['title'] = application.ptBlog2.csData.createUniquePageTitle(csPageTitle=pageData.title,
csSubsiteID=pageData.subsiteID);
// Convert the metadata structure to an array of MetadataValue structures for the API
pageData['metadata'] = application.ptBlog2.csData.metadataStructToArray(metadata=custMetadata);
// Create the page
pageCreationResults = application.ptBlog2.apiPage.create(pageData=pageData,
activatePage=true);
//application.ADF.utils.logAppend(pageCreationResults,"PT_Blog_postDAO.log");
if ( StructKeyExists(pageCreationResults, "CMDSTATUS")
AND pageCreationResults.CMDSTATUS EQ true
AND StructKeyExists(pageCreationResults, "CMDRESULTS") ) {
result.newPageID = pageCreationResults.CMDRESULTS;
}
else {
retData.newPageID = 0;
}
// Validate the postID passed into the function
var postData = getPost(arguments.postID);
var sparams = StructNew();
var csPage = "";
var delResult = "";
// Check that we have values
if ( StructKeyExists(postData, "postPageID") AND LEN(postData.postPageID) AND isNumeric(postData.postPageID) ){
// Load the sparams
sparams.pageid = postData.postPageID;
// Call CSData to get the subsiteID for the pageID
sparams.subsiteid = application.ptBlog2.csdata.getSubsiteIDByPageID(postData.postPageID);
// create the page CFC
csPage = server.ADF.objectFactory.getBean("CSPage_1_0");
// delete the page
delResult = csPage.deletePage(sparams);
}
return delResult;
// Create the page
var pageResult = application.ptBlog2.CSContent.populateContent("BlogPost", arguments.dataValues);
var sDate = application.ptBlog2.date.csDateFormat(arguments.startDate);
var eDate = application.ptBlog2.date.csDateFormat(arguments.endDate);
var postsQuery = queryNew('');
var postsArray = arrayNew(1);
SELECT *
FROM ce_Posts2View
WHERE datePosted >
AND datePosted <
AND blogID =
var status = "";
var postData = "";
// TODO - Better Error handling for the deleting
// Delete all comments for the posts
status = application.ptBlog2.commentsDAO.deleteCommentsByPostID(postid=arguments.postid);
// Delete the post page and Posts2 CE record
status = deletePostPage(postid=arguments.postid);
// Delete the Posts2 CE record
postData = getPost(postID=arguments.postid);
status = application.ptBlog2.ceData.deleteCE(datapageidList=postData.dataPageID);
return status;
// Get the blog Posts
var postsData = getPostByBlogID(blogID=arguments.blogID);
var currPost = "";
var status = false;
// Initialize the variables
var postsTagQry = "";
SELECT PageID
FROM ce_Posts2View
WHERE tags LIKE '%#arguments.tagID#%'