[yast-commit] r48622 - in /trunk/ldap-server/src: agent/SlapdConfigAgent.cc lib/backConfigTest.cpp lib/backConfigTest.h tree_structure.ycp
Author: rhafer Date: Fri Jun 27 15:58:54 2008 New Revision: 48622 URL: http://svn.opensuse.org/viewcvs/yast?rev=48622&view=rev Log: Add Index support Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc trunk/ldap-server/src/lib/backConfigTest.cpp trunk/ldap-server/src/lib/backConfigTest.h trunk/ldap-server/src/tree_structure.ycp Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfig... ============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Fri Jun 27 15:58:54 2008 @@ -389,8 +389,13 @@ std::vector<IndexType>::const_iterator k = j->second.begin(); for ( ; k != j->second.end(); k++ ) { - if ( *k == Eq ) + if ( *k == Eq ){ ycpIdx.add(YCPString("eq"), YCPBoolean(true) ); + } else if ( *k == Present ){ + ycpIdx.add(YCPString("pres"), YCPBoolean(true) ); + } else if ( *k == Sub ){ + ycpIdx.add(YCPString("sub"), YCPBoolean(true) ); + } } resMap.add( YCPString(j->first), ycpIdx ); } Modified: trunk/ldap-server/src/lib/backConfigTest.cpp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/backConfigTes... ============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.cpp (original) +++ trunk/ldap-server/src/lib/backConfigTest.cpp Fri Jun 27 15:58:54 2008 @@ -149,6 +149,7 @@ } } std::cout << "indexString: '" << indexString << "'" << std::endl; + this->addStringValue( "olcDbIndex", indexString ); } void OlcBdbDatabase::setDirectory( const std::string &dir ) @@ -638,6 +639,19 @@ m_dbEntryChanged.replaceAttribute(attr); } +void OlcConfigEntry::addStringValue(const std::string &type, const std::string &value) +{ + const LDAPAttribute *attr = m_dbEntryChanged.getAttributeByName(type); + if ( attr ) { + LDAPAttribute newAttr(*attr); + newAttr.addValue(value); + m_dbEntryChanged.replaceAttribute(newAttr); + } else { + LDAPAttribute newAttr(type, value); + m_dbEntryChanged.addAttribute(newAttr); + } +} + std::string OlcConfigEntry::toLdif() const { std::ostringstream ldifStream; Modified: trunk/ldap-server/src/lib/backConfigTest.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/backConfigTes... ============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.h (original) +++ trunk/ldap-server/src/lib/backConfigTest.h Fri Jun 27 15:58:54 2008 @@ -45,6 +45,7 @@ // shortcuts for single-valued Attributes std::string getStringValue(const std::string &type) const; void setStringValue(const std::string &type, const std::string &value); + void addStringValue(const std::string &type, const std::string &value); void setIndex( int index ); void getEntryDn(); Modified: trunk/ldap-server/src/tree_structure.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/tree_structure.yc... ============================================================================== --- trunk/ldap-server/src/tree_structure.ycp (original) +++ trunk/ldap-server/src/tree_structure.ycp Fri Jun 27 15:58:54 2008 @@ -1000,9 +1000,16 @@ y2milestone("index attr: %1", attr); if ( idx["eq"]:false ) { - y2milestone("eq index"); eqIdx = _("Yes"); } + if ( idx["pres"]:false ) + { + presIdx = _("Yes"); + } + if ( idx["sub"]:false ) + { + substrIdx = _("Yes"); + } newItems = add( newItems, `item( `id(i), attr, presIdx, eqIdx, substrIdx, approxIdx ) ); } ); UI::ChangeWidget( `tab_idx, `Items , newItems ); @@ -1027,8 +1034,8 @@ if ( size(newIdx) > 0 ) { LdapServer::ChangeDatabaseIndex( index, newIdx ); + cb_read_bdb_index(); } - } return true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
rhafer@svn.opensuse.org