MIFOSX-2043 Adding new Database column 'key' to password preferences to support localization of description values.

This commit is contained in:
Chandrika
2015-05-14 15:18:28 -04:00
parent 0061e1dd2e
commit 5c8691598e
4 changed files with 18 additions and 7 deletions
+7 -4
View File
@@ -31176,13 +31176,15 @@ GET https://DomainName/api/v1/passwordpreferences/template
[
{
"id": 1,
"description": "Password most be at least 1 character and not more that 50 characters long",
"active": true
"description": "Password must be at least 1 character and not more that 50 characters long",
"active": true,
"key" : "simple"
},
{
"id": 2,
"description": "Password must be at least 6 characters, no more than 50 characters long, must include at least one upper case letter, one lower case letter, one numeric digit and no space",
"active": false
"active": false,
"key" : "secure"
}
]
</code>
@@ -31196,7 +31198,8 @@ GET https://DomainName/api/v1/passwordpreferences/
{
"id": 1,
"description": "Password most be at least 1 character and not more that 50 characters long",
"active": true
"active": true,
"key" : "simple"
}
</code>
</div>
@@ -18,11 +18,13 @@ public class PasswordValidationPolicyData implements Serializable {
private final String description;
@SuppressWarnings("unused")
private final boolean active;
private final String key;
public PasswordValidationPolicyData(final Long id, final Boolean active, final String description) {
public PasswordValidationPolicyData(final Long id, final Boolean active, final String description, final String key) {
this.id = id;
this.active = active;
this.description = description;
this.key = key;
}
}
@@ -56,12 +56,14 @@ public class PasswordValidationPolicyReadPlatformServiceImpl implements Password
final Long id = JdbcSupport.getLong(rs, "id");
final Boolean active = rs.getBoolean("active");
final String description = rs.getString("description");
final String key = rs.getString("key");
return new PasswordValidationPolicyData(id, active, description);
return new PasswordValidationPolicyData(id, active, description, key);
}
public String schema() {
return " pvp.id as id, pvp.active as active, pvp.description as description from m_password_validation_policy pvp";
return " pvp.id as id, pvp.active as active, pvp.description as description, pvp.`key` as `key`"
+ " from m_password_validation_policy pvp";
}
}
@@ -0,0 +1,4 @@
ALTER TABLE `m_password_validation_policy` ADD COLUMN `key` VARCHAR(255) NOT NULL;
UPDATE `m_password_validation_policy` pvp SET pvp.`key`='simple' where pvp.id='1' ;
UPDATE `m_password_validation_policy` pvp SET pvp.`key`='secure' where pvp.id='2' ;