Package org.apache.wicket.resource

Examples of org.apache.wicket.resource.IPropertiesFactory


     */
    public String loadStringResource(Class clazz, final String key, final Locale locale,
        final String style)
    {
        // Load the properties associated with the path
        IPropertiesFactory propertiesFactory = Application.get().getResourceSettings()
            .getPropertiesFactory();

        // All GeoServer releated resources are loaded into a GeoServerApplication*.properties file
        String path = "/GeoServerApplication";
        while (true)
        {
            // Iterator over all the combinations
            ResourceNameIterator iter = new ResourceNameIterator(path, style, locale,
                "properties,xml");
            while (iter.hasNext())
            {
                String newPath = (String)iter.next();

                final Properties props = propertiesFactory.load(clazz, newPath);
                if (props != null)
                {
                    // Lookup the qualified key
                    String qualifiedKey = clazz != null ? clazz.getSimpleName() + "." + key : key;
                    String value = props.getString(qualifiedKey);
View Full Code Here


      log.debug("key: '" + key + "'; class: '" + clazz.getName() + "'; locale: '" + locale +
        "'; Style: '" + style + "'; Variation: '" + variation + '\'');
    }

    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = getPropertiesFactory();
    while (true)
    {
      // Create the base path
      String path = clazz.getName().replace('.', '/');

      // Iterator over all the combinations
      ResourceNameIterator iter = newResourceNameIterator(path, locale, style, variation);
      while (iter.hasNext())
      {
        String newPath = iter.next();

        Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here

   */
  public void testRenderHomePage_2() throws Exception
  {
    // Avoid the conflict by limiting the search for properties files
    // to *.properties
    IPropertiesFactory myFac = new MyPropertiesFactory(tester.getApplication().getResourceSettings());
    tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

    executeTest(TestPage_1.class, "TestPageExpectedResult_1.xml");
  }
View Full Code Here

  /**
   * @throws Exception
   */
  public void testDisabledCache() throws Exception
  {
    IPropertiesFactory myFac = new DisabledCachePropertiesFactory(tester.getApplication().getResourceSettings());
    tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

    executeTest(TestPage_1.class, "TestPageExpectedResult_1.xml");

    myFac.clearCache();
  }
View Full Code Here

  /**
   * @throws Exception
   */
  public void testRenderHomePage_2() throws Exception
  {
    IPropertiesFactory myFac = new MyPropertiesFactory(tester.getApplication());
    tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

    executeTest(XmlPage_2.class, "XmlPageExpectedResult_2.xml");
  }
View Full Code Here

  /**
   * @throws Exception
   */
  public void testRenderHomePage_3() throws Exception
  {
    IPropertiesFactory myFac = new MyPropertiesFactory(tester.getApplication());
    tester.getApplication().getResourceSettings().setPropertiesFactory(myFac);

    executeTest(XmlPage_3.class, "XmlPageExpectedResult_3.xml");
  }
View Full Code Here

    {
      return null;
    }

    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = Application.get()
      .getResourceSettings()
      .getPropertiesFactory();

    while (true)
    {
      // Create the base path
      String path = clazz.getName().replace('.', '/');

      // Iterator over all the combinations
      ResourceNameIterator iter = new ResourceNameIterator(path, style, locale, null);
      while (iter.hasNext())
      {
        String newPath = (String)iter.next();

        final Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here

    String packageName = clazz.getPackage().getName();
    packageName = packageName.replace('.', '/');

    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = Application.get()
      .getResourceSettings()
      .getPropertiesFactory();

    while (packageName.length() > 0)
    {
      // Create the base path
      String path = packageName + "/" + filename;

      // Iterator over all the combinations
      ResourceNameIterator iter = new ResourceNameIterator(path, style, locale, null);
      while (iter.hasNext())
      {
        String newPath = iter.next();

        final Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here

    String packageName = clazz.getPackage().getName();
    packageName = packageName.replace('.', '/');

    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = Application.get()
      .getResourceSettings()
      .getPropertiesFactory();

    while (packageName.length() > 0)
    {
      // Create the base path
      String path = packageName + "/" + filename;

      // Iterator over all the combinations
      ResourceNameIterator iter = new ResourceNameIterator(path, style, locale, null);
      while (iter.hasNext())
      {
        String newPath = iter.next();

        final Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here

    {
      return null;
    }

    // Load the properties associated with the path
    IPropertiesFactory propertiesFactory = Application.get()
      .getResourceSettings()
      .getPropertiesFactory();

    while (true)
    {
      // Create the base path
      String path = clazz.getName().replace('.', '/');

      // Iterator over all the combinations
      ResourceNameIterator iter = new ResourceNameIterator(path, style, locale, null);
      while (iter.hasNext())
      {
        String newPath = iter.next();

        final Properties props = propertiesFactory.load(clazz, newPath);
        if (props != null)
        {
          // Lookup the value
          String value = props.getString(key);
          if (value != null)
View Full Code Here

TOP

Related Classes of org.apache.wicket.resource.IPropertiesFactory

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.