Skip to content

Commit

Permalink
setting xml updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jrivard committed Nov 18, 2015
1 parent 432782e commit bbaf6d5
Show file tree
Hide file tree
Showing 6 changed files with 543 additions and 529 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@
<artifactId>jdom2</artifactId>
<version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.12.1.1</version>
</dependency>
</dependencies>

<repositories>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/password/pwm/config/PwmSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -1134,15 +1134,15 @@ public StoredValue getDefaultValue(final PwmSettingTemplate template)
return defaultValues.keySet().iterator().next(); // return top if no template matches.
}

public Map<PwmSettingTemplate, String> getDefaultValueDebugStrings(final Locale locale)
public Map<PwmSettingTemplate, String> getDefaultValueDebugStrings(final Locale locale, final PwmSettingTemplate.Type templateType)
throws PwmOperationalException, PwmUnrecoverableException
{
final Map<PwmSettingTemplate, String> returnObj = new LinkedHashMap<>();
final String defaultDebugStr = this.getDefaultValue(PwmSettingTemplate.DEFAULT).toDebugString(locale);
boolean hasNonDefaultValue = false;
if (defaultDebugStr != null) {
for (final PwmSettingTemplate template : PwmSettingTemplate.valuesOrderedByLabel(locale)) {
if (!template.isHidden()) {
if (!template.isHidden() && template.getType() == templateType) {
final String debugStr = this.getDefaultValue(template).toDebugString(locale);
if (!defaultDebugStr.equals(debugStr)) {
hasNonDefaultValue = true;
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/password/pwm/http/ContextManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ private enum ContextParameter {
configurationFile,
}

private final static String UNSPECIFIED_VALUE = "unspecified";

public ContextManager(ServletContext servletContext) {
this.servletContext = servletContext;
this.instanceGuid = PwmRandom.getInstance().randomUUID().toString();
Expand Down Expand Up @@ -367,9 +369,16 @@ public int getRestartCount()
public File locateConfigurationFile(final File applicationPath)
throws Exception
{
final String configurationFileSetting = servletContext.getInitParameter(
String configurationFileSetting = servletContext.getInitParameter(
ContextParameter.configurationFile.toString());

if (configurationFileSetting == null
|| configurationFileSetting.trim().isEmpty()
|| UNSPECIFIED_VALUE.equalsIgnoreCase(configurationFileSetting.trim())
) {
configurationFileSetting = PwmConstants.DEFAULT_CONFIG_FILE_FILENAME;
}

try {
File file = new File(configurationFileSetting);
if (file.isAbsolute()) {
Expand Down Expand Up @@ -402,7 +411,7 @@ public String readApplicationPath() {
ContextParameter.applicationPath.toString());

if (contextAppPathSetting != null && !contextAppPathSetting.isEmpty()) {
if (!"unspecified".equalsIgnoreCase(contextAppPathSetting)) {
if (!UNSPECIFIED_VALUE.equalsIgnoreCase(contextAppPathSetting)) {
return contextAppPathSetting;
}
}
Expand Down
Loading

0 comments on commit bbaf6d5

Please sign in to comment.