Search in sources :

Example 1 with ExpandoBridge

use of com.liferay.portlet.expando.model.ExpandoBridge in project liferay-ide by liferay.

the class OAuthTokenModelImpl method setExpandoBridgeAttributes.

@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
    ExpandoBridge expandoBridge = getExpandoBridge();
    expandoBridge.setAttributes(serviceContext);
}
Also used : ExpandoBridge(com.liferay.portlet.expando.model.ExpandoBridge)

Example 2 with ExpandoBridge

use of com.liferay.portlet.expando.model.ExpandoBridge in project liferay-ide by liferay.

the class KBTemplateModelImpl method setExpandoBridgeAttributes.

@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
    ExpandoBridge expandoBridge = getExpandoBridge();
    expandoBridge.setAttributes(serviceContext);
}
Also used : ExpandoBridge(com.liferay.portlet.expando.model.ExpandoBridge)

Example 3 with ExpandoBridge

use of com.liferay.portlet.expando.model.ExpandoBridge in project liferay-ide by liferay.

the class KBArticleModelImpl method setExpandoBridgeAttributes.

@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
    ExpandoBridge expandoBridge = getExpandoBridge();
    expandoBridge.setAttributes(serviceContext);
}
Also used : ExpandoBridge(com.liferay.portlet.expando.model.ExpandoBridge)

Example 4 with ExpandoBridge

use of com.liferay.portlet.expando.model.ExpandoBridge in project liferay-ide by liferay.

the class KBFolderModelImpl method setExpandoBridgeAttributes.

@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
    ExpandoBridge expandoBridge = getExpandoBridge();
    expandoBridge.setAttributes(serviceContext);
}
Also used : ExpandoBridge(com.liferay.portlet.expando.model.ExpandoBridge)

Example 5 with ExpandoBridge

use of com.liferay.portlet.expando.model.ExpandoBridge in project sw360portal by sw360.

the class CustomFieldHelper method ensureUserCustomFieldExists.

private static void ensureUserCustomFieldExists(com.liferay.portal.model.User liferayUser, String customFieldName, int customFieldType) throws PortalException, SystemException {
    ExpandoBridge exp = liferayUser.getExpandoBridge();
    if (!exp.hasAttribute(customFieldName)) {
        exp.addAttribute(customFieldName, customFieldType, false);
        long companyId = liferayUser.getCompanyId();
        ExpandoColumn column = ExpandoColumnLocalServiceUtil.getColumn(companyId, exp.getClassName(), ExpandoTableConstants.DEFAULT_TABLE_NAME, customFieldName);
        String[] roleNames = new String[] { RoleConstants.USER, RoleConstants.POWER_USER };
        for (String roleName : roleNames) {
            Role role = RoleLocalServiceUtil.getRole(companyId, roleName);
            if (role != null && column != null) {
                ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(column.getColumnId()), role.getRoleId(), new String[] { ActionKeys.VIEW, ActionKeys.UPDATE });
            }
        }
    }
}
Also used : Role(com.liferay.portal.model.Role) ExpandoColumn(com.liferay.portlet.expando.model.ExpandoColumn) ExpandoBridge(com.liferay.portlet.expando.model.ExpandoBridge)

Aggregations

ExpandoBridge (com.liferay.portlet.expando.model.ExpandoBridge)14 PortalException (com.liferay.portal.kernel.exception.PortalException)2 SystemException (com.liferay.portal.kernel.exception.SystemException)2 JSONObject (com.liferay.portal.kernel.json.JSONObject)1 Role (com.liferay.portal.model.Role)1 ExpandoColumn (com.liferay.portlet.expando.model.ExpandoColumn)1 Serializable (java.io.Serializable)1 LinkedHashMap (java.util.LinkedHashMap)1