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;
File upfile = commonInitialize(Constants.TRUE);
_mystudy = getOpenStudy();
+ //updating relations of docs
+ _mystudy.updateCurrentStep();
_defuses = new ArrayList<Document>();
-
+
Publication tag = _mystudy.getSelectedStep().getDocument(
Integer.valueOf(_index));
Document doc = tag.value();
// 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> document = _defuses.iterator(); document.hasNext(); ) {
- Publication pub = tag.getOwner().getPublication(document.next());
- if(pub != null && pub.getRelations(UsesRelation.class).contains(tag)) {
- document.remove();
+ List<Document> toDeleteFromDefuses = new ArrayList<Document>();
+ getPublicationService().findSequenceUses(toDeleteFromDefuses, tag,
+ _defuses);
+ for (Document document : toDeleteFromDefuses) {
+ if (_defuses.contains(document)) {
+ _defuses.remove(document);
}
}