<commit_before>package gov.nih.nci.calab.dto.particle;

import gov.nih.nci.calab.dto.common.SortableName;
import gov.nih.nci.calab.service.util.StringUtils;

import java.net.URLEncoder;

import org.displaytag.decorator.TableDecorator;

/**
 * This decorator is used to for decorate different properties of a nanoparticle
 * to be shown properly in the view page using display tag lib.
 * 
 * @author pansu
 * 
 */
public class NanoparticleDecorator extends TableDecorator {
	public SortableName getEditParticleURL() throws Exception {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		String particleType = URLEncoder.encode(particle.getSampleType(),
				"UTF-8");
		String particleName = URLEncoder.encode(particle.getSampleName(),
				"UTF-8");
		String particleSource = URLEncoder.encode(particle.getSampleSource(),
				"UTF-8");
		String editParticleURL = "nanoparticleGeneralInfo.do?dispatch=setupUpdate&particleType="
				+ particleType
				+ "&particleName="
				+ particleName
				+ "&particleSource=" + particleSource;
		String link = "<a href=" + editParticleURL + ">"
				+ particle.getSampleName() + "</a>";

		SortableName sortableLink = new SortableName(particle.getSampleName(),
				link);
		return sortableLink;
	}

	public SortableName getViewParticleURL() throws Exception {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		String particleType = URLEncoder.encode(particle.getSampleType(),
				"UTF-8");
		String particleName = URLEncoder.encode(particle.getSampleName(),
				"UTF-8");
		String particleSource = URLEncoder.encode(particle.getSampleSource(),
				"UTF-8");
		String viewParticleURL = "nanoparticleGeneralInfo.do?dispatch=setupView&particleType="
				+ particleType
				+ "&particleName="
				+ particleName
				+ "&particleSource=" + particleSource;
		;
		String link = "<a href=" + viewParticleURL + ">"
				+ particle.getSampleName() + "</a>";
		SortableName sortableLink = new SortableName(particle.getSampleName(),
				link);
		return sortableLink;
	}

	public SortableName getRemoteViewURL() throws Exception {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		String particleType = URLEncoder.encode(particle.getSampleType(),
				"UTF-8");
		String particleName = URLEncoder.encode(particle.getSampleName(),
				"UTF-8");
		String remoteViewURL = "remoteNanoparticleGeneralInfo.do?dispatch=view&particleType="
				+ particleType
				+ "&particleName="
				+ particleName
				+ "&gridNodeHost=" + particle.getGridNode();
		String link = "<a href=" + remoteViewURL + ">"
				+ particle.getSampleName() + "</a>";
		SortableName sortableLink = new SortableName(particle.getSampleName(),
				link);
		return sortableLink;
	}

	public String getKeywordsStr() {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		return StringUtils.join(particle.getKeywords(), "<br>");
	}

	public String getFunctionTypesStr() {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		return StringUtils.join(particle.getFunctionTypes(), "<br>");
	}

	public String getCharacterizationsStr() {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		return StringUtils.join(particle.getCharacterizations(), "<br>");
	}
}<commit_msg>updated links<commit_after>package gov.nih.nci.calab.dto.particle;

import gov.nih.nci.calab.dto.common.SortableName;
import gov.nih.nci.calab.service.util.StringUtils;

import org.displaytag.decorator.TableDecorator;

/**
 * This decorator is used to for decorate different properties of a nanoparticle
 * to be shown properly in the view page using display tag lib.
 * 
 * @author pansu
 * 
 */
public class NanoparticleDecorator extends TableDecorator {
	public SortableName getEditParticleURL() throws Exception {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		String particleId = particle.getSampleId();
		String editParticleURL = "nanoparticleGeneralInfo.do?dispatch=setupUpdate&particleId="
				+ particleId;
		String link = "<a href=" + editParticleURL + ">"
				+ particle.getSampleName() + "</a>";

		SortableName sortableLink = new SortableName(particle.getSampleName(),
				link);
		return sortableLink;
	}

	public SortableName getViewParticleURL() throws Exception {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		String particleId = particle.getSampleId();
		String viewParticleURL = "nanoparticleGeneralInfo.do?dispatch=setupView&particleId="
				+ particleId;
		;
		String link = "<a href=" + viewParticleURL + ">"
				+ particle.getSampleName() + "</a>";
		SortableName sortableLink = new SortableName(particle.getSampleName(),
				link);
		return sortableLink;
	}

	public SortableName getRemoteViewURL() throws Exception {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		String particleId = particle.getSampleId();
		String remoteViewURL = "remoteNanoparticleGeneralInfo.do?dispatch=view&particleId="
				+ particleId + "&gridNodeHost=" + particle.getGridNode();
		String link = "<a href=" + remoteViewURL + ">"
				+ particle.getSampleName() + "</a>";
		SortableName sortableLink = new SortableName(particle.getSampleName(),
				link);
		return sortableLink;
	}

	public String getKeywordsStr() {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		return StringUtils.join(particle.getKeywords(), "<br>");
	}

	public String getFunctionTypesStr() {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		return StringUtils.join(particle.getFunctionTypes(), "<br>");
	}

	public String getCharacterizationsStr() {
		ParticleBean particle = (ParticleBean) getCurrentRowObject();
		return StringUtils.join(particle.getCharacterizations(), "<br>");
	}
}
{'fraction_non_alphanumeric': 0.11930318493753299, 'fraction_numerical': 0.0014077071969030442, 'mean_word_length': 5.218818380743983, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '373042', 'n_tokens_mistral': 1916, 'n_tokens_neox': 1689, 'n_words': 358}