Examples of IPropertySource


Examples of org.apache.tapestry.engine.IPropertySource

    protected AssetExternalizer(IRequestCycle cycle)
    {
        _resolver = cycle.getEngine().getResourceResolver();
   
        IPropertySource properties = cycle.getEngine().getPropertySource();


        String directory = properties.getPropertyValue("org.apache.tapestry.asset.dir");

        if (directory == null)
            return;

        _URL = properties.getPropertyValue("org.apache.tapestry.asset.URL");

        if (_URL == null)
            return;

        _assetDir = new File(directory);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

        String result = null;
        int count = _sources.size();
       
        for (int i = 0; i < count; i++)
        {
            IPropertySource source = (IPropertySource)_sources.get(i);
           
            result = source.getPropertyValue(propertyName);
           
            if (result != null)
                break;
        }
       
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

        if (!init)
        {
            RequestContext requestContext = cycle.getRequestContext();
            ApplicationServlet servlet = requestContext.getServlet();
            ServletContext context = servlet.getServletContext();
            IPropertySource propertySource = cycle.getEngine().getPropertySource();

            Resource webInfLocation = new ContextResource(context, "/WEB-INF/");

            Resource webInfAppLocation =
                webInfLocation.getRelativeResource(servlet.getServletName() + "/");

            readQuestions(
                easyQuestions,
                webInfAppLocation,
                propertySource.getPropertyValue("easyquestionsfile"));
            readQuestions(
                mediumQuestions,
                webInfAppLocation,
                propertySource.getPropertyValue("mediumquestiosfile"));
            readQuestions(
                hardQuestions,
                webInfAppLocation,
                propertySource.getPropertyValue("hardquestionsfile"));
            points = new int[10];
            names = new String[10];
            for (int i = 0; i <= 9; i++)
            {
                points[i] = 0;
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

        if (!init)
        {
            RequestContext requestContext = cycle.getRequestContext();
            ApplicationServlet servlet = requestContext.getServlet();
            ServletContext context = servlet.getServletContext();
            IPropertySource propertySource = cycle.getEngine().getPropertySource();

            Resource webInfLocation = new ContextResource(context, "/WEB-INF/");

            Resource webInfAppLocation =
                webInfLocation.getRelativeResource(servlet.getServletName() + "/");

            readQuestions(
                easyQuestions,
                webInfAppLocation,
                propertySource.getPropertyValue("easyquestionsfile"));
            readQuestions(
                mediumQuestions,
                webInfAppLocation,
                propertySource.getPropertyValue("mediumquestiosfile"));
            readQuestions(
                hardQuestions,
                webInfAppLocation,
                propertySource.getPropertyValue("hardquestionsfile"));
            points = new int[10];
            names = new String[10];
            for (int i = 0; i <= 9; i++)
            {
                points[i] = 0;
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    private synchronized IPropertySource getSourceForNamespace(INamespace namespace)
    {
        Resource key = namespace.getSpecificationLocation();

        IPropertySource result = (IPropertySource) _namespaceSources.get(key);

        if (result == null)
        {
            result = createSourceForNamespace(namespace);
            _namespaceSources.put(key, result);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    private synchronized IPropertySource getSourceForComponent(IComponent component)
    {
        Resource key = component.getSpecification().getSpecificationLocation();

        IPropertySource result = (IPropertySource) _componentSources.get(key);

        if (result == null)
        {
            result = createSourceForComponent(component);
            _componentSources.put(key, result);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    private synchronized IPropertySource getSourceForNamespace(INamespace namespace)
    {
        Resource key = namespace.getSpecificationLocation();

        IPropertySource result = (IPropertySource) _namespaceSources.get(key);

        if (result == null)
        {
            result = createSourceForNamespace(namespace);
            _namespaceSources.put(key, result);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    private synchronized IPropertySource getSourceForComponent(IComponent component)
    {
        Resource key = component.getSpecification().getSpecificationLocation();

        IPropertySource result = (IPropertySource) _componentSources.get(key);

        if (result == null)
        {
            result = createSourceForComponent(component);
            _componentSources.put(key, result);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

public class TestLocalizedPropertySource extends HiveMindTestCase
{
    public void testFound()
    {
        MockControl control = newControl(IPropertySource.class);
        IPropertySource ps = (IPropertySource) control.getMock();

        ps.getPropertyValue("property-name_en");
        control.setReturnValue(null);

        ps.getPropertyValue("property-name");
        control.setReturnValue("fred");

        replayControls();

        LocalizedPropertySource lps = new LocalizedPropertySource(ps);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    }

    public void testNotFound()
    {
        MockControl control = newControl(IPropertySource.class);
        IPropertySource ps = (IPropertySource) control.getMock();

        ps.getPropertyValue("property-name_fr");
        control.setReturnValue(null);

        ps.getPropertyValue("property-name");
        control.setReturnValue(null);

        replayControls();

        LocalizedPropertySource lps = new LocalizedPropertySource(ps);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.