Hi,

I wrote a simple template that i am trying to process via doclet task. The
template is not getting processed at all. what could be the reason? I am
attaching the XDT, ant build script.

Please Help me out... I am totally confused.

Pawan
<?xml version="1.0"?>

<project name="test" basedir="." default="templatedoclet">

  <property name="xdoclet.home"    value="D:/xdoclet1.2b3" />
  <property name="xdoclet.lib.dir" value="${xdoclet.home}/lib" />
  
  <path id="xdoclet.lib.path">
    <fileset dir="${xdoclet.lib.dir}">
      <include name="*.jar" />
    </fileset>
  </path>
  
  <target name="templatedoclet">
    
    <taskdef name="templatedoclet" classname="xdoclet.DocletTask" 
             classpathref="xdoclet.lib.path"/>
    
    <templatedoclet destdir="${basedir}">
      <template templateFile="test-template.xdt" destinationfile="RO_{0}.java"/>
      <fileset dir="${basedir}">
        <include name="*Bean.java"/>
      </fileset>
    </templatedoclet>

  </target>
  
  <target name="echo_this">
    <fileset id="fs" dir="${basedir}">
      <include name="*Bean.java"/>
    </fileset>
    <property name="fs.value" refid="fs"/>
    <echo message="${fs.value}" />

  </target>
  
</project>
package com.elitecore.billing.ejb.facades.session;

import java.util.*;
import javax.naming.NamingException;
import javax.ejb.*;

import com.elitecore.billing.ejb.test.interfaces.*;
import com.elitecore.billing.ejb.test.data.*;
import com.elitecore.billing.ejb.test.factory.*;

/**
 * Session Bean for Testing Customer. Can Update Here.
 * @ejb.bean name="CustomerSessionBean"
 *  type="Stateless"
 *  view-type="both"
 * jndi-name="ejb/CustomerSessionBean"
 * local-jndi-name="CustomerSessionBean"
 * transaction-type="Container"
 *
 * @ejb.transaction type="Required"
 * @ejb.util generate="false"
 * @ejb.remote-facade
 */
public class CustomerSessionBean implements javax.ejb.SessionBean
{
    private javax.ejb.SessionContext _ctx;

    /**
     * Gets All Customer Data From Updatable Database.
     *
     * @ejb.interface-method
     * @ejb.facade-method invalidate="true"
     */
    public int getAllCustomer()
    {
        int i = -1;
        try
        {
            ICustomerLocalHome localHome = getCustomerLocalHome();
            Collection findCollection = localHome.findAll();

            if(findCollection != null)
            {
                Iterator iterator = findCollection.iterator();
                ICustomerLocal customerLocal = null;
                CustomerData customerData = null;
                i=0;

                while(iterator.hasNext())
                {
                    customerLocal = (ICustomerLocal)iterator.next();
                    customerData = customerLocal.getData();
                    i++;
                    System.out.println("*****CustomerData number: " + i + " :\n " + customerData);
                }
            }
        } catch(NamingException namingExp)
        {
            System.out.println("XXXXXXXX Naming Exception: XXXXXXXX");
            namingExp.printStackTrace();
        } catch(Exception generalExp )
        {
            System.out.println("XXXXXXXX General Exception: XXXXXXXX");
            generalExp.printStackTrace();
        }
        return i;
    }

    /**
     * Create Customer. This is an updatable facade, so no problems here
     *
     * @ejb.interface-method
     * @ejb.facade-method invalidate="true"
     */
    public int createCustomer(String strName, String strAddress)
    {
        int i = -1;
        try
        {
            ICustomerLocalHome localHome = getCustomerLocalHome();

            CustomerData customerData = new CustomerData();
            customerData.setName(strName);
            customerData.setAddress(strAddress);

            System.out.println("To Create CustomerData: " + customerData);
            localHome.create(customerData);
            System.out.println("Customer Created");
            i = 1;

        } catch(NamingException namingExp)
        {
            System.out.println("XXXXXXXX Naming Exception: XXXXXXXX");
            namingExp.printStackTrace();
        } catch(Exception generalExp )
        {
            System.out.println("XXXXXXXX General Exception: XXXXXXXX");
            generalExp.printStackTrace();
        }
        return i;
    }

    /**
     * Get local home of Updatable Staff.
     */
    protected ICustomerLocalHome getCustomerLocalHome () throws NamingException
    {
        ICustomerLocalHome localHome;

        System.out.println("Before Getting Updatable Local Home of Customer");

            System.out.println("Writable Local Home Factory");
            localHome = CustomerHomeFactory.getLocalHome();

        System.out.println("After Getting Local Home: " );
        return localHome ;
    }

    /**
     * @ejb.create-method
     * @ejb.permission unchecked="true"
     */
    public void ejbCreate() throws javax.ejb.CreateException {
    }

    public void setSessionContext (javax.ejb.SessionContext ctx) {
        _ctx = ctx;
    }

    public void ejbActivate () {
    }

    public void ejbPassivate () {
    }

    public void unsetSessionContext () {
    }

    public void ejbRemove () {
    }
}

Attachment: test-template.xdt
Description: Binary data

Reply via email to