Esempio n. 1
0
</form>
<br/>

<?php 
if (WorkbenchContext::get()->getDefaultObject()) {
    $describeSObjectResult = WorkbenchContext::get()->describeSObjects(WorkbenchContext::get()->getDefaultObject());
    $alwaysArrayChildren = array("recordTypeInfos", "childRelationships");
    foreach ($alwaysArrayChildren as $child) {
        if (isset($describeSObjectResult->{$child}) && !is_array($describeSObjectResult->{$child})) {
            $describeSObjectResult->{$child} = array($describeSObjectResult->{$child});
        }
    }
    $forceCollapse = WorkbenchContext::get()->hasDefaultObjectChanged();
    $processedResults = ExpandableTree::processResults($describeSObjectResult, "Attributes", true);
    ?>
    <div class="legend">
        <strong>Legend:</strong>
        <ul>
            <li class="trueColor">True</li>
            <li class="falseColor">False</li>
            <li class="highlightCustomField">Custom Field</li>
            <li class="highlightSystemField">System Field</li>
        </ul>
    </div>
    <?php 
    $tree = new ExpandableTree("describeTree", $processedResults);
    $tree->setForceCollapse($forceCollapse);
    $tree->setAdditionalMenus(ExpandableTree::getClearCacheMenu());
    $tree->printTree();
}
require_once 'footer.php';
        print "<p/>";
        displayInfo("Successfully staged " . ceil($_FILES["deployFile"]["size"] / 1024) . " KB zip file " . $_FILES["deployFile"]["name"] . " for deployment.", true, false);
        ?>
<p class='instructions'>Confirm the following deployment options:</p>
<form id='deployForm' name='deployForm' method='POST'
    action=''>
    <?php 
        print getCsrfFormTag();
        ?>
    <input type='hidden' name='deployFileTmpName' value='<?php 
        print $deployFileTmpName;
        ?>
' />
<p />
    <?php 
        $tree = new ExpandableTree("deployOptionsTree", $_SESSION[$deployFileTmpName . "_OPTIONS"]);
        $tree->setForceCollapse(true);
        $tree->printTree();
        ?>
<p />
    <?php 
        if (!isset($_POST['checkOnly'])) {
            displayWarning("Warning, this deployment will make permanent changes to this organization's metadata and cannot be rolled back. " . "Use the 'Check Only' option to validate this deployment without making changes.");
            print "<p/>";
        }
        ?>
 <input type='submit' name='deploymentConfirmed' value='Deploy' />
</form>
    <?php 
    } else {
        require_once 'header.php';
</form>
<p />

<?php 
if (isset($typeString)) {
    if (!isset($metadataTypeMap[$typeString])) {
        if (isset($_REQUEST['type']) && $_REQUEST['type']) {
            displayError("Invalid metadata type type: {$typeString}", false, true);
        }
        exit;
    }
    $type = $metadataTypeMap[$typeString];
    $_SESSION['defaultMetadataType'] = $typeString;
    $metadataComponents = listMetadata($type);
    $componentsLabel = "Components (" . count($metadataComponents) . ")";
    $tree = new ExpandableTree("listMetadataTree", array("Type Description" => $type, $componentsLabel => $metadataComponents));
    $tree->setForceCollapse($typeStringChanged);
    $tree->setContainsIds(true);
    $tree->setContainsDates(true);
    $tree->printTree();
}
require_once 'footer.php';
function listMetadata($type)
{
    try {
        if (isset($type->childXmlName)) {
            return processListMetadataResult(WorkbenchContext::get()->getMetadataConnection()->listMetadata($type->childXmlName, null, WorkbenchContext::get()->getApiVersion()));
        }
        if (!$type->inFolder) {
            return processListMetadataResult(WorkbenchContext::get()->getMetadataConnection()->listMetadata($type->xmlName, null, WorkbenchContext::get()->getApiVersion()));
        }
Esempio n. 4
0
        }
    }
} catch (Exception $e) {
    $errors[] = "Partner API Error: " . $e->getMessage();
}
if (WorkbenchContext::get()->isApiVersionAtLeast(10.0)) {
    try {
        foreach (WorkbenchContext::get()->getMetadataConnection()->describeMetadata(WorkbenchContext::get()->getApiVersion()) as $resultsKey => $resultsValue) {
            if ($resultsKey != 'metadataObjects' && !is_array($resultsValue)) {
                $sessionInfo['Metadata'][$resultsKey] = $resultsValue;
            }
        }
    } catch (Exception $e) {
        $sessionInfo['Metadata']['Error'] = $e->getMessage();
    }
}
if (count($errors) > 0) {
    print "<p>&nbsp;</p>";
    displayError($errors);
    print "</p>";
}
$tree = new ExpandableTree("sessionInfoTree", $sessionInfo);
$tree->setContainsDates(true);
$tree->setContainsIds(true);
$tree->setAdditionalMenus(ExpandableTree::getClearCacheMenu());
$tree->printTree();
print "</div>";
require_once 'footer.php';
?>

        $zipLink = null;
        if (isset($results->zipFile) || isset($results->retrieveResult->zipFile)) {
            if (isset($results->zipFile)) {
                $_SESSION['retrievedZips'][$asyncResults->id] = $results->zipFile;
                unset($results->zipFile);
            } else {
                if (isset($results->retrieveResult->zipFile)) {
                    $_SESSION['retrievedZips'][$asyncResults->id] = $results->retrieveResult->zipFile;
                    unset($results->retrieveResult->zipFile);
                }
            }
            displayInfo("Retrieve result ZIP file is ready for download.");
            print "<p/>";
            $zipLink = " | <a id='zipLink' href='?asyncProcessId={$asyncResults->id}&downloadZip' onclick='undownloadedZip=false;' style='text-decoration:none;'>" . "<span style='text-decoration:underline;'>Download ZIP File</span> <img src='" . getPathToStaticResource('/images/downloadIconCompleted.gif') . "' border='0'/>" . "</a></p>";
        }
        $tree = new ExpandableTree("metadataStatusResultsTree", ExpandableTree::processResults($results));
        $tree->setForceCollapse(true);
        $tree->setAdditionalMenus($zipLink);
        $tree->setContainsIds(true);
        $tree->setContainsDates(true);
        $tree->printTree();
        if (isset($debugInfo["DebuggingInfo"]->debugLog)) {
            print "<p>&nbsp;</p><h3>Debug Logs</h3>";
            print "<pre>" . addLinksToIds(htmlspecialchars($debugInfo["DebuggingInfo"]->debugLog, ENT_QUOTES)) . '</pre>';
        }
        // if metadata changes were deployed, clear the cache because describe results will probably be different
        if ($operation == "D") {
            WorkbenchContext::get()->clearCache();
        }
    }
} catch (Exception $e) {