Class PromaStoreItems


  • public class PromaStoreItems
    extends Object
    Additional functions for reading and writing store items. These are more high-level functions that do not interact with the REST API directly, but usually combine several methods offered by the IStoreItemPromaApi.
    Since:
    8.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • checkForUpdates

        public static <R> StageChain<de.xima.proma.restclient.pub.gen.model.PublicStoreItemUpdateCheckResult,​R> checkForUpdates​(IPublicPromaInvocationContext pc,
                                                                                                                                      String storeKey,
                                                                                                                                      String itemKey,
                                                                                                                                      String itemVersion,
                                                                                                                                      String productVersion,
                                                                                                                                      Locale locale,
                                                                                                                                      String licenseKey,
                                                                                                                                      boolean loadHistory,
                                                                                                                                      boolean loadVersion)
        Checks for update for a given PROMA store item.
        Type Parameters:
        R - Type of the eventual expected return value for the newly created stage chain.
        Parameters:
        pc - Context for accessing the PROMA APIs.
        storeKey - The key of the PROMA store.
        itemKey - The key of the store item to check for updates.
        itemVersion - The current version of the store item that is being used or is currently installed.
        productVersion - Product version to check for compatible store items.
        locale - The locale for localized plugin informations
        licenseKey - the license key of the current license. This could be either the system license or a client
        loadHistory - if the change history should be included in the response
        loadVersion - if all versions should be included in the response
        Returns:
        The result of the update check, or null when no item key was given.
      • findLatestCompatibleVersion

        public static <R> StageChain<String,​R> findLatestCompatibleVersion​(IPublicPromaInvocationContext pc,
                                                                                 String storeKey,
                                                                                 String itemKey,
                                                                                 String itemVersion,
                                                                                 String productVersion,
                                                                                 String licenseKey,
                                                                                 boolean loadHistory,
                                                                                 boolean loadVersion)
        Retrieves the latest compatible version for the given store item.
        Type Parameters:
        R - Type of the eventual expected return value for the newly created stage chain.
        Parameters:
        pc - Context for accessing the PROMA APIs.
        storeKey - The key of the PROMA store.
        itemKey - The key of the store item to check for updates.
        itemVersion - The current version of the store item that is being used or is currently installed.
        productVersion - Product version to check for compatible store items.
        licenseKey - the license key of the current license. This could be either the system license or a client
        loadHistory - if the change history should be included in the response
        loadVersion - if all versions should be included in the response
        Returns:
        The latest version, or null when the store item was not found or not versions exist.
      • getChangelog

        public static <R> StageChain<Map<String,​String>,​R> getChangelog​(IPublicPromaInvocationContext pc,
                                                                                    String storeKey,
                                                                                    String itemKey,
                                                                                    Locale locale,
                                                                                    String licenseKey)
        Gets a map with the changelogs of the given store item.
        Type Parameters:
        R - Type of the eventual expected return value for the newly created stage chain.
        Parameters:
        pc - Context for accessing the PROMA APIs.
        storeKey - The key of the PROMA store.
        itemKey - The key of the store item for which to retrieve the changelog.
        locale - The locale for localized plugin informations
        licenseKey - key of the current product license
        Returns:
        A map from the version to the changelog of that version.
      • getStoreItemCompatibleWithProduct

        public static <R> StageChain<de.xima.proma.restclient.pub.gen.model.PublicStoreItemResource,​R> getStoreItemCompatibleWithProduct​(IPublicPromaInvocationContext pc,
                                                                                                                                               String storeKey,
                                                                                                                                               String itemKey,
                                                                                                                                               String productVersion,
                                                                                                                                               Locale locale,
                                                                                                                                               String licenseKey)
        This method gives the PROMA store item from the plugin store of the given plugin item key.
        Type Parameters:
        R - Type of the eventual expected return value for the newly created stage chain.
        Parameters:
        pc - Context to use for accessing the PROMA API.
        storeKey - the key of the PROMA store
        itemKey - the item key of the plugin in PROMA
        productVersion - Optional product version for which to check for compatible store items.
        locale - the locale for localized plugin informations
        licenseKey - key of the current product license
        Returns:
        PublicStoreItemResource which represents the API response of rest method
      • getStoreItemFileByName

        public static <R> StageChain<TempFile,​R> getStoreItemFileByName​(IPublicPromaInvocationContext pc,
                                                                              String licenseKey,
                                                                              String storeKey,
                                                                              String itemKey,
                                                                              String itemVersion,
                                                                              Predicate<String> fileNameFilter)
        For a given store item version from a store, finds a store item file by name, using a custom user-supplied predicate for the file name.

        The returned stages completes exceptionally when more than one store item file matches.

        Type Parameters:
        R - Type of the eventual expected return value for the newly created stage chain.
        Parameters:
        pc - Context for accessing the PROMA APIs.
        licenseKey - the license key of the current license. This could be either the system license or a client
        storeKey - the key of the PROMA store
        itemKey - key of the item for fetching
        itemVersion - the version of the item for the store item files
        fileNameFilter - Custom filter that is passed the name of each store item file.
        Returns:
        The matching store item file or null if no file matches.
      • getStoreItemJarFilesByFileKey

        public static <R> StageChain<Closable<Map<String,​PluginJarWithManifest>>,​R> getStoreItemJarFilesByFileKey​(IPublicPromaInvocationContext pc,
                                                                                                                              String licenseKey,
                                                                                                                              String storeKey,
                                                                                                                              String itemKey,
                                                                                                                              String itemVersion)
        Downloads all files for a given plugin key, and returns a map between each plugin file key and the corresponding file. When a plugin has no file key, the empty string is used.
        Type Parameters:
        R - Type of the eventual expected return value for the newly created stage chain.
        Parameters:
        pc - Context for accessing the PROMA APIs.
        licenseKey - the license key of the current license. This could be either the system license or a client
        storeKey - The key of the PROMA store
        itemKey - The key of the plugin item.
        itemVersion - The version of the plugin item.
        Returns:
        A map between the file key of each plugin JAR and the JAR file with the Manifest. When the returned closable is closed, all extracted files are deleted.
      • getStoreItemName

        public static <R> StageChain<String,​R> getStoreItemName​(IPublicPromaInvocationContext pc,
                                                                      String storeKey,
                                                                      String pluginKey,
                                                                      String productVersion,
                                                                      Locale locale,
                                                                      String licenseKey)
        This method returns the localized store item name from PROMA. The name of the most recent store item version is used.
        Parameters:
        pc - Context to use for accessing the PROMA API.
        storeKey - The key of the PROMA store
        pluginKey - The key of the store item.
        productVersion - Optional product version for which to check for compatible store items.
        locale - The locale for localizing the name.
        licenseKey - the license key of the current license. This could be either the system license or a client
        Returns:
        The name of PROMA store item, empty string if none could be found.
      • getStoreItemsWithFileMatchingChecksum

        public static <R> StageChain<de.xima.proma.restclient.pub.gen.model.PublicStoreItemList,​R> getStoreItemsWithFileMatchingChecksum​(IPublicPromaInvocationContext pc,
                                                                                                                                               String storeKey,
                                                                                                                                               IFileEntity<?,​?> entity,
                                                                                                                                               Locale locale,
                                                                                                                                               String licenseKey)
        Gets all plugin store items that contain files with same checksum as the file from the given file entity.
        Type Parameters:
        R - Type of the eventual expected return value for the newly created stage chain.
        Parameters:
        pc - Context for accessing the PROMA APIs.
        storeKey - the key of the PROMA store
        entity - File entity with the store item file to check.
        locale - The locale for localized plugin informations
        licenseKey - the license key of the current license. This could be either the system license or a client
        Returns:
        representation of a list of plugin store items with the same check sum
      • getStoreItemsWithFileMatchingChecksum

        public static <R> StageChain<de.xima.proma.restclient.pub.gen.model.PublicStoreItemList,​R> getStoreItemsWithFileMatchingChecksum​(IPublicPromaInvocationContext pc,
                                                                                                                                               String storeKey,
                                                                                                                                               Path file,
                                                                                                                                               Locale locale,
                                                                                                                                               String licenseKey)
        Gets all plugin store items that contain files with same checksum as the given file.
        Type Parameters:
        R - Type of the eventual expected return value for the newly created stage chain.
        Parameters:
        pc - Context for accessing the PROMA APIs.
        storeKey - the key of the PROMA store
        file - The store item file to check.
        locale - The locale for localized plugin informations
        licenseKey - the license key of the current license. This could be either the system license or a client
        Returns:
        representation of a list of plugin store items with the same check sum