X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Workspace%2FSiman%2Fsrc%2Forg%2Fsplat%2Fsimer%2FVersionDocumentAction.java;fp=Workspace%2FSiman%2Fsrc%2Forg%2Fsplat%2Fsimer%2FVersionDocumentAction.java;h=1eeaabe06b8dfeabc5f4be792f2d9b03391f5ce6;hb=6273a46aa9ca47e2a4f1eb08a0230ec9f1b44f57;hp=90733644a26a13fa2c333d2f464ab4891df951f6;hpb=d71796668bef300bf69bd7e97591e78f6ec6612f;p=tools%2Fsiman.git diff --git a/Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java b/Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java index 9073364..1eeaabe 100644 --- a/Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java +++ b/Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java @@ -21,6 +21,8 @@ import org.splat.dal.bo.som.ValidationStep; import org.splat.kernel.InvalidPropertyException; import org.splat.manox.Reader; import org.splat.manox.Toolbox; +import org.splat.service.PublicationService; +import org.splat.service.StudyService; import org.splat.som.Revision; import org.splat.som.Step; import org.splat.wapp.Constants; @@ -65,6 +67,7 @@ public class VersionDocumentAction extends BaseUploadDocumentAction { File upfile = commonInitialize(Constants.TRUE); _mystudy = getOpenStudy(); + //updating relations of docs _mystudy.updateCurrentStep(); _defuses = new ArrayList(); @@ -95,10 +98,12 @@ public class VersionDocumentAction extends BaseUploadDocumentAction { // Avoid using of documents dependent on the current version of the document being versioned // (This case is possible only if both documents belong to the step of the same Project Element) - for(Iterator document = _defuses.iterator(); document.hasNext(); ) { - Publication pub = tag.getOwner().getPublication(document.next()); - if(pub != null && pub.getRelations(UsesRelation.class).contains(tag)) { - document.remove(); + List toDeleteFromDefuses = new ArrayList(); + getPublicationService().findSequenceUses(toDeleteFromDefuses, tag, + _defuses); + for (Document document : toDeleteFromDefuses) { + if (_defuses.contains(document)) { + _defuses.remove(document); } }