All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.memority.citadel.shared.api.im.I18nKeys Maven / Gradle / Ivy

Go to download

This artifact provides the API classes that are necessary to implement general configuration Rules on the Memority IM platform.

There is a newer version: 3.43.1
Show newest version
/*
 * Copyright (c) 2016-2023 Memority. All Rights Reserved.
 *
 * This file is part of Memority Citadel API , a Memority project.
 *
 * This file is released under the Memority Public Artifacts End-User License Agreement,
 * see 
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 */
package com.memority.citadel.shared.api.im;

/**
 * This class holds constants and utility method that describe and help enforce i18n conventions related to the
 * IM model.
 */
public abstract class I18nKeys {
    public final static String SCHEMA_PREFIX = "ui.model";
    public final static String ATTRIBUTE_PREFIX = SCHEMA_PREFIX + ".attributes";
    public final static String FIELD_PREFIX = SCHEMA_PREFIX + ".fields";
    public final static String IDENTITY_TYPES_PREFIX = SCHEMA_PREFIX + ".identityType";
    public final static String ORGANIZATION_TYPES_PREFIX = SCHEMA_PREFIX + ".organizationType";
    public final static String RESOURCE_TYPES_PREFIX = SCHEMA_PREFIX + ".resourceType";
    public final static String ROLE_TYPES_PREFIX = SCHEMA_PREFIX + ".roleType";
    public final static String ROLE_PUBLICATION_TYPES_PREFIX = SCHEMA_PREFIX + ".rolePublicationType";

    /**
     * Return the base i18n prefix for the given attributeId.
     *
     * @param attributeId the attribute id
     * @return the base prefix, to be built upon
     */
    public static String attributePrefix(String attributeId) {
        return ATTRIBUTE_PREFIX + "." + attributeId;
    }

    /**
     * Return the base i18n prefix for the given fieldId.
     *
     * @param fieldId the field id
     * @return the base prefix, to be built upon
     */
    public static String fieldPrefix(String fieldId) {
        return FIELD_PREFIX + "." + fieldId;
    }

    /**
     * Return the base i18n prefix for the given identityTypeId.
     *
     * @param identityTypeId the identity type id
     * @return the base prefix, to be built upon
     */
    public static String identityTypePrefix(String identityTypeId) {
        return IDENTITY_TYPES_PREFIX + "." + identityTypeId;
    }

    /**
     * Return the base i18n prefix for the given organizationTypeId.
     *
     * @param organizationTypeId the organization type id
     * @return the base prefix, to be built upon
     */
    public static String organizationTypePrefix(String organizationTypeId) {
        return ORGANIZATION_TYPES_PREFIX + "." + organizationTypeId;
    }

    /**
     * Return the base i18n prefix for the given resourceTypeId.
     *
     * @param resourceTypeId the resource type id
     * @return the base prefix, to be built upon
     */
    public static String resourceTypePrefix(String resourceTypeId) {
        return RESOURCE_TYPES_PREFIX + "." + resourceTypeId;
    }

    /**
     * Return the base i18n prefix for the given roleTypeId.
     *
     * @param roleTypeId the role type id
     * @return the base prefix, to be built upon
     */
    public static String roleTypePrefix(String roleTypeId) {
        return ROLE_TYPES_PREFIX + "." + roleTypeId;
    }

    /**
     * Return the base i18n prefix for the given rolePublicationTypeId.
     *
     * @param rolePublicationTypeId the role publication type id
     * @return the base prefix, to be built upon
     */
    public static String rolePublicationTypePrefix(String rolePublicationTypeId) {
        return ROLE_PUBLICATION_TYPES_PREFIX + "." + rolePublicationTypeId;
    }

    /**
     * Return the base i18n prefix for the given attributeId.
     *
     * @param relationName the relation name
     * @param attributeId the role type id
     * @return the base prefix, to be built upon
     */
    public static String complexAttributeValueAttributePrefix(String relationName, String attributeId) {
        return SCHEMA_PREFIX + "." + relationName + ".attributes." + attributeId + ".values";
    }

    /**
     * Return the base prefix for the choice values of the given attributeId.
     *
     * @param attributeId the attribute id
     * @return the base prefix, to hold values
     */
    public static String attributeValuesPrefix(String attributeId) {
        return attributePrefix(attributeId) + ".values";
    }

    /**
     * Return the base prefix for the choice values of the given fieldId.
     *
     * @param fieldId the field id
     * @return the base prefix, to hold values
     */
    public static String fieldValuesPrefix(String fieldId) {
        return fieldPrefix(fieldId) + ".values";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy