modules/orionode/lib/shared/sharedUtil.js
function treeJSON(name, location, timestamp, dir, length, addNameToLoc) {
        location = api.toURLPath(location);
        if (typeof addNameToLoc == 'undefined' || addNameToLoc) {
            location += "/" + name;
        }
        var result = {
            Name: name,
            LocalTimeStamp: timestamp,
            Directory: dir,
            Length: length,
            Location: location ? contextPath +"/sharedWorkspace/tree/file" + location : contextPath +"/sharedWorkspace/tree",
            ChildrenLocation: dir ? (location ? contextPath +"/sharedWorkspace/tree/file" + location + "?depth=1": contextPath +"/sharedWorkspace/tree" + "?depth=1") : undefined,
            Parents: fileUtil.getParents(contextPath +'/sharedWorkspace/tree/file' + location.split('/').splice(0, 2).join('/'), location.split('/').splice(2).join('/')),
            Attributes: {
                ReadOnly: false
            }
        };
        result.ImportLocation = result.Location.replace(/\/sharedWorkspace\/tree\/file/, "/sharedWorkspace/tree/xfer/import").replace(/\/$/, "");
        result.ExportLocation = result.Location.replace(/\/sharedWorkspace\/tree\/file/, "/sharedWorkspace/tree/xfer/export").replace(/\/$/, "") + ".zip";
        return result;
    }
function treeJSON(name, location, timestamp, dir, length, addNameToLoc) {
        location = api.toURLPath(location);
        if (typeof addNameToLoc == 'undefined' || addNameToLoc) {
            location += "/" + name;
        }
        var result = {
            Name: name,
            LocalTimeStamp: timestamp,
            Directory: dir,
            Length: length,
            Location: location ? contextPath +"/sharedWorkspace/tree/file" + location : contextPath +"/sharedWorkspace/tree",
            ChildrenLocation: dir ? (location ? contextPath +"/sharedWorkspace/tree/file" + location + "?depth=1": contextPath +"/sharedWorkspace/tree" + "?depth=1") : undefined,
            Parents: fileUtil.getParents(contextPath +'/sharedWorkspace/tree/file' + location.split('/').splice(0, 2).join('/'), location.split('/').splice(2).join('/')),
            Attributes: {
                ReadOnly: false
            }
        };
        result.ImportLocation = result.Location.replace(/\/sharedWorkspace\/tree\/file/, "/sharedWorkspace/tree/xfer/import").replace(/\/$/, "");
        result.ExportLocation = result.Location.replace(/\/sharedWorkspace\/tree\/file/, "/sharedWorkspace/tree/xfer/export").replace(/\/$/, "") + ".zip";
        return result;
    }
function treeJSON ( name , location , timestamp , dir , length , addNameToLoc ) { location = api . toURLPath ( location ) ; if ( typeof addNameToLoc == 'undefined' || addNameToLoc ) { location += "/" + name ; } var result = { Name : name , LocalTimeStamp : timestamp , Directory : dir , Length : length , Location : location ? contextPath + "/sharedWorkspace/tree/file" + location : contextPath + "/sharedWorkspace/tree" , ChildrenLocation : dir ? ( location ? contextPath + "/sharedWorkspace/tree/file" + location + "?depth=1" : contextPath + "/sharedWorkspace/tree" + "?depth=1" ) : undefined , Parents : fileUtil . getParents ( contextPath + '/sharedWorkspace/tree/file' + location . split ( '/' ) . splice ( 0 , 2 ) . join ( '/' ) , location . split ( '/' ) . splice ( 2 ) . join ( '/' ) ) , Attributes : { ReadOnly : false } } ; result . ImportLocation = result . Location . replace ( / \/sharedWorkspace\/tree\/file / , "/sharedWorkspace/tree/xfer/import" ) . replace ( / \/$ / , "" ) ; result . ExportLocation = result . Location . replace ( / \/sharedWorkspace\/tree\/file / , "/sharedWorkspace/tree/xfer/export" ) . replace ( / \/$ / , "" ) + ".zip" ; return result ; }
if opening a file, we don't want to add the name to the location so addNameToLoc needs to be false
else undefined
if opening a file we don t want to add the name to the location so addNameToLoc needs to be false else undefined