Example usage for com.liferay.portal.kernel.security.permission ResourceActionsUtil getModelResourceNamePrefix

List of usage examples for com.liferay.portal.kernel.security.permission ResourceActionsUtil getModelResourceNamePrefix

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.security.permission ResourceActionsUtil getModelResourceNamePrefix.

Prototype

public static String getModelResourceNamePrefix() 

Source Link

Usage

From source file:com.liferay.asset.util.AssetPublisherAddItemHolder.java

License:Open Source License

/**
 * @see AssetRendererFactory#getTypeName(Locale)
 *//*from  w ww. ja va 2s. co  m*/
private String _getModelResource(ResourceBundle resourceBundle) {
    String modelResourceNamePrefix = ResourceActionsUtil.getModelResourceNamePrefix();

    String key = modelResourceNamePrefix.concat(_name);

    String value = LanguageUtil.get(_locale, key, null);

    if ((value == null) && (resourceBundle != null)) {
        value = ResourceBundleUtil.getString(resourceBundle, key);
    }

    if (value == null) {
        value = _name;
    }

    return value;
}

From source file:jorgediazest.util.model.ModelImpl.java

License:Open Source License

public String getDisplayName(Locale locale) {
    String displayName = ResourceActionsUtil.getModelResource(locale, getClassName());

    if (displayName.startsWith(ResourceActionsUtil.getModelResourceNamePrefix())) {

        return StringPool.BLANK;
    }//from  ww w .ja v  a2  s  . c om

    if (Validator.isNull(this.suffix)) {
        return displayName;
    }

    return displayName + " (" + suffix + ")";
}