package com.apobates.forum.thrones.tag;

import com.apobates.forum.core.entity.proxy.TopicReplica;
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

/**
 * 生成话题的连接标识
 * @author xiaofanku
 * @since 20200531
 */
public class TopicReplicaConnectorTag extends SimpleTagSupport{
    //话题的ID
    private long id;
    //话题所在的版块ID
    private long board;
    //话题所在的版块组/卷ID
    private int volumes;
    
    public void setId(long id) {
        this.id = id;
    }
    public void setBoard(long board) {
        this.board = board;
    }
    public void setVolumes(int volumes) {
        this.volumes = volumes;
    }
    
    @Override
    public void doTag() throws JspException, IOException {
        String tc = TopicReplica.generateConnectString(id, board, volumes);
        getJspContext().getOut().print(tc+".xhtml");
    }
}