Package org.apache.tiles.definition

Examples of org.apache.tiles.definition.DefinitionsFactory


                                              BasicTilesContainer container) throws TilesException {
        TilesContextFactory contextFactory =
            (TilesContextFactory) createFactory(configuration,
                CONTEXT_FACTORY_INIT_PARAM);

        DefinitionsFactory defsFactory =
            (DefinitionsFactory) createFactory(configuration,
                DEFINITIONS_FACTORY_INIT_PARAM);

        PreparerFactory prepFactory =
            (PreparerFactory) createFactory(configuration,
View Full Code Here


    public void testCreateDefinitionsFactory() {
        TilesRequestContextFactory requestContextFactory = factory
                .createRequestContextFactory(applicationContext);
        LocaleResolver resolver = factory.createLocaleResolver(applicationContext,
                requestContextFactory);
        DefinitionsFactory defsFactory = factory.createDefinitionsFactory(
                applicationContext, requestContextFactory, resolver);
        assertTrue("The class of the definitions factory is not correct",
                defsFactory instanceof UrlDefinitionsFactory);
    }
View Full Code Here

    protected void postCreationOperations(TilesRequestContextFactory contextFactory,
            TilesApplicationContext tilesContext,
            RendererFactory rendererFactory, AttributeEvaluator evaluator,
            Map<String, String> initParameters,
            Map<String, String> configuration, BasicTilesContainer container) {
        DefinitionsFactory defsFactory =
            (DefinitionsFactory) createFactory(configuration,
                DEFINITIONS_FACTORY_INIT_PARAM);
        if (defsFactory instanceof TilesApplicationContextAware) {
            ((TilesApplicationContextAware) defsFactory)
                    .setApplicationContext(tilesContext);
        }

        defsFactory.init(configuration);

        container.setDefinitionsFactory(defsFactory);
    }
View Full Code Here

     * @return The newly created definitions factory.
     * @throws TilesContainerFactoryException If something goes wrong.
     */
    public DefinitionsFactory createDefinitionsFactory(
            TilesApplicationContext context) {
        DefinitionsFactory retValue;
        Map<String, String> config = new HashMap<String, String>(defaultConfiguration);
        config.putAll(context.getInitParams());
        retValue = (DefinitionsFactory) createFactory(config,
                    DEFINITIONS_FACTORY_INIT_PARAM);
        if (retValue instanceof TilesApplicationContextAware) {
View Full Code Here

                            param);
                } else {
                    initParams.remove(DefinitionsFactory.DEFINITIONS_CONFIG);
                }

                DefinitionsFactory defsFactory =
                    (DefinitionsFactory) createFactory(configuration,
                            DEFINITIONS_FACTORY_INIT_PARAM);
                if (defsFactory instanceof TilesApplicationContextAware) {
                    ((TilesApplicationContextAware) defsFactory).setApplicationContext(tilesContext);
                }

                defsFactory.init(initParams);
                ((KeyedDefinitionsFactoryTilesContainer) container)
                        .setDefinitionsFactory(keys[i], defsFactory);
            }
        }
    }
View Full Code Here

    @Override
    protected DefinitionsFactory createDefinitionsFactory(ApplicationContext applicationContext,
        LocaleResolver resolver) {

      if (definitionsFactoryClass != null) {
        DefinitionsFactory factory = BeanUtils.instantiate(definitionsFactoryClass);
        if (factory instanceof org.apache.tiles.request.ApplicationContextAware) {
          ((org.apache.tiles.request.ApplicationContextAware) factory)
              .setApplicationContext(applicationContext);
        }
        BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(factory);
View Full Code Here

            (TilesContextFactory) createFactory(configuration,
                CONTEXT_FACTORY_INIT_PARAM);

        contextFactory = new StrutsTilesContextFactory(contextFactory);

        DefinitionsFactory defsFactory =
            (DefinitionsFactory) createFactory(configuration,
                DEFINITIONS_FACTORY_INIT_PARAM);

        PreparerFactory prepFactory =
            (PreparerFactory) createFactory(configuration,
View Full Code Here

     * @return The newly created definitions factory.
     * @throws TilesException If something goes wrong.
     */
    public DefinitionsFactory createDefinitionsFactory(Object context)
            throws TilesException {
        DefinitionsFactory retValue;
        Map<String, String> config = new HashMap<String, String>(defaultConfiguration);
        config.putAll(getInitParameterMap(context));
        retValue = (DefinitionsFactory) createFactory(config,
                    DEFINITIONS_FACTORY_INIT_PARAM);

View Full Code Here

                if (param != null) {
                    initParams.put(BasicTilesContainer.DEFINITIONS_CONFIG,
                            param);
                }

                DefinitionsFactory defsFactory =
                    (DefinitionsFactory) createFactory(config,
                            DEFINITIONS_FACTORY_INIT_PARAM);
                ((KeyedDefinitionsFactoryTilesContainer) container)
                        .setDefinitionsFactory(keys[i], defsFactory,
                                initParams);
View Full Code Here

        assertNull(container.getProperDefinitionsFactory("two"));
       
        Map<String, String> initParams = new HashMap<String, String>();
        initParams.put(BasicTilesContainer.DEFINITIONS_CONFIG,
                "/WEB-INF/tiles-one.xml");
        DefinitionsFactory defsFactory = factory.createDefinitionsFactory(context);
        container.setDefinitionsFactory("one", defsFactory, initParams);
        initParams.put(BasicTilesContainer.DEFINITIONS_CONFIG,
                "/WEB-INF/tiles-two.xml");
        defsFactory = factory.createDefinitionsFactory(context);
        container.setDefinitionsFactory("two", defsFactory, initParams);
View Full Code Here

TOP

Related Classes of org.apache.tiles.definition.DefinitionsFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.