Hi all,
 
Sorry if you get this twice, I had some problems posting.
 
I would like to know how I could retrieve a list of all
tiles-definitions within an action.
Background:
I'm currently building a framework that lets a user dynamically add
destinations within an application. These destinations will use a
definition that's defined in tiles-config.xml. To create a new
destination a user first needs to select which definition to use, and
then he should select which pages he wants to use for all areas defined
within that definition.
I can get the list of areas when I have a definition. For that I use the
following code:
 
<code>
// get a reference to the definitions 
ServletContext sc = request.getSession().getServletContext();
 
// get the definitionFactory that is used (Tiles-specific)
DefinitionsFactory definitionsFactory = ((TilesUtilStrutsImpl)
TilesUtil.getTilesUtil()).getDefinitionsFactory(request, sc);
 
logger.debug("DefinitionsFactory =" + definitionsFactory.toString());
 
// get the ComponentDefinition for the definition that has
// been selected for the current destination, for example
"portal.masterPage".
ComponentDefinition compDef =
definitionsFactory.getDefinition(definition, request, sc);
 
logger.debug("We have the following areas according to the definition:
");
            logger.debug(compDef.getAttributes().keySet());
</code>
 
This only works when I already know the definition. I would like to get
a list of all definitions, so a user can get a drop-down list from which
to select the definition he wants to use for the new destination.
Do I need to extend the DefinitionFactory in order to get something like
DefinitionFactory.getDefinitions() ?
 
Thanks in advance.
 
 
Roeland J.C. Lengers
Email:      [EMAIL PROTECTED]
 
 
 


Reply via email to