global virtual with sharing class ocms_DNETFileDownload extends cms.ContentTemplateController {
global virtual override String getHTML() {
Boolean hasFileName = String.isNotBlank(fileName);
Boolean hasFileSize = String.isNotBlank(fileSize);
Boolean hasDownloadFile = String.isNotBlank(fileDownloadUrl);
Boolean hasFileDescription = String.isNotBlank(fileDescription);
String html ='';
if(hasFileName){
html += '
'+fileName.escapeHtml4();
}
if(hasDownloadFile){
html +='
Download ';
}
if(hasFileSize){
html += ''+fileSize.escapeHtml4()+'
';
}
if(hasFileDescription){
html += ''+fileDescription.escapeHtml4()+'
';
}
return html;
}
public String fileName {
get {
return getAttribute('fileName');
} set;
}
public String fileDownloadUrl {
get {
return getAttribute('fileDownloadUrl');
} set;
}
public String fileDescription {
get {
return getAttribute('fileDescription');
} set;
}
public String fileSize {
get {
return getAttribute('fileSize');
} set;
}
@TestVisible
private Map testAttributes = new Map();
private String getAttribute(String attributeName) {
if(Test.isRunningTest()) {
return testAttributes.get(attributeName);
} else {
return getProperty(attributeName);
}
}
}