Class BasicPluginBean<E extends IPluginEntity<?,​?,​?>>

    • Constructor Detail

      • BasicPluginBean

        public BasicPluginBean​(IGenericDao<E> dao)
    • Method Detail

      • expandPluginDesc

        public void expandPluginDesc()
      • activate

        public void activate​(PluginWrapperModel<E> plugin)
        When the user click on the button to activate a plugin.
        Parameters:
        plugin - Plugin to activate.
      • addNew

        public void addNew()
      • checkForAvailableUpdates

        public Void checkForAvailableUpdates()
        This method is called when the plugin management page is loaded initially. It fetches the plugin meta data from PROMA and updates the UI when done.
        Returns:
        A stage that completes once the update check has completed.
      • checkMarkedPluginUpdates

        public void checkMarkedPluginUpdates()
        x Handler for when the user click on the button in the UI. It checks if the marked plugins needs a update.
      • checkPluginUpdate

        public void checkPluginUpdate()
        This method checks if the currently selected plugin needs an update. When multiple plugin candidates were found in PROMA, shows the dialog for selecting a plugin.
      • checkPluginUpdate

        public void checkPluginUpdate​(PluginWrapperModel<E> plugin)
        This method checks if the passed plugin needs an update. When multiple plugin candidates were found in PROMA, shows the dialog for selecting a plugin.
        Parameters:
        plugin - the plugin for update check
      • deactivate

        public void deactivate()
      • openPluginDeactivateDialog

        public void openPluginDeactivateDialog​(PluginWrapperModel<E> plugin,
                                               boolean isDeactivateWithSave)
      • openPluginDeleteDialog

        public void openPluginDeleteDialog​(PluginWrapperModel<E> plugin)
      • openPluginMarkedDeleteDialog

        public void openPluginMarkedDeleteDialog()
      • delete

        public void delete​(PluginWrapperModel<E> plugin)
        When the user clicks on the button to delete a plugin.
        Parameters:
        plugin - Plugin to delete.
      • deleteMarked

        public void deleteMarked()
      • createStoreItemMetaResources

        protected List<de.xima.proma.restclient.pub.gen.model.PublicStoreItemMetaResource> createStoreItemMetaResources​(List<PluginWrapperModel<E>> pluginList)
      • getAllPluginsByKey

        public List<PluginWrapperModel<E>> getAllPluginsByKey​(String key)
        This method returns a list of plugins which all have either the same plugin key in the database or in the manifest.
        Parameters:
        key - the plugin key which should be compared
        Returns:
        a list of all plugins with the same plugin key
      • getMarkedPlugins

        public org.primefaces.model.StreamedContent getMarkedPlugins()
      • isPluginDescExpanded

        public boolean isPluginDescExpanded()
      • setPluginDescExpanded

        public void setPluginDescExpanded​(boolean pluginDescExpanded)
      • getSinglePlugin

        public org.primefaces.model.StreamedContent getSinglePlugin​(PluginWrapperModel<E> plugin)
      • getUpdateStatus

        public EPluginUpdateAvailability getUpdateStatus​(PluginWrapperModel<E> plugin)
        This method returns the current update status of a plugin from the pluginUpdateStatusMap.
        Parameters:
        plugin - the plugin which should be checked
        Returns:
        the update status of the plugin
      • isContainsEntityPlugins

        public boolean isContainsEntityPlugins()
      • isMarkedContainsEntityPlugins

        public boolean isMarkedContainsEntityPlugins()
        Returns:
        true if the marked plugins containing an entity-based one
      • isPromaDataLoading

        public boolean isPromaDataLoading()
        Returns:
        Whether data is currently being fetched from PROMA. Used to show a loading icon initially when the page is loaded.
      • onPluginSelected

        public void onPluginSelected()
        When the user select a plugin in the list of plugins to the left.
      • savePlugin

        public void savePlugin()
      • save

        public void save()
        When the user click on the save button, persists the currently selected plugin and activates it.
      • setInternalMessageBean

        public void setInternalMessageBean​(InternalMessageBean internalMessageBean)
      • setPluginKeyFromChecksum

        public void setPluginKeyFromChecksum​(de.xima.proma.restclient.pub.gen.model.PublicStoreItemResource pluginsWithSameChecksum)
        For the dialog where the user can choose a plugin when the plugin does not have a PROMA ID yet and multiple plugins with the same checksum were found. This method assign an ID to the plugin selected by the user and closes the assignment dialog.
        Parameters:
        pluginsWithSameChecksum - The resource of the PROMA plugin store with the same check sum.
      • setPluginStoreListChecksum

        public void setPluginStoreListChecksum​(SameChecksumPlugins<E> pluginStoreListChecksum)
      • setPropertiesAfterActivation

        public void setPropertiesAfterActivation​(PluginWrapperModel<E> plugin)
      • setSelectedFromMarked

        public void setSelectedFromMarked()
      • setSelectedPluginMetadata

        public void setSelectedPluginMetadata​(PluginUpdateMetadata selectedPluginMetadata)
      • setSelectionBean

        public void setSelectionBean​(SelectionBean selectionBean)
      • updateAssignedPlugin

        public PluginWrapperModel<E> updateAssignedPlugin​(PluginWrapperModel<E> plugin,
                                                          String pluginKey,
                                                          String repository)
        This method sets the plugin key for assigning the plugin to a plugin in proma and saving it in the database.
        Parameters:
        plugin - the plugin which should be assignied
        pluginKey - the plugin key for assigning
        Returns:
        the saved and updated plugin which is assignied to a plugin in proma
      • updateData

        public abstract void updateData()
      • createPluginDependencies

        public abstract List<PluginDependencies> createPluginDependencies​(PluginRuntime runtime)
        This method creates a list of plugin dependencies. Dependencies are workflow actions and trigger, client dashboards and authenticators.
        Parameters:
        runtime - the plugin runtime to get all dependencies
        Returns:
        list of plugin dependencies
      • updateMarkedPlugins

        public void updateMarkedPlugins()
        When the user clicks on the button to update all plugins currently selected by the user on the UI.
      • updatePlugin

        public void updatePlugin​(PluginWrapperModel<E> plugin,
                                 boolean updateSelectedPlugin)
        Updates a plugin with the updated plugin version from proma. If it is a plugin that consists of several files, the file key, which comes either from the database or manifest, is used to determine which plugin jar is updated with which file from proma. If no file key is available, identical plugin jar names are searched. Remaining files from Proma will be installed additionally.
        Parameters:
        plugin - the plugin which should be updated
        updateSelectedPlugin - Whether the selected plugin should be updated.
      • updateSelectedPlugin

        public void updateSelectedPlugin()
      • upload

        public void upload​(org.primefaces.event.FileUploadEvent evt)
        When the user uploads a plugin. Reads the plugin file and shows the contents of the plugin. The plugin is not saved in the database.
        Parameters:
        evt - File upload event with the plugin JAR.
      • uploadAndPersist

        public void uploadAndPersist​(org.primefaces.event.FileUploadEvent evt)
        When the user uploads a plugin. Reads the plugin file and shows the contents of the plugin. When the plugin was newly added , also saves the plugin.
        Parameters:
        evt - File event with the uploaded plugin JAR.
      • uploadUpdatedPlugin

        public void uploadUpdatedPlugin​(org.primefaces.event.FileUploadEvent evt)
        When the user uploads a plugin for updating manually. Reads the plugin file and shows the contents of the plugin. The plugin is not saved in the database. This method is for the manually update. For this there is no check for already existing plugins based on the plugin key.
        Parameters:
        evt - File upload event with the plugin JAR.
      • overwriteSelectedPlugin

        public void overwriteSelectedPlugin()
      • deleteInternPluginMessages

        protected abstract void deleteInternPluginMessages​(IEntityContext ec,
                                                           PluginWrapperModel<E> plugin)
        This method deletes the internal update message of a plugin.
        Parameters:
        plugin - the plugin for deleting internal message
      • deletePlugin

        protected abstract boolean deletePlugin​(PluginWrapperModel<E> plugin)
        Parameters:
        plugin - Plugin to be deleted.
        Returns:
        true iff the plugin was deleted.
      • getAllPluginRuntimes

        protected abstract Set<PluginRuntime> getAllPluginRuntimes()
      • getStreamedContent

        protected org.primefaces.model.StreamedContent getStreamedContent​(List<PluginWrapperModel<E>> plugins,
                                                                          String zipFileName)
      • isPluginStoreConnected

        protected <R> StageChain<Boolean,​R> isPluginStoreConnected​(IPublicPromaInvocationContext pc)
        This method returns informations about the connecting to the plugin store. This may be a problem with the websocket or with the connection to proma or the plugin store.
        Returns:
        true if there is a active websocket connection and a connection to the plugin store. It returns false if no connection can be established via websocket or there are problems connecting to the plugin store.
      • selectDefault

        protected void selectDefault()
      • sortAllByPluginName

        protected void sortAllByPluginName()
        Sorts the plugin list by the plugin name from proma.
      • doesPluginKeyExist

        protected boolean doesPluginKeyExist​(String currentPluginKey,
                                             String currentPluginFileKey)
      • isDeactivateWithSave

        public boolean isDeactivateWithSave()
      • setDeactivateWithSave

        public void setDeactivateWithSave​(boolean isDeactivateWithSave)
      • setPluginToDeactivate

        public void setPluginToDeactivate​(PluginWrapperModel<E> pluginToDeactivate)
      • setSelectedOverwriteData

        public void setSelectedOverwriteData​(PluginOverwriteData selectedOverwriteData)