Package de.grogra.pm

Class PluginEntry

java.lang.Object
de.grogra.pm.PluginEntry

public class PluginEntry extends Object
  • Field Details

    • VER_STOCK

      public static final String VER_STOCK
      See Also:
    • versions

      protected org.json.JSONObject versions
    • id

      protected String id
    • name

      protected String name
    • description

      protected String description
    • helpUrl

      protected String helpUrl
    • vendor

      protected String vendor
    • dependencies

      protected static String[] dependencies
    • libsRepo

      protected String libsRepo
    • excluded

      protected static String[] excluded
    • mainClass

      protected String mainClass
    • installedPath

      protected String installedPath
    • installedVersion

      protected String installedVersion
    • tempName

      protected String tempName
    • destName

      protected String destName
    • candidateVersion

      protected Version candidateVersion
    • enforcedVersion

      protected String enforcedVersion
    • canUninstall

      protected boolean canUninstall
    • isDisabled

      protected boolean isDisabled
  • Constructor Details

    • PluginEntry

      public PluginEntry(String aId)
  • Method Details

    • fromJSON

      public static PluginEntry fromJSON(org.json.JSONObject elm)
    • getDefaultDescriptionKey

      public static String getDefaultDescriptionKey(PluginDescriptor pd)
    • getDefaultDeletionPermissionKey

      public static String getDefaultDeletionPermissionKey(PluginDescriptor pd)
    • fromPluginDescriptor

      public static PluginEntry fromPluginDescriptor(PluginDescriptor pd)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • detectInstalled

      public void detectInstalled()
    • isVersionFrozenToGroIMP

      public boolean isVersionFrozenToGroIMP()
    • hasEnforcedVersion

      public boolean hasEnforcedVersion()
    • getEnforcedVersion

      public String getEnforcedVersion()
    • setEnforcedVersion

      public void setEnforcedVersion(String version)
    • rollbackCandidateVersion

      public void rollbackCandidateVersion(boolean reload)
      Set the value of the candidate version to the highest of the "selected" listeners (jcheckbox). So the highest value of the selected box (between installed, update, and new)
    • resetVersionsCandidate

      public void resetVersionsCandidate(boolean reload)
      The dependency resolving is messing with the candidate & enforced version: It changes the versions depending on what is possible based on the dependecies of the plugin to be changed. This reset is performed at every change from the plugin manager (usually from the dialog). It ensure that the candidate version of the plugin entry matches the one from the dialog
      Parameters:
      skip - Should the reset reload value from the listeners ?
    • getMaxVersion

      public String getMaxVersion()
    • getVersions

      public Set<String> getVersions()
    • getGroIMPVersion

      public static String getGroIMPVersion()
    • getLibInstallPath

      public static String getLibInstallPath(String lib)
    • getLibPath

      public static String getLibPath(String lib, String[] paths)
    • getID

      public String getID()
    • getInstalledPath

      public String getInstalledPath()
    • getDestName

      public String getDestName()
    • getTempName

      public String getTempName()
    • getLibRepo

      public String getLibRepo()
    • isInstalled

      public boolean isInstalled()
    • isDisabled

      public boolean isDisabled()
    • getState

      public int getState()
      The state of the plugin follows the plugin manager action for plugins. INSTALL if the plugin is installed, DISABLE is the plugin is disabled, and UNSINSTALL if the plugin is not installed
      Returns:
    • download

      public void download(de.grogra.pm.repo.RepoManager manager, GenericCallback<String> notify) throws IOException, URISyntaxException
      Throws:
      IOException
      URISyntaxException
    • cachePlugin

      public void cachePlugin() throws IOException, URISyntaxException
      Cache the installed version of the plugin to the cache folder Should not require to manage the libs as they should be included in the repo already
      Throws:
      IOException
      URISyntaxException
    • getDownloadUrl

      public String getDownloadUrl(String version)
      Parameters:
      version -
      Returns:
    • checkZip

      public boolean checkZip(String version) throws IOException
      Test the downloaded zip (jar) by loading the plugin in a temporary Groimp Plugin. The version of hte plugin is tested. This test required a groimp environment (aka a Workbench.current to be executed). The safeDeleter run outside of a groimp environment
      Parameters:
      version -
      Returns:
      Throws:
      IOException
    • getName

      public String getName()
    • getDescription

      public String getDescription()
    • getHelpLink

      public String getHelpLink()
    • getVendor

      public String getVendor()
    • getCandidateVersion

      public String getCandidateVersion()
    • addCandidateVersionListener

      public void addCandidateVersionListener(Version.VersionListener listener)
    • removeCandidateVersionListener

      public void removeCandidateVersionListener(Version.VersionListener listener)
    • canUninstall

      public boolean canUninstall()
    • getInstalledVersion

      public String getInstalledVersion()
    • getMainClass

      public String getMainClass()
    • setCandidateVersion

      public void setCandidateVersion(String candidateVersion)
    • setCandidateVersion

      public void setCandidateVersion(String condition, String candidateVersion)
      Set the candidate version to a new value. If the condition require the version to be equal - then also set the enforced version
    • isUpgradable

      public boolean isUpgradable()
    • isInstalledVersionHigherThan

      public boolean isInstalledVersionHigherThan(String version)
    • isCandidateVersionHigherThan

      public boolean isCandidateVersionHigherThan(String version)
    • isConditionRespected

      public boolean isConditionRespected(String condition, String version, boolean installed)
      Return true if the version (installed?) fulfill the condition
      Parameters:
      condition - a string that is composed of the 3 char =, <, >
      version - a string of a version to test against the plugin version
      installed - True if the version compared is the installed one. False if the version compared is the candidate one.
      Returns:
    • hasVersion

      public boolean hasVersion(String condition, String version)
      Return true if the plugin can provide a version that fulfill the condition. If the plugin has an enforced version (aka. version that Need to be used from dependency) it checks if that enforced version is the tested one. If the condition look for a higher than version, test if the maxversion could fulfill the version;
      Parameters:
      condition -
      version -
      Returns:
    • getDepends

      public Map<String,String> getDepends() throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getExcluded

      public Set<String> getExcluded()
    • getLibs

      public Map<String,String> getLibs(String verStr)
    • getRequiredLibs

      public Map<String,String> getRequiredLibs(String verStr)
    • getVersionChanges

      public String getVersionChanges(String versionStr)
    • getSearchIndexString

      public String getSearchIndexString()