コード例 #1
0
    /// <summary>
    /// Copies a document to the prepared Source folder. Called when the "Copy document" button is pressed.
    /// Expects the "CreateDocumentStructure" and "CreateDocument" method to be run first.
    /// </summary>
    private bool CopyDocument()
    {
        // Create an instance of the Tree provider first
        TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);

        // Get the document
        TreeNode node = tree.SelectSingleNode(CMSContext.CurrentSiteName, "/API-Example/My-new-document", "en-us");

        // Get the new parent document
        TreeNode parentNode = tree.SelectSingleNode(CMSContext.CurrentSiteName, "/API-Example/Source", "en-us");

        if ((node != null) && (parentNode != null))
        {
            // Copy the document
            tree.CopyNode(node, parentNode.NodeID);

            return(true);
        }

        return(false);
    }
コード例 #2
0
    /// <summary>
    /// Copies a document to the prepared Source folder. Called when the "Copy document" button is pressed.
    /// Expects the "CreateDocumentStructure" and "CreateDocument" method to be run first.
    /// </summary>
    private bool CopyDocument()
    {
        // Create an instance of the Tree provider first
        TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);

        // Get the document
        TreeNode node = tree.SelectSingleNode(CMSContext.CurrentSiteName, "/API-Example/My-new-document", "en-us");

        // Get the new parent document
        TreeNode parentNode = tree.SelectSingleNode(CMSContext.CurrentSiteName, "/API-Example/Source", "en-us");

        if ((node != null) && (parentNode != null))
        {
            // Copy the document
            tree.CopyNode(node, parentNode.NodeID);

            return true;
        }

        return false;
    }