private Path getDeployedRoot(final Metadata metadata) { final Path root = metadata.getRoot(); return deployed .values() .stream() .filter(root::equals) .findFirst() .orElse(null); } }
public org.uberfire.java.nio.file.Path resolveGlobalPath(final Metadata metadata) { return resolveGlobalPathByRoot(metadata.getRoot()); }
@SuppressWarnings("all") public void deploy(final Metadata metadata) { final Path root = metadata.getRoot(); final Path deployedPath = getDeployedRoot(metadata); final Path path = null != deployedPath ? deployedPath : root; synchronized (path) { if (null == getDeployedRoot(metadata)) { deployed.put(root.toURI(), root); deployServices.forEach(s -> s.deploy(metadata)); } } }
@Inject public WorkItemDefinitionClientRegistry(final Caller<WorkItemDefinitionLookupService> service, final SessionManager sessionManager, final ManagedInstance<WorkItemDefinitionCacheRegistry> registryInstances, final ErrorPopupPresenter errorPopupPresenter) { this(service, sessionManager, registryInstances::get, exception -> errorPopupPresenter.showMessage(getExceptionMessage(exception)), new WorkItemDefinitionRegistries<>(metadata -> metadata.getRoot().toURI(), new HashMap<>(), registryInstances::destroy)); }
public org.uberfire.java.nio.file.Path resolveResourcesPath(final Metadata metadata) { return ioService.get(metadata.getRoot().toURI()).resolve(PATH_RESOURCES); }
@Override public void loadDiagramType(Metadata metadata) { bpmnDiagramService .call((r) -> setProjectType(metadata, (ProjectType) r)) .getProjectType(metadata.getRoot()); }
@Override protected Metadata obtainMetadata(DefinitionSetService services, final org.uberfire.backend.vfs.Path diagramFilePath, final String defSetId, final String fileName) { Metadata metadata = null; final InputStream metaDataStream = loadMetadataForPath(diagramFilePath); if (null != metaDataStream) { try { metadata = services.getDiagramMarshaller().getMetadataMarshaller().unmarshall(metaDataStream); if (null == metadata.getRoot() || null == metadata.getRoot().toURI()) { metadata.setRoot(getRoot()); } } catch (java.io.IOException e) { LOG.error("Cannot unmarshall metadata for diagram's path [{}]", diagramFilePath, e); } } return metadata; }
@Before public void init() { when(metadata.getRoot()).thenReturn(root); tested = new WorkItemDefinitionProjectInstaller(pomService, metadataService, moduleService); }
@Before public void init() { when(metadata.getRoot()).thenReturn(root); when(remoteLookupService.execute(any(WorkItemDefinitionRemoteRequest.class))) .thenReturn(Collections.singleton(WID)); tested = new WorkItemDefinitionRemoteDeployService(remoteLookupService, backendFileSystemManager, resources, projectInstaller, (WorkItemDefinition wid) -> WID.equals(wid) ? widAsset : null, (WorkItemDefinition wid) -> WID.equals(wid) ? iconAsset : null); }