Package de.odysseus.calyxo.panels.conf

Examples of de.odysseus.calyxo.panels.conf.ParamConfig


      }
      return result;
    }

    ParamConfig lookupParamConfig(String name) {
      ParamConfig result = item.getParamConfig(name);
      if (result == null && previous != null) {
        result = previous.lookupParamConfig(name);
      }
      return result;
    }
View Full Code Here


    PanelConfig test = context.lookupPanelConfig("test");
    assertNotNull(test);

    context.push(test); // --> /panel

    ParamConfig param = context.lookupParamConfig("param");
    assertNotNull(param);
    assertEquals("test.param", param.getValue());

    PanelConfig panel = context.lookupPanelConfig("panel");
    assertNotNull(panel);
    context.push(panel); // --> /panel/panel
    param = context.lookupParamConfig("param");
    assertNotNull(param);
    assertEquals("test.panel.param", param.getValue());
    context.pop(); // --> /panel

    ListConfig list = context.lookupListConfig("list");
    assertNotNull(list);
    Iterator items = list.getItemConfigs();
    assertTrue(items.hasNext());
    ItemConfig item = (ItemConfig)items.next();
    context.push(item); // --> /panel/item

    param = context.lookupParamConfig("param");
    assertNotNull(param);
    assertEquals("test.item.param", param.getValue());

    panel = context.lookupPanelConfig("panel");
    assertNotNull(panel);
    context.push(panel); // --> /panel/item/panel
    param = context.lookupParamConfig("param");
    assertNotNull(param);
    assertEquals("test.item.panel.param", param.getValue());
    context.pop(); // --> /panel/item

    context.pop(); // --> /panel

    assertTrue(items.hasNext());
    item = (ItemConfig)items.next();
    context.push(item); // --> /panel/item

    param = context.lookupParamConfig("param");
    assertNotNull(param);
    assertEquals("test.param", param.getValue());

    panel = context.lookupPanelConfig("panel");
    assertNotNull(panel);
    context.push(panel); // --> /panel/item/panel
    param = context.lookupParamConfig("param");
    assertNotNull(param);
    assertEquals("test.panel.param", param.getValue());
    context.pop(); // --> /panel/item

    context.pop(); // --> /panel

    context.pop(); // --> /
View Full Code Here

    /**
     * Lookup parameter.
     */
    protected Object get(HttpServletRequest request, Object key) {
      PanelsContext context = support.getContext(request);
      ParamConfig param = context.lookupParamConfig(key.toString());
      if (param == null) {
        throw new AccessException("Unknown panel parameter '" + key + "'");
      }
      if (!param.isDefined()) {
        throw new AccessException("Undefined value for panel parameter '" + key + "'");
      }
      return param.getValue();
    }
View Full Code Here

  /**
   * Search receiver and generalizations for a contained param with
   * given name
   */
  ParamConfig findParamConfigByGeneralization(String name) {
    ParamConfig param = getParamConfig(name);
    if (param == null && generalizedPanel != null) {
      param = generalizedPanel.findParamConfigByGeneralization(name);
    }
    return param;
  }
View Full Code Here

   * @see de.odysseus.calyxo.panels.conf.PanelConfig#findParamConfig(java.lang.String, java.util.Locale)
   */
  public ParamConfig findParamConfig(String name, Locale locale) {
    PanelConfigImpl panel = this;
    while (panel != null) {
      ParamConfig result = panel.findParamConfigByGeneralization(name);
      if (result != null) {
        return result;
      }
      panel = panel.lookupBase(locale);
    }
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.panels.conf.ParamConfig

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.