Class ExamplesServiceImpl

  • All Implemented Interfaces:
    org.kie.workbench.common.screens.examples.service.ExamplesService, org.kie.workbench.common.screens.examples.service.ImportService, org.uberfire.commons.lifecycle.Disposable, org.uberfire.commons.lifecycle.PriorityDisposable

    @ApplicationScoped
    public class ExamplesServiceImpl
    extends BaseProjectImportService
    implements org.kie.workbench.common.screens.examples.service.ExamplesService
    • Field Detail

      • playgroundSpaceName

        protected String playgroundSpaceName
      • playgroundRootDirectory

        protected File playgroundRootDirectory
    • Constructor Detail

      • ExamplesServiceImpl

        @Inject
        public ExamplesServiceImpl​(@Named("ioStrategy")
                                   org.uberfire.io.IOService ioService,
                                   org.guvnor.structure.server.repositories.RepositoryFactory repositoryFactory,
                                   org.kie.workbench.common.services.shared.project.KieModuleService moduleService,
                                   org.guvnor.structure.organizationalunit.OrganizationalUnitService ouService,
                                   org.guvnor.common.services.project.service.WorkspaceProjectService projectService,
                                   org.guvnor.common.services.shared.metadata.MetadataService metadataService,
                                   javax.enterprise.event.Event<org.guvnor.common.services.project.events.NewProjectEvent> newProjectEvent,
                                   org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService projectScreenService,
                                   org.kie.workbench.common.screens.examples.validation.ImportProjectValidators validators,
                                   org.guvnor.structure.organizationalunit.config.SpaceConfigStorageRegistry spaceConfigStorageRegistry,
                                   @Named("systemFS")
                                   org.uberfire.java.nio.file.FileSystem systemFS,
                                   org.guvnor.common.services.project.backend.server.utils.PathUtil pathUtil,
                                   org.guvnor.structure.repositories.RepositoryService repoService)
    • Method Detail

      • initPlaygroundRepository

        @PostConstruct
        public void initPlaygroundRepository()
      • deleteOldHiddenSpaces

        protected void deleteOldHiddenSpaces​(String md5)
      • isOldPlayground

        protected boolean isOldPlayground​(org.guvnor.structure.organizationalunit.OrganizationalUnit ou)
      • createPlaygroundHiddenSpace

        protected void createPlaygroundHiddenSpace​(String md5)
      • deleteOldPlaygrounds

        protected void deleteOldPlaygrounds​(String md5)
      • calculateMD5

        protected String calculateMD5​(URL resource)
      • resolveRepositoryUrl

        protected String resolveRepositoryUrl​(String playgroundDirectoryPath)
      • getMetaData

        public org.kie.workbench.common.screens.examples.model.ExamplesMetaData getMetaData()
        Specified by:
        getMetaData in interface org.kie.workbench.common.screens.examples.service.ExamplesService
      • getPlaygroundRepository

        public org.kie.workbench.common.screens.examples.model.ExampleRepository getPlaygroundRepository()
        Specified by:
        getPlaygroundRepository in interface org.kie.workbench.common.screens.examples.service.ExamplesService
      • resolveGitRepository

        protected org.guvnor.structure.repositories.Repository resolveGitRepository​(org.kie.workbench.common.screens.examples.model.ExampleRepository exampleRepository)
        Specified by:
        resolveGitRepository in class BaseProjectImportService
      • setupExamples

        public org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent setupExamples​(org.kie.workbench.common.screens.examples.model.ExampleOrganizationalUnit exampleTargetOU,
                                                                                                           List<org.kie.workbench.common.screens.examples.model.ImportProject> importProjects)
        Specified by:
        setupExamples in interface org.kie.workbench.common.screens.examples.service.ExamplesService
      • getExampleProjects

        public Set<org.kie.workbench.common.screens.examples.model.ImportProject> getExampleProjects​(org.guvnor.structure.organizationalunit.OrganizationalUnit targetOu)
        Specified by:
        getExampleProjects in interface org.kie.workbench.common.screens.examples.service.ExamplesService
      • getOrganizationalUnit

        protected org.guvnor.structure.organizationalunit.OrganizationalUnit getOrganizationalUnit​(String targetOUName)
      • createOrganizationalUnit

        protected org.guvnor.structure.organizationalunit.OrganizationalUnit createOrganizationalUnit​(String name)
      • priority

        public int priority()
        Specified by:
        priority in interface org.uberfire.commons.lifecycle.PriorityDisposable
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.uberfire.commons.lifecycle.Disposable
      • existSpace

        protected boolean existSpace​(String space)
      • existSpace

        protected boolean existSpace​(String space,
                                     Path path)
      • getNiogitPath

        protected Path getNiogitPath()