package ubic.gemma.web.taglib.displaytag;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.displaytag.decorator.TableDecorator;

import ubic.gemma.model.common.description.Characteristic;
import ubic.gemma.ontology.GeneOntologyService; 

/**
 * used for proper decoration of the ontologyEntry
 * <p>
 * See http://displaytag.sourceforge.net/10/tut_decorators.html and http://displaytag.sourceforge.net/10/tut_links.html
 * for explanation of how this works.
 * 
 * @author klc
 * @version $Id$
 */
public class OntologyWrapper extends TableDecorator {

    Log log = LogFactory.getLog( this.getClass() );

    // public String getValue() {
    // OntologyEntry oe = (OntologyEntry ) getCurrentRowObject();
    // return oe.getValue();
    // }
    //
    // public String getDescription() {
    // OntologyEntry oe = (OntologyEntry ) getCurrentRowObject();
    // return oe.getDescription();
    // }
    //
    // public String getCategory() {
    // OntologyEntry oe = (OntologyEntry ) getCurrentRowObject();
    // return oe.getCategory();
    // }

    public String getAccession() {
        Characteristic oe = ( Characteristic ) getCurrentRowObject();

        return "<a target='_blank' href='http://amigo.geneontology.org/cgi-bin/amigo/go.cgi?view=details&query="
                + GeneOntologyService.asRegularGoId( oe ) + "'>" + GeneOntologyService.asRegularGoId( oe ) + "</a>";

    }

}

@@ -229,16 +229,80 @@
 ristic;%0A
+import ubic.gemma.model.common.description.VocabCharacteristic;%0A
 import u
@@ -340,17 +340,16 @@
 Service;
- 
 %0A%0A/**%0A *
@@ -353,55 +353,34 @@
 %0A * 
-used for proper decoration of the o
+This is for Gene O
 ntology
-Entry
+.
 %0A * 
@@ -1480,10 +1480,185 @@
 %0A    %7D%0A%0A
+    public String getAspect() %7B%0A        VocabCharacteristic oe = ( VocabCharacteristic ) getCurrentRowObject();%0A        return GeneOntologyService.getTermAspect( oe );%0A    %7D%0A%0A
 %7D%0A

support getaspect