Search in sources :

Example 11 with ExpandoBridge

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

the class GadgetModelImpl method setExpandoBridgeAttributes.

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

Example 12 with ExpandoBridge

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

the class OAuthConsumerModelImpl method setExpandoBridgeAttributes.

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

Example 13 with ExpandoBridge

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

the class CustomFieldHelper method loadField.

public static <T extends Serializable> Optional<T> loadField(Class<T> type, PortletRequest request, User user, String field) {
    try {
        ExpandoBridge exp = getUserExpandoBridge(request, user);
        T viewSize = type.cast(exp.getAttribute(field));
        return Optional.ofNullable(viewSize);
    } catch (PortalException | SystemException e) {
        log.error("Could not load custom field " + field, e);
        return Optional.empty();
    }
}
Also used : SystemException(com.liferay.portal.kernel.exception.SystemException) PortalException(com.liferay.portal.kernel.exception.PortalException) ExpandoBridge(com.liferay.portlet.expando.model.ExpandoBridge)

Example 14 with ExpandoBridge

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

the class CustomFieldHelper method saveField.

public static <T extends Serializable> void saveField(PortletRequest request, User user, String field, T value) {
    try {
        ExpandoBridge exp = getUserExpandoBridge(request, user);
        exp.setAttribute(field, value);
    } catch (PortalException | SystemException e) {
        log.error("Could not save custom field " + field, e);
    }
}
Also used : SystemException(com.liferay.portal.kernel.exception.SystemException) PortalException(com.liferay.portal.kernel.exception.PortalException) 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