From: rkv Date: Fri, 29 Nov 2013 09:20:42 +0000 (+0000) Subject: Vasily has fixed the following bug : X-Git-Tag: V7_3_0b1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8f0a8ee39a7043e2212c5d78f98204fc27de57eb;p=tools%2Fsiman.git Vasily has fixed the following bug : (Steps to reproduce) - Import the e0_donnees.py - Import the e1_geometrie.py (uses e0_donnees.py) - Remove the e1_geometrie.py - Remove the e0_donnees.py - Import the e0_donnees.py - Import the e1_geometrie.py (uses e0_donnees.py) ===> It is possible to remove the e0_donnees.py (pop-up menu item is activated) --- diff --git a/Workspace/Siman-Common/src/org/splat/service/PublicationServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/PublicationServiceImpl.java index 91f2c25..5439663 100644 --- a/Workspace/Siman-Common/src/org/splat/service/PublicationServiceImpl.java +++ b/Workspace/Siman-Common/src/org/splat/service/PublicationServiceImpl.java @@ -155,12 +155,9 @@ public class PublicationServiceImpl implements PublicationService { final List docuses) throws MissedPropertyException, InvalidPropertyException, MultiplyDefinedException, IOException, NotApplicableException, InterruptedException, ParseException { - DocumentType type = getDocumentTypeService().selectType( - (int) documentTypeId); User user = getUserService().selectUser(userId); File updir = getRepositoryService().getDownloadDirectory(user); File upfile = new File(updir.getPath() + "/" + fname); - String[] table = fname.split("\\x2E"); // Creation of the document Document.Properties dprop = new Document.Properties(); @@ -169,6 +166,9 @@ public class PublicationServiceImpl implements PublicationService { if (reference.length() == 0) { // Importation of a foreign document // TODO: Extract property of supported documents (DOCX, ODT...) + DocumentType type = getDocumentTypeService().selectType( + (int) documentTypeId); + String[] table = fname.split("\\x2E"); addoc = getStepService().createDocument( step, dprop.setName(doctitle).setType(type).setFormat( @@ -210,7 +210,26 @@ public class PublicationServiceImpl implements PublicationService { if (docuses != null) { for (Long index : docuses) { Document used = getDocumentService().selectDocument(index); + Publication pub = step.getDocument(index); + if (pub == null) { + for (Publication doc : step.getOwner(). + getDocums()) { + if (doc.value().getIndex() == index) { + pub = doc; + break; + } + } + } + if (pub == null) { + for (Publication doc : step.getOwnerStudy().getDocums()) { + if (doc.value().getIndex() == index) { + pub = doc; + break; + } + } + } addoc.addDependency(used); + pub.setValue(used); } } return addoc;