package es.uv.saic.dto;

public class DocumentDTO {

	private String text;
	private String ruta;
	
	public DocumentDTO() {}
	
	public DocumentDTO(String text, String ruta, String data) {
		String template = """
			<a style="width:100;display:flex;" target="_blank" href="/download/document/[ruta]">
				<span style="width:100%;display:flex;">
					<span style="width:80%;text-align:left;">[text]</span>
					<span>[data]</span>
					&nbsp;&nbsp;&nbsp;
				</span>
			</a>
		""";
		this.text = template.replace("[ruta]", ruta).replace("[text]", text)
					.replace("[data]", (data == null) ? "" : data);
		this.ruta = ruta;
	}
	
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getRuta() {
		return ruta;
	}
	public void setRuta(String ruta) {
		this.ruta = ruta;
	}
}
