java.lang.Object
de.grogra.pf.registry.Plugin
de.grogra.pm.PluginManager
- All Implemented Interfaces:
RegistryContext,Disposable,ResourceConverter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<PluginEntry, Integer> static final Stringstatic final Stringstatic final Stringstatic final intstatic final I18NBundlestatic final intstatic final Stringstatic final intFields inherited from interface de.grogra.util.ResourceConverter
CAT, LINK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMissingVersions(PluginEntry pluginFromJSON) static voidapplyChanges(Item item, Object info, Context ctx) voidapplyChanges(GenericCallback<String> statusChanged, boolean doRestart, LinkedList<String> additionalGroIMPoptions) booleancanHandleConversion(String name) voidchangeCallBack(GenericCallback<Object> newCallBack) voidstatic voidclearCache(Item item, Object info, Context ctx) voidcontainsPlugin(String id) convert(String name, String argument, I18NBundle bundle) static PanelcreatePluginPanel(Context ctx, Map params) static voiddescribeAllPlugins(Item item, Object info, Context ctx) static voiddescribePlugin(Item item, Object info, Context ctx) static voiddisableCMD(Item item, Object info, Context ctx) voiddispose()static voidexportPluginList(Item item, Object info, Context ctx) voidexportPluginList(File output, GenericCallback<Object> statusChange) static Stringstatic StringgetChangesAsText(boolean reload) getChangesAsText(DependencyResolver resolver) static Set<PluginEntry> getInstalledPlugins(Map<PluginEntry, Integer> allPlugins) static PluginManagergetPluginByID(String key) getPluginByName(String key) getPluginFromRemoteRepo(org.json.JSONArray json) Get the plugin entries from a json arraygetPluginFromRepo(org.json.JSONArray json) static Stringde.grogra.pm.repo.RepoManagerstatic Stringbooleanbooleanstatic voidimportPlugin(Item item, Object info, Context ctx) Import one plugin from a glz filevoidimportPluginFromFile(File src, GenericCallback<Object> statusChanged) static voidimportPluginList(Item item, Object info, Context ctx) voidimportPluginList(GenericCallback<Object> statusChanged, Context ctx) voidimportPluginList(File input, GenericCallback<Object> statusChanged) This set the plugin entries to match the set of plugin from the file input.voidstatic voidinstallCMD(Item item, Object info, Context ctx) a static command to run from cmd: java -jar core.jar --headless -- -cmd /pluginmanager/commands/installCMD=de.grogra.gltf;de.grogra.clivoidload()voidloadPluginFromLocalRepo(File path) voidloadPluginFromRemoteRepo(org.json.JSONArray json) voidloadPluginFromRepo(org.json.JSONArray json) Load the plugins from the json array to the set of allPluginsvoidstatic voidreloadHTTPClient(Item item, Object info, Context ctx) voidstatic voidreloadRepositories(Item item, Object info, Context ctx) scanPluginsDirectory(Node dir) static voidselectVersion(Item item, Object info, Context ctx) static voidsetAllUpgrade(Item item, Object info, Context ctx) voidsetTimeout(int timeout) voidstartModifications(Set<PluginEntry> delPlugins, Set<PluginEntry> installPlugins, Set<PluginEntry> disablePlugins, Set<PluginEntry> ablePlugins, boolean doRestart, LinkedList<String> additionalGroIMPptions) voidstartup()This method is invoked when the plugin is activated, i.e., when the first class defined by the plugin is loaded (except for the Plugin class itself).voidtoggleInstalled(PluginEntry plugin, int peState) Change the state of a plugin.voidtogglePlugins(Set<PluginEntry> pluginsToInstall, int isInstall) static voidtoggleStringList(String list, int isInstall) takes a string of packages ids sepetrated by semicolon and changes their plugin status to the value of isInstall.static voiduninstallCMD(Item item, Object info, Context ctx) Methods inherited from class de.grogra.pf.registry.Plugin
checkConfigure, getI18NBundle, getPluginDescriptor, getRegistry, initialize, shutdown
-
Field Details
-
I18N
-
allPlugins
-
UNINSTALL
public static final int UNINSTALL- See Also:
-
INSTALL
public static final int INSTALL- See Also:
-
DISABLE
public static final int DISABLE- See Also:
-
REPO_PLUGIN_LIST
- See Also:
-
CACHE_REPO
- See Also:
-
CACHE_SOURCE_PATH
- See Also:
-
CACHE_PLUGIN_PATH
- See Also:
-
-
Constructor Details
-
PluginManager
public PluginManager()
-
-
Method Details
-
getInstance
-
startup
public void startup()Description copied from class:PluginThis method is invoked when the plugin is activated, i.e., when the first class defined by the plugin is loaded (except for the Plugin class itself). The default implementation executes all executable items in the directory/hooks/startup/name, wherenameis the name of the plugin.The method
Plugin.initialize()has been invoked before. Only if this invocation has returnedtrue, the plugin may be activated. -
canHandleConversion
- Specified by:
canHandleConversionin interfaceResourceConverter
-
convert
- Specified by:
convertin interfaceResourceConverter
-
initSources
public void initSources() -
hasPlugins
public boolean hasPlugins() -
load
- Throws:
Throwable
-
addMissingVersions
-
containsPlugin
-
startModifications
public void startModifications(Set<PluginEntry> delPlugins, Set<PluginEntry> installPlugins, Set<PluginEntry> disablePlugins, Set<PluginEntry> ablePlugins, boolean doRestart, LinkedList<String> additionalGroIMPptions) throws IOException - Throws:
IOException
-
applyChanges
public void applyChanges(GenericCallback<String> statusChanged, boolean doRestart, LinkedList<String> additionalGroIMPoptions) -
getChangesAsText
-
getChangesAsText
-
getChangesAsText
-
loadPluginFromLocalRepo
-
loadPluginFromRemoteRepo
public void loadPluginFromRemoteRepo(org.json.JSONArray json) -
loadPluginFromRepo
public void loadPluginFromRepo(org.json.JSONArray json) Load the plugins from the json array to the set of allPlugins- Parameters:
json-
-
getPluginFromRemoteRepo
Get the plugin entries from a json array- Parameters:
json-
-
getPluginFromRepo
-
getAlreadyInstalledPlugins
-
scanPluginsDirectory
-
getInstalledPlugins
-
getInstalledPlugins
-
getAvailablePlugins
-
getUpgradablePlugins
-
togglePlugins
-
toggleInstalled
Change the state of a plugin. States are checked when the modifications are resolved. The states are INSTALL, UNINSTALL, DISABLE.- Parameters:
plugin-peState-
-
hasAnyUpdates
public boolean hasAnyUpdates() -
getPluginByID
-
getPluginByName
-
setTimeout
public void setTimeout(int timeout) -
getPluginStatus
- Parameters:
id- ID of the plugin to check- Returns:
- Version name for the plugin if it is installed, null otherwise
-
getAllPluginsStatus
- Returns:
- Status for all plugins
-
getAllPlugins
-
getAvailablePluginsAsString
- Returns:
- Available plugins
-
getUpgradablePluginsAsString
- Returns:
- Upgradable plugins
-
logPluginComponents
public void logPluginComponents() -
changeCallBack
-
dispose
public void dispose()- Specified by:
disposein interfaceDisposable
-
clearCache
- Throws:
IOException
-
reloadRepo
- Throws:
Throwable
-
clearRepo
- Throws:
Throwable
-
getMainRepo
-
exportPluginList
-
exportPluginList
-
importPlugin
Import one plugin from a glz file -
importPluginFromFile
-
importPluginList
This set the plugin entries to match the set of plugin from the file input. I.e. it deactivate plugins that are not in the list, and- Parameters:
input-
-
importPluginList
-
importPluginList
-
clearCache
-
reloadRepositories
-
getRepoManager
public de.grogra.pm.repo.RepoManager getRepoManager() -
createPluginPanel
-
describeAllPlugins
-
uninstallCMD
- Throws:
Throwable
-
disableCMD
- Throws:
Throwable
-
installCMD
a static command to run from cmd: java -jar core.jar --headless -- -cmd /pluginmanager/commands/installCMD=de.grogra.gltf;de.grogra.cli- Parameters:
item-info-ctx-- Throws:
Throwable
-
toggleStringList
takes a string of packages ids sepetrated by semicolon and changes their plugin status to the value of isInstall.- Parameters:
list-isInstall-- Throws:
Throwable
-
describePlugin
-
selectVersion
-
applyChanges
-
setAllUpgrade
-
reloadHTTPClient
-