src/snac/client/webui/WebUIExecutor.php
/**
     * Process a Merge
     *
     * Takes the merged input data from the merge page, converts the merged Constellation into a
     * Constellation object and asks the server to perform the 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 a Merge
Takes the merged input data from the merge page, converts the merged Constellation into a
Constellation object and asks the server to perform the 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 a Merge Takes the merged input data from the merge page converts the merged Constellation into a Constellation object and asks the server to perform the 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 processMerge(&$input, &$display) {
        $mapper = new \snac\client\webui\util\ConstellationPostMapper();
        $mapper->allowTermLookup();
        $mapper->mapAsNewConstellation();
        $constellation = $mapper->serializeToConstellation($input);
        if ($constellation != null && isset($input["constellationid1"]) && isset($input["constellationid2"])) {
            $query = [
                "command" => "constellation_merge",
                "constellationids" => [
                    $input["constellationid1"],
                    $input["constellationid2"]
                ],
                "constellation" => $constellation->toArray()
            ];
            $this->logger->addDebug("Asking server to do the 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 processMerge ( & $ input , & $ display ) { $ mapper = new \ snac \ client \ webui \ util \ ConstellationPostMapper ( ) ; $ mapper -> allowTermLookup ( ) ; $ mapper -> mapAsNewConstellation ( ) ; $ constellation = $ mapper -> serializeToConstellation ( $ input ) ; if ( $ constellation != null && isset ( $ input [ " constellationid1 " ] ) && isset ( $ input [ " constellationid2 " ] ) ) { $ query = [ " command " => " constellation_merge " , " constellationids " => [ $ input [ " constellationid1 " ] , $ input [ " constellationid2 " ] ] , " constellation " => $ constellation -> toArray ( ) ] ; $ this -> logger -> addDebug ( " Asking server to do the 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 a Merge
 Takes the merged input data from the merge page, converts the merged Constellation into a
 Constellation object and asks the server to perform the merge.
Process a Merge Takes the merged input data from the merge page converts the merged Constellation into a Constellation object and asks the server to perform the merge .
// All the information should come VIA post to build the preview // Serialize constellation object // Ask the server to do the merge // Since this was just merged, it is currently editable