Skip to content

IAdmAttributeFriendlyNamesOps

The IAdmAttributeFriendlyNamesOps interface is used to manage property display names.

Inheritance: The IAdmAttributeFriendlyNamesOps interface inherits from the IUnknown interface.

Note

To use the IAdmAttributeFriendlyNamesOps interface, you need to bind to the Configuration Set Settings container using the “ConfigurationSetSettings” alias.

Methods

Details

GetLanguages()

Returns an array of languages, for which property display names are specified. Each language in the array is represented by an ISO 639-2 three-letter code (e.g. deu).

String[] GetLanguages()

GetAttributeFriendlyNames()

Returns an array of property display names specified for the given language.

IAdmAttributeFriendlyNames[] GetAttributeFriendlyNames(String language, 
                                                       ADM_GETATTRFRIENDLYNAMESMODE_ENUM friendlyNamesType)

Parameters

  • language - Specifies the ISO 639-2 three-letter code of the language (e.g. deu) for which to return property display names.
  • friendlyNamesType - Specifies what property display names to return. You can retrieve built-in property display names provided out of the box, modified property display names or a merged array of modified and built-in property display names.

SetAttributeFriendlyNames()

Sets property display names for the given language.

void SetAttributeFriendlyNames(String language, IAdmAttributeFriendlyNames[] friendlyNames)

Parameters

  • language - Specifies the ISO 639-2 three-letter code of the language (e.g. deu).
  • friendlyNames - Specifies an array of property display names.

Remarks

To save the changes, call IADs::SetInfo after calling this method.

Examples

The following code sample sets a display name for the CustomAttributeText1 property.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

# Bind to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

# Bind to the 'Configuration Set Settings' container
$settingsPath = $admService.Backend.GetConfigurationContainerPath(`
    "ConfigurationSetSettings")
$settingsContainer = $admService.OpenObject($settingsPath, $NULL, $NULL, 0)

# Specify property display name
$attributeFriendlyNames = New-Object "Softerra.Adaxes.Management.AdmAttributeFriendlyNames"
$attributeFriendlyNames.AttributeName = "adm-CustomAttributeText1"
$attributeFriendlyNames.GenericFriendlyName = "Details"

# Get property display names
[System.Array]$displayNames = $settingsContainer.GetAttributeFriendlyNames("eng",
    "ADM_GETATTRFRIENDLYNAMESMODE_USERDEF") | Where-Object {$_.AttributeName -ne "adm-CustomAttributeText1"}

# Add new property display name
$displayNames += $attributeFriendlyNames

# Save the changes
$settingsContainer.SetAttributeFriendlyNames("eng", $displayNames)
$settingsContainer.SetInfo()
using System;
using System.Collections.Generic;
using System.Linq;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi;
using Softerra.Adaxes.Interop.Adsi.Management;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;
using Softerra.Adaxes.Management;

class Program
{
    static void Main(string[] args)
    {
        // Connect to the Adaxes service
        AdmNamespace adsNS = new AdmNamespace();
        IAdmService admService = adsNS.GetServiceDirectly("localhost");

        // Bind to the 'Configuration Set Settings' container
        string settingsPath = admService.Backend.GetConfigurationContainerPath(
            "ConfigurationSetSettings");
        IAdmAttributeFriendlyNamesOps settingsContainer =
            (IAdmAttributeFriendlyNamesOps)admService.OpenObject(settingsPath, null, null, 0);

        // Specify property display name
        IAdmAttributeFriendlyNames attributeFriendlyNames = new AdmAttributeFriendlyNames();
        attributeFriendlyNames.AttributeName = "adm-CustomAttributeText1";
        attributeFriendlyNames.GenericFriendlyName = "Details";

        // Get property display names
        List<IAdmAttributeFriendlyNames> displayNames =
            settingsContainer.GetAttributeFriendlyNames(
            "eng", ADM_GETATTRFRIENDLYNAMESMODE_ENUM.ADM_GETATTRFRIENDLYNAMESMODE_USERDEF).ToList();
        displayNames.RemoveAll(displayName => string.Equals(
            displayName.AttributeName, "adm-CustomAttributeText1",
            StringComparison.CurrentCultureIgnoreCase));

        // Add new property display name
        displayNames.Add(attributeFriendlyNames);

        // Save the changes
        settingsContainer.SetAttributeFriendlyNames("eng", displayNames.ToArray());
        IAdmTop settingsContainer2 = (IAdmTop)settingsContainer;
        settingsContainer2.SetInfo();
    }
}

Requirements

Minimum required version: 2018.1

See also