You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Merve Temizer <me...@gmail.com> on 2012/10/23 13:55:10 UTC

Custom objects

I could define several object model by writing specs of its attributes into
an ldif file and import them into schema.

Now i want to ask

Can i define object models like a map, which contains keys and their
values, but keys are not hard coded, modifiable like values.

Or is there an attribute type which can contain keys and values map in it?

Re: Custom objects

Posted by Jim Willeke <ji...@willeke.com>.
We often use a really simple idea for string objects.
Create a custom "keyList" object.
named by cn.
The cn then is the key.

We add the "l, localityname" as a may attribute.

So we now have a entry like:
dn: cn=CR,ou=jobcodes,ou=EmpTypeCodes,ou=ouofours,o=org
...
cn: CR
description: Entries are used for lookups by the By JobCode.
l: 0384
l: 1137

So we can easily do a search like:
# command line : ldapsearch -h server.com -x .... -b
"ou=jobcodes,ou=EmpTypeCodes,ou=ouofours,o=org" -s sub -a always -z 1000
"(l=1137)" "cn"
where l is the value of the jobCode and it returns the cn value which is
the description.

This may not fit the specific conditions you need, but a lot can be done
with in the DIT structure by simple means.

--
-jim
Jim Willeke


On Tue, Oct 23, 2012 at 8:13 AM, Emmanuel Lécharny <el...@gmail.com>wrote:

> Le 10/23/12 1:55 PM, Merve Temizer a écrit :
>
>  I could define several object model by writing specs of its attributes
>> into
>> an ldif file and import them into schema.
>>
>> Now i want to ask
>>
>> Can i define object models like a map, which contains keys and their
>> values, but keys are not hard coded, modifiable like values.
>>
>> Or is there an attribute type which can contain keys and values map in it?
>>
>>  Three things :
> - Attributes can contain opaque values : as soon as your client know how
> to deserialize the data, you are good. Just be sure to use an OCTET_STRING
> syntax
> - If you want to be able to do fancy things like indexing, ordering, etc,
> you will need to extend the schema by adding an LdapSyntax, the needed
> MatchingRules, associated with the Comparator that will be used.
> - Or you can store a plain Java object using the java schema, which
> contains the javaSerializedData (OID: 1.3.6.1.4.1.42.2.27.4.1.8) to store
> things like a Map.
>
> Hope it helps...
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Re: Custom objects

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 10/23/12 1:55 PM, Merve Temizer a écrit :
> I could define several object model by writing specs of its attributes into
> an ldif file and import them into schema.
>
> Now i want to ask
>
> Can i define object models like a map, which contains keys and their
> values, but keys are not hard coded, modifiable like values.
>
> Or is there an attribute type which can contain keys and values map in it?
>
Three things :
- Attributes can contain opaque values : as soon as your client know how 
to deserialize the data, you are good. Just be sure to use an 
OCTET_STRING syntax
- If you want to be able to do fancy things like indexing, ordering, 
etc, you will need to extend the schema by adding an LdapSyntax, the 
needed MatchingRules, associated with the Comparator that will be used.
- Or you can store a plain Java object using the java schema, which 
contains the javaSerializedData (OID: 1.3.6.1.4.1.42.2.27.4.1.8) to 
store things like a Map.

Hope it helps...


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com