Code Search for Developers
 
 
  

ThinkcapAnswer.java from ThinkCap Collaborative Knowledge Portal at Krugle


Show ThinkcapAnswer.java syntax highlighted

package org.integratedmodelling.thinkcap;

import java.io.File;

import org.apache.velocity.VelocityContext;
import org.integratedmodelling.thinklab.exception.ThinklabNoKMException;
import org.integratedmodelling.thinklab.interfaces.IConcept;
import org.integratedmodelling.thinklab.value.Value;


/**
 * A specialized value that holds an answer to a Thinkcap command, including whether a template should
 * be generated or an image fetched from the plugin storage and output. 
 * 
 * All ThinkcapCommand actions return a ThinkcapAnswer. This way all Thinkcap operations
 * are accomplished by creating ThinkcapCommands, which is all API users need to learn.
 * 
 * @author Ferdinando Villa, Ecoinformatics Collaboratory, UVM
 *
 */
public class ThinkcapAnswer extends Value {

	public String template = null;
	public File image = null;
	public String style = null;
	private VelocityContext context;
	
	public ThinkcapAnswer() throws ThinklabNoKMException {
		super();
		// TODO Auto-generated constructor stub
	}

	public ThinkcapAnswer(IConcept arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
	}

	public ThinkcapAnswer(VelocityContext context) throws ThinklabNoKMException {
		super();
		this.context = context;
	}

	/**
	 * Set a variable into the context for the next template output.
	 * 
	 * @param varname
	 * @param object
	 */
	public void setVariable(String varname, Object object) {
		context.put(varname, object);
	}
	
	public String getVariableAsString(String varname) {
		return null;
	}

	
	public void setOutputImage(File imageFile) {
		image = imageFile;
	}
	
	public Object getVariable(String varname) {
		return null;
	}
	
	public void setOutputTemplate(String templatename) {
		template = templatename;
	}

	public void setStyle(String s) {
		style = s;
	}
	
	public void resetPage() {
		((PageSpecs)context.get("pageSpecs")).reset();
	}
	
}




See more files for this project here

ThinkCap Collaborative Knowledge Portal

A portal to explore and edit the knowledge contained in a set of ontologies in intuitive ways. Presents a Dictionary view (a Google-like interface), a Thesaurus view (a graphical display with simplified relationships) and a full graphical Concept view.

Project homepage: http://sourceforge.net/projects/thinkcap
Programming language(s): Java,JavaScript,XML
License: other

  basecommands/
    StreamResource.java
    StreamTemplate.java
    ThinkcapMain.java
  exceptions/
    ThinkcapException.java
    ThinkcapWidgetException.java
  portfolio/
    ThinkcapPortfolio.java
  widget/
    HtmlLink.java
    IItemDecorator.java
    IThinkcapWidget.java
    IWidgetPublisher.java
    ImageDecorator.java
    PopupMenu.java
    ThinkcapInputWidget.java
    ThinkcapWidgetManager.java
  PageSpecs.java
  ResultContainer.java
  TemplateProcessor.java
  ThinkCap.java
  ThinkcapAction.java
  ThinkcapAnswer.java
  ThinkcapCommand.java
  ThinkcapManager.java
  ThinkcapPlugin.java
  ThinkcapSession.java
  ThinkcapSessionListener.java