Class ModuleImpl
java.lang.Object
org.nuxeo.ecm.webengine.model.impl.ModuleImpl
- All Implemented Interfaces:
MessagesProvider
,Module
The default implementation for a web configuration.
- Author:
- Bogdan Stefanescu
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ModuleConfiguration
protected DirectoryStack
protected final WebEngine
protected ConcurrentMap<String,
ScriptFile> protected LinkRegistry
protected Messages
protected ResourceType
Deprecated.protected final com.sun.jersey.server.impl.inject.ServerInjectableProviderContext
protected final String
protected final ModuleImpl
protected final Object
protected TypeRegistry
-
Constructor Summary
ConstructorDescriptionModuleImpl
(WebEngine engine, ModuleImpl superModule, ModuleConfiguration config, com.sun.jersey.server.impl.inject.ServerInjectableProviderContext sic) -
Method Summary
Modifier and TypeMethodDescriptionTODO There are no more reasons to lazy load the type registry since module are lazy loaded.protected ScriptFile
void
void
Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources.void
void
getActiveLinks
(Resource context, String category) getAdapter
(Resource ctx, String name) Gets the named adapter definition for the given resource.getAdapterNames
(Resource ctx) Gets the list of adapter names that applies to the given resource.Gets the adapters registered within this module.getAdapters
(Resource ctx) Gets the list of adapters that applies to the given resource.Gets the list of adapter names that are enabled for the given context.Gets the list of adapters that are enabled for the given context.Gets a file using the configured directory stack.getMediaTypeId
(javax.ws.rs.core.MediaType mt) getMessages
(String language) getName()
getRoot()
getRootObject
(WebContext ctx) Deprecated.UseWebApplication
to declare modulesDeprecated.UseWebApplication
to declare modulesstatic File
getSkinDir
(File moduleDir) Get the path prefix to be used from templates to prepend to links to static resources.getSkinResource
(String path) Gets a skin resource input stream.Gets aResourceType
instance given its name.getTypes()
Gets the types registered within this module.boolean
boolean
isDerivedFrom
(String moduleName) boolean
Whether or not this module has a GUI and should be listed in available GUI module list.Class<?>
Loads a class given its name.void
protected void
void
toString()
-
Field Details
-
engine
-
typeLock
-
typeReg
-
configuration
-
sic
protected final com.sun.jersey.server.impl.inject.ServerInjectableProviderContext sic -
superModule
-
linkReg
-
skinPathPrefix
-
rootType
Deprecated.UseWebApplication
to declare modules - modules may have multiple roots -
messages
-
dirStack
-
fileCache
-
-
Constructor Details
-
ModuleImpl
public ModuleImpl(WebEngine engine, ModuleImpl superModule, ModuleConfiguration config, com.sun.jersey.server.impl.inject.ServerInjectableProviderContext sic)
-
-
Method Details
-
isHeadless
public boolean isHeadless()Whether or not this module has a GUI and should be listed in available GUI module list. For example, REST modules usually don't have a GUI.- Returns:
- true if headless (no GUI is provided), false otherwise
-
getNatures
- Returns:
- the natures, or null if no natures were specified
-
hasNature
-
getEngine
-
getName
-
getSuperModule
- Specified by:
getSuperModule
in interfaceModule
-
getModuleConfiguration
-
getRootType
Deprecated.UseWebApplication
to declare modules -
getRootObject
Deprecated.UseWebApplication
to declare modules- Specified by:
getRootObject
in interfaceModule
-
getSkinPathPrefix
Description copied from interface:Module
Get the path prefix to be used from templates to prepend to links to static resources.This prefix is exposed to templates as ${skinPath}.
- Specified by:
getSkinPathPrefix
in interfaceModule
- Returns:
- the skin path prefix. never null.
-
getTypeRegistry
-
loadClass
Description copied from interface:Module
Loads a class given its name.The scripting class loader will be used to load the class.
- Specified by:
loadClass
in interfaceModule
- Parameters:
className
- the class name- Returns:
- the class instance
- Throws:
ClassNotFoundException
-
getType
Description copied from interface:Module
Gets aResourceType
instance given its name.The web type lookup is performed in the following order:
- First the annotated Groovy classes are checked. (web/ directory)
- Then the configuration type registry corresponding
-
getTypes
Description copied from interface:Module
Gets the types registered within this module. -
getAdapters
Description copied from interface:Module
Gets the adapters registered within this module.- Specified by:
getAdapters
in interfaceModule
- Returns:
- the adapters. Cannot be null.
-
getAdapter
Description copied from interface:Module
Gets the named adapter definition for the given resource.- Specified by:
getAdapter
in interfaceModule
- Parameters:
ctx
- the target resourcename
- the adapter name- Returns:
- the adapter if any adapter with that name applies for that resource otherwise throws an exception
-
getAdapterNames
Description copied from interface:Module
Gets the list of adapter names that applies to the given resource.- Specified by:
getAdapterNames
in interfaceModule
- Parameters:
ctx
- the context resource- Returns:
- the list of adapters Cannot be null.
-
getAdapters
Description copied from interface:Module
Gets the list of adapters that applies to the given resource.- Specified by:
getAdapters
in interfaceModule
- Parameters:
ctx
- the context resource- Returns:
- the list of adapters Cannot be null.
-
getEnabledAdapterNames
Description copied from interface:Module
Gets the list of adapter names that are enabled for the given context.Enabled services are those adapters which can be accessed in the current security context.
- Specified by:
getEnabledAdapterNames
in interfaceModule
- Parameters:
ctx
- the context resource- Returns:
- the list of adapters. Cannot be null.
-
getEnabledAdapters
Description copied from interface:Module
Gets the list of adapters that are enabled for the given context.Enabled adapters are those adapters which can be accessed in the current security context.
- Specified by:
getEnabledAdapters
in interfaceModule
- Parameters:
ctx
- the context resource- Returns:
- the list of adapter.s Cannot be null.
-
getMediaTypeId
- Specified by:
getMediaTypeId
in interfaceModule
-
getResourceBindings
- Specified by:
getResourceBindings
in interfaceModule
-
isDerivedFrom
- Specified by:
isDerivedFrom
in interfaceModule
-
loadConfiguration
public void loadConfiguration() -
getLinks
-
getActiveLinks
- Specified by:
getActiveLinks
in interfaceModule
-
getLinkRegistry
-
getTemplateFileExt
- Specified by:
getTemplateFileExt
in interfaceModule
-
flushSkinCache
public void flushSkinCache() -
flushTypeCache
public void flushTypeCache() -
flushRootResourcesCache
Deprecated.resources are deprecated - you should use a jax-rs application to declare more resources. -
flushCache
public void flushCache()- Specified by:
flushCache
in interfaceModule
-
getSkinDir
-
loadDirectoryStack
protected void loadDirectoryStack() -
getFile
Description copied from interface:Module
Gets a file using the configured directory stack. Each directory in the stack is asked for the file until a file is found. If no file is found, returns null.Note that the implementation may cache the results. To clear any cached data, you should call the
Module.flushCache()
method. -
findFile
- Parameters:
path
- a normalized path (absolute path)- Throws:
IOException
-
getSkinResource
Description copied from interface:Module
Gets a skin resource input stream. This must not cache resources. This method is using the module stacking directory to find the resource.- Specified by:
getSkinResource
in interfaceModule
- Throws:
IOException
-
createTypeRegistry
TODO There are no more reasons to lazy load the type registry since module are lazy loaded. Type registry must be loaded at module creation -
getRoot
-
reloadMessages
public void reloadMessages() -
getMessages
- Specified by:
getMessages
in interfaceModule
-
getMessages
- Specified by:
getMessages
in interfaceMessagesProvider
- Specified by:
getMessages
in interfaceModule
-
toString
-
WebApplication
to declare modules - modules may have multiple roots