dtContent); final GuidedDecisionTableGraphEntry dtGraphEntry = new GuidedDecisionTableGraphEntry(dtPath, dtPath); dtGraphContent.getModel().getEntries().add(dtGraphEntry);
model.getEntries().add( new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry( source, source ) ); when( dtableGraphService.load( any( Path.class ) ) ).thenReturn( model ); newModel.getEntries().size() ); assertEquals( destination.toURI(), newModel.getEntries().iterator().next().getPathHead().toURI() );
dtGraphModel.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(path, path)); when(dtableGraphService.load(any(Path.class))).thenReturn(dtGraphModel); dtGraphModel.getEntries().size()); assertEquals(versions.get(0).uri(), dtGraphModel.getEntries().iterator().next().getPathVersion().toURI());
dtGraphModel.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(path, path)); when(dtableGraphService.load(any(Path.class))).thenReturn(dtGraphModel); dtGraphModel.getEntries().size()); assertEquals(versions.get(0).uri(), dtGraphModel.getEntries().iterator().next().getPathVersion().toURI());
model.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(vfsDtable1Path, vfsDtable1Path)); model.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(vfsDtable2Path, vfsDtable2Path)); final String xml = GuidedDTGraphXMLPersistence.getInstance().marshal(model);
dtContent); final GuidedDecisionTableGraphEntry dtGraphEntry = new GuidedDecisionTableGraphEntry(dtPath, dtPath); dtGraphContent.getModel().getEntries().add(dtGraphEntry);
dtContent); final GuidedDecisionTableGraphEntry dtGraphEntry = new GuidedDecisionTableGraphEntry(dtPath, dtPath); dtGraphContent.getModel().getEntries().add(dtGraphEntry);
dtContent); final GuidedDecisionTableGraphEntry dtGraphEntry = new GuidedDecisionTableGraphEntry(dtPath, dtPath); dtGraphContent.getModel().getEntries().add(dtGraphEntry);
model.getEntries().add( new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry( source, source ) ); when( dtableGraphService.load( any( Path.class ) ) ).thenReturn( model ); newModel.getEntries().size() ); assertEquals( destination.toURI(), newModel.getEntries().iterator().next().getPathHead().toURI() );
dtContent); final GuidedDecisionTableGraphEntry dtGraphEntry = new GuidedDecisionTableGraphEntry(dtPath, dtPath); dtGraphContent.getModel().getEntries().add(dtGraphEntry);
model.getEntries().add( new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry( path, path ) ); when( dtableGraphService.load( any( Path.class ) ) ).thenReturn( model );
model.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(vfsDtable1Path, vfsDtable1Path)); model.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(vfsDtable2Path, vfsDtable2Path)); final String xml = GuidedDTGraphXMLPersistence.getInstance().marshal(model);
@Test public void checkMarshallingModelWithEntryPosition() { final Path path = PathFactory.newPath( "path", "default://path" ); final GuidedDecisionTableEditorGraphModel model = new GuidedDecisionTableEditorGraphModel(); model.getEntries().add( new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry( path, path, 100.0, 200.0 ) ); final String xml = GuidedDTGraphXMLPersistence.getInstance().marshal( model ); assertNotNull( xml ); assertEqualsIgnoreWhitespace( "<graph>\n" + " <entries>\n" + " <entry>\n" + " <pathHead class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\">\n" + " <uri>default://path</uri>\n" + " <fileName>path</fileName>\n" + " <attributes/>\n" + " <hasVersionSupport>false</hasVersionSupport>\n" + " </pathHead>\n" + " <pathVersion class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\" reference=\"../pathHead\"/>\n" + " <x>100.0</x>\n" + " <y>200.0</y>\n" + " </entry>\n" + " </entries>\n" + "</graph>", xml ); }
model.getEntries().add( new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry( path, path ) ); when( dtableGraphService.load( any( Path.class ) ) ).thenReturn( model );
@Test public void checkMarshallingModelWithEntryPosition() { final Path path = PathFactory.newPath( "path", "default://path" ); final GuidedDecisionTableEditorGraphModel model = new GuidedDecisionTableEditorGraphModel(); model.getEntries().add( new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry( path, path, 100.0, 200.0 ) ); final String xml = GuidedDTGraphXMLPersistence.getInstance().marshal( model ); assertNotNull( xml ); assertEqualsIgnoreWhitespace( "<graph>\n" + " <entries>\n" + " <entry>\n" + " <pathHead class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\">\n" + " <uri>default://path</uri>\n" + " <fileName>path</fileName>\n" + " <attributes/>\n" + " <hasVersionSupport>false</hasVersionSupport>\n" + " </pathHead>\n" + " <pathVersion class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\" reference=\"../pathHead\"/>\n" + " <x>100.0</x>\n" + " <y>200.0</y>\n" + " </entry>\n" + " </entries>\n" + "</graph>", xml ); }
@Test public void checkMarshallingModelWithoutEntryPosition() { final Path path = PathFactory.newPath( "path", "default://path" ); final GuidedDecisionTableEditorGraphModel model = new GuidedDecisionTableEditorGraphModel(); model.getEntries().add( new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry( path, path ) ); final String xml = GuidedDTGraphXMLPersistence.getInstance().marshal( model ); assertNotNull( xml ); assertEqualsIgnoreWhitespace( "<graph>\n" + " <entries>\n" + " <entry>\n" + " <pathHead class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\">\n" + " <uri>default://path</uri>\n" + " <fileName>path</fileName>\n" + " <attributes/>\n" + " <hasVersionSupport>false</hasVersionSupport>\n" + " </pathHead>\n" + " <pathVersion class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\" reference=\"../pathHead\"/>\n" + " </entry>\n" + " </entries>\n" + "</graph>", xml ); }
@Override public Path create(final Path context, final String fileName, final GuidedDecisionTableEditorGraphModel model, final String comment) { try { final org.uberfire.java.nio.file.Path nioPath = Paths.convert(context).resolve(fileName); if (ioService.exists(nioPath)) { throw new FileAlreadyExistsException(nioPath.toString()); } final Set<Path> paths = getLinkedDecisionTablesInPackage(context); paths.forEach((path) -> model.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(path, getLatestVersionPath(path)))); ioService.write(nioPath, GuidedDTGraphXMLPersistence.getInstance().marshal(model), commentedOptionFactory.makeCommentedOption(comment)); final Path newPath = Paths.convert(nioPath); return newPath; } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
private RemoteCallback<GuidedDecisionTableEditorGraphContent> getLoadGraphContentSuccessCallback() { return (content) -> { this.content = content; this.originalGraphHash = content.getModel().hashCode(); this.concurrentUpdateSessionInfo = null; final GuidedDecisionTableEditorGraphModel model = content.getModel(); final Set<GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry> modelEntries = model.getEntries(); initialiseEditorTabsWhenNoDocuments(); if (modelEntries == null || modelEntries.isEmpty()) { view.hideBusyIndicator(); return; } loadGraphLatch = new LoadGraphLatch(modelEntries.size(), getSelectDecisionTableCommand(modelEntries.iterator().next().getPathHead()), () -> { originalGraphHash = buildModelFromEditor().hashCode(); modeller.getView().getGridPanel().setFocus(true); }); modelEntries.stream().forEach(loadGraphLatch::loadDocumentGraphEntry); }; }
@Test public void checkMarshallingModelWithoutEntryPosition() { final Path path = PathFactory.newPath( "path", "default://path" ); final GuidedDecisionTableEditorGraphModel model = new GuidedDecisionTableEditorGraphModel(); model.getEntries().add( new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry( path, path ) ); final String xml = GuidedDTGraphXMLPersistence.getInstance().marshal( model ); assertNotNull( xml ); assertEqualsIgnoreWhitespace( "<graph>\n" + " <entries>\n" + " <entry>\n" + " <pathHead class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\">\n" + " <uri>default://path</uri>\n" + " <fileName>path</fileName>\n" + " <attributes/>\n" + " <hasVersionSupport>false</hasVersionSupport>\n" + " </pathHead>\n" + " <pathVersion class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\" reference=\"../pathHead\"/>\n" + " </entry>\n" + " </entries>\n" + "</graph>", xml ); }
private RemoteCallback<GuidedDecisionTableEditorGraphContent> getLoadGraphContentSuccessCallback() { return (content) -> { this.content = content; this.originalGraphHash = content.getModel().hashCode(); this.concurrentUpdateSessionInfo = null; final GuidedDecisionTableEditorGraphModel model = content.getModel(); final Set<GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry> modelEntries = model.getEntries(); initialiseEditorTabsWhenNoDocuments(); if (modelEntries == null || modelEntries.isEmpty()) { view.hideBusyIndicator(); return; } loadGraphLatch = new LoadGraphLatch(modelEntries.size(), getSelectDecisionTableCommand(modelEntries.iterator().next().getPathHead()), () -> { originalGraphHash = buildModelFromEditor().hashCode(); modeller.getView().getGridPanel().setFocus(true); }); modelEntries.stream().forEach(loadGraphLatch::loadDocumentGraphEntry); }; }