Package org.apache.tapestry.engine

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


        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

        if (!init)
        {
            RequestContext requestContext = cycle.getRequestContext();
            ApplicationServlet servlet = requestContext.getServlet();
            ServletContext context = servlet.getServletContext();
            IPropertySource propertySource = cycle.getEngine().getPropertySource();
            IResourceLocation webInfLocation = new ContextResourceLocation(context, "/WEB-INF/");
            IResourceLocation webInfAppLocation = webInfLocation.getRelativeLocation(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

    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

        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

    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

        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

    }

    public void testGlobalPropertyObjectProviderSuccess()
    {
        MockControl sourceControl = newControl(IPropertySource.class);
        IPropertySource source = (IPropertySource) sourceControl.getMock();

        // Training

        source.getPropertyValue("foo");
        sourceControl.setReturnValue("bar");

        replayControls();

        PropertyObjectProvider p = new PropertyObjectProvider();
View Full Code Here

    public void testGlobalPropertyObjectProviderFailure()
    {
        Location l = fabricateLocation(223);

        MockControl sourceControl = newControl(IPropertySource.class);
        IPropertySource source = (IPropertySource) sourceControl.getMock();

        // Training

        source.getPropertyValue("foo");
        sourceControl.setThrowable(new ApplicationRuntimeException("failure"));

        replayControls();

        PropertyObjectProvider p = new PropertyObjectProvider();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.engine.IPropertySource

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.