RepositoryUtilExtra
  • 02 Nov 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light

RepositoryUtilExtra

  • Dark
    Light

Article summary

Small helpers and utils for repository actions.

Project

com.corzia.comflow.utils

List of methods

getConstantFromValue

Get the name/description of a value in a constant for a column.

ArgumentColumn c, String value, String localeId
ReturnsString with the constant name/description for the value argument

Example of usage

String description = RepositoryUtilExtra.getConstantFromValue(column, "12", "SE_sv");

Code

public static String getConstantFromValue(Column c, String value, String localeId) {
	String[] consts = c.getColumnConstants();
	for (int j = 0; j < consts.length; j++) {
		String constId = c.getColumnConstantId(consts[j]);
		if (consts[j].equals(value)) {
			return RepositoryUtil.getConstant(c.getMetadataId(), constId, localeId);
		}
	}
	return null;
}



Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.