Directory Studio
  1. Directory Studio
  2. DIRSTUDIO-212

Provide support for attribute references for LDIF construction during batch operations

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      The Studio allows one to specify an LDIF changetype fragment to be executed on all entries returned from a search operation. It would be nice to have a more dynamic way to specify attribute values as in the following examples:

      changetype: modify
      replace: homeDirectory
      homeDirectory: /home/$

      {uid}

      changetype: modify
      replace: mail
      mail: ${uid}

      @example.com

      1. dirstudio-212-2.diff
        14 kB
        Martin Alderson
      2. dirstudio-212.diff
        11 kB
        Martin Alderson

        Activity

        Hide
        Martin Alderson added a comment -

        The attached patch is my second shot at this. It will now always search for the referenced attributes, rather than using a cached copy.

        Could someone (Stefan?) check this out again?

        Show
        Martin Alderson added a comment - The attached patch is my second shot at this. It will now always search for the referenced attributes, rather than using a cached copy. Could someone (Stefan?) check this out again?
        Hide
        Martin Alderson added a comment -

        Thanks for checking it out Stefan.

        It is a bit confusing as it is. I'll have a go at reading the attributes on demand. It doesn't look as hard as I first thought!

        Show
        Martin Alderson added a comment - Thanks for checking it out Stefan. It is a bit confusing as it is. I'll have a go at reading the attributes on demand. It doesn't look as hard as I first thought!
        Hide
        Stefan Seelmann added a comment -

        Thanks Martin, looks good.

        As you wrote it works great if the used attributes are already cached or if the search is executed and the necessary attributes are requested. It is also cool that the replacement works in LDIF fragment as well when selecting the 'Modify entries' option.

        However in the case where entries are not cached or attributes were not requested the result is an empty value, which is a bit confusing. Here is an example:
        -------------------------------------------------
        dn: ...
        changetype: modify
        add: description
        description:
        -
        -------------------------------------------------
        Do you think it makes sense to load the missing attributes in such a case?

        Show
        Stefan Seelmann added a comment - Thanks Martin, looks good. As you wrote it works great if the used attributes are already cached or if the search is executed and the necessary attributes are requested. It is also cool that the replacement works in LDIF fragment as well when selecting the 'Modify entries' option. However in the case where entries are not cached or attributes were not requested the result is an empty value, which is a bit confusing. Here is an example: ------------------------------------------------- dn: ... changetype: modify add: description description: - ------------------------------------------------- Do you think it makes sense to load the missing attributes in such a case?
        Hide
        Martin Alderson added a comment -

        The attached dirstudio-212.diff is a possible implementation of this feature based on the current studio trunk.

        Any $

        {name} specified in the modification is replaced with the value of attribute "name" in the source entry. When a search is done the specified attributes are retrieved. When the modification is applied to an entry the cached copy is used. This means the specified attribute(s) will not be found if they have not already been requested or if the entry has not yet been cached. When an attribute is not found the ${name}

        is just ignored (removed).

        I haven't committed this yet as it is my first change to studio - any chance some one could check it out?

        Show
        Martin Alderson added a comment - The attached dirstudio-212.diff is a possible implementation of this feature based on the current studio trunk. Any $ {name} specified in the modification is replaced with the value of attribute "name" in the source entry. When a search is done the specified attributes are retrieved. When the modification is applied to an entry the cached copy is used. This means the specified attribute(s) will not be found if they have not already been requested or if the entry has not yet been cached. When an attribute is not found the ${name} is just ignored (removed). I haven't committed this yet as it is my first change to studio - any chance some one could check it out?
        Hide
        Martin Alderson added a comment -

        I've just been having a look at implementing this. I'm wondering what should be done when the referenced attribute doesn't exist in the entry? I think that to keep it simple for now we should just ignore the reference. In the example this could leave an entry with a mail attribute value of "@example.com". Alternatively we could just not generate the ldif fragment for that entry. Any thoughts?

        Show
        Martin Alderson added a comment - I've just been having a look at implementing this. I'm wondering what should be done when the referenced attribute doesn't exist in the entry? I think that to keep it simple for now we should just ignore the reference. In the example this could leave an entry with a mail attribute value of "@example.com". Alternatively we could just not generate the ldif fragment for that entry. Any thoughts?

          People

          • Assignee:
            Unassigned
            Reporter:
            Ersin Er
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development