src/snac/client/webui/WebUIExecutor.php
/**
     * Send Constellation to User
     *
     * Requests the server to send the given constellation to a specific user.
     *
     * @param string[] $input Post/Get inputs from the webui
     * @return string[] The web ui's response to the client (array ready for json_encode)
     */
Send Constellation to User
Requests the server to send the given constellation to a specific user.

@param string[] $input Post/Get inputs from the webui
@return string[] The web ui's response to the client (array ready for json_encode)
Send Constellation to User Requests the server to send the given constellation to a specific user . @param string [] $input Post / Get inputs from the webui @return string [] The web ui ' s response to the client ( array ready for json_encode )
public function sendConstellation(&$input) {
        $constellation = null;
        if (isset($input["constellationid"]) && isset($input["version"])) {
            $constellation = new \snac\data\Constellation();
            $constellation->setID($input["constellationid"]);
            $constellation->setVersion($input["version"]);
        } else if (isset($input["id"]) && isset($input["version"])) {
            $mapper = new \snac\client\webui\util\ConstellationPostMapper();
            $constellation = $mapper->serializeToConstellation($input);
        } else {
            return array( "result" => "failure", "error" => "No constellation or version number");
        }
        $this->logger->addDebug("sending constellation", $constellation->toArray());
        $request = array (
                "command" => "reassign_constellation"
        );
        if (isset($input["editor"]) && $input["editor"] != "") {
            $editor = new \snac\data\User();
            $editor->setUserName($input["editor"]);
            $request["to_user"] = $editor->toArray();
            $this->logger->addDebug("Sending Constellation to ".$input["editor"], $editor->toArray());
        } else {
            return array( "result" => "failure", "error" => "No editor to send constellation");
        }
        if (isset($input['savemessage']) || isset($input["reviewmessage"])) {
            $message = "";
            if (isset($input["reviewmessage"]))
                $message .= $input["reviewmessage"] . "\n\n";
            if (isset($input["savemessage"]))
                $message .= $input["savemessage"];
            $request["message"] = $message;
        }
        $request["constellation"] = $constellation->toArray();
        $serverResponse = $this->connect->query($request);
        $response = array ();
        $response["server_debug"] = array ();
        $response["server_debug"]["send"] = $serverResponse;
        if (isset($serverResponse["result"]))
            $response["result"] = $serverResponse["result"];
        if (isset($serverResponse["error"]))
            $response["error"] = $serverResponse["error"];
        return $response;
    }
public function sendConstellation ( & $ input ) { $ constellation = null ; if ( isset ( $ input [ " constellationid " ] ) && isset ( $ input [ " version " ] ) ) { $ constellation = new \ snac \ data \ Constellation ( ) ; $ constellation -> setID ( $ input [ " constellationid " ] ) ; $ constellation -> setVersion ( $ input [ " version " ] ) ; } else if ( isset ( $ input [ " id " ] ) && isset ( $ input [ " version " ] ) ) { $ mapper = new \ snac \ client \ webui \ util \ ConstellationPostMapper ( ) ; $ constellation = $ mapper -> serializeToConstellation ( $ input ) ; } else { return array ( " result " => " failure " , " error " => " No constellation or version number " ) ; } $ this -> logger -> addDebug ( " sending constellation " , $ constellation -> toArray ( ) ) ; $ request = array ( " command " => " reassign_constellation " ) ; if ( isset ( $ input [ " editor " ] ) && $ input [ " editor " ] != " " ) { $ editor = new \ snac \ data \ User ( ) ; $ editor -> setUserName ( $ input [ " editor " ] ) ; $ request [ " to_user " ] = $ editor -> toArray ( ) ; $ this -> logger -> addDebug ( " Sending Constellation to  " . $ input [ " editor " ] , $ editor -> toArray ( ) ) ; } else { return array ( " result " => " failure " , " error " => " No editor to send constellation " ) ; } if ( isset ( $ input [ 'savemessage' ] ) || isset ( $ input [ " reviewmessage " ] ) ) { $ message = " " ; if ( isset ( $ input [ " reviewmessage " ] ) ) $ message .= $ input [ " reviewmessage " ] . " \n \n " ; if ( isset ( $ input [ " savemessage " ] ) ) $ message .= $ input [ " savemessage " ] ; $ request [ " message " ] = $ message ; } $ request [ " constellation " ] = $ constellation -> toArray ( ) ; $ serverResponse = $ this -> connect -> query ( $ request ) ; $ response = array ( ) ; $ response [ " server_debug " ] = array ( ) ; $ response [ " server_debug " ] [ " send " ] = $ serverResponse ; if ( isset ( $ serverResponse [ " result " ] ) ) $ response [ " result " ] = $ serverResponse [ " result " ] ; if ( isset ( $ serverResponse [ " error " ] ) ) $ response [ " error " ] = $ serverResponse [ " error " ] ; return $ response ; }
Send Constellation to User
 Requests the server to send the given constellation to a specific user.
Send Constellation to User Requests the server to send the given constellation to a specific user .
// Get the constellation object // Build a data structure to send to the server // Add reviewer if we have it // Add a message if we have it // Send the query to the server