1   package eu.fbk.dkm.pikes.tintop.server;
2   
3   import eu.fbk.dkm.pikes.tintop.AnnotationPipeline;
4   import ixa.kaflib.KAFDocument;
5   import org.glassfish.grizzly.http.server.Request;
6   import org.glassfish.grizzly.http.server.Response;
7   
8   /**
9    * Created with IntelliJ IDEA.
10   * User: alessio
11   * Date: 21/07/14
12   * Time: 15:30
13   * This class is used to generate an empty NAF starting from the text.
14   */
15  
16  public class NafGenerateHandler extends AbstractHandler {
17  
18  	public NafGenerateHandler(AnnotationPipeline pipeline) {
19  		super(pipeline);
20  	}
21  
22  	@Override
23  	public void service(Request request, Response response) throws Exception {
24  
25  		super.service(request, response);
26  
27  		String text = request.getParameter("text");
28  		KAFDocument doc = text2naf(text, meta);
29  
30  		writeOutput(response, "text/xml", doc.toString());
31  	}
32  }