Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.webengine.model
Interface Module

All Superinterfaces:
MessagesProvider
All Known Implementing Classes:
DefaultModule, ModuleImpl

public interface Module
extends MessagesProvider

Author:
Bogdan Stefanescu

Method Summary
 void flushCache()
           
 java.util.List<LinkDescriptor> getActiveLinks(Resource context, java.lang.String category)
           
 AdapterType getAdapter(Resource ctx, java.lang.String name)
          Gets the named adapter definition for the given resource.
 java.util.List<java.lang.String> getAdapterNames(Resource ctx)
          Gets the list of adapter names that applies to the given resource.
 AdapterType[] getAdapters()
          Gets the adapters registered within this module.
 java.util.List<AdapterType> getAdapters(Resource ctx)
          Gets the list of adapters that applies to the given resource.
 java.util.List<java.lang.String> getEnabledAdapterNames(Resource ctx)
          Gets the list of adapter names that are enabled for the given context.
 java.util.List<AdapterType> getEnabledAdapters(Resource ctx)
          Gets the list of adapters that are enabled for the given context.
 WebEngine getEngine()
           
 ScriptFile getFile(java.lang.String path)
          Gets a file using the configured directory stack.
 java.util.List<LinkDescriptor> getLinks(java.lang.String category)
           
 java.lang.String getMediaTypeId(javax.ws.rs.core.MediaType mt)
           
 Messages getMessages()
           
 java.util.Map<java.lang.String,java.lang.String> getMessages(java.lang.String language)
           
 java.lang.String getName()
           
 java.util.List<ResourceBinding> getResourceBindings()
           
 java.io.File getRoot()
           
 Resource getRootObject(WebContext ctx)
           
 java.lang.String getSkinPathPrefix()
          Get the path prefix to be used from templates to prepend to links to static resources.
 ScriptFile getSkinResource(java.lang.String path)
          Gets a skin resource input stream.
 Module getSuperModule()
           
 java.lang.String getTemplateFileExt()
           
 ResourceType getType(java.lang.String typeName)
          Gets a ResourceType instance given its name.
 ResourceType[] getTypes()
          Gets the types registered within this module.
 Validator getValidator(java.lang.String docType)
           
 boolean isDerivedFrom(java.lang.String moduleName)
           
 java.lang.Class<?> loadClass(java.lang.String className)
          Loads a class given its name.
 

Method Detail

getName

java.lang.String getName()

getRoot

java.io.File getRoot()

getRootObject

Resource getRootObject(WebContext ctx)

getEngine

WebEngine getEngine()

flushCache

void flushCache()

getSuperModule

Module getSuperModule()

getTemplateFileExt

java.lang.String getTemplateFileExt()

getMediaTypeId

java.lang.String getMediaTypeId(javax.ws.rs.core.MediaType mt)

getMessages

java.util.Map<java.lang.String,java.lang.String> getMessages(java.lang.String language)
Specified by:
getMessages in interface MessagesProvider

getMessages

Messages getMessages()

getResourceBindings

java.util.List<ResourceBinding> getResourceBindings()

getFile

ScriptFile getFile(java.lang.String path)
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 flushCache() method.

Parameters:
path - the file path
Returns:
null if no file found otherwise the file

getSkinResource

ScriptFile getSkinResource(java.lang.String path)
                           throws java.io.IOException
Gets a skin resource input stream. This must not cache resources. This method is using the module stacking directory to find the resource.

Throws:
java.io.IOException

loadClass

java.lang.Class<?> loadClass(java.lang.String className)
                             throws java.lang.ClassNotFoundException
Loads a class given its name.

The scripting class loader will be used to load the class.

Parameters:
className - the class name
Returns:
the class instance
Throws:
java.lang.ClassNotFoundException

getType

ResourceType getType(java.lang.String typeName)
Gets a ResourceType instance given its name.

The web type lookup is performed in the following order:

  1. First the annotated Groovy classes are checked. (web/ directory)
  2. Then the configuration type registry corresponding

Parameters:
typeName - the type name
Returns:
the web type instance
Throws:
TypeNotFoundException - if no such web type was defined

getTypes

ResourceType[] getTypes()
Gets the types registered within this module.

Returns:
the types. Cannot be null.

getAdapters

AdapterType[] getAdapters()
Gets the adapters registered within this module.

Returns:
the adapters. Cannot be null.

getAdapter

AdapterType getAdapter(Resource ctx,
                       java.lang.String name)
Gets the named adapter definition for the given resource.

Parameters:
ctx - the target resource
name - the adapter name
Returns:
the adapter if any adapter with that name applies for that resource otherwise throws an exception
Throws:
WebSecurityException - if the adapter exists but cannot be accessed in the context of that resource
AdapterNotFoundException - if no such adapter exists for that resource

getAdapters

java.util.List<AdapterType> getAdapters(Resource ctx)
Gets the list of adapters that applies to the given resource.

Parameters:
ctx - the context resource
Returns:
the list of adapters Cannot be null.

getAdapterNames

java.util.List<java.lang.String> getAdapterNames(Resource ctx)
Gets the list of adapter names that applies to the given resource.

Parameters:
ctx - the context resource
Returns:
the list of adapters Cannot be null.

getEnabledAdapters

java.util.List<AdapterType> getEnabledAdapters(Resource ctx)
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.

Parameters:
ctx - the context resource
Returns:
the list of adapter.s Cannot be null.

getEnabledAdapterNames

java.util.List<java.lang.String> getEnabledAdapterNames(Resource ctx)
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.

Parameters:
ctx - the context resource
Returns:
the list of adapters. Cannot be null.

getLinks

java.util.List<LinkDescriptor> getLinks(java.lang.String category)

getActiveLinks

java.util.List<LinkDescriptor> getActiveLinks(Resource context,
                                              java.lang.String category)

getSkinPathPrefix

java.lang.String getSkinPathPrefix()
Get the path prefix to be used from templates to prepend to links to static resources.

This prefix is exposed to templates as ${skinPath}.

Returns:
the skin path prefix. never null.

isDerivedFrom

boolean isDerivedFrom(java.lang.String moduleName)

getValidator

Validator getValidator(java.lang.String docType)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.