Example usage for org.apache.commons.configuration HierarchicalConfiguration getLogger

List of usage examples for org.apache.commons.configuration HierarchicalConfiguration getLogger

Introduction

In this page you can find the example usage for org.apache.commons.configuration HierarchicalConfiguration getLogger.

Prototype

public Log getLogger() 

Source Link

Document

Returns the logger used by this configuration object.

Usage

From source file:com.eyeq.pivot4j.ui.AbstractPivotUIRenderer.java

/**
 * @see com.eyeq.pivot4j.ui.AbstractPivotRenderer#saveSettings(org.apache.commons.configuration.HierarchicalConfiguration)
 */// ww  w .ja va  2  s .  c o  m
@Override
public void saveSettings(HierarchicalConfiguration configuration) {
    super.saveSettings(configuration);

    if (configuration.getLogger() == null) {
        configuration.setLogger(LogFactory.getLog(getClass()));
    }

    configuration.addProperty("drillDown[@mode]", drillDownMode);
    configuration.addProperty("drillDown.columnAxis[@enabled]", enableColumnDrillDown);
    configuration.addProperty("drillDown.rowAxis[@enabled]", enableRowDrillDown);
    configuration.addProperty("sort[@enabled]", enableSort);

    if (sortMode != null) {
        configuration.addProperty("sort[@mode]", sortMode.getName());
    }

    configuration.addProperty("drillThrough[@enabled]", enableDrillThrough);

    // TODO Need to store registered commands here.
}

From source file:com.eyeq.pivot4j.ui.AbstractPivotRenderer.java

/**
 * @see com.eyeq.pivot4j.ui.property.PropertySupport#saveSettings(org.apache.commons.configuration.HierarchicalConfiguration)
 *///  w w  w .  j a v  a2  s  .c o m
@Override
public void saveSettings(HierarchicalConfiguration configuration) {
    if (configuration == null) {
        throw new NullArgumentException("configuration");
    }

    configuration.setDelimiterParsingDisabled(true);

    if (configuration.getLogger() == null) {
        configuration.setLogger(LogFactory.getLog(getClass()));
    }

    configuration.addProperty("showDimensionTitle", showDimensionTitle);
    configuration.addProperty("showParentMembers", showParentMembers);
    configuration.addProperty("hideSpans", hideSpans);

    if (!aggregatorNames.isEmpty()) {
        int index = 0;

        for (AggregatorKey key : aggregatorNames.keySet()) {
            Axis axis = key.getAxis();
            AggregatorPosition position = key.getPosition();

            List<String> names = aggregatorNames.get(key);

            for (String name : names) {
                configuration.addProperty(String.format("aggregations.aggregation(%s)[@name]", index), name);
                configuration.addProperty(String.format("aggregations.aggregation(%s)[@axis]", index),
                        axis.name());
                configuration.addProperty(String.format("aggregations.aggregation(%s)[@position]", index),
                        position.name());

                index++;
            }
        }
    }

    if (cellProperties != null) {
        configuration.addProperty("properties.cell", "");

        cellProperties.saveSettings(configuration.configurationAt("properties.cell"));
    }

    if (headerProperties != null) {
        configuration.addProperty("properties.header", "");

        headerProperties.saveSettings(configuration.configurationAt("properties.header"));
    }
}

From source file:com.eyeq.pivot4j.impl.PivotModelImpl.java

/**
 * @see com.eyeq.pivot4j.state.Configurable#saveSettings(org.apache.commons.configuration.HierarchicalConfiguration)
 *//*from w ww  .  j av a 2  s  .  c  o m*/
@Override
public synchronized void saveSettings(HierarchicalConfiguration configuration) {
    if (configuration == null) {
        throw new NullArgumentException("configuration");
    }

    if (configuration.getLogger() == null) {
        configuration.setLogger(LogFactory.getLog(getClass()));
    }

    if (isInitialized()) {
        configuration.addProperty("mdx", getCurrentMdx());
    } else {
        configuration.addProperty("mdx", mdxQuery);
    }

    if (sorting) {
        configuration.addProperty("sort[@enabled]", sorting);

        if (queryAdapter.getQuaxToSort() != null) {
            configuration.addProperty("sort[@ordinal]", queryAdapter.getQuaxToSort().getOrdinal());
        }

        if (sortCriteria != null) {
            configuration.addProperty("sort[@criteria]", sortCriteria.name());
            configuration.addProperty("sort[@topBottomCount]", topBottomCount);
            if (isSorting() && sortPosMembers != null) {
                int index = 0;
                for (Member member : sortPosMembers) {
                    configuration.addProperty(String.format("sort.member(%s)", index++),
                            member.getUniqueName());
                }
            }
        }
    }
}

From source file:org.pivot4j.impl.PivotModelImpl.java

/**
 * @see org.pivot4j.state.Configurable#saveSettings(org.apache.commons.configuration.HierarchicalConfiguration)
 */// ww w  .ja v a 2  s .c  om
@Override
public synchronized void saveSettings(HierarchicalConfiguration configuration) {
    if (configuration == null) {
        throw new NullArgumentException("configuration");
    }

    if (configuration.getLogger() == null) {
        configuration.setLogger(LogFactory.getLog(getClass()));
    }

    if (isInitialized()) {
        configuration.addProperty("mdx", getCurrentMdx());
    } else {
        configuration.addProperty("mdx", mdxQuery);
    }

    if (sorting) {
        configuration.addProperty("sort[@enabled]", sorting);

        if (queryAdapter.getQuaxToSort() != null) {
            configuration.addProperty("sort[@ordinal]", queryAdapter.getQuaxToSort().getOrdinal());
        }

        if (sortCriteria != null) {
            configuration.addProperty("sort[@criteria]", sortCriteria.name());
            configuration.addProperty("sort[@topBottomCount]", topBottomCount);
            if (isSorting() && sortPosMembers != null) {
                int index = 0;
                for (Member member : sortPosMembers) {
                    configuration.addProperty(String.format("sort.member(%s)", index++),
                            member.getUniqueName());
                }
            }
        }
    }

    if (queryAdapter != null && queryAdapter.isAxesSwapped()) {
        configuration.addProperty("axesSwapped", true);
    }

    // TODO This setting can potentially be present in the
    // pivot4j-config.xml, in which case, it would be saved with the report
    // thus making subsequent changing of the default value ineffective.
    // We should wait till we find a way to handle such a scenario better
    // later.
    //
    // if (defaultNonEmpty) {
    // configuration.addProperty("nonEmpty[@default]", true);
    // }
}

From source file:org.pivot4j.ui.AbstractPivotRenderer.java

/**
 * @see org.pivot4j.ui.property.DefaultRenderPropertyList#saveSettings(org.apache.commons.configuration.HierarchicalConfiguration)
 *//* w w  w.j a va  2 s .  c o  m*/
@Override
public void saveSettings(HierarchicalConfiguration configuration) {
    if (configuration == null) {
        throw new NullArgumentException("configuration");
    }

    configuration.setDelimiterParsingDisabled(true);

    if (configuration.getLogger() == null) {
        configuration.setLogger(LogFactory.getLog(getClass()));
    }

    configuration.addProperty("drillDown[@mode]", drillDownMode);
    configuration.addProperty("drillDown[@enabled]", enableDrillDown);

    configuration.addProperty("sort[@enabled]", enableSort);

    if (sortMode != null) {
        configuration.addProperty("sort[@mode]", sortMode.getName());
    }

    configuration.addProperty("drillThrough[@enabled]", enableDrillThrough);

    if (!aggregatorNames.isEmpty()) {
        int index = 0;

        for (AggregatorKey key : aggregatorNames.keySet()) {
            Axis axis = key.getAxis();
            AggregatorPosition position = key.getPosition();

            List<String> names = aggregatorNames.get(key);

            for (String name : names) {
                configuration.addProperty(String.format("aggregations.aggregation(%s)[@name]", index), name);
                configuration.addProperty(String.format("aggregations.aggregation(%s)[@axis]", index),
                        axis.name());
                configuration.addProperty(String.format("aggregations.aggregation(%s)[@position]", index),
                        position.name());

                index++;
            }
        }
    }

    for (String category : renderProperties.keySet()) {
        RenderPropertyList properties = renderProperties.get(category);

        if (properties != null) {
            String propertyConfigName = "properties." + category;

            configuration.addProperty(propertyConfigName, "");

            properties.saveSettings(configuration.configurationAt(propertyConfigName));
        }
    }

    configuration.addProperty("filter[@visible]", renderSlicer);
}