Search in sources :

Example 1 with Path

use of org.uberfire.backend.vfs.Path in project kie-wb-common by kiegroup.

the class CalledElementFormProvider method getBusinessProcessIDs.

public Map<Object, String> getBusinessProcessIDs() {
    final Set<ValueIndexTerm> queryTerms = new HashSet<ValueIndexTerm>() {

        {
            add(new ValueResourceIndexTerm("*", ResourceType.BPMN2, ValueIndexTerm.TermSearchType.WILDCARD));
        }
    };
    List<RefactoringPageRow> results = queryService.query(FindBpmnProcessIdsQuery.NAME, queryTerms);
    Map<Object, String> businessProcessIDs = new TreeMap<Object, String>();
    for (RefactoringPageRow row : results) {
        Map<String, Path> mapRow = (Map<String, Path>) row.getValue();
        for (String rKey : mapRow.keySet()) {
            businessProcessIDs.put(rKey, rKey);
        }
    }
    return businessProcessIDs;
}
Also used : Path(org.uberfire.backend.vfs.Path) ValueResourceIndexTerm(org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueResourceIndexTerm) ValueIndexTerm(org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueIndexTerm) TreeMap(java.util.TreeMap) RefactoringPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow) TreeMap(java.util.TreeMap) Map(java.util.Map) HashSet(java.util.HashSet)

Example 2 with Path

use of org.uberfire.backend.vfs.Path in project kie-wb-common by kiegroup.

the class WorkItemDefinitionMetadataRegistry method load.

public void load(final Metadata metadata, final Command callback) {
    final Path rootPath = rootPathMetadataSupplier.apply(metadata);
    workItemsByPathSupplier.accept(rootPath, workItemDefinitions -> {
        workItemDefinitions.forEach(getMemoryRegistry()::register);
        callback.execute();
    });
}
Also used : Path(org.uberfire.backend.vfs.Path)

Example 3 with Path

use of org.uberfire.backend.vfs.Path in project kie-wb-common by kiegroup.

the class WorkItemDefinitionMetadataRegistryTest method testLoad.

@Test
@SuppressWarnings("unchecked")
public void testLoad() {
    Path path = mock(Path.class);
    Metadata metadata = mock(Metadata.class);
    Command callback = mock(Command.class);
    when(metadata.getRoot()).thenReturn(path);
    tested.load(metadata, callback);
    verify(workItemsByPathSupplier, times(1)).accept(eq(path), any(Consumer.class));
}
Also used : Path(org.uberfire.backend.vfs.Path) Consumer(java.util.function.Consumer) BiConsumer(java.util.function.BiConsumer) Command(org.uberfire.mvp.Command) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 4 with Path

use of org.uberfire.backend.vfs.Path in project kie-wb-common by kiegroup.

the class PackageNameWhiteListServiceImplTest method testSave.

@Test
public void testSave() throws Exception {
    final PackageNameWhiteListService service = makeService("");
    final Path path = mock(Path.class);
    final WhiteList whiteList = new WhiteList();
    final Metadata metadata = new Metadata();
    final String comment = "comment";
    service.save(path, whiteList, metadata, comment);
    verify(saver).save(path, whiteList, metadata, comment);
}
Also used : Path(org.uberfire.backend.vfs.Path) PackageNameWhiteListService(org.kie.workbench.common.services.shared.whitelist.PackageNameWhiteListService) WhiteList(org.kie.workbench.common.services.shared.whitelist.WhiteList) Metadata(org.guvnor.common.services.shared.metadata.model.Metadata) Test(org.junit.Test)

Example 5 with Path

use of org.uberfire.backend.vfs.Path in project drools-wb by kiegroup.

the class GuidedDecisionTableGraphEditorServiceImpl method findDecisionTables.

private List<Path> findDecisionTables(final org.uberfire.java.nio.file.Path nioRootPath) {
    final List<Path> paths = new ArrayList<>();
    final DirectoryStream<org.uberfire.java.nio.file.Path> directoryStream = ioService.newDirectoryStream(nioRootPath);
    for (org.uberfire.java.nio.file.Path nioPath : directoryStream) {
        final Path path = Paths.convert(nioPath);
        if (!dotFileFilter.accept(nioPath) && resourceType.accept(path)) {
            paths.add(path);
        }
    }
    return paths;
}
Also used : Path(org.uberfire.backend.vfs.Path) ArrayList(java.util.ArrayList)

Aggregations

Path (org.uberfire.backend.vfs.Path)607 Test (org.junit.Test)408 URL (java.net.URL)93 Package (org.guvnor.common.services.project.model.Package)87 KieModuleService (org.kie.workbench.common.services.shared.project.KieModuleService)71 CreationalContext (javax.enterprise.context.spi.CreationalContext)66 Bean (javax.enterprise.inject.spi.Bean)66 ArrayList (java.util.ArrayList)63 Metadata (org.guvnor.common.services.shared.metadata.model.Metadata)51 Module (org.guvnor.common.services.project.model.Module)48 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)41 KieModule (org.kie.workbench.common.services.shared.project.KieModule)38 List (java.util.List)37 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)30 Branch (org.guvnor.structure.repositories.Branch)29 HashMap (java.util.HashMap)28 FileAlreadyExistsException (org.uberfire.java.nio.file.FileAlreadyExistsException)28 ObservablePath (org.uberfire.backend.vfs.ObservablePath)27 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)25 Before (org.junit.Before)25