Re: Change of name forms and DIT structure rules when renaming an entry

Steven Legg <[email protected]> Fri, 22 Aug 2008 16:09:11 +1000
Newsgroups gmane.ietf.ldapbis
Message-ID <[email protected]>
Michael,

Michael Str=F6der wrote:
> Steven,
>=20
> I really appreciate your comment.
>=20
> Steven Legg wrote:
>>
>> Michael Str=F6der wrote:
>>> when displaying an input form for renaming an entry I'd like to let=20
>>> the user search for possible new superior DNs. If applicable I'd like=
=20
>>> to construct the search filter derived from applicable DIT structure=20
>>> rules.
>>> So the question is how to find the structural object classes which=20
>>> are allowed for superior entries.
>>>
>>> X.501 (1993) section 12.6.5 says:
>>> "Each object and alias entry is governed by a single DIT structure=20
>>> rule."
>>>
>>> Currently I determine the governing structure rule by looking up the=20
>>> best matching name form for 1. the structural object class and 2. the=
=20
>>> current old RDN.
>>
>> In general, you also need the governingStructureRule of the current
>> superior entry,
>=20
> You mean I could derive the possible structural object class from the=20
> governingStructureRule of the superior entry?

I was just making the point that an entry's governingStructureRule also
depends on the governingStructureRule of its superior. However, you don't
need to know the current governingStructureRule of the entry or its super=
ior.

 > Hmm, there could be more
> possible structural object classes of superior entries.
>=20
>> but it is easier to just look at the governingStructureRule
>> of the entry to be moved.
>=20
> That's how I currently implemented it.
>=20
>> Ultimately though, the governingStructureRule
>> of the entry to be moved doesn't matter.
>=20
> ...because the RDN could also change...

... because it only tells you about one valid possibility for a new
superior. There can be others. Clearly, the entry could be moved
under any new superior (in the same subschema administrative area)
that has the same governingStructureRule as its old superior, provided
the moving entry's naming attributes are not changed, because the
structural object class, name form and superior entry
governingStructureRule will all be the same in the new location.
If the moving entry was schema-valid before the move it will be
schema-valid after the move. By examining the name forms and structure
rules in the schema it is possible to work out what other
possibilities are valid, but they may necessitate a change to the
naming attributes and may cause the governingStructureRule of the moved
entry to change. The current governingStructureRule of the entry
to be moved doesn't affect what's a valid possibility and what's not.

The possibilities in the schema boil down to a collection of pairs
where the first item is an acceptable governingStructureRule value
for a new superior and the second item is an acceptable name form
for the entry to be moved, i.e., the first item tells you where the entry
can go and the second item tells you whether the RDN needs to change.

>=20
>>  > Then I can derive the possible superior structure rules
>>> and lookup the superior structural object classes via the=20
>>> accompanying name forms.
>>>
>>> But now I wonder what to do in case the user wants to change the RDN=20
>>> together with a new superior DN in one rename operation? From my=20
>>> understanding changing the RDN could lead to another governing=20
>>> structure rule. Is that right?
>>
>> Yes, it could. In the general case the structural object class of the
>> entry being renamed/moved would permit a number of candidate name
>> forms, each with its own set of mandatory and optional naming
>> attributes. For each name form, the structure rules specify the
>> permitted governingStructureRule values for the new superior entry of
>> the entry being renamed/moved. The structuralObjectClass of the
>> superior entries doesn't come into it directly, but can be determined
>>  from the name form associated with the structure rule corresponding
>> to each of the permitted values for the governingStructureRule of the
>> new superior.
>=20
> I could sort this out since I already have working code for determining=
=20
> the current name form of an entry and for determining the=20
> governingStructureRule. Not sure how to come up with a good user=20
> interface for that though.
>=20
> Thinking about this a little bit more I came up with another difficulty=
:=20
> The new superior DN might reside in a part of the DIT where another=20
> subschema is defined. So this is a real blocker.

It means that the search filter is only valid within the scope of the
subschema used to form it. It's rare for a single server to have more tha=
n
one subschema area, so you could make that simplifying assumption, but in
the more general case it means emitting one search for each subschema are=
a
the client knows about. It would help to ask for the subschemaSubentry to=
 be
returned so that matched entries that are not in the expected subschema a=
rea
can be detected and ignored. Depending on the server implementation, you
might be able to put a subschemaSubentry equality assertion in the search
filter.

>=20
>> If you allow the user to select the new superior first, then that will
>> constrain which name forms are available to rename the entry. If you=20
>> allow
>> the user to rename the entry first (explicitly or implicitly selecting=
=20
>> one
>> of the applicable name forms), then that will constrain which new=20
>> superior
>> entries are available.
>=20
> Yes. But the problem is that it might be necessary for the user to=20
> change both in one rename operation.

I was assuming one operation, but allowing that it might be put together
in a multi-step interaction at the user interface. Which step the user
takes first constrains what can be done on the second step, but it isn't
until after the second step that the "save" button gets clicked.

Presenting the user with a list of (superior DN, eligible naming attribut=
e
types) pairs to choose from would be one way of combining both steps in a=
 single
action. Of course, if the naming attribute types in the selection are dif=
ferent
from the current naming attributes, the user interface should enter a scr=
een
to have the user edit them before allowing the operation to be submitted.

 > From my understanding changing the
> name form could lead to the situation where the old superior is not=20
> valid anymore.

Correct.

>=20
> This all gets very hairy. At the moment I can't imagine a user interfac=
e=20
> which really helps the user to do the right thing without the user=20
> knowing a lot about how DIT structure rules and name forms work.

The governing structure rules are determined by structural object classes
and name forms. A name form is basically a set of naming attributes, so
the object class and "what attributes are used for naming" are all that
the user really needs to be exposed to.

>=20
> I will take a simpler approach with client-side configuration. Probably=
=20
> I will display a pre-configured select list of named LDAP URLs for=20
> searching the new superior entries. This would also work with servers=20
> which don't support DIT structure rules and name forms.

Whether or not you get back governingStructureRule is probably an accurat=
e
test of whether the server supports structure rules and name forms.

Regards,
Steven

>=20
> Ciao, Michael.