Plugins.ThreeGiG.ProspectDirector.BuiltIn.DownloadResourceAction =
PD.Actions.ActionDefinition.extend({

    init: function (options) {

        this._super({
            id: "download-resource",
            pluginId: "builtin",
            name: "Download Resource",
            description: "Download the specified resource.",
            parameters: [
                new PD.Actions.ActionParameterDefinition({
                    name: "Resource Path",
                    type: PD.Actions.ActionParameterType.STRING,
                    required: true,
                    description: "The path of the resource to download."
                })
            ]
        });

    },

    method: function (entityId, reportId) {

        if (resourcePath == null) {
            this._showErrorDialog("Resource Path");
            return;
        }
        
        ProspectDirector.RUNTIME.iframeRequest("~/Resources/" + resourcePath);

    },

    _showErrorDialog: function (label) {

        ProspectDirector.Web.UI.MessageDialog.warn({
            message: "Cannot complete the 'Download Report Action' because no " + label + " has been specified."
        });

    }

});