r1018 - in trunk/simexplorer-is: simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment simexplorer-is-storage/src
Author: tchemit Date: 2008-02-16 15:03:25 +0000 (Sat, 16 Feb 2008) New Revision: 1018 Added: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/ContentTypeFactory.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/ElementGenerator.java Removed: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/ElementGenerator.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/ContentTypeFactory.java Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/Attachment.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/ContentType.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/RawType.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/MetaDataGenerator.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/AttachmentHandler.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/FileSystemAttachmentHandler.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java trunk/simexplorer-is/simexplorer-is-storage/src/resources/i18n/simexplorer-is-storage-en_GB.properties trunk/simexplorer-is/simexplorer-is-storage/src/resources/i18n/simexplorer-is-storage-fr_FR.properties trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service/MockDatabase.java trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java Log: deplacement du generateur d'element dans le module storage avec les autres generateurs et dans le meme module deplacement de la factorie de ContentType dans le paquetage des factories deplacement du paquetage attchment dans paquetage entities ajout TODO sur javadoc i18n pour EntityHelper.Type Deleted: trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/ElementGenerator.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/ElementGenerator.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/ElementGenerator.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -1,387 +0,0 @@ -/* -* ##% Copyright (C) 2008 Code Lutin, Gabriel Landais -* -* 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. -* ##% */ -package fr.cemagref.simexplorer.is.service; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.UUID; - -import org.apache.commons.lang.RandomStringUtils; -import org.codelutin.util.MD5; - -import fr.cemagref.simexplorer.is.attachment.Attachment; -import fr.cemagref.simexplorer.is.attachment.ContentTypeFactory; -import fr.cemagref.simexplorer.is.entities.data.Code; -import fr.cemagref.simexplorer.is.entities.data.Component; -import fr.cemagref.simexplorer.is.entities.data.Constant; -import fr.cemagref.simexplorer.is.entities.data.ConstantValue; -import fr.cemagref.simexplorer.is.entities.data.DataEntity; -import fr.cemagref.simexplorer.is.entities.data.ExplorationApplication; -import fr.cemagref.simexplorer.is.entities.data.ExplorationData; -import fr.cemagref.simexplorer.is.entities.data.Library; -import fr.cemagref.simexplorer.is.entities.data.LoggableElement; -import fr.cemagref.simexplorer.is.entities.data.Result; -import fr.cemagref.simexplorer.is.entities.data.Structure; -import fr.cemagref.simexplorer.is.entities.metadata.MetaData; -import fr.cemagref.simexplorer.is.entities.metadata.Version; -import fr.cemagref.simexplorer.is.factories.BaseEntityFactory; - -/** - * The Class ElementGenerator. - */ -public class ElementGenerator { - - /** - * The Class RandomStream. - */ - public class RandomStream { - - /** The md5. */ - private String md5; - - private byte[] data; - - /** - * Gets the stream. - * - * @return the stream - */ - public InputStream getStream() { - InputStream is; - is = new ByteArrayInputStream(data); - return is; - } - - /** - * Gets the md5. - * - * @return the md5 - */ - public String getMd5() { - return md5; - } - - /** - * Sets the md5. - * - * @param md5 the new md5 - */ - public void setMd5(String md5) { - this.md5 = md5; - } - - public void setData(byte[] bytes) { - data = bytes; - } - - } - - /** The r. */ - private Random r = new Random(); - - /** The cs. */ - private static int cs; - - /** The randomstrings. */ - private static String[] randomstrings; - - /** - * Instantiates a new element generator. - */ - public ElementGenerator() { - super(); - initializeStrings(); - } - - /** - * Short string. - * - * @return the string - */ - private String shortString() { - return RandomStringUtils.randomAlphabetic(r.nextInt(5) + 5); - } - - /** - * Long string. - * - * @return the string - */ - private String longString() { - /* - StringBuilder sb = new StringBuilder(); - int c = 3 + r.nextInt(5); - for (int i = 0; i < c; i++) { - sb.append(shortString()); - sb.append(" "); - } - return sb.toString(); - */ - return RandomStringUtils.randomAlphabetic(r.nextInt(10) + 10); - } - - private String hash() { - return RandomStringUtils.randomAlphanumeric(32); - } - - /** - * Initialize strings. - */ - private void initializeStrings() { - cs = 150000; - randomstrings = new String[cs]; - for (int i = 0; i < randomstrings.length; i++) { - randomstrings[i] = shortString(); - } - } - - /** - * Update. - * - * @param element the element - * - * @throws Exception the exception - */ - private void update(LoggableElement element) throws Exception { - MetaData metaData = new MetaData(); - metaData.setUuid(UUID.randomUUID().toString()); - metaData.setName(longString()); - metaData.setType(element.getClass().getSimpleName()); - - StringBuffer sb = new StringBuffer(""); - - for (int i = 0, max = 3 + r.nextInt(5); i < max; i++) { - sb.append(randomstrings[r.nextInt(cs)]).append(" "); - } - metaData.setDescription(sb.toString()); - - Version v = new Version("0"); - - for (int i = 0, max = 2 + r.nextInt(2); i < max; i++) { - v.setVersion(i, r.nextInt(5)); - } - metaData.setVersion(v.toString()); - metaData.setCreationDate(new Date()); - metaData.setHash(shortString()); - metaData.setLatest(true); - - Map<String, String> descriptors = new HashMap<String, String>(); - for (int i = 0, max = 1 + r.nextInt(12); i < max; i++) { - descriptors.put(Integer.toString(i), shortString()); - } - metaData.setDescriptors(descriptors); - - if (element instanceof Library || element instanceof ExplorationData) { - // generate attachments - for (int i = 0, max = r.nextInt(15); i < max; i++) { - metaData.getAttachments().add(generateAttachment()); - } - } - - element.setMetaData(metaData); - } - - /** - * Generate array. - * - * @param <T> Class in array - * - * @param clazz the clazz - * - * @return the set< t> - * - * @throws Exception the exception - */ - public <T extends DataEntity> Set<T> generateArray(Class<T> clazz) throws Exception { - Set<T> elements = new HashSet<T>(); - int i = 3 + r.nextInt(2); - for (int j = 0; j < i; j++) { - T element = BaseEntityFactory.<T> getFactory(clazz).createInstance(); - if (element instanceof LoggableElement) { - update((LoggableElement) element); - } - elements.add(element); - } - return elements; - } - - /** - * Generate random ea. - * - * @return the exploration application - * - * @throws Exception the exception - */ - public ExplorationApplication generateRandomEA() throws Exception { - ExplorationApplication ea = new ExplorationApplication(); - update(ea); - Set<ExplorationData> datas = generateArray(ExplorationData.class); - for (ExplorationData object : datas) { - processExplorationData(object); - } - ea.setExplorations(datas); - Set<Component> components = generateArray(Component.class); - for (Component object : components) { - processComponent(object); - } - ea.setComponents(components); - return ea; - } - - /** - * Process component. - * - * @param component the component - * - * @throws Exception the exception - */ - private void processComponent(Component component) throws Exception { - Set<Constant> constants = generateArray(Constant.class); - for (Constant constant : constants) { - processConstant(constant); - } - component.setConstants(constants); - - component.setStructures(new HashSet<Structure>()); - - Set<Code> codes = generateArray(Code.class); - for (Code code : codes) { - processCode(code); - } - component.setCodes(codes); - - Set<Library> libraries = generateArray(Library.class); - for (Library library : libraries) { - processLibrary(library); - } - component.setLibraries(libraries); - - } - - /** - * Generate attachment. - * - * @return the attachment - * - * @throws Exception the exception - */ - private Attachment generateAttachment() throws Exception { - Attachment attachment = new Attachment(); - attachment.setContentType(ContentTypeFactory.getContentTypeInstance("RawType")); - attachment.setDataHash(hash()); - // attachment.setDataHash("d41d8cd98f00b204e9800998ecf8427e"); - attachment.setFileName(shortString() + ".txt"); - return attachment; - } - - /** - * Process library. - * - * @param library the library - * - * @throws Exception the exception - */ - private void processLibrary(Library library) throws Exception { - // library.getMetaData().getAttachments().add(generateAttachment()); - } - - /** - * Process code. - * - * @param code the code - */ - private void processCode(Code code) { - code.setCode(shortString()); - code.setLanguage(shortString()); - } - - /** - * Process constant. - * - * @param constant the constant - */ - private void processConstant(Constant constant) { - constant.setName(shortString()); - constant.setType(String.class); - } - - /** - * Process exploration data. - * - * @param explorationData the exploration data - * - * @throws Exception the exception - */ - private void processExplorationData(ExplorationData explorationData) throws Exception { - Result result = new Result(); - explorationData.setResult(result); - // explorationData.getMetaData().getAttachments().add(generateAttachment()); - - Set<ConstantValue> constantValues = generateArray(ConstantValue.class); - for (ConstantValue constantValue : constantValues) { - processConstantValue(constantValue); - } - explorationData.setValuesMap(constantValues); - - } - - /** - * Process constant value. - * - * @param constantValue the constant value - */ - private void processConstantValue(ConstantValue constantValue) { - Constant constant = new Constant(); - constant.setName(shortString()); - constant.setType(Integer.class); - - constantValue.setConstant(constant); - constantValue.setValue(Integer.toString(r.nextInt())); - } - - /** - * Generate text stream. - * - * @return the input stream - * - * @throws Exception the exception - */ - public RandomStream generateTextStream() throws Exception { - RandomStream rs = new RandomStream(); - - int wordcount = 300 + r.nextInt(300); - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < wordcount; i++) { - sb.append(randomstrings[r.nextInt(cs)]).append(" "); - } - - MD5 md5 = new MD5(); - md5.Update(sb.toString().getBytes()); - rs.setMd5(md5.asHex()); - - rs.setData(sb.toString().getBytes()); - - return rs; - } -} Copied: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment (from rev 1014, trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/attachment) Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/Attachment.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/attachment/Attachment.java 2008-02-16 09:39:37 UTC (rev 1014) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/Attachment.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -15,18 +15,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ##% */ -package fr.cemagref.simexplorer.is.attachment; +package fr.cemagref.simexplorer.is.entities.attachment; -import java.io.Serializable; - import org.apache.commons.lang.StringUtils; +import fr.cemagref.simexplorer.is.entities.BaseEntity; +import fr.cemagref.simexplorer.is.entities.EntityVisitor; /** * Represents data attached to metadata. * * @author glandais */ -public class Attachment implements Serializable { +public class Attachment implements BaseEntity { /** Serial version ID. */ private static final long serialVersionUID = 5467615366054227592L; @@ -176,13 +176,14 @@ @Override public String toString() { StringBuffer sb = new StringBuffer(); - sb.append(getFileName()); - //sb.append(getFileName()).append(" - "); - //sb.append(getDataHash()); + sb.append(getFileName()); if (getContentType() != null) { sb.append(" - ").append(getContentType().getDescription()); } return sb.toString(); } + public void accept(EntityVisitor visitor) { + visitor.visitAttachment(this); + } } Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/ContentType.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/attachment/ContentType.java 2008-02-16 09:39:37 UTC (rev 1014) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/ContentType.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -15,45 +15,42 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ##% */ -package fr.cemagref.simexplorer.is.attachment; +package fr.cemagref.simexplorer.is.entities.attachment; +import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; + import java.io.InputStream; import java.io.Reader; +import java.io.Serializable; -import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; - /** - * Content handler. - * + * Content handler contract. + * * @author landais */ -public abstract class ContentType { +public interface ContentType extends Serializable { /** * Index content. - * - * @param is - * Input stream - * + * + * @param is Input stream * @return Indexable text - * - * @throws SimExplorerException - * the exception + * @throws SimExplorerException the exception */ - public abstract Reader renderToText(InputStream is) throws SimExplorerException; + Reader renderToText(InputStream is) throws SimExplorerException; /** * Gets the mime type. - * + * * @return the mimeType */ - public abstract String getMimeType(); + String getMimeType(); /** * Gets the description. - * + * * @return the description */ - public abstract String getDescription(); + String getDescription(); } Deleted: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/ContentTypeFactory.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/attachment/ContentTypeFactory.java 2008-02-16 09:39:37 UTC (rev 1014) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/ContentTypeFactory.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -1,78 +0,0 @@ -/* -* ##% Copyright (C) 2008 Code Lutin, Gabriel Landais -* -* 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. -* ##% */ -package fr.cemagref.simexplorer.is.attachment; - -import java.util.HashMap; -import java.util.Map; - -/** - * Cache content types. - * - * @author landais - */ -public class ContentTypeFactory { - - /** Content type cache. */ - private static Map<String, ContentType> contentTypes = null; - - /** Constant defining where are implementations */ - private static final String PACKAGE_IMPLS = ContentTypeFactory.class.getPackage().getName(); - - /** - * Retrieve a content type instance from the cache. - * <p/> - * If no such instance is found, then create it and store it in cache. - * - * @param contentTypeClassSimpleName Class required - * @return the Instance - * @throws IllegalArgumentException if could not found the class or has - * problem while instanciation - */ - public static ContentType getContentTypeInstance(String contentTypeClassSimpleName) throws IllegalArgumentException { - Map<String, ContentType> contentTypes = getContentTypes(); - // Check cache - ContentType result = getContentTypes().get(contentTypeClassSimpleName); - // Create instance if doesn't exist, and put it in cache - if (result == null) { - try { - Class<?> impl; - impl = Class.forName(PACKAGE_IMPLS + "." + contentTypeClassSimpleName); - result = (ContentType) impl.newInstance(); - contentTypes.put(contentTypeClassSimpleName, result); - } catch (ClassNotFoundException e) { - throw new IllegalArgumentException(e); - } catch (IllegalAccessException e) { - throw new IllegalArgumentException(e); - } catch (InstantiationException e) { - throw new IllegalArgumentException(e); - } - } - return result; - } - - protected static Map<String, ContentType> getContentTypes() { - if (contentTypes == null) { - contentTypes = new HashMap<String, ContentType>(); - } - return contentTypes; - } - - protected ContentTypeFactory() { - // no instance - } -} Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/RawType.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/attachment/RawType.java 2008-02-16 09:39:37 UTC (rev 1014) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/entities/attachment/RawType.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -15,27 +15,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ##% */ -package fr.cemagref.simexplorer.is.attachment; +package fr.cemagref.simexplorer.is.entities.attachment; import static org.codelutin.i18n.I18n._; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; -import java.io.Serializable; /** * Raw content type. * * @author landais */ -public class RawType extends ContentType implements Serializable { +public class RawType implements ContentType { /** The Constant serialVersionUID. */ private static final long serialVersionUID = -8010160085848440286L; /* (non-Javadoc) - * @see fr.cemagref.simexplorer.is.attachment.ContentType#renderToText(java.io.InputStream) + * @see fr.cemagref.simexplorer.is.entities.attachment.ContentType#renderToText(java.io.InputStream) */ @Override public Reader renderToText(InputStream is) { @@ -44,15 +43,17 @@ } /* (non-Javadoc) - * @see fr.cemagref.simexplorer.is.attachment.ContentType#getDescription() + * @see fr.cemagref.simexplorer.is.entities.attachment.ContentType#getDescription() */ @Override public String getDescription() { + //TODO, il vaudrait mieux utiliser la clef de marquage i18n + //TODO, sinon on ne peut pas changer de langue... return _("simexplorer.contenttype.rawtype"); } /* (non-Javadoc) - * @see fr.cemagref.simexplorer.is.attachment.ContentType#getMimeType() + * @see fr.cemagref.simexplorer.is.entities.attachment.ContentType#getMimeType() */ @Override public String getMimeType() { Copied: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/ContentTypeFactory.java (from rev 1014, trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/attachment/ContentTypeFactory.java) =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/ContentTypeFactory.java (rev 0) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/ContentTypeFactory.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -0,0 +1,80 @@ +/* +* ##% Copyright (C) 2008 Code Lutin, Gabriel Landais +* +* 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. +* ##% */ +package fr.cemagref.simexplorer.is.factories; + +import fr.cemagref.simexplorer.is.entities.attachment.ContentType; + +import java.util.HashMap; +import java.util.Map; + +/** + * Cache content types. + * + * @author landais + */ +public class ContentTypeFactory { + + /** Content type cache. */ + private static Map<String, ContentType> contentTypes = null; + + /** Constant defining where are implementations */ + private static final String PACKAGE_IMPLS = ContentTypeFactory.class.getPackage().getName(); + + /** + * Retrieve a content type instance from the cache. + * <p/> + * If no such instance is found, then create it and store it in cache. + * + * @param contentTypeClassSimpleName Class required + * @return the Instance + * @throws IllegalArgumentException if could not found the class or has + * problem while instanciation + */ + public static ContentType getContentTypeInstance(String contentTypeClassSimpleName) throws IllegalArgumentException { + Map<String, ContentType> contentTypes = getContentTypes(); + // Check cache + ContentType result = getContentTypes().get(contentTypeClassSimpleName); + // Create instance if doesn't exist, and put it in cache + if (result == null) { + try { + Class<?> impl; + impl = Class.forName(PACKAGE_IMPLS + "." + contentTypeClassSimpleName); + result = (ContentType) impl.newInstance(); + contentTypes.put(contentTypeClassSimpleName, result); + } catch (ClassNotFoundException e) { + throw new IllegalArgumentException(e); + } catch (IllegalAccessException e) { + throw new IllegalArgumentException(e); + } catch (InstantiationException e) { + throw new IllegalArgumentException(e); + } + } + return result; + } + + protected static Map<String, ContentType> getContentTypes() { + if (contentTypes == null) { + contentTypes = new HashMap<String, ContentType>(); + } + return contentTypes; + } + + protected ContentTypeFactory() { + // no instance + } +} Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/factories/MetaDataFactory.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -38,9 +38,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import fr.cemagref.simexplorer.is.attachment.Attachment; -import fr.cemagref.simexplorer.is.attachment.ContentType; -import fr.cemagref.simexplorer.is.attachment.ContentTypeFactory; +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; +import fr.cemagref.simexplorer.is.entities.attachment.ContentType; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; import fr.cemagref.simexplorer.is.exceptions.SimExplorerTechnicalException; @@ -300,7 +299,7 @@ /** * Compute hash. * - * @param xmlStream the xml stream + * @param node the xml stream * * @return the string * @@ -311,7 +310,7 @@ Document document = getXMLBuilder().newDocument(); document.appendChild(document.importNode(node, true)); - int removeNodes = removeMetadatas(document); + removeMetadatas(document); DigestGenerator digestGenerator = new DigestGenerator(); byte[] digest = digestGenerator.getDigest(document, DigestGenerator.sha1DigestAlgorithm); @@ -324,8 +323,7 @@ /** * Removes the metadatas. - * - * @param document the document + * * @param node the node * * @return the int Copied: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/ElementGenerator.java (from rev 1014, trunk/simexplorer-is/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/ElementGenerator.java) =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/ElementGenerator.java (rev 0) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/ElementGenerator.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -0,0 +1,387 @@ +/* +* ##% Copyright (C) 2008 Code Lutin, Gabriel Landais +* +* 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. +* ##% */ +package fr.cemagref.simexplorer.is.storage; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.UUID; + +import org.apache.commons.lang.RandomStringUtils; +import org.codelutin.util.MD5; + +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; +import fr.cemagref.simexplorer.is.factories.ContentTypeFactory; +import fr.cemagref.simexplorer.is.entities.data.Code; +import fr.cemagref.simexplorer.is.entities.data.Component; +import fr.cemagref.simexplorer.is.entities.data.Constant; +import fr.cemagref.simexplorer.is.entities.data.ConstantValue; +import fr.cemagref.simexplorer.is.entities.data.DataEntity; +import fr.cemagref.simexplorer.is.entities.data.ExplorationApplication; +import fr.cemagref.simexplorer.is.entities.data.ExplorationData; +import fr.cemagref.simexplorer.is.entities.data.Library; +import fr.cemagref.simexplorer.is.entities.data.LoggableElement; +import fr.cemagref.simexplorer.is.entities.data.Result; +import fr.cemagref.simexplorer.is.entities.data.Structure; +import fr.cemagref.simexplorer.is.entities.metadata.MetaData; +import fr.cemagref.simexplorer.is.entities.metadata.Version; +import fr.cemagref.simexplorer.is.factories.BaseEntityFactory; + +/** + * The Class ElementGenerator. + */ +public class ElementGenerator { + + /** + * The Class RandomStream. + */ + public class RandomStream { + + /** The md5. */ + private String md5; + + private byte[] data; + + /** + * Gets the stream. + * + * @return the stream + */ + public InputStream getStream() { + InputStream is; + is = new ByteArrayInputStream(data); + return is; + } + + /** + * Gets the md5. + * + * @return the md5 + */ + public String getMd5() { + return md5; + } + + /** + * Sets the md5. + * + * @param md5 the new md5 + */ + public void setMd5(String md5) { + this.md5 = md5; + } + + public void setData(byte[] bytes) { + data = bytes; + } + + } + + /** The r. */ + private Random r = new Random(); + + /** The cs. */ + private static int cs; + + /** The randomstrings. */ + private static String[] randomstrings; + + /** + * Instantiates a new element generator. + */ + public ElementGenerator() { + super(); + initializeStrings(); + } + + /** + * Short string. + * + * @return the string + */ + private String shortString() { + return RandomStringUtils.randomAlphabetic(r.nextInt(5) + 5); + } + + /** + * Long string. + * + * @return the string + */ + private String longString() { + /* + StringBuilder sb = new StringBuilder(); + int c = 3 + r.nextInt(5); + for (int i = 0; i < c; i++) { + sb.append(shortString()); + sb.append(" "); + } + return sb.toString(); + */ + return RandomStringUtils.randomAlphabetic(r.nextInt(10) + 10); + } + + private String hash() { + return RandomStringUtils.randomAlphanumeric(32); + } + + /** + * Initialize strings. + */ + private void initializeStrings() { + cs = 150000; + randomstrings = new String[cs]; + for (int i = 0; i < randomstrings.length; i++) { + randomstrings[i] = shortString(); + } + } + + /** + * Update. + * + * @param element the element + * + * @throws Exception the exception + */ + private void update(LoggableElement element) throws Exception { + MetaData metaData = new MetaData(); + metaData.setUuid(UUID.randomUUID().toString()); + metaData.setName(longString()); + metaData.setType(element.getClass().getSimpleName()); + + StringBuffer sb = new StringBuffer(""); + + for (int i = 0, max = 3 + r.nextInt(5); i < max; i++) { + sb.append(randomstrings[r.nextInt(cs)]).append(" "); + } + metaData.setDescription(sb.toString()); + + Version v = new Version("0"); + + for (int i = 0, max = 2 + r.nextInt(2); i < max; i++) { + v.setVersion(i, r.nextInt(5)); + } + metaData.setVersion(v.toString()); + metaData.setCreationDate(new Date()); + metaData.setHash(shortString()); + metaData.setLatest(true); + + Map<String, String> descriptors = new HashMap<String, String>(); + for (int i = 0, max = 1 + r.nextInt(12); i < max; i++) { + descriptors.put(Integer.toString(i), shortString()); + } + metaData.setDescriptors(descriptors); + + if (element instanceof Library || element instanceof ExplorationData) { + // generate attachments + for (int i = 0, max = r.nextInt(15); i < max; i++) { + metaData.getAttachments().add(generateAttachment()); + } + } + + element.setMetaData(metaData); + } + + /** + * Generate array. + * + * @param <T> Class in array + * + * @param clazz the clazz + * + * @return the set< t> + * + * @throws Exception the exception + */ + public <T extends DataEntity> Set<T> generateArray(Class<T> clazz) throws Exception { + Set<T> elements = new HashSet<T>(); + int i = 3 + r.nextInt(2); + for (int j = 0; j < i; j++) { + T element = BaseEntityFactory.<T> getFactory(clazz).createInstance(); + if (element instanceof LoggableElement) { + update((LoggableElement) element); + } + elements.add(element); + } + return elements; + } + + /** + * Generate random ea. + * + * @return the exploration application + * + * @throws Exception the exception + */ + public ExplorationApplication generateRandomEA() throws Exception { + ExplorationApplication ea = new ExplorationApplication(); + update(ea); + Set<ExplorationData> datas = generateArray(ExplorationData.class); + for (ExplorationData object : datas) { + processExplorationData(object); + } + ea.setExplorations(datas); + Set<Component> components = generateArray(Component.class); + for (Component object : components) { + processComponent(object); + } + ea.setComponents(components); + return ea; + } + + /** + * Process component. + * + * @param component the component + * + * @throws Exception the exception + */ + private void processComponent(Component component) throws Exception { + Set<Constant> constants = generateArray(Constant.class); + for (Constant constant : constants) { + processConstant(constant); + } + component.setConstants(constants); + + component.setStructures(new HashSet<Structure>()); + + Set<Code> codes = generateArray(Code.class); + for (Code code : codes) { + processCode(code); + } + component.setCodes(codes); + + Set<Library> libraries = generateArray(Library.class); + for (Library library : libraries) { + processLibrary(library); + } + component.setLibraries(libraries); + + } + + /** + * Generate attachment. + * + * @return the attachment + * + * @throws Exception the exception + */ + private Attachment generateAttachment() throws Exception { + Attachment attachment = new Attachment(); + attachment.setContentType(ContentTypeFactory.getContentTypeInstance("RawType")); + attachment.setDataHash(hash()); + // attachment.setDataHash("d41d8cd98f00b204e9800998ecf8427e"); + attachment.setFileName(shortString() + ".txt"); + return attachment; + } + + /** + * Process library. + * + * @param library the library + * + * @throws Exception the exception + */ + private void processLibrary(Library library) throws Exception { + // library.getMetaData().getAttachments().add(generateAttachment()); + } + + /** + * Process code. + * + * @param code the code + */ + private void processCode(Code code) { + code.setCode(shortString()); + code.setLanguage(shortString()); + } + + /** + * Process constant. + * + * @param constant the constant + */ + private void processConstant(Constant constant) { + constant.setName(shortString()); + constant.setType(String.class); + } + + /** + * Process exploration data. + * + * @param explorationData the exploration data + * + * @throws Exception the exception + */ + private void processExplorationData(ExplorationData explorationData) throws Exception { + Result result = new Result(); + explorationData.setResult(result); + // explorationData.getMetaData().getAttachments().add(generateAttachment()); + + Set<ConstantValue> constantValues = generateArray(ConstantValue.class); + for (ConstantValue constantValue : constantValues) { + processConstantValue(constantValue); + } + explorationData.setConstantValues(constantValues); + + } + + /** + * Process constant value. + * + * @param constantValue the constant value + */ + private void processConstantValue(ConstantValue constantValue) { + Constant constant = new Constant(); + constant.setName(shortString()); + constant.setType(Integer.class); + + constantValue.setConstant(constant); + constantValue.setValue(Integer.toString(r.nextInt())); + } + + /** + * Generate text stream. + * + * @return the input stream + * + * @throws Exception the exception + */ + public RandomStream generateTextStream() throws Exception { + RandomStream rs = new RandomStream(); + + int wordcount = 300 + r.nextInt(300); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < wordcount; i++) { + sb.append(randomstrings[r.nextInt(cs)]).append(" "); + } + + MD5 md5 = new MD5(); + md5.Update(sb.toString().getBytes()); + rs.setMd5(md5.asHex()); + + rs.setData(sb.toString().getBytes()); + + return rs; + } +} Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/MetaDataGenerator.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/MetaDataGenerator.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/MetaDataGenerator.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -17,7 +17,7 @@ * ##% */ package fr.cemagref.simexplorer.is.storage; -import fr.cemagref.simexplorer.is.attachment.Attachment; +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.entities.metadata.Version; Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/AttachmentHandler.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/AttachmentHandler.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/AttachmentHandler.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -19,7 +19,7 @@ import java.io.InputStream; -import fr.cemagref.simexplorer.is.attachment.Attachment; +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/FileSystemAttachmentHandler.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/FileSystemAttachmentHandler.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/FileSystemAttachmentHandler.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -29,7 +29,7 @@ import org.codelutin.util.MD5; -import fr.cemagref.simexplorer.is.attachment.Attachment; +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; import fr.cemagref.simexplorer.is.exceptions.SimExplorerTechnicalException; Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -93,7 +93,7 @@ * * @param fromElement the from element * @param toElement the to element - * @throws SimExplorerException + * @throws SimExplorerException TODO */ public abstract void duplicateElementHierarchy(MetaData fromElement, MetaData toElement) throws SimExplorerException; @@ -129,7 +129,7 @@ * @param mde the mde * * @return the elements used by - * @throws SimExplorerException + * @throws SimExplorerException TODO */ public abstract Set<MetaData> getElementsUsedBy(MetaData mde) throws SimExplorerException; @@ -139,7 +139,7 @@ * @param mde the mde * * @return the elements using - * @throws SimExplorerException + * @throws SimExplorerException TODO */ public abstract Set<MetaData> getElementsUsing(MetaData mde) throws SimExplorerException; Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -55,8 +55,8 @@ import org.apache.lucene.store.LockFactory; import org.apache.lucene.store.NoLockFactory; -import fr.cemagref.simexplorer.is.attachment.Attachment; -import fr.cemagref.simexplorer.is.attachment.ContentTypeFactory; +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; +import fr.cemagref.simexplorer.is.factories.ContentTypeFactory; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.entities.metadata.Version; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -24,7 +24,7 @@ import javax.ejb.Local; -import fr.cemagref.simexplorer.is.attachment.Attachment; +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.entities.metadata.Version; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; @@ -86,7 +86,7 @@ * @param token the token * @param fromElement the from element * @param toElement the to element - * @throws SimExplorerException + * @throws SimExplorerException if any problem while operation */ public abstract void duplicateElementHierarchy(String token, MetaData fromElement, MetaData toElement) throws SimExplorerException; Modified: trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngineImpl.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -26,13 +26,11 @@ import java.util.Set; import java.util.UUID; -import org.codelutin.util.CollectionUtil; -import fr.cemagref.simexplorer.is.attachment.Attachment; +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.entities.metadata.Version; import fr.cemagref.simexplorer.is.exceptions.SimExplorerException; -import fr.cemagref.simexplorer.is.exceptions.SimExplorerTechnicalException; import fr.cemagref.simexplorer.is.storage.attachment.AttachmentHandler; import fr.cemagref.simexplorer.is.storage.attachment.FileSystemAttachmentHandler; import fr.cemagref.simexplorer.is.storage.database.Database; Modified: trunk/simexplorer-is/simexplorer-is-storage/src/resources/i18n/simexplorer-is-storage-en_GB.properties =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/resources/i18n/simexplorer-is-storage-en_GB.properties 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/resources/i18n/simexplorer-is-storage-en_GB.properties 2008-02-16 15:03:25 UTC (rev 1018) @@ -1 +1,23 @@ +simexplorer.common.attachment=Attachment +simexplorer.common.attachments=Attachments +simexplorer.common.code=Code +simexplorer.common.codes=Codes +simexplorer.common.component=Component +simexplorer.common.components=Components +simexplorer.common.constant=Constant +simexplorer.common.constants=Constants +simexplorer.common.constantvalue=Constant value +simexplorer.common.constantvalues=Constant values +simexplorer.common.explorationapplication=Exploration application +simexplorer.common.explorationapplications=Exploration applications +simexplorer.common.explorationdata=Exploration data +simexplorer.common.explorationdatas=Exploration datas +simexplorer.common.libraries=Libraries +simexplorer.common.library=Library +simexplorer.common.repositories=Repositories +simexplorer.common.repository=Repository +simexplorer.common.result=Result +simexplorer.common.results=Results +simexplorer.common.structure=Structure +simexplorer.common.structures=Structures simexplorer.contenttype.rawtype=Raw file (text) Modified: trunk/simexplorer-is/simexplorer-is-storage/src/resources/i18n/simexplorer-is-storage-fr_FR.properties =================================================================== --- trunk/simexplorer-is/simexplorer-is-storage/src/resources/i18n/simexplorer-is-storage-fr_FR.properties 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-storage/src/resources/i18n/simexplorer-is-storage-fr_FR.properties 2008-02-16 15:03:25 UTC (rev 1018) @@ -1 +1,23 @@ +simexplorer.common.attachment=Fichier attach\u00E9 +simexplorer.common.attachments=Fichiers attach\u00E9s +simexplorer.common.code=Code +simexplorer.common.codes=Codes +simexplorer.common.component=Componsant +simexplorer.common.components=Composants +simexplorer.common.constant=Constante +simexplorer.common.constants=Constantes +simexplorer.common.constantvalue=Valeur de constante +simexplorer.common.constantvalues=Valeurs de constante +simexplorer.common.explorationapplication=Exploration d'application +simexplorer.common.explorationapplications=Explorations d'application +simexplorer.common.explorationdata=Donn\u00E9e d'exploration +simexplorer.common.explorationdatas=Donn\u00E9es d'Explorations +simexplorer.common.libraries=Librairies +simexplorer.common.library=Librarie +simexplorer.common.repositories=Repositories +simexplorer.common.repository=Repository +simexplorer.common.result=R\u00E9sultat +simexplorer.common.results=Resultats +simexplorer.common.structure=Structure +simexplorer.common.structures=Structures simexplorer.contenttype.rawtype=Fichier brut (texte) Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service/MockDatabase.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service/MockDatabase.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/service/MockDatabase.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -26,6 +26,7 @@ import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.entities.metadata.Version; import fr.cemagref.simexplorer.is.storage.VersionGenerator; +import fr.cemagref.simexplorer.is.storage.ElementGenerator; import fr.cemagref.simexplorer.is.exceptions.SimExplorerRuntimeException; import java.util.ArrayList; Modified: trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java 2008-02-16 14:56:40 UTC (rev 1017) +++ trunk/simexplorer-is/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Install.java 2008-02-16 15:03:25 UTC (rev 1018) @@ -29,7 +29,7 @@ import com.healthmarketscience.rmiio.SerializableInputStream; -import fr.cemagref.simexplorer.is.attachment.Attachment; +import fr.cemagref.simexplorer.is.entities.attachment.Attachment; import fr.cemagref.simexplorer.is.entities.data.Component; import fr.cemagref.simexplorer.is.entities.data.ExplorationApplication; import fr.cemagref.simexplorer.is.entities.data.ExplorationData; @@ -37,8 +37,8 @@ import fr.cemagref.simexplorer.is.entities.metadata.Version; import fr.cemagref.simexplorer.is.factories.BaseEntityFactory; import fr.cemagref.simexplorer.is.factories.XmlConstants; -import fr.cemagref.simexplorer.is.service.ElementGenerator; -import fr.cemagref.simexplorer.is.service.ElementGenerator.RandomStream; +import fr.cemagref.simexplorer.is.storage.ElementGenerator; +import fr.cemagref.simexplorer.is.storage.ElementGenerator.RandomStream; import fr.cemagref.simexplorer.is.ui.web.pages.security.SuperAdminPage; import fr.cemagref.simexplorer.is.ui.web.services.RemoteStorageService;
participants (1)
-
tchemit@users.labs.libre-entreprise.org