/*
 * JBoss, Home of Professional Open Source
 * Copyright 2005, JBoss Inc., and individual contributors as indicated
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package xdoclet.modules.jboss.net;

import xdoclet.XmlSubTask;

/**
 * JBossNetSubTask is an xml-based ant task that comes with a few
 * useful tags to support the generation of a suitable web-service.xml 
 * from EJB sources and the JBossNet template.
 * @ant.element display-name="JBoss.Net" name="jbossnet" parent="xdoclet.modules.ejb.EjbDocletTask"
 * @author Frederick M. Brier
 * @author jung
 * @author Jason Essington
 * @since May 28, 2002
 * @version $Revision: 1.1.2.4 $
 */

public abstract class JBossNetSubTask extends XmlSubTask {
   public final static String SUBTASK_NAME= "jbossnet";

   private final static String SOAP_SCHEMA= "http://xml.apache.org/axis/wsdd/";
   private final static String JBOSSNET_DTD_SYSTEMID_31=
      "http://www.jboss.org/j2ee/dtd/jbossnet_3_1.dtd";
   private static String GENERATED_FILE_NAME= "web-service.xml";
   protected String applicationName= "jboss-net-web-application";
   protected String targetNameSpace= "http://www.jboss.org/net";
   protected String prefix= "jboss-net";

   public JBossNetSubTask() {
      setTemplateURL(
         getClass().getClassLoader().getResource(getTemplateName()));
      setDestinationFile(GENERATED_FILE_NAME);
      setSchema(SOAP_SCHEMA);
      setHavingClassTag("jboss-net.web-service");
      setValidateXML(false);
      setSubTaskName(SUBTASK_NAME);
   }

   protected abstract String getTemplateName();
   
   public String getWebDeploymentName() {
      return applicationName;
   }

   public String getTargetNameSpace() {
      return this.targetNameSpace;
   }

   public String getPrefix() {
      return this.prefix;
   }

   public void setWebDeploymentName(String name) {
      this.applicationName= name;
   }

   public void setTargetNameSpace(String name) {
      this.targetNameSpace= name;
   }

   public void setPrefix(String prefix) {
      this.prefix= prefix;
   }

   public void engineStarted() {
   }

}
