var FileService = Ext.extend(ServiceBase, {
    constructor: function() {
        FileService.superclass.constructor.call(this, 'FileService');
        this.entranceUrl = 'hsweb/' + this.entranceUrl;
    },

    getFileClassList: function(pathToRoot, onSuccess) {
        var invokeParam = new ServiceInvokeParam();
        invokeParam.pathToRoot = pathToRoot;
        invokeParam.actionFunc = this.getFileClassList;
        invokeParam.returnRoot = this.SIMPLE_RETURN;
        invokeParam.invokeListener = {
            success: onSuccess
        };
        this.invoke(invokeParam);
    },

    getFileListBrief: function(pathToRoot, onSuccess) {
        var invokeParam = new ServiceInvokeParam();
        invokeParam.pathToRoot = pathToRoot;
        invokeParam.actionFunc = this.getFileListBrief;
        invokeParam.returnRoot = this.SIMPLE_RETURN;
        invokeParam.invokeListener = {
            success: onSuccess
        };
        this.invoke(invokeParam);
    },

    getFileList: function(pathToRoot, aClassId, onSuccess) {
        var invokeParam = new ServiceInvokeParam();
        invokeParam.pathToRoot = pathToRoot;
        invokeParam.actionFunc = this.getFileList;
        invokeParam.actionParams = [aClassId.toString()];
        invokeParam.returnRoot = this.SIMPLE_RETURN;
        invokeParam.invokeListener = {
            success: onSuccess
        };
        this.invoke(invokeParam);
    },

    getFileDetail: function(pathToRoot, aSoftId, onSuccess) {
        var invokeParam = new ServiceInvokeParam();
        invokeParam.pathToRoot = pathToRoot;
        invokeParam.actionFunc = this.getFileDetail;
        invokeParam.actionParams = [aSoftId.toString()];
        invokeParam.returnRoot = this.SIMPLE_RETURN;
        invokeParam.invokeListener = {
            success: onSuccess
        };
        this.invoke(invokeParam);
    }
});

var GetFileService = new FileService();
