summaryrefslogtreecommitdiffstats
path: root/base/server/cmscore/src/com/netscape/cmscore/dbs/LDAPDatabase.java
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2014-08-25 10:27:09 -0400
committerEndi S. Dewata <edewata@redhat.com>2014-08-26 11:04:02 -0400
commit8e464b6ba5d83d7915978db5841967f20672dfd0 (patch)
tree36662b6cec8b52bbcab68abc8612574924161514 /base/server/cmscore/src/com/netscape/cmscore/dbs/LDAPDatabase.java
parent20b9d956aab21a5a2a61162e6c88fbee5828a9e9 (diff)
downloadpki-8e464b6ba5d83d7915978db5841967f20672dfd0.tar.gz
pki-8e464b6ba5d83d7915978db5841967f20672dfd0.tar.xz
pki-8e464b6ba5d83d7915978db5841967f20672dfd0.zip
Fixed problem emptying a field in TPS UI.
Previously emptying a field in TPS UI could not be saved because the change was not saved and sent to the server. The UI framework now has been fixed to save and send the empty field to the server such that the database can be updated properly. Additional parameters have been added to the tps-token-mod command to modify all editable fields. Ticket #1085
Diffstat (limited to 'base/server/cmscore/src/com/netscape/cmscore/dbs/LDAPDatabase.java')
-rw-r--r--base/server/cmscore/src/com/netscape/cmscore/dbs/LDAPDatabase.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/base/server/cmscore/src/com/netscape/cmscore/dbs/LDAPDatabase.java b/base/server/cmscore/src/com/netscape/cmscore/dbs/LDAPDatabase.java
index 650a65ea9..cfe958807 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/dbs/LDAPDatabase.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/dbs/LDAPDatabase.java
@@ -141,19 +141,31 @@ public abstract class LDAPDatabase<E extends IDBObj> extends Database<E> {
@Override
public void updateRecord(String id, E record) throws Exception {
+
CMS.debug("LDAPDatabase: updateRecord(\"" + id + "\")");
+
try (IDBSSession session = dbSubsystem.createSession()) {
String dn = createDN(id);
+ CMS.debug("LDAPDatabase: dn: " + dn);
+ CMS.debug("LDAPDatabase: changetype: modify");
ModificationSet mods = new ModificationSet();
for (Enumeration<String> names = record.getSerializableAttrNames(); names.hasMoreElements(); ) {
String name = names.nextElement();
Object value = record.get(name);
+ CMS.debug("LDAPDatabase: replace: " + name);
+ CMS.debug("LDAPDatabase: " + name + ": " + value);
+ CMS.debug("LDAPDatabase: -");
mods.add(name, Modification.MOD_REPLACE, value);
}
- CMS.debug("LDAPDatabase: modifying " + dn);
session.modify(dn, mods);
+ CMS.debug("LDAPDatabase: modification completed");
+
+ } catch (Exception e) {
+ CMS.debug("LDAPDatabase: modification failed");
+ CMS.debug(e);
+ throw e;
}
}