Package de.xima.fc.plugin
Class PluginHelper
- java.lang.Object
-
- de.xima.fc.plugin.PluginHelper
-
public class PluginHelper extends Object
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description PluginHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T extends IFCPlugin>
booleancanPluginBeRegistered(PluginRuntime prtm, Class<T> pluginClass)static EPluginCompatibilitycheckPluginVersion(PluginManifest manifest)static EPluginCompatibilitycheckPluginVersion(String requiredFCVersionStr)static org.reflections.ReflectionscreateReflections(File file)Creates reflections for the given file if it is an jarstatic List<? extends Class<? extends IFCPlugin>>getAllPlugins(PluginRuntime pluginRuntime)static List<? extends Class<? extends IFCPlugin>>getAllPlugins(org.reflections.Reflections reflect)static List<IBundleProperties>getBundleProperties(org.reflections.Reflections reflect)Method to loadIBundlePropertiesfrom the givenReflectionsstatic StringgetDisplayName(IFCPlugin plugin, Locale locale)Returns the display name of the plugin if it is not null.static FilegetPluginFolder(PluginRuntime runtime)Deprecated.static FilegetPluginFolder(String scopeKey, String runtimeKey)Deprecated.static FilegetPluginJarFile(PluginRuntime rtm)Deprecated.static FilegetPluginJarFile(String scopeKey, String runtimeKey)Deprecated.static PluginManifestgetPluginManifest(PluginRuntime pluginRuntime)static PluginManifestgetPluginManifest(File jarFile)static FilegetPluginMetaFile(PluginRuntime rtm)Deprecated.static FilegetPluginMetaFile(String scopeKey, String runtimeKey)Deprecated.static org.apache.commons.configuration.PropertiesConfigurationgetPluginProperties(PluginRuntime rtm)Deprecated.static org.apache.commons.configuration.PropertiesConfigurationgetPluginProperties(String scopeKey, String runtimeKey)Deprecated.static FilegetPluginPropertiesFile(PluginRuntime rtm)Deprecated.static FilegetPluginPropertiesFile(String scopeKey, String runtimeKey)Deprecated.static StringgetScopeKey(Mandant man)Deprecated.static booleanhasRemotePlugins(org.reflections.Reflections reflect)static booleanhasServerTypeAnnotation(org.reflections.Reflections reflections)Checks forFcServerTypeannotation inside a givenReflectionsobject.static booleanisPluginJar(File file)Tests if the given file is a jar and contains FORMCYCLE-plugins of the typeIFCPluginstatic booleanisSystemScope(String scopeKey)static <T extends IFCPlugin>
TregisterPlugin(boolean install, boolean initialize, PluginRuntime prtm, Class<T> clazz)static voidremoveJarFileCacheEntries(JarFile jarToDelete)Deprecated.static voidsavePluginProperties(PluginRuntime rtm, Properties props)Deprecated.static voidsavePluginProperties(String scopeKey, String runtimeKey, Properties props)Deprecated.
-
-
-
Method Detail
-
checkPluginVersion
public static EPluginCompatibility checkPluginVersion(PluginManifest manifest)
-
checkPluginVersion
public static EPluginCompatibility checkPluginVersion(String requiredFCVersionStr)
-
getPluginManifest
public static PluginManifest getPluginManifest(PluginRuntime pluginRuntime)
-
getPluginManifest
public static PluginManifest getPluginManifest(File jarFile)
-
registerPlugin
public static <T extends IFCPlugin> T registerPlugin(boolean install, boolean initialize, PluginRuntime prtm, Class<T> clazz) throws InstantiationException, IllegalAccessException, FCPluginException
-
canPluginBeRegistered
public static <T extends IFCPlugin> boolean canPluginBeRegistered(PluginRuntime prtm, Class<T> pluginClass)
- Type Parameters:
T- type of the plugin- Parameters:
prtm- A plugin runtime to check.pluginClass-Classto check- Returns:
- whether or not the given plugin class can be registered in the given plugin scope
-
isSystemScope
public static boolean isSystemScope(String scopeKey)
-
isPluginJar
public static boolean isPluginJar(File file)
Tests if the given file is a jar and contains FORMCYCLE-plugins of the typeIFCPlugin
-
getBundleProperties
public static List<IBundleProperties> getBundleProperties(org.reflections.Reflections reflect)
Method to loadIBundlePropertiesfrom the givenReflections- Parameters:
reflect-Reflections- Returns:
- IBundleProperties
-
createReflections
public static org.reflections.Reflections createReflections(File file) throws MalformedURLException
Creates reflections for the given file if it is an jar- Parameters:
file-File- Returns:
Reflections- Throws:
MalformedURLException- if the file-url is malformed
-
getAllPlugins
public static List<? extends Class<? extends IFCPlugin>> getAllPlugins(org.reflections.Reflections reflect)
-
getAllPlugins
public static List<? extends Class<? extends IFCPlugin>> getAllPlugins(PluginRuntime pluginRuntime)
-
hasRemotePlugins
public static boolean hasRemotePlugins(org.reflections.Reflections reflect)
-
hasServerTypeAnnotation
public static boolean hasServerTypeAnnotation(org.reflections.Reflections reflections)
Checks forFcServerTypeannotation inside a givenReflectionsobject.- Parameters:
reflections- Reflection data obtained from scanning the classes.- Returns:
trueif anyFcServerTypeannotation was found, otherwisefalse
-
getDisplayName
public static String getDisplayName(IFCPlugin plugin, Locale locale)
Returns the display name of the plugin if it is not null. Otherwise returns the plugin name.
-
removeJarFileCacheEntries
@Deprecated public static void removeJarFileCacheEntries(JarFile jarToDelete)
Deprecated.
-
getScopeKey
@Deprecated public static String getScopeKey(Mandant man)
Deprecated.
-
getPluginFolder
@Deprecated public static File getPluginFolder(PluginRuntime runtime)
Deprecated.
-
getPluginFolder
@Deprecated public static File getPluginFolder(String scopeKey, String runtimeKey)
Deprecated.
-
getPluginPropertiesFile
@Deprecated public static File getPluginPropertiesFile(PluginRuntime rtm)
Deprecated.
-
getPluginPropertiesFile
@Deprecated public static File getPluginPropertiesFile(String scopeKey, String runtimeKey)
Deprecated.
-
getPluginMetaFile
@Deprecated public static File getPluginMetaFile(PluginRuntime rtm)
Deprecated.
-
getPluginMetaFile
@Deprecated public static File getPluginMetaFile(String scopeKey, String runtimeKey)
Deprecated.
-
getPluginJarFile
@Deprecated public static File getPluginJarFile(PluginRuntime rtm)
Deprecated.
-
getPluginJarFile
@Deprecated public static File getPluginJarFile(String scopeKey, String runtimeKey)
Deprecated.
-
savePluginProperties
@Deprecated public static void savePluginProperties(PluginRuntime rtm, Properties props) throws IOException
Deprecated.- Throws:
IOException
-
savePluginProperties
@Deprecated public static void savePluginProperties(String scopeKey, String runtimeKey, Properties props) throws IOException
Deprecated.- Throws:
IOException
-
getPluginProperties
@Deprecated public static org.apache.commons.configuration.PropertiesConfiguration getPluginProperties(PluginRuntime rtm)
Deprecated.
-
getPluginProperties
@Deprecated public static org.apache.commons.configuration.PropertiesConfiguration getPluginProperties(String scopeKey, String runtimeKey)
Deprecated.
-
-