Index: topia/src/java/org/codelutin/topia/generators/serializable/ObjectModelToPersistenceHelperPropertiesGenerator.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/serializable/ObjectModelToPersistenceHelperPropertiesGenerator.java:1.1 --- /dev/null Tue Jun 21 17:00:48 2005 +++ topia/src/java/org/codelutin/topia/generators/serializable/ObjectModelToPersistenceHelperPropertiesGenerator.java Tue Jun 21 17:00:43 2005 @@ -0,0 +1,66 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * ObjectModelToPersistenceHelperPropertiesGenerator.java + * + * Created: 6 juil. 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2005/06/21 17:00:43 $ + * par : $Author: thimel $ + */ + +package org.codelutin.topia.generators.serializable; + +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; + +import org.codelutin.generator.Generator; +import org.codelutin.generator.ObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModel; +import org.codelutin.generator.models.object.ObjectModelClass; +import org.codelutin.generator.models.object.ObjectModelClassifier; +import org.codelutin.topia.generators.Util; + +public class ObjectModelToPersistenceHelperPropertiesGenerator extends ObjectModelGenerator { // ObjectModelToPersistenceHelperPropertiesGenerator + + public ObjectModelToPersistenceHelperPropertiesGenerator(){ + super(); + } + + public ObjectModelToPersistenceHelperPropertiesGenerator(Generator parent){ + super(parent); + } + + public String getFilenameForModel(ObjectModel model){ + return model.getName() + "SerializablePersistenceHelper.properties"; + } + + public void generateFromModel(Writer output, ObjectModel model) throws IOException { +/*{# emplacement du fichier db +topia.persistence.serializable.dbfile=/tmp/<%=model.getName()%>.db.file +}*/ + } + +} // ObjectModelToPersistenceHelperPropertiesGenerator(Serializable) + Index: topia/src/java/org/codelutin/topia/generators/serializable/ObjectModelToSerializableMetaGenerator.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/serializable/ObjectModelToSerializableMetaGenerator.java:1.1 --- /dev/null Tue Jun 21 17:00:48 2005 +++ topia/src/java/org/codelutin/topia/generators/serializable/ObjectModelToSerializableMetaGenerator.java Tue Jun 21 17:00:43 2005 @@ -0,0 +1,66 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * JDOGenerator.java + * + * Created: 7 juil. 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2005/06/21 17:00:43 $ + * par : $Author: thimel $ + */ + +package org.codelutin.topia.generators.serializable; + +import org.codelutin.topia.generators.ObjectModelToTopiaMetaGenerator; +import org.codelutin.generator.Generator; +import org.codelutin.generator.ObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModel; +import java.io.IOException; +import java.io.File; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class ObjectModelToSerializableMetaGenerator extends ObjectModelGenerator { // JDOGenerator + + public ObjectModelToSerializableMetaGenerator(){ + super(); + } + + public ObjectModelToSerializableMetaGenerator(Generator parent){ + super(parent); + } + + public void generate(ObjectModel model, File destDir) throws IOException { + ObjectModelGenerator gen = null; + + Logger.getLogger(getClass().getName() + ".generate").log(Level.FINE, "Generation de ObjectModelToTopiaMetaGenerator"); + gen = new ObjectModelToTopiaMetaGenerator(this); + gen.generate(model, destDir); + + Logger.getLogger(getClass().getName() + ".generate").log(Level.FINE, "Generation de ObjectModelToPersistenceHelperPropertiesGenerator(serializable)"); + gen = new ObjectModelToPersistenceHelperPropertiesGenerator(this); + gen.generate(model, destDir); +} + +} // SerializableGenerator +