Update of /cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv4875/src/xdoclet/modules/hibernate
Modified Files: HibernateSubTask.java HibernateTagsHandler.java JBossServiceSubTask.java XDocletModulesHibernateMessages.java Log Message: fixed german messages problem, jbossservice not complete. Index: HibernateSubTask.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/HibernateSubTask.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** HibernateSubTask.java 11 Dec 2002 10:15:57 -0000 1.1 --- HibernateSubTask.java 12 Dec 2002 10:06:28 -0000 1.2 *************** *** 5,13 **** package xdoclet.modules.hibernate; import xdoclet.TemplateSubTask; import xdoclet.XDocletException; import xdoclet.util.Translator; - /** * Generates Hibernate xml mapping file for a given class. --- 5,14 ---- package xdoclet.modules.hibernate; + import xjavadoc.XClass; + import xdoclet.TemplateSubTask; import xdoclet.XDocletException; import xdoclet.util.Translator; /** * Generates Hibernate xml mapping file for a given class. *************** *** 47,50 **** --- 48,56 ---- setTemplateURL(getClass().getResource(DEFAULT_HIBERNATE_TEMPLATE_FILE)); setDestinationFile(GENERATED_HIBERNATE_FILE_NAME); + } + + public String getGeneratedFileName(XClass clazz) throws XDocletException + { + return super.getGeneratedFileName(clazz); } Index: HibernateTagsHandler.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/HibernateTagsHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** HibernateTagsHandler.java 11 Dec 2002 10:15:57 -0000 1.1 --- HibernateTagsHandler.java 12 Dec 2002 10:06:28 -0000 1.2 *************** *** 13,18 **** --- 13,21 ---- import xjavadoc.XClass; import xjavadoc.XCollections; + import xdoclet.DocletContext; import xdoclet.DocletSupport; + import xdoclet.DocletTask; + import xdoclet.TemplateSubTask; import xdoclet.XDocletException; import xdoclet.XDocletTagSupport; *************** *** 22,26 **** import xdoclet.util.LogUtil; import xdoclet.util.TypeConversionUtil; - /** * Specific tags handler to make the template easy. --- 25,28 ---- *************** *** 47,62 **** throws XDocletException { ! StringBuffer fileName = new StringBuffer(getCurrentClass().getQualifiedName()); ! int stringLength = fileName.length(); ! for (int i = 0; i < stringLength; i++) { ! if (fileName.charAt(i) == '.') { ! fileName.setCharAt(i, '/'); } } ! ! return fileName.toString(); } --- 49,113 ---- throws XDocletException { + return getCurrentClass().getQualifiedName().replace('.', '/'); + } ! public JBossServiceSubTask getJBossServiceSubTask() ! { ! return (JBossServiceSubTask) (DocletContext.getInstance().getSubTaskBy(DocletTask.getSubTaskName(JBossServiceSubTask.class))); ! } ! /** ! * return configured service name ! * ! * @return ! * @exception XDocletException ! * @doc.tag type="content" ! */ ! public String serviceName() throws XDocletException ! { ! return getJBossServiceSubTask().getServiceName(); ! } ! ! /** ! * configured JNDI name ! * ! * @return ! * @exception XDocletException ! * @doc.tag type="content" ! */ ! public String jndiName() throws XDocletException ! { ! return getJBossServiceSubTask().getJndiName(); ! } ! /** ! * comma separated list of hibernate mappings ! * ! * @return ! * @exception XDocletException ! * @doc.tag type="content" ! */ ! public String mappingList() throws XDocletException ! { ! String mappingName; ! String retval; ! StringBuffer sb = new StringBuffer(); ! Collection classes = ClassTagsHandler.getAllClasses(); ! ! for (ClassIterator i = XCollections.classIterator(classes); i.hasNext(); ) { ! XClass clazz = i.next(); ! ! if (clazz.getDoc().hasTag("hibernate.class", false)) { ! mappingName = ((HibernateSubTask) (DocletContext.getInstance().getSubTaskBy(DocletTask.getSubTaskName(HibernateSubTask.class)))).getGeneratedFileName(clazz); ! sb.append(mappingName); ! sb.append(","); } } ! if (sb.length() > 0) { ! return sb.substring(0, sb.length() - 1); ! } ! else { ! return ""; ! } } *************** *** 74,81 **** * type." */ public void forAllClasses(String template, Properties attributes) throws XDocletException { Log log = LogUtil.getLog(HibernateTagsHandler.class, "forAllClasses"); - String abstractStr = attributes.getProperty("abstract"); boolean acceptAbstractClasses = TypeConversionUtil.stringToBoolean(abstractStr, true); --- 125,132 ---- * type." */ + public void forAllClasses(String template, Properties attributes) throws XDocletException { Log log = LogUtil.getLog(HibernateTagsHandler.class, "forAllClasses"); String abstractStr = attributes.getProperty("abstract"); boolean acceptAbstractClasses = TypeConversionUtil.stringToBoolean(abstractStr, true); *************** *** 94,103 **** setCurrentClass(currentClass); log.debug("currentClass=" + currentClass); - if (DocletSupport.isDocletGenerated(getCurrentClass()) || (getCurrentClass().isAbstract() && acceptAbstractClasses == false)) { log.debug("isDocletGenerated or isAbstract"); continue; } - if (typeName != null) { if (getCurrentClass().getSuperclass().getQualifiedName().equals(typeName)) { --- 145,152 ---- *************** *** 111,113 **** --- 160,163 ---- } } + } Index: JBossServiceSubTask.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/JBossServiceSubTask.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** JBossServiceSubTask.java 11 Dec 2002 13:26:13 -0000 1.1 --- JBossServiceSubTask.java 12 Dec 2002 10:06:28 -0000 1.2 *************** *** 40,46 **** private static String GENERATED_SERVICE_FILE_NAME = "jboss-service.xml"; ! private String jndiName = null; ! private String dataSource = null; ! private String dialect = null; /** --- 40,47 ---- private static String GENERATED_SERVICE_FILE_NAME = "jboss-service.xml"; ! private String _jndiName = null; ! private String _dataSource = null; ! private String _dialect = null; ! private String _serviceName = null; /** *************** *** 54,58 **** } ! //~ Methods ........................................................................................................ /** --- 55,117 ---- } ! /** ! * return configured service name ! * ! * @return ! */ ! public String getServiceName() ! { ! return _serviceName; ! } ! ! public String getJndiName() ! { ! return _jndiName; ! } ! ! public String getDataSource() ! { ! return _dataSource; ! } ! ! public String getDialect() ! { ! return _dialect; ! } ! ! public void setServiceName(String serviceName) ! { ! _serviceName = serviceName; ! } ! ! public void setJndiName(String jndiName) ! { ! _jndiName = jndiName; ! } ! ! public void setDataSource(String dataSource) ! { ! _dataSource = dataSource; ! } ! ! public void setDialect(String dialect) ! { ! _dialect = dialect; ! } ! ! public void validateOptions() throws XDocletException ! { ! super.validateOptions(); ! ! if (getJndiName() == null) { ! throw new XDocletException(Translator.getString(XDocletModulesHibernateMessages.class, ! XDocletModulesHibernateMessages.JNDI_NAME_REQUIRED)); ! } ! ! if (getServiceName() == null) { ! throw new XDocletException(Translator.getString(XDocletModulesHibernateMessages.class, ! XDocletModulesHibernateMessages.SERVICE_NAME_REQUIRED)); ! } ! } /** *************** *** 61,70 **** * @exception XDocletException Thrown in case of problem */ ! protected void engineStarted() ! throws XDocletException { System.out.println(Translator.getString(XDocletModulesHibernateMessages.class, ! XDocletModulesHibernateMessages.GENERATING_HIBERNATE_FOR, ! new String[]{getCurrentClass().getQualifiedName()})); } } --- 120,127 ---- * @exception XDocletException Thrown in case of problem */ ! protected void engineStarted() throws XDocletException { System.out.println(Translator.getString(XDocletModulesHibernateMessages.class, ! XDocletModulesHibernateMessages.GENERATING_JBOSS_SERVICE_DESCRIPTOR)); } } Index: XDocletModulesHibernateMessages.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/XDocletModulesHibernateMessages.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** XDocletModulesHibernateMessages.java 11 Dec 2002 13:26:13 -0000 1.2 --- XDocletModulesHibernateMessages.java 12 Dec 2002 10:06:28 -0000 1.3 *************** *** 6,12 **** /** ! * @author Sébastien Guimont ([EMAIL PROTECTED]) ! * @created August 9th, 2002 ! * @version $Revision$ */ public final class XDocletModulesHibernateMessages --- 6,13 ---- /** ! * @author Sébastien Guimont ([EMAIL PROTECTED]) ! * @created August 9th, 2002 ! * @version $Revision$ ! * @msg.bundle */ public final class XDocletModulesHibernateMessages *************** *** 17,27 **** /** * @msg.bundle msg="Generating mapping file for {0}." ! * @msg.bundle msg="Mappingdatei für {0} wird erzeugt." lang="de" */ public final static String GENERATING_HIBERNATE_FOR = "GENERATING_HIBERNATE_FOR"; /** * @msg.bundle msg="Generating jboss service descriptor" ! * @msg.bundle msg="Generiere JBoss Descriptor" lang="de" */ public final static String GENERATING_JBOSS_SERVICE_DESCRIPTOR = "GENERATING_JBOSS_SERVICE_DESCRIPTOR"; } --- 18,39 ---- /** * @msg.bundle msg="Generating mapping file for {0}." ! * @msg.bundle msg="Mappingdatei für {0} wird erzeugt." language="de" */ public final static String GENERATING_HIBERNATE_FOR = "GENERATING_HIBERNATE_FOR"; /** * @msg.bundle msg="Generating jboss service descriptor" ! * @msg.bundle msg="Generiere JBoss Descriptor" language="de" */ public final static String GENERATING_JBOSS_SERVICE_DESCRIPTOR = "GENERATING_JBOSS_SERVICE_DESCRIPTOR"; + + /** + * @msg.bundle msg="JNDI name is required for jboss service" + * @msg.bundle msg="JNDI-Name wird benötigt" language="de" + */ + public final static String JNDI_NAME_REQUIRED = "JNDI_NAME_REQUIRED"; + /** + * @msg.bundle msg="Service name is required for jboss service" + * @msg.bundle msg="Bigge geben Sie die Servicename ein" language="de" + */ + public final static String SERVICE_NAME_REQUIRED = "SERVICE_NAME_REQUIRED"; } ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel