Interface AppManagerService

    • Method Detail

      • activateApp

        void activateApp​(App app)
        Activate an App by App id
        Parameters:
        app - The App
      • deactivateApp

        void deactivateApp​(App app)
        Deactivate an App by App id
        Parameters:
        app - The App
      • deleteApp

        void deleteApp​(java.lang.String id)
        Delete an existing App
        Parameters:
        id - The id of an App
        Throws:
        CouldNotDeleteAppException - if deletion fails
      • uploadApp

        java.lang.String uploadApp​(java.io.InputStream zipData,
                                   java.lang.String zipFileName,
                                   java.lang.String formFieldName)
                            throws java.io.IOException
        Upload an app If zip fails to verify, throw an exception with the missing information
        Parameters:
        zipData - steam with app data in zip from
        zipFileName - the name of the zip file
        formFieldName - the value of the name field in the form
        Returns:
        temporary directory for app
        Throws:
        java.io.IOException
        InvalidAppArchiveException - if the zipData cannot be unzipped
      • checkAndObtainConfig

        AppConfig checkAndObtainConfig​(java.lang.String tempDir,
                                       java.lang.String configContent)
                                throws java.io.IOException
        Check the app-configuration and obtain the AppConfig if the configuration is valid
        Parameters:
        tempDir - temporary directory with uploadede app-content
        Returns:
        appConfig
        Throws:
        java.io.IOException
      • configureApp

        void configureApp​(AppConfig appConfig,
                          java.lang.String htmlTemplate)
        Configure app in database.
        Parameters:
        appConfig - app configuration object
        htmlTemplate - HTML template based on the packaged index.html
      • extractFileContent

        java.lang.String extractFileContent​(java.lang.String appDir,
                                            java.lang.String fileName)
        Get the UTF-8 file-content of a file served by an app
        Parameters:
        appDir - app directory
        fileName - file name
        Returns:
        UTF-8 file-content