src/server/worker/workerrequests.js
function renameMetaPointerTarget(webgmeToken, parameters, callback) {
        var storage,
            context,
            finish = function (err, result) {
                if (err) {
                    err = err instanceof Error ? err : new Error(err);
                    logger.error('changeAttributeMeta failed with error', err);
                } else {
                    logger.debug('changeAttributeMeta completed');
                }

                if (storage) {
                    storage.close(function (closeErr) {
                        callback(err || closeErr, result);
                    });
                } else {
                    callback(err, result);
                }
            };

        getConnectedStorage(webgmeToken)
            .then(function (storage_) {
                storage = storage_;
                storage.addEventListener(storage.CONSTANTS.NETWORK_STATUS_CHANGED,
                    getNetworkStatusChangeHandler(finish));
                return _getCoreAndRootNode(storage, parameters.projectId, parameters.commitHash,
                    parameters.branchName, parameters.tagName);
            })
            .then(function (context_) {
                context = context_;
                return Q.all([context.core.loadByPath(context.rootNode, parameters.nodePath),
                    context.core.loadByPath(context.rootNode, parameters.targetPath)]);
            })
            .then(function (nodes) {
                context.core.movePointerMetaTarget(nodes[0], nodes[1], parameters.oldName, parameters.newName);
                return metaRename.propagateMetaDefinitionRename(context.core, nodes[0], parameters);
            })
            .then(function () {
                var persisted = context.core.persist(context.rootNode);

                return context.project.makeCommit(
                    parameters.branchName,
                    [context.commitObject._id],
                    persisted.rootHash,
                    persisted.objects,
                    'rename pointer definition [' + parameters.oldName + '->' +
                    parameters.newName + '] of [' + parameters.nodePath + '] regarding target [' +
                    parameters.targetPath + ']');
            })
            .nodeify(finish);
    }
function renameMetaPointerTarget(webgmeToken, parameters, callback) {
        var storage,
            context,
            finish = function (err, result) {
                if (err) {
                    err = err instanceof Error ? err : new Error(err);
                    logger.error('changeAttributeMeta failed with error', err);
                } else {
                    logger.debug('changeAttributeMeta completed');
                }

                if (storage) {
                    storage.close(function (closeErr) {
                        callback(err || closeErr, result);
                    });
                } else {
                    callback(err, result);
                }
            };

        getConnectedStorage(webgmeToken)
            .then(function (storage_) {
                storage = storage_;
                storage.addEventListener(storage.CONSTANTS.NETWORK_STATUS_CHANGED,
                    getNetworkStatusChangeHandler(finish));
                return _getCoreAndRootNode(storage, parameters.projectId, parameters.commitHash,
                    parameters.branchName, parameters.tagName);
            })
            .then(function (context_) {
                context = context_;
                return Q.all([context.core.loadByPath(context.rootNode, parameters.nodePath),
                    context.core.loadByPath(context.rootNode, parameters.targetPath)]);
            })
            .then(function (nodes) {
                context.core.movePointerMetaTarget(nodes[0], nodes[1], parameters.oldName, parameters.newName);
                return metaRename.propagateMetaDefinitionRename(context.core, nodes[0], parameters);
            })
            .then(function () {
                var persisted = context.core.persist(context.rootNode);

                return context.project.makeCommit(
                    parameters.branchName,
                    [context.commitObject._id],
                    persisted.rootHash,
                    persisted.objects,
                    'rename pointer definition [' + parameters.oldName + '->' +
                    parameters.newName + '] of [' + parameters.nodePath + '] regarding target [' +
                    parameters.targetPath + ']');
            })
            .nodeify(finish);
    }
function renameMetaPointerTarget ( webgmeToken , parameters , callback ) { var storage , context , finish = function ( err , result ) { if ( err ) { err = err instanceof Error ? err : new Error ( err ) ; logger . error ( 'changeAttributeMeta failed with error' , err ) ; } else { logger . debug ( 'changeAttributeMeta completed' ) ; } if ( storage ) { storage . close ( function ( closeErr ) { callback ( err || closeErr , result ) ; } ) ; } else { callback ( err , result ) ; } } ; getConnectedStorage ( webgmeToken ) . then ( function ( storage_ ) { storage = storage_ ; storage . addEventListener ( storage . CONSTANTS . NETWORK_STATUS_CHANGED , getNetworkStatusChangeHandler ( finish ) ) ; return _getCoreAndRootNode ( storage , parameters . projectId , parameters . commitHash , parameters . branchName , parameters . tagName ) ; } ) . then ( function ( context_ ) { context = context_ ; return Q . all ( [ context . core . loadByPath ( context . rootNode , parameters . nodePath ) , context . core . loadByPath ( context . rootNode , parameters . targetPath ) ] ) ; } ) . then ( function ( nodes ) { context . core . movePointerMetaTarget ( nodes [ 0 ] , nodes [ 1 ] , parameters . oldName , parameters . newName ) ; return metaRename . propagateMetaDefinitionRename ( context . core , nodes [ 0 ] , parameters ) ; } ) . then ( function ( ) { var persisted = context . core . persist ( context . rootNode ) ; return context . project . makeCommit ( parameters . branchName , [ context . commitObject . _id ] , persisted . rootHash , persisted . objects , 'rename pointer definition [' + parameters . oldName + '->' + parameters . newName + '] of [' + parameters . nodePath + '] regarding target [' + parameters . targetPath + ']' ) ; } ) . nodeify ( finish ) ; }
Renames the given pointer relation definitions and propagates the change throughout the whole project.
@param {string} webgmeToken
@param {object} parameters
@param {string} parameters.projectId
@param {string} parameters.branchName
@param {string} parameters.type - the type of the relation ['pointer'|'set'].
@param {string} parameters.nodePath - the starting meta node's path.
@param {string} parameters.targetPath - the path of the meta node that is the target of
the relationship definition.
@param {string} parameters.oldName - the current name of the concept.
@param {string} parameters.newName - the new name of the concept.
@param {function} callback
Renames the given pointer relation definitions and propagates the change throughout the whole project .