src/bin/serialize_to_xml.js
function connectionToJson(object) {
        var pointerNames = theCore.getPointerNames(object);
        var src = null;
        var dst = null;
        if (pointerNames.indexOf('source') !== -1) {
            src = theCore.loadPointer(object, 'source');
        }
        if (pointerNames.indexOf('target') !== -1) {
            dst = theCore.loadPointer(object, 'target');
        }
        return TASYNC.call(function (s, d) {
            var jsonObject = initJsonObject(object);
            if (s !== null) {
                if (theCore.getRegistry(s, 'metameta') === 'refport') {
                    var sA = theCore.getParent(s);
                    jsonObject._children.push({
                        _type: 'connpoint',
                        _empty: true,
                        _attr: {
                            role: "src",
                            target: theCore.getRegistry(s, 'id'),
                            refs: theCore.getRegistry(sA, 'id')
                        }
                    });
                } else {
                    jsonObject._children.push({
                        _type: 'connpoint',
                        _empty: true,
                        _attr: {
                            role: "src",
                            target: theCore.getRegistry(s, 'id')
                        }
                    });
                }
            }
            if (d !== null) {
                if (theCore.getRegistry(d, 'metameta') === 'refport') {
                    var dA = theCore.getParent(d);
                    jsonObject._children.push({
                        _type: 'connpoint',
                        _empty: true,
                        _attr: {
                            role: "dst",
                            target: theCore.getRegistry(d, 'id'),
                            refs: theCore.getRegistry(dA, 'id')
                        }
                    });
                } else {
                    jsonObject._children.push({
                        _type: 'connpoint',
                        _empty: true,
                        _attr: {
                            role: "dst",
                            target: theCore.getRegistry(d, 'id')
                        }
                    });
                }
            }
            return jsonObject;
        }, src, dst);
    }
function connectionToJson(object) {
        var pointerNames = theCore.getPointerNames(object);
        var src = null;
        var dst = null;
        if (pointerNames.indexOf('source') !== -1) {
            src = theCore.loadPointer(object, 'source');
        }
        if (pointerNames.indexOf('target') !== -1) {
            dst = theCore.loadPointer(object, 'target');
        }
        return TASYNC.call(function (s, d) {
            var jsonObject = initJsonObject(object);
            if (s !== null) {
                if (theCore.getRegistry(s, 'metameta') === 'refport') {
                    var sA = theCore.getParent(s);
                    jsonObject._children.push({
                        _type: 'connpoint',
                        _empty: true,
                        _attr: {
                            role: "src",
                            target: theCore.getRegistry(s, 'id'),
                            refs: theCore.getRegistry(sA, 'id')
                        }
                    });
                } else {
                    jsonObject._children.push({
                        _type: 'connpoint',
                        _empty: true,
                        _attr: {
                            role: "src",
                            target: theCore.getRegistry(s, 'id')
                        }
                    });
                }
            }
            if (d !== null) {
                if (theCore.getRegistry(d, 'metameta') === 'refport') {
                    var dA = theCore.getParent(d);
                    jsonObject._children.push({
                        _type: 'connpoint',
                        _empty: true,
                        _attr: {
                            role: "dst",
                            target: theCore.getRegistry(d, 'id'),
                            refs: theCore.getRegistry(dA, 'id')
                        }
                    });
                } else {
                    jsonObject._children.push({
                        _type: 'connpoint',
                        _empty: true,
                        _attr: {
                            role: "dst",
                            target: theCore.getRegistry(d, 'id')
                        }
                    });
                }
            }
            return jsonObject;
        }, src, dst);
    }
function connectionToJson ( object ) { var pointerNames = theCore . getPointerNames ( object ) ; var src = null ; var dst = null ; if ( pointerNames . indexOf ( 'source' ) !== - 1 ) { src = theCore . loadPointer ( object , 'source' ) ; } if ( pointerNames . indexOf ( 'target' ) !== - 1 ) { dst = theCore . loadPointer ( object , 'target' ) ; } return TASYNC . call ( function ( s , d ) { var jsonObject = initJsonObject ( object ) ; if ( s !== null ) { if ( theCore . getRegistry ( s , 'metameta' ) === 'refport' ) { var sA = theCore . getParent ( s ) ; jsonObject . _children . push ( { _type : 'connpoint' , _empty : true , _attr : { role : "src" , target : theCore . getRegistry ( s , 'id' ) , refs : theCore . getRegistry ( sA , 'id' ) } } ) ; } else { jsonObject . _children . push ( { _type : 'connpoint' , _empty : true , _attr : { role : "src" , target : theCore . getRegistry ( s , 'id' ) } } ) ; } } if ( d !== null ) { if ( theCore . getRegistry ( d , 'metameta' ) === 'refport' ) { var dA = theCore . getParent ( d ) ; jsonObject . _children . push ( { _type : 'connpoint' , _empty : true , _attr : { role : "dst" , target : theCore . getRegistry ( d , 'id' ) , refs : theCore . getRegistry ( dA , 'id' ) } } ) ; } else { jsonObject . _children . push ( { _type : 'connpoint' , _empty : true , _attr : { role : "dst" , target : theCore . getRegistry ( d , 'id' ) } } ) ; } } return jsonObject ; } , src , dst ) ; }
new TASYNC compatible functions
new TASYNC compatible functions