package fi.csc.microarray.client;

import fi.csc.microarray.client.operation.OperationDefinition;
import fi.csc.microarray.config.DirectoryLayout;

public class HelpMapping {

    public static final String MANUAL_ROOT = DirectoryLayout.getInstance().getConfiguration().getString("client", "manual-root");

	public static String mapToHelppage(OperationDefinition definition) {
		
		// blast
		if ("BLAST".equals(definition.getCategory().getName())) {
			return "http://www.csc.fi/english/research/sciences/bioscience/programs/blast/index_html"; 
		}
		
		// mafft
		else if ("Alignment:Multiple".equals(definition.getCategory().getName()) && definition.getID().startsWith("mafft")) {
			return "http://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html";

		}
		
		// others
		else {
			String page = definition.getID();
			if (page.contains(".")) {
				page = page.substring(0, page.lastIndexOf(".")) + ".html"; 
			}
			return MANUAL_ROOT + page;
		}
	}
}

@@ -374,425 +374,9 @@
 ) %7B%0A
-%09%09
 %0A
-%09%09// blast%0A%09%09if (%22BLAST%22.equals(definition.getCategory().getName())) %7B%0A%09%09%09return %22http://www.csc.fi/english/research/sciences/bioscience/programs/blast/index_html%22; %0A%09%09%7D%0A%09%09%0A%09%09// mafft%0A%09%09else if (%22Alignment:Multiple%22.equals(definition.getCategory().getName()) && definition.getID().startsWith(%22mafft%22)) %7B%0A%09%09%09return %22http://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html%22;%0A%0A%09%09%7D%0A%09%09%0A%09%09// others%0A%09%09else %7B%0A%09
 %09%09St
@@ -407,17 +407,16 @@
 etID();%0A
-%09
 %09%09if (pa
@@ -435,17 +435,16 @@
 %22.%22)) %7B%0A
-%09
 %09%09%09page 
@@ -500,20 +500,18 @@
 ml%22; %0A%09%09
-%09
 %7D%0A
-%09
 %09%09return
@@ -531,17 +531,13 @@
 + page;%0A
-%09%09%7D%0A
 %09%7D%0A%7D%0A

Remove emboss help mappings