src/snac/server/ServerExecutor.php
/**
     * Publish Functionality
     *
     * This method actually does the publishing of a constellation.  If the constellation does not
     * have an ARK, it is assigned one (temporary or permanent depending on the SANDBOX_MODE config
     * variable.  It then updates the status to published.
     *
     * @param \snac\data\Constellation $constellation The constellation to publish
     * @return integer|boolean Returns the new version number on success or false on failure.
     */
Publish Functionality
This method actually does the publishing of a constellation.  If the constellation does not
have an ARK, it is assigned one (temporary or permanent depending on the SANDBOX_MODE config
variable.  It then updates the status to published.

@param \snac\data\Constellation $constellation The constellation to publish
@return integer|boolean Returns the new version number on success or false on failure.
Publish Functionality This method actually does the publishing of a constellation . If the constellation does not have an ARK it is assigned one ( temporary or permanent depending on the SANDBOX_MODE config variable . It then updates the status to published . @param \ snac \ data \ Constellation $constellation The constellation to publish @return integer|boolean Returns the new version number on success or false on failure .
protected function corePublish(&$constellation) {
        if ($constellation->getArk() === null) {
            $arkManager = new \ark\ArkManager();
            $newArk = null;
            if (\snac\Config::$SANDBOX_MODE) {
                $newArk = $arkManager->mintTemporaryArk();
            } else {
                $newArk = $arkManager->mintArk();
            }
            $microConstellation = new \snac\data\Constellation();
            $microConstellation->setID($constellation->getID());
            $microConstellation->setVersion($constellation->getVersion());
            $microConstellation->setArkID($newArk);
            $microConstellation->setEntityType($constellation->getEntityType());
            $microConstellation->setOperation(\snac\data\Constellation::$OPERATION_UPDATE);
            $written = $this->cStore->writeConstellation($this->user, $microConstellation,
            "System assigning new ARK to constellation", "locked editing");
            if ($written !== false && $written != null) {
                $result = $written->getVersion();
                unset($written);
            }
            $constellation->setArkID($newArk);
        }
        $selfDirect = array($constellation);
        $this->cStore->updateConstellationLookup($constellation, $selfDirect);
        return $this->cStore->writeConstellationStatus($this->user, $constellation->getID(),
                                                        "published", "User published constellation");
    }
protected function corePublish ( & $ constellation ) { if ( $ constellation -> getArk ( ) === null ) { $ arkManager = new \ ark \ ArkManager ( ) ; $ newArk = null ; if ( \ snac \ Config :: $ SANDBOX_MODE ) { $ newArk = $ arkManager -> mintTemporaryArk ( ) ; } else { $ newArk = $ arkManager -> mintArk ( ) ; } $ microConstellation = new \ snac \ data \ Constellation ( ) ; $ microConstellation -> setID ( $ constellation -> getID ( ) ) ; $ microConstellation -> setVersion ( $ constellation -> getVersion ( ) ) ; $ microConstellation -> setArkID ( $ newArk ) ; $ microConstellation -> setEntityType ( $ constellation -> getEntityType ( ) ) ; $ microConstellation -> setOperation ( \ snac \ data \ Constellation :: $ OPERATION_UPDATE ) ; $ written = $ this -> cStore -> writeConstellation ( $ this -> user , $ microConstellation , " System assigning new ARK to constellation " , " locked editing " ) ; if ( $ written !== false && $ written != null ) { $ result = $ written -> getVersion ( ) ; unset ( $ written ) ; } $ constellation -> setArkID ( $ newArk ) ; } $ selfDirect = array ( $ constellation ) ; $ this -> cStore -> updateConstellationLookup ( $ constellation , $ selfDirect ) ; return $ this -> cStore -> writeConstellationStatus ( $ this -> user , $ constellation -> getID ( ) , " published " , " User published constellation " ) ; }
Publish Functionality
 This method actually does the publishing of a constellation.
Publish Functionality This method actually does the publishing of a constellation .
// We must mint an ark // Mint a temporary ark if we are in testing mode, else mint real ark // If this is published, then it should point to itself in the lookup table.