Code Search for Developers
 
 
  

StreamTemplate.java from ThinkCap Collaborative Knowledge Portal at Krugle


Show StreamTemplate.java syntax highlighted

package org.integratedmodelling.thinkcap.basecommands;

import org.integratedmodelling.thinkcap.ThinkcapAction;
import org.integratedmodelling.thinkcap.ThinkcapAnswer;
import org.integratedmodelling.thinkcap.ThinkcapCommand;
import org.integratedmodelling.thinklab.command.CommandDeclaration;
import org.integratedmodelling.thinklab.command.CommandPattern;
import org.integratedmodelling.thinklab.exception.ThinklabException;
import org.integratedmodelling.thinklab.KnowledgeManager;
import org.integratedmodelling.thinklab.interfaces.IAction;

/**
 * This command simply outputs the template identified. Only the name of the template is required. Templates are
 * usually contained in plugin jars. They're normally output directly from commands; this one just gives 
 * flexibility and can be used to implement an "include" facility.
 * 
 * Usage in templates is:
 * 
 * <code>
 *   <a href="StreamTemplate.cmd?ref=tname">....</a>
 * </code>
 * 
 * @author Ferdinando Villa
 *
 */
public class StreamTemplate extends CommandPattern {

	public class StreamTemplateAction extends ThinkcapAction {

		@Override
		public void execute(ThinkcapCommand command, ThinkcapAnswer value) throws ThinklabException {

			String img = command.getArgumentAsString("res");
			value.setOutputTemplate(img);
		}	
	}
	
	
	@Override
	public CommandDeclaration createCommand() throws ThinklabException  {
		
		CommandDeclaration ret = new CommandDeclaration("StreamTemplate", "");
		try {
			ret.addMandatoryArgument("ref", "", 
					KnowledgeManager.KM().getTextType().getSemanticType());
		} catch (ThinklabException e) {
		}
		return ret;
	}

	@Override
	public IAction createAction() {
		return new StreamTemplateAction();
	}


}




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

  StreamResource.java
  StreamTemplate.java
  ThinkcapMain.java