src/snac/server/ServerExecutor.php
/**
     * Checkout Constellation
     *
     * Similar to editConstellation, this method returns a Constellation on the response.  If the client provided
     * an ark id, this constellation is generated by using the EAC-CPF parser.  If the client provided a
     * constellation id, it upgrades the status to "currently editing" and then returns the constellation in the response.
     *
     * @param string[] $input Input array from the Server object
     * @throws \snac\exceptions\SNACPermissionException
     * @return string[] The response to send to the client
     */
Checkout Constellation
Similar to editConstellation, this method returns a Constellation on the response.  If the client provided
an ark id, this constellation is generated by using the EAC-CPF parser.  If the client provided a
constellation id, it upgrades the status to "currently editing" and then returns the constellation in the response.

@param string[] $input Input array from the Server object
@throws \snac\exceptions\SNACPermissionException
@return string[] The response to send to the client
Checkout Constellation Similar to editConstellation this method returns a Constellation on the response . If the client provided an ark id this constellation is generated by using the EAC - CPF parser . If the client provided a constellation id it upgrades the status to " currently editing " and then returns the constellation in the response . @param string [] $input Input array from the Server object @throws \ snac \ exceptions \ SNACPermissionException @return string [] The response to send to the client
public function checkoutConstellation(&$input) {
        $this->logger->addDebug("Checking out Constellation");
        $response = array();
        if (isset($input["constellation"])) {
            $constellation = new \snac\data\Constellation($input["constellation"]);
            try {
                $this->logger->addDebug("Reading constellation status from the database");
                $cId = $constellation->getID();
                $info = $this->cStore->readConstellationUserStatus($cId);
                if (!is_array($info)) {
                    throw new \snac\exceptions\SNACInputException("Constellation does not have a current version", 404);
                }
                $status = $info["status"];
                if ($info["userid"] === $this->user->getUserID() && $status === "currently editing") {
                    throw new \snac\exceptions\SNACConcurrentEditException("Constellation currently opened in another window", 403);
                }
                if ( $status == "published" || ($status == "needs review" && $this->hasPermission("Change Locks"))) {
                    $success = $this->cStore->writeConstellationStatus($this->user, $cId, "locked editing");
                    if ($success === false) {
                        $this->logger->addError("Writing Constellation Status failed", array("user"=>$this->user, "id"=>$cId));
                    }
                    $response["result"] = "success";
                } else {
                    throw new \snac\exceptions\SNACPermissionException("Constellation is currently locked to another user.", 403);
                }
            } catch (\Exception $e) {
                throw $e;
            }
        }
        return $response;
    }
public function checkoutConstellation ( & $ input ) { $ this -> logger -> addDebug ( " Checking out Constellation " ) ; $ response = array ( ) ; if ( isset ( $ input [ " constellation " ] ) ) { $ constellation = new \ snac \ data \ Constellation ( $ input [ " constellation " ] ) ; try { $ this -> logger -> addDebug ( " Reading constellation status from the database " ) ; $ cId = $ constellation -> getID ( ) ; $ info = $ this -> cStore -> readConstellationUserStatus ( $ cId ) ; if ( ! is_array ( $ info ) ) { throw new \ snac \ exceptions \ SNACInputException ( " Constellation does not have a current version " , 404 ) ; } $ status = $ info [ " status " ] ; if ( $ info [ " userid " ] === $ this -> user -> getUserID ( ) && $ status === " currently editing " ) { throw new \ snac \ exceptions \ SNACConcurrentEditException ( " Constellation currently opened in another window " , 403 ) ; } if ( $ status == " published " || ( $ status == " needs review " && $ this -> hasPermission ( " Change Locks " ) ) ) { $ success = $ this -> cStore -> writeConstellationStatus ( $ this -> user , $ cId , " locked editing " ) ; if ( $ success === false ) { $ this -> logger -> addError ( " Writing Constellation Status failed " , array ( " user " => $ this -> user , " id " => $ cId ) ) ; } $ response [ " result " ] = " success " ; } else { throw new \ snac \ exceptions \ SNACPermissionException ( " Constellation is currently locked to another user. " , 403 ) ; } } catch ( \ Exception $ e ) { throw $ e ; } } return $ response ; }
Checkout Constellation
 Similar to editConstellation, this method returns a Constellation on the response.
Checkout Constellation Similar to editConstellation this method returns a Constellation on the response .
// Read the constellation // If the current status is published // OR the constellation needs review and the user has permission to review (TODO) // then the user is allowed to edit.  If the user is already editing, then don't allow the reserve. // Can edit this, so can also check it out // lock the constellation to the user as locked editing // Leaving a catch block for logging purposes