/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gr.uoa.di.web.utils.rss;

import java.util.List;

import eu.dnetlib.domain.data.Document;

/**
 *
 * @author alexm
 */
public class RSSFieldsMapper {
    private String titleKey;
    private String descriptionKey;
    private String authorKey;

    public String getTitle( Document doc ){
        StringBuffer title = new StringBuffer();

        List<String> vals =  doc.getFieldValues( getTitleKey());
        for( String val : vals ){
            title.append( val );
            title.append( " " );
        }

        return title.toString();
    }

    public String getDescription( Document doc ){
        StringBuffer title = new StringBuffer();

        List<String> vals =  doc.getFieldValues( getDescriptionKey());
        for( String val : vals ){
            title.append( val );
            title.append( " " );
        }

        return title.toString();
    }

    public String getAuthors( Document doc ){
        StringBuffer title = new StringBuffer();

        List<String> vals =  doc.getFieldValues( getAuthorKey());
        for( String val : vals ){
            title.append( val );
            title.append( " " );
        }

        return title.toString();
    }

    /**
     * @return the titleKey
     */
    public String getTitleKey() {
        return titleKey;
    }

    /**
     * @param titleKey the titleKey to set
     */
    public void setTitleKey( String titleKey ) {
        this.titleKey = titleKey;
    }

    /**
     * @return the descriptionKey
     */
    public String getDescriptionKey() {
        return descriptionKey;
    }

    /**
     * @param descriptionKey the descriptionKey to set
     */
    public void setDescriptionKey( String descriptionKey ) {
        this.descriptionKey = descriptionKey;
    }

    /**
     * @return the authorKey
     */
    public String getAuthorKey() {
        return authorKey;
    }

    /**
     * @param authorKey the authorKey to set
     */
    public void setAuthorKey( String authorKey ) {
        this.authorKey = authorKey;
    }

}

