var stdMetadata = ""; var custMetadata = StructNew(); var metaFormsStruct = StructNew(); var metaFormFieldStruct = StructNew(); var formKey = ""; var fieldKey = ""; var taxTermTextList = ""; var taxTermIDList = ""; var getDocType = ''; stdMetadata = getStandardMetadata(arguments.pageID); arguments.categoryID = stdMetadata.categoryID; arguments.subsiteID = stdMetadata.subsiteID; arguments.inheritedTemplateList = stdMetadata.inheritedTemplateList; SELECT doctype from sitepages where id = AND ((doctype <> '' or doctype <> null) and (doctype <> '0')) if ((getDocType.recordcount gt 0) and (len(getDocType.doctype))) arguments.doctype = getDocType.doctype; // Copy the Module Struct to a local custMetaData variable if ( StructKeyExists(request,"metadata") ) custMetadata = request.metadata; // Convert Taxonomy Term Lists in CustomMetadata Taxonomy Fields to a TermID lists if ( arguments.convertTaxonomyTermsToIDs ) { // Get the CustomMetaData fields that are Taxonomy Fields metaFormsStruct = getCustomMetadataFieldsByCSPageID(arguments.pageID,"taxonomy"); // Loop over the formkeys (MetaData Form Names) in the struct for ( formKey in metaFormsStruct ) { metaFormFieldStruct = metaFormsStruct[formKey]; // Loop over the fieldkeys (MetaData Feild Names) in the FormName struct for ( fieldKey in metaFormFieldStruct ) { if ( StructKeyExists(custMetadata,formKey) AND StructKeyExists(custMetadata[formKey],fieldkey) ) { taxTermTextList = custMetadata[formKey][fieldkey]; if ( LEN(TRIM(taxTermTextList)) ) { // Convert the List Terms to a List of TermIDs taxTermIDList = variables.taxonomy.getTermIDs(termList=taxTermTextList); // Reset The CustomMetadata to the Term ID List custMetadata[formKey][fieldkey] = taxTermIDList; } } } } } return custMetadata; var textblockData = ''; var returnData = StructNew(); if ( Len(trim(arguments.name)) eq 0 or arguments.pageID lt 1 ) return returnData; SELECT * FROM Data_TextBlock dtb INNER JOIN controlInstance ci on ci.controlID = dtb.controlID WHERE ci.controlName = AND dtb.pageID = AND dtb.versionState = 2; if ( textblockData.recordCount ) { returnData.dateAdded = textblockData.DateAdded; returnData.dateApproved = textblockData.DateApproved; returnData.controlID = textblockData.controlID; returnData.controlName = textblockData.controlName; returnData.pageID = textblockData.pageID; returnData.values = StructNew(); returnData.values.caption = textblockData.caption; returnData.values.TextBlock = server.commonspot.udf.html.DECODEENTITIES(textblockData.TextBlock); } return returnData; var itm = ''; var inheritedPageIDList = ""; var stdMetadata = getStandardMetadata(arguments.cspageid); var getFormFields = queryNew("temp"); var thisForm = {}; var thisField = ""; var thisFieldValue = ""; var paramsOutput = {}; var rtnStruct = {}; var fqParams = ''; // Get the inheritedTemplateList from the stdMetadata if ( StructKeyExists(stdMetadata,"inheritedTemplateList") ) inheritedPageIDList = ListAppend(stdMetadata.inheritedTemplateList,arguments.cspageid); else inheritedPageIDList = arguments.cspageid; SELECT FormInputControl.FieldName,FormInputControlMap.FieldID,FormInputControl.Params,FormInputControl.Type,FormControl.FormName,FormControl.ID AS FormID FROM FormControl INNER JOIN FormInputControlMap ON FormControl.ID = FormInputControlMap.FormID INNER JOIN FormInputControl ON FormInputControlMap.FieldID = FormInputControl.ID WHERE FormInputControlMap.FormID IN ( SELECT DISTINCT FormID FROM Data_FieldValue WHERE AND VersionState = 2 ) AND FormInputControl.Type = ORDER BY FormControl.FormName,FormInputControl.FieldName thisFieldValue = {}; fqParams = ''; if ( StructKeyExists(getFormFields,"params") ) fqParams = getFormFields.Params; fqParams = fqParams.replaceAll('[<]struct[^>]*[>]',''); var rssData = ""; var pageURL = ""; select xpub.pageid, xfmt.name as fmtName, xpub.name as pubName from xmlpublications xpub join xmlpublicationformat xfmt on xfmt.XMLPublicationFormatID = xpub.XMLPublicationFormatID where xpub.controlid = and xpub.pageid = pageURL = application.ADF.csData.getCSPageURL(rssData.pageID); pageURL = pageURL&"?xml="&rssData.pubName&","&rssData.fmtName; var stndMetaStruct = getStandardMetadata(arguments.csPageID); var newStndMetaStruct = StructNew(); var findReplaceArray = arguments.findReplaceTextArray; var structKeyList = TRIM(arguments.fieldList); var findTxt = ""; var replaceTxt = ""; var findFileName = ""; var replaceFileName = ""; var key = ""; var findPos = 0; var findFilePos = 0; var s = 1; // structKeyList has no value get a list of all the keys in the structure if ( LEN(structKeyList) EQ 0 ) structKeyList = StructKeyList(stndMetaStruct); // If findReplace data was provided, do the work on the standard metadata if ( ArrayLen(findReplaceArray) ) { // Loop over the findReplace Array for( s=1; s LTE ArrayLen(findReplaceArray); s=s+1 ) { // Get the Find Text and the Replace text findTxt = ""; if ( StructKeyExists(findReplaceArray[s],"findtext") ) findTxt = findReplaceArray[s].findtext; replaceTxt = ""; if ( StructKeyExists(findReplaceArray[s],"replacetext") ) replaceTxt = findReplaceArray[s].replacetext; // Do not process if the findTxt has no value if ( LEN(findTxt) ) { // Loop over the metadata value that match the KEY LIST for ( key IN stndMetaStruct ) { if ( ListFindNoCase(structKeyList,key) ) { if ( key EQ "FILENAME" ) { // Add dashes to the find and replace text for file name matching findFileName = REReplaceNoCase(findTxt,"[\s]","-","all"); replaceFileName = REReplaceNoCase(replaceTxt,"[\s]","-","all"); // If the FIND text is found, replace it with the REPLACE text findFilePos = FindNoCase(findFileName, stndMetaStruct["FILENAME"]); if ( findFilePos ) stndMetaStruct["FILENAME"] = ReplaceNoCase(stndMetaStruct["FILENAME"],findFileName,replaceFileName,"all"); } else { // If the FIND text is found, replace it with the REPLACE text findPos = FindNoCase(findTxt, stndMetaStruct[key]); if ( findPos ) stndMetaStruct[key] = ReplaceNoCase(stndMetaStruct[key],findTxt,replaceTxt,"all"); } } } } } } return stndMetaStruct; var getData = ''; var stdMetadata = structNew(); var keywordsArray = ArrayNew(1); // build Standard Metadata return structure stdMetadata.name = ""; stdMetadata.title = ""; stdMetadata.caption = ""; stdMetadata.description = ""; stdMetadata.globalKeywords = ""; stdMetadata.categoryName = ""; stdMetadata.subsiteID = ""; stdMetadata.templateID = ""; stdMetadata.fileName = ""; stdMetadata.pageID = ""; stdMetadata.languageID = ""; stdMetadata.language = ""; stdMetadata.approvalStatus = ""; stdMetadata.PublicReleaseDate = ""; // IncludeInIndex list: ie. 1,2,4,8 | 1-include Page Index, 8-include in full text search stdMetadata.IncludeInIndex = ""; // confidentiality: 0-Unknown, 4-Confidential, 3-Highly Confidential, 5-Internal, 2-Public stdMetadata.confidentiality = ""; select title, description, dateAdded, caption, inheritedTemplateList, categoryID, subsiteID, name, lang, fileName, approvalStatus, PublicReleaseDate, IsPublic, Confidentiality from sitePages where id = if( getData.recordCount ) { stdMetadata.pageID = arguments.csPageID; stdMetadata.name = getData.name; stdMetadata.title = getData.title; stdMetadata.caption = getData.caption; stdMetadata.description = getData.description; // If page has a title get global Keywords (same criteria as CommonSpot ) if ( LEN(TRIM(stdMetadata.title)) ) { keywordsArray = getGlobalKeywords(arguments.csPageID); stdMetadata.globalKeywords = ArrayToList(keywordsArray, ", "); } stdMetadata.categoryName = ""; stdMetadata.subsiteID = getData.subsiteID; stdMetadata.templateID = listFirst(getData.inheritedTemplateList); // used primarily to retrieve custom metadata stdMetadata.inheritedTemplateList = getData.inheritedTemplateList; stdMetadata.categoryID = getData.categoryID; if( getData.lang eq 0 ) stdMetadata.language = "en"; else if ( getData.lang eq 9 ) stdMetadata.language = "es"; stdMetadata.fileName = getData.fileName; stdMetadata.languageID = getData.lang; stdMetadata.approvalStatus = getData.approvalStatus; stdMetadata.PublicReleaseDate = getData.PublicReleaseDate; stdMetadata.Confidentiality = getData.Confidentiality; if ( IsNumeric(getData.IsPublic) AND getData.IsPublic gt 0 ) stdMetadata.IncludeInIndex = Server.CommonSpot.udf.site.IsPublicGetOptions(getData.IsPublic); } var keywordsArray = ArrayNew(1); var globalKeywordsList = ""; var qryGlobalKeywords = QueryNew("tmp"); var productVersion = ListFirst(ListLast(request.cp.productversion," "),"."); var keywordObj = ""; SELECT Distinct Keyword FROM Keywords,UserKeywords WHERE Keywords.ID=UserKeywords.KeywordID AND UserID=0 AND PageID= ORDER BY Keyword // Get the list of global keywords from the qryGlobalKeywords query if ( qryGlobalKeywords.RecordCount gt 0 ) globalKeywordsList = ValueList(qryGlobalKeywords.Keyword); // If CS 6.x or greater create the Keywords Object keywordObj = server.CommonSpot.ObjectFactory.getObject("keywords"); // Get the list of global keywords from the keywordObj if ( StructKeyExists(keywordObj,"getDelimitedListForObject") ) globalKeywordsList = keywordObj.getDelimitedListForObject(objectID=arguments.csPageID); // Parse the list of global keywords into an Array if ( LEN(TRIM(globalKeywordsList)) ) keywordsArray = ListToArray(globalKeywordsList,','); return keywordsArray; var elements = arrayNew(1); var qryGetElements = queryNew(""); select DISTINCT ci.controlID, ci.controlName, ci.controlType, ci.pageID, ac.name, ac.shortDesc, ac.longDesc from controlInstance ci, availableControls ac where ci.pageID in () and ( ci.controlType in () or ci.controlType > ) and ci.controlName IS NOT NULL and ci.controlType = ac.ID order by controlName, controlID select ID, subsiteID from sitePages where title = and subsiteID = and ( pageType = or pageType = ) return Server.CommonSpot.udf.util.resolveUploadedDocURL(arguments.pageID); // Get the subsite URL for the uploaded doc //var docSubisteID = getSubsiteIDByPageID(pageid=arguments.pageID); // Build the doc path for the subsite security for get file //var docGetFilePath = request.subsiteCache[docSubisteID].DLGLOADER & "?csModule=security/getfile&PageID=" & arguments.pageID; //return docGetFilePath;