src/snac/client/webui/WebUIExecutor.php
/**
     * Process Automatic Merge
     *
     * Takes a list of Constellation IDs as input from the user and try to merge.  If the merge is successful,
     * this method will load the new (merged) Constellation into the detailed view template for
     * display to the user.
     *
     * @param string[] $input Post/Get inputs from the webui
     * @param \snac\client\webui\display\Display $display The display object for page creation
     */
Process Automatic Merge
Takes a list of Constellation IDs as input from the user and try to merge.  If the merge is successful,
this method will load the new (merged) Constellation into the detailed view template for
display to the user.


Process Automatic Merge Takes a list of Constellation IDs as input from the user and try to merge . If the merge is successful this method will load the new ( merged ) Constellation into the detailed view template for display to the user .
public function processAutoMerge(&$input, &$display) {
        if (isset($input["mergecount"]) && is_numeric($input["mergecount"]) && $input["mergecount"] > 1) {
            $count = $input["mergecount"];
            $icids = array();
            for ($i = 1; $i <= $count; $i++) {
                if (!isset($input["constellationid" .$i])) {
                    $this->logger->addDebug("Error page being drawn");
                    $this->drawErrorPage(["error" => "Could not auto-merge"], $display);
                }
                array_push($icids, $input["constellationid" . $i]);
            }
            $query = [
                "command" => "constellation_auto_merge",
                "constellationids" => $icids
            ];
            $this->logger->addDebug("Asking server to do the auto merge");
            $serverResponse = $this->connect->query($query);
            $this->logger->addDebug("Received server response", array($serverResponse));
            if (isset($serverResponse["constellation"])) {
                $display->setTemplate("detailed_view_page");
                if (\snac\Config::$DEBUG_MODE == true) {
                    $display->addDebugData("constellationSource", json_encode($serverResponse["constellation"], JSON_PRETTY_PRINT));
                    $display->addDebugData("serverResponse", json_encode($serverResponse, JSON_PRETTY_PRINT));
                }
                $serverResponse["constellation"]["status"] = "editable";
                $this->logger->addDebug("Setting constellation data into the page template");
                $display->setData($serverResponse["constellation"]);
            } else {
                $this->logger->addDebug("Error page being drawn");
                $this->drawErrorPage($serverResponse, $display);
            }
        }
    }
public function processAutoMerge ( & $ input , & $ display ) { if ( isset ( $ input [ " mergecount " ] ) && is_numeric ( $ input [ " mergecount " ] ) && $ input [ " mergecount " ] > 1 ) { $ count = $ input [ " mergecount " ] ; $ icids = array ( ) ; for ( $ i = 1 ; $ i <= $ count ; $ i ++ ) { if ( ! isset ( $ input [ " constellationid " . $ i ] ) ) { $ this -> logger -> addDebug ( " Error page being drawn " ) ; $ this -> drawErrorPage ( [ " error " => " Could not auto-merge " ] , $ display ) ; } array_push ( $ icids , $ input [ " constellationid " . $ i ] ) ; } $ query = [ " command " => " constellation_auto_merge " , " constellationids " => $ icids ] ; $ this -> logger -> addDebug ( " Asking server to do the auto merge " ) ; $ serverResponse = $ this -> connect -> query ( $ query ) ; $ this -> logger -> addDebug ( " Received server response " , array ( $ serverResponse ) ) ; if ( isset ( $ serverResponse [ " constellation " ] ) ) { $ display -> setTemplate ( " detailed_view_page " ) ; if ( \ snac \ Config :: $ DEBUG_MODE == true ) { $ display -> addDebugData ( " constellationSource " , json_encode ( $ serverResponse [ " constellation " ] , JSON_PRETTY_PRINT ) ) ; $ display -> addDebugData ( " serverResponse " , json_encode ( $ serverResponse , JSON_PRETTY_PRINT ) ) ; } $ serverResponse [ " constellation " ] [ " status " ] = " editable " ; $ this -> logger -> addDebug ( " Setting constellation data into the page template " ) ; $ display -> setData ( $ serverResponse [ " constellation " ] ) ; } else { $ this -> logger -> addDebug ( " Error page being drawn " ) ; $ this -> drawErrorPage ( $ serverResponse , $ display ) ; } } }
Process Automatic Merge
 Takes a list of Constellation IDs as input from the user and try to merge.
Process Automatic Merge Takes a list of Constellation IDs as input from the user and try to merge .
// Ask the server to do the merge // Since this was just merged, it is currently editable