Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package info.kwarc.sally4.theo.impl;
  
 
 
 
 @Provides(specifications=Theo.class)
 public class TheoInstance extends RouteBuilder implements Theo {
 	String officeNamespace = "http://kwarc.info/sally/comm/select";
 	
 	
 	
 	
 
 
 	@Requires(id="docQueue", filter="(filterThatWillNeverSucceed=1)")
 
 	
 	
 	void doStart() throws Exception {
 		
 
 	}
 
 	void doStop() throws Exception {
 	}
 
 		
 		public void process(Exchange exchangethrows Exception {
 			HashMap<StringStringquery = exchange.getIn().getHeader(.HashMap.class);
 			String id = query.get("id");
 			String item = query.get("item");
 
 			if (item != null) {
 				.info("Closing id "+items.getTheoID());
 
 				
 				SallyMenuItem menuItem = items.getItems().get(Integer.parseInt(item));
 				menuItem.run();
 			}
 			exchange.getIn().setHeader("id"id);
 			exchange.getIn().setBody(items.getItems());
 		}
	};
	public TheoInstance() {		
	}	
	public void configure() throws Exception {
		getContext().addComponent("freemarker"new TemplatingComponent("templates/"getClass().getClassLoader()));
		//getContext().addComponent("freemarker", new FreemarkerComponent());
		DataFormat theo = .getFormat("theo");
		.info(">>>> Theo="+theo);
		from("direct:sendTheoInOut")
		.marshal(theo)
		.inOut("theo:default")
		.to("log:theo")
		.unmarshal(theo);
		from("direct:sendTheoEvent")
		.marshal(theo)
		.to("theo:default");
		 = "frameselector"+Long.toHexString(Double.doubleToLongBits(Math.random()));
		from("sallyservlet:///"+)
		.to("freemarker:frameselector.html");
		//.to("freemarker:file:///home/costea/workspace_sally4/sally4/sally4-docmanager/src/main/resources/templates/frameselector.html");
	}
	public String openNewWindow(String URLString titleInteger xInteger yInteger width,
			Integer height) {
		wnd.setTitle(title);
		wnd.setUrl(URL);
		if (x != null)
			wnd.setPosx(x);
		if (y != null)
			wnd.setPosy(y);
		if (width != null)
			wnd.setWidth(width);
		if (height != null)
			wnd.setHeight(height);
		e.getIn().setBody(wnd);
		getContext().createProducerTemplate().send("direct:sendTheoInOut"e);
		if (response == null)
			return null;
		return response.getId();
	}
	public void closeWindow(String id) {
		wnd.setId(id);
		getContext().createProducerTemplate().sendBody("direct:sendTheoEvent"wnd);
	}
New to GrepCode? Check out our FAQ X