(function (paw, utils) {
    function DocumentIrisDef1000000482(documentIrisModel) {
        this.popup;

        this.irisId = '1000000482';
        this.documentIrisModel = documentIrisModel;
    }

    DocumentIrisDef1000000482.prototype.compileDescription = function(description){
        if(utils.value.isSet(this.documentIrisModel.documentStorage)){
            description = utils.value.strReplace(description, '~S0~', this.documentIrisModel.documentStorage.Name + ' - ' + this.documentIrisModel.documentStorage.Description);
        }
        
        description = utils.value.strReplace(description, '~S1~', this.documentIrisModel.featureName);
        return description;
    };

    DocumentIrisDef1000000482.prototype.getAction = function (irisItem) {
        var self = this;
        switch (irisItem.AnNo) {
            case 10:{
                var caption = irisItem.Caption;
                if(utils.value.isSet(this.documentIrisModel.classification)){
                    caption = utils.value.strReplace(irisItem.Caption, 
                        "~S2~", this.documentIrisModel.classification.code + ' - ' + this.documentIrisModel.classification.name);
                }
                
                return {
                    type: 'link',
                    link: this.documentIrisModel.classificationUrl + '&selected=' + this.documentIrisModel.classification.id,
                    caption: caption
                };
            }
            case 20:{
                var caption = irisItem.Caption;
                if(utils.value.isSet(this.documentIrisModel.docTypeName)){
                    caption = utils.value.strReplace(irisItem.Caption, "~S3~", this.documentIrisModel.docTypeName);
                }

                return {
                    type: 'link',
                    caption: caption,
                    link: utils.value.strReplace(this.documentIrisModel.docTypeUrl, ':docType', this.documentIrisModel.docType)
                };
            }
            case 50: {
                return {
                    type: 'button',
                    caption: irisItem.Caption,
                    onSelected: function () {
                        self.popup.hide();
                    }
                };
            }
        }
    };

    paw.view.document.DocumentIrisDef1000000482 = DocumentIrisDef1000000482;
})(paw, paw.utils);