// TextExtractImpl.java
//
// Created: January 2006
//
// This file is a component of the BioMoby project.
// Copyright Martin Senger (martin.senger@gmail.com).
//

package org.jmoby.tutorial.service;

import net.jmoby.samples.TextExtractSkel;
import org.biomoby.shared.MobyException;
import org.biomoby.shared.parser.MobyPackage;
import org.biomoby.shared.parser.MobyJob;
import org.biomoby.shared.datatypes.*;

/**
 * Another example of a BioMoby service. <p>
 *
 * This service extracts the real content of an input text and return
 * it as a primitive String type. <p>
 *
 * The main reason is to show that one can send a more specialized
 * data type to this service (even though the service claims that
 * operates only on text-plain data type). <p>
 *
 * The details about service are in the generated sketeton
 * <tt>TextExtractSkel</tt>. <p>
 *
 * @author <A HREF="mailto:martin.senger@gmail.com">Martin Senger</A>
 * @version $Id: TextExtractImpl.java,v 1.2 2006/02/19 18:42:57 senger Exp $
 */

public class TextExtractImpl
    extends TextExtractSkel {

    /**************************************************************************
     * This is a mandatory method to be implemented.
     *************************************************************************/
    public void processIt (MobyJob request,
			   MobyJob response,
			   MobyPackage outputContext)
	throws MobyException {
 	text_plain input = get_input (request);
	if (input == null) return;
	set_result (response, new MobyString (input.get_content()));
    }

}

