Class CustomOrDefaultApplicationInstaller


  • @Component
    @ConditionalOnSingleCandidate(CustomOrDefaultApplicationInstaller.class)
    public class CustomOrDefaultApplicationInstaller
    extends java.lang.Object
    Install custom application if one exists under a specific folder. If none, install default provided applications.
    This installer listens to the event PlatformStartedEvent to ensure the platform is started before launching any application installation.
    • Field Detail

      • CUSTOM_APPLICATION_DEFAULT_FOLDER

        public static final java.lang.String CUSTOM_APPLICATION_DEFAULT_FOLDER
        See Also:
        Constant Field Values
      • applicationInstallFolder

        @Value("${bonita.runtime.custom-application.install-folder:my-application}")
        protected java.lang.String applicationInstallFolder
      • addDefaultPages

        @Value("${bonita.runtime.custom-application.install-provided-pages:false}")
        protected boolean addDefaultPages
      • cpResourceResolver

        protected final org.springframework.core.io.support.ResourcePatternResolver cpResourceResolver
    • Constructor Detail

      • CustomOrDefaultApplicationInstaller

        public CustomOrDefaultApplicationInstaller()
    • Method Detail

      • autoDeployDetectedCustomApplication

        @EventListener
        public void autoDeployDetectedCustomApplication​(PlatformStartedEvent event)
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getResourceFromClasspath

        protected static org.springframework.core.io.Resource getResourceFromClasspath​(org.springframework.core.io.Resource[] resources,
                                                                                       java.lang.String type)
                                                                                throws java.io.IOException,
                                                                                       org.bonitasoft.engine.exception.ApplicationInstallationException
        Throws:
        java.io.IOException
        org.bonitasoft.engine.exception.ApplicationInstallationException
      • installCustomApplication

        protected void installCustomApplication​(org.springframework.core.io.Resource customApplication)
                                         throws java.lang.Exception
        Parameters:
        customApplication - custom application resource
        Throws:
        org.bonitasoft.engine.exception.ApplicationInstallationException - if unable to install the application
        java.lang.Exception
      • getApplicationArchive

        protected ApplicationArchive getApplicationArchive​(java.io.InputStream applicationZipFileStream)
                                                    throws org.bonitasoft.engine.exception.ApplicationInstallationException
        Throws:
        org.bonitasoft.engine.exception.ApplicationInstallationException