var pageResult = StructNew(); // Use the CS 6.x Command API to SET page Metadata var pageComponent = server.CommonSpot.api.getObject('Page'); var pageCmdResults = StructNew(); var newConfidentialityID = 0; var newShowInList = "PageIndex,SearchResults"; var newExpirationDate = ""; var newExpirationAction = ""; var newExpirationRedirectURL = ""; var newMetadata = ArrayNew(1); var activateState = ""; // Convert PUBLICRELEASEDATE to publicationDate if exists if ( !StructKeyExists(arguments.pageData,"publicationDate") AND StructKeyExists(arguments.pageData,"PublicReleaseDate") ) arguments.pageData.publicationDate = arguments.pageData.PublicReleaseDate; // Build the Optional Field Nodes if ( StructKeyExists(arguments.pageData,"confidentialityID") ) newConfidentialityID = arguments.pageData.confidentialityID; if ( StructKeyExists(arguments.pageData,"showInList") ) newShowInList = arguments.pageData.showInList; if ( StructKeyExists(arguments.pageData,"expirationDate") ) newExpirationDate = arguments.pageData.expirationDate; if ( StructKeyExists(arguments.pageData,"expirationAction") ) newExpirationAction = arguments.pageData.expirationAction; if ( StructKeyExists(arguments.pageData,"expirationRedirectURL") ) newExpirationRedirectURL = arguments.pageData.expirationRedirectURL; if ( StructKeyExists(arguments.pageData,"expirationDate") ) newExpirationDate = arguments.pageData.expirationWarningMsg; if ( StructKeyExists(arguments.pageData,"metadata") ) newMetadata = arguments.pageData.metadata; try { pageCmdResults = pageComponent.create(subsiteIDOrURL=arguments.pageData.subsiteID, name=arguments.pageData.name, title=arguments.pageData.title, caption=arguments.pageData.caption, publicationDate=arguments.pageData.publicationDate, categoryID=arguments.pageData.categoryID, templateID=arguments.pageData.templateID, description=arguments.pageData.description, targetedAudienceID=0, confidentialityID=newConfidentialityID, showInList=newShowInList, expirationDate=newExpirationDate, expirationAction=newExpirationAction, expirationRedirectURL=newExpirationRedirectURL, expirationWarningMsg=newExpirationDate, metadata=newMetadata); // Activate the page if ( arguments.activatePage ) activateState = saveActivationState(pageCmdResults, "Active"); // Check the return status has a LENGTH pageResult["CMDSTATUS"] = true; pageResult["CMDRESULTS"] = pageCmdResults; } catch (any e) { //application.ADF.utils.logAppend(e,"APIPage_Errors.log"); pageResult["CMDSTATUS"] = false; pageResult["CMDRESULTS"] = e; pageResult["CFCATCH"] = e; } return pageResult; var pageCmdResult = StructNew(); // Use the CS 6.x Command API to delete the page whose pageID was passed in var pageComponent = server.CommonSpot.api.getObject('page'); try { pageComponent.delete(arguments.csPageID,0); pageCmdResult["CMDSTATUS"] = true; pageCmdResult["CMDRESULTS"] = true; } catch (any e) { pageCmdResult["CMDSTATUS"] = false; if ( StructKeyExists(e,"Reason") AND StructKeyExists(e['Reason'],"pageID") ) pageCmdResult["CMDRESULTS"] = e['Reason']['pageID']; else if ( StructKeyExists(e,"message") ) pageCmdResult["CMDRESULTS"] = e.message; else pageCmdResult["CMDRESULTS"] = e; } return pageCmdResult; var pageResult = StructNew(); // Use the CS 6.x Command API to RENAME the page var pageComponent = server.CommonSpot.api.getObject('Page'); var pageCmdResults = StructNew(); try { pageCmdResults = pageComponent.getInfo(pageID=arguments.csPageID); // Check the return status has a LENGTH if ( isStruct(pageCmdResults) ) pageResult["CMDSTATUS"] = true; else pageResult["CMDSTATUS"] = false; pageResult["CMDRESULTS"] = pageCmdResults; } catch (any e) { pageResult["CMDSTATUS"] = false; pageResult["CMDRESULTS"] = pageCmdResults; pageResult["CFCATCH"] = e; } return pageResult; var pageResult = StructNew(); // Use the CS 6.x Command API to RENAME the page var pageComponent = server.CommonSpot.api.getObject('Page'); var pageCmdResults = StructNew(); var newPageTitle = ""; var newCaption = ""; // Build the Optional Field Nodes if ( StructKeyExists(arguments.pageData,"title") ) newPageTitle = arguments.pageData.title; if ( StructKeyExists(arguments.pageData,"caption") ) newCaption = arguments.pageData.caption; try { pageCmdResults = pageComponent.rename(id=arguments.pageData.id, name=arguments.pageData.name, title=newPageTitle, caption=newCaption); // Check the return status has a LENGTH if ( LEN(pageCmdResults) ) pageResult["CMDSTATUS"] = true; else pageResult["CMDSTATUS"] = false; pageResult["CMDRESULTS"] = pageCmdResults; } catch (any e) { pageResult["CMDSTATUS"] = false; pageResult["CMDRESULTS"] = pageCmdResults; pageResult["CFCATCH"] = e; } return pageResult; var pageCmdResult = StructNew(); // Use the CS 6.x Command API to SET page keywords var pageComponent = server.CommonSpot.api.getObject('page'); try { pageComponent.saveActivationState(arguments.csPageID, arguments.state); pageCmdResult["CMDSTATUS"] = true; pageCmdResult["CMDRESULTS"] = true; } catch (any e) { pageCmdResult["CMDSTATUS"] = false; if ( StructKeyExists(e,"Reason") AND StructKeyExists(e['Reason'],"pageID") ) pageCmdResult["CMDRESULTS"] = e['Reason']['pageID']; else if ( StructKeyExists(e,"message") ) pageCmdResult["CMDRESULTS"] = e.message; else pageCmdResult["CMDRESULTS"] = e; } return pageCmdResult; var pageResult = StructNew(); // Use the CS 6.x Command API to SET page Metadata var pageComponent = server.CommonSpot.api.getObject('Page'); var pageCmdResults = StructNew(); var newConfidentialityID = 0; var newShowInList = "PageIndex,SearchResults"; var newExpirationDate = ""; var newExpirationAction = ""; var newExpirationRedirectURL = ""; var newMetadata = ArrayNew(1); // Build the Optional Field Nodes if ( StructKeyExists(arguments.pageData,"confidentialityID") ) newConfidentialityID = arguments.pageData.confidentialityID; if ( StructKeyExists(arguments.pageData,"showInList") ) newShowInList = arguments.pageData.showInList; if ( StructKeyExists(arguments.pageData,"expirationDate") ) newExpirationDate = arguments.pageData.expirationDate; if ( StructKeyExists(arguments.pageData,"expirationAction") ) newExpirationAction = arguments.pageData.expirationAction; if ( StructKeyExists(arguments.pageData,"expirationRedirectURL") ) newExpirationRedirectURL = arguments.pageData.expirationRedirectURL; if ( StructKeyExists(arguments.pageData,"expirationDate") ) newExpirationDate = arguments.pageData.expirationWarningMsg; if ( StructKeyExists(arguments.pageData,"metadata") ) newMetadata = arguments.pageData.metadata; try { pageCmdResults = pageComponent.saveInfo(id=arguments.pageData.id, title=arguments.pageData.title, caption=arguments.pageData.caption, publicationDate=arguments.pageData.publicationDate, categoryID=arguments.pageData.categoryID, description=arguments.pageData.description, confidentialityID=newConfidentialityID, showInList=newShowInList, expirationDate=newExpirationDate, expirationAction=newExpirationAction, expirationRedirectURL=newExpirationRedirectURL, expirationWarningMsg=newExpirationDate, metadata=newMetadata); // Check the return status has a LENGTH pageResult["CMDSTATUS"] = true; pageResult["CMDRESULTS"] = ""; } catch (any e) { pageResult["CMDSTATUS"] = false; pageResult["CMDRESULTS"] = ""; pageResult["CFCATCH"] = e; } return pageResult;