コード例 #1
0
        /*
        private static void nullStructuredData(structureddatanodes sDataNodes)
        {
            if (sDataNodes != null & sDataNodes.structuredDataNode != null)
            {
                for (int k = 0; k < sDataNodes.structuredDataNode.Length; k++)
                {
                    if (structureddatatype.asset == sDataNodes.structuredDataNode[k].type)
                    {
                        sDataNodes.structuredDataNode[k].text = null;

                        if (sDataNodes.structuredDataNode[k].assetType == structureddataassettype.block)
                        {
                            if (sDataNodes.structuredDataNode[k].blockId == null && sDataNodes.structuredDataNode[k].blockPath == null)
                            {
                                sDataNodes.structuredDataNode[k].blockPath = "";
                            }
                            else
                            {
                                sDataNodes.structuredDataNode[k].blockId = null;
                            }
                        }
                        else if (sDataNodes.structuredDataNode[k].assetType == structureddataassettype.file)
                        {
                            if (sDataNodes.structuredDataNode[k].fileId == null && sDataNodes.structuredDataNode[k].filePath == null)
                            {
                                sDataNodes.structuredDataNode[k].filePath = "";
                            }
                            else
                            {
                                sDataNodes.structuredDataNode[k].fileId = null;
                            }
                        }
                        else if (sDataNodes.structuredDataNode[k].assetType == structureddataassettype.page)
                        {
                            if (sDataNodes.structuredDataNode[k].pageId == null && sDataNodes.structuredDataNode[k].pagePath == null)
                            {
                                sDataNodes.structuredDataNode[k].pagePath = "";
                            }
                            else
                            {
                                sDataNodes.structuredDataNode[k].pageId = null;
                            }
                        }
                        else if (sDataNodes.structuredDataNode[k].assetType == structureddataassettype.symlink)
                        {
                            if (sDataNodes.structuredDataNode[k].symlinkId == null && sDataNodes.structuredDataNode[k].symlinkPath == null)
                            {
                                sDataNodes.structuredDataNode[k].symlinkPath = "";
                            }
                            else
                            {
                                sDataNodes.structuredDataNode[k].symlinkId = null;
                            }
                        }
                    }
                    else if (structureddatatype.group == sDataNodes.structuredDataNode[k].type)
                    {
                        structureddatanodes sDataNodeArray = sDataNodes.structuredDataNode[k].structuredDataNodes;
                        nullStructuredData(sDataNodeArray);
                        sDataNodes.structuredDataNode[k].text = null;
                        sDataNodes.structuredDataNode[k].assetType = null;
                    }
                    else if (structureddatatype.text == sDataNodes.structuredDataNode[k].type)
                    {
                        sDataNodes.structuredDataNode[k].assetType = null;
                        sDataNodes.structuredDataNode[k].structuredDataNodes = null;
                        if (sDataNodes.structuredDataNode[k].text == null)
                        {
                            sDataNodes.structuredDataNode[k].text = "";
                        }
                    }
                    else
                    {
                        sDataNodes.structuredDataNode[k].assetType = null;
                        sDataNodes.structuredDataNode[k].text = null;
                    }
                }
            }
        }*/

        /**
            * Nulls out unneeded properties on File objects.
            * 
            * @param file
            */
        public static void nullFileValues(file file)
        {
            nullPublishableValues(file);
            if ((file.text != null) && (file.text != ""))
                file.data = null;
            else
                file.text = null;
        }
コード例 #2
0
        public static string printFileData(file file)
        {
            string val = "<li>File = ";

            if (file != null)
            {
                val += "<ul>";
                val += "<li>data = " + file.data + "</li>";
                val += "<li>entityType = " + file.entityType + "</li>";
                val += "<li>exirationFolderId = " + file.expirationFolderId +"</li>";
                val += "<li>exirationFolderPath = " + file.expirationFolderPath + "</li>";
                val += "<li>exirationFolderRecycled = " + file.expirationFolderRecycled + "</li>";
                val += "<li>exirationFolderRecycledSpecified = " + file.expirationFolderRecycledSpecified + "</li>";
                val += "<li>id = " + file.id + "</li>";
                val += "<li>lastModifiedBy = " + file.lastModifiedBy + "</li>";
                val += "<li>lastModifiedDate = " + file.lastModifiedDate + "</li>";
                val += "<li>lastModifiedDateSpecified = " + file.lastModifiedDateSpecified + "</li>";
                val += "<li>lastPublishedBy = " + file.lastPublishedBy + "</li>";
                val += "<li>lastPublishedDate = " + file.lastPublishedDate + "</li>";
                val += "<li>lastPublishedDateSpecified = " + file.lastPublishedDateSpecified + "</li>";
                val += "<li>maintainAbsoluteLinks = " + file.maintainAbsoluteLinks + "</li>";
                val += "<li>maintainAbsoluteLinksSpecified = " + file.maintainAbsoluteLinksSpecified + "</li>";
                val += "<li>metadata = " + printMetadata(file.metadata) +"</li>";
                val += "<li>metadataSetId = " + file.metadataSetId + "</li>";
                val += "<li>metadataSetPath = " + file.metadataSetPath + "</li>";
                val += "<li>name = " + file.name + "</li>";
                val += "<li>parentFolderId = " + file.parentFolderId + "</li>";
                val += "<li>parentFolderPath = " + file.parentFolderPath + "</li>";
                val += "<li>path = " + file.path + "</li>";
                val += "<li>rewriteLinks = " + file.rewriteLinks + "</li>";
                val += "<li>rewriteLinksSpecified = " + file.rewriteLinksSpecified + "</li>";
                val += "<li>shouldBeIndexed = " + file.shouldBeIndexed + "</li>";
                val += "<li>shouldBeIndexedSpecified = " + file.shouldBeIndexedSpecified + "</li>";
                val += "<li>shouldBePublished = " + file.shouldBePublished + "</li>";
                val += "<li>shouldBePublishedSpecified = " + file.shouldBePublishedSpecified + "</li>";
                val += "<li>siteId = " + file.siteId + "</li>";
                val += "<li>siteName = " + file.siteName + "</li>";
                val += "<li>text = " + file.text + "</li>";
                val += "</ul>";
            }
            else
            {
                val += "null";
            }

            val += "</li>";
            return val;
        }