nsIAbLDAPAttributeMap
| IID: | bc543118-db5d-4616-b2d4-9a8667609a7c |
| Inherits From: | nsISupports |
A mapping between addressbook properties and ldap attributes.
Each addressbook property can map to one or more attributes. If there is no entry in preferences for a field, the getters generally return null; empty strings are passed through as usual. The intent is that properties with a non-zero number of attributes can be overridden for a specific server by supplying a zero-length string. For this to work, most callers are likely to want to check for both success and a non-empty string.
Note that the one exception to this pattern is getAttributes, which throws NS_ERROR_FAILURE for non-existent property entries, since XPConnect doesn't like returning null arrays.
Note that each LDAP attribute can map to at most one addressbook property. The checkState method is a useful tool in enforcing this. Failure to enforce it may make it impossible to guarantee that getProperty will do something consistent and reasonable.
Maybe someday once we support ldap autoconfig stuff (ie draft-joslin-config-schema-11.txt), we can simplify this and other code and only allow a property to map to a single attribute.
Methods
void checkState ( )
ACString getAllCardAttributes ( )
void getAllCardProperties ( out PRUint32 count , out arrayof char* props )
ACString getAttributeList ( ACString property )
void getAttributes ( ACString property , out PRUint32 count , out arrayof char* attrs )
ACString getFirstAttribute ( ACString property )
ACString getProperty ( ACString attribute )
void setAttributeList ( ACString property , ACString attributeList , PRBool allowInconsistencies )
void setCardPropertiesFromLDAPMessage ( nsILDAPMessage message , nsIAbCard card )
void setFromPrefs ( ACString prefBranchName )
ACString getAllCardAttributes ( )
Get all attributes that may be used in an addressbook card via this property map (used for passing to to an LDAP search when you want everything that could be in a card returned).
- Returns:
- a comma-separated list of attribute names
void getAllCardProperties ( out PRUint32 count , out arrayof char* props )
Get all properties that may be used in an addressbook card via this property map.
- Arguments:
- count
- props
- Returns:
- an array of properties
ACString getAttributeList ( ACString property )
Get all the LDAP attributes associated with a given property name, in order of precedence (highest to lowest).
- Arguments:
- property: the address book property to return attrs for
- Returns:
- a comma-separated list of attributes, null if no entry is present
void getAttributes ( ACString property , out PRUint32 count , out arrayof char* attrs )
Get all the LDAP attributes associated with a given property name, in order of precedence (highest to lowest).
- Arguments:
- property: the address book property to return attrs for
- count
- attrs
- Returns:
- an array of attributes
ACString getFirstAttribute ( ACString property )
Get the first (canonical) LDAP attribute associated with a given property name
- Arguments:
- property: the address book property to return attrs for
- Returns:
- the first attribute associated with a given property, null if there is no entry for this property
ACString getProperty ( ACString attribute )
Find the Mozilla addressbook property name that this attribute should map to.
- Arguments:
- attribute
- Returns:
- the addressbook property name, null if it's not used in the map
void setAttributeList ( ACString property , ACString attributeList , PRBool allowInconsistencies )
Set an existing mapping to the comma-separated list of attributes.
- Arguments:
- property: the mozilla addressbook property name
- attributeList: a comma-separated list of attributes in order of precedence from high to low
- allowInconsistencies: allow changes that would result in a map with an LDAP attribute associated with more than one property. Useful for doing a bunch of sets at once, and calling checkState at the end.
void setCardPropertiesFromLDAPMessage ( nsILDAPMessage message , nsIAbCard card )
Set the properties on an addressbook card from the given LDAP message using the map in this object.
- Arguments:
- message: is the LDAP message to get the values from
- card: is the card object whose values are to be set
void setFromPrefs ( ACString prefBranchName )
Set any attributes specified in the given prefbranch on this object.
- Arguments:
- prefBranchName: the pref branch containing all the property names
References
This interface is the type of the following properties:
nsIAbLDAPDirectory.attributeMap
This interface is passed as an argument to the following methods:
nsIAbLDAPCard.buildRdn, nsIAbLDAPCard.getLDAPMessageInfo
This interface is returned from the following methods:
nsIAbLDAPAttributeMapService.getMapForPrefBranch
Reference documentation is generated from Mozilla's source.
