Search in sources :

Example 6 with ExpandoBridge

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

the class AlbumModelImpl method setExpandoBridgeAttributes.

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

Example 7 with ExpandoBridge

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

the class ArtistModelImpl method setExpandoBridgeAttributes.

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

Example 8 with ExpandoBridge

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

the class SongModelImpl method setExpandoBridgeAttributes.

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

Example 9 with ExpandoBridge

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

the class KBCommentModelImpl method setExpandoBridgeAttributes.

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

Example 10 with ExpandoBridge

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

the class SerializerUtil method toExpandoAttributes.

public static Map<String, Serializable> toExpandoAttributes(Object bean, Object[] fields, long companyId, String className) throws PortalException {
    ExpandoBridge expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(companyId, className);
    for (Object field : fields) {
        String fieldName = field.toString();
        String value = BeanPropertiesUtil.getString(bean, fieldName);
        if ((value != null) && !expandoBridge.hasAttribute(fieldName)) {
            expandoBridge.addAttribute(fieldName);
        }
    }
    Map<String, Serializable> expandoBridgeAttributes = new LinkedHashMap<String, Serializable>();
    copyProperties(bean, expandoBridgeAttributes, fields);
    return expandoBridgeAttributes;
}
Also used : Serializable(java.io.Serializable) JSONObject(com.liferay.portal.kernel.json.JSONObject) ExpandoBridge(com.liferay.portlet.expando.model.ExpandoBridge) LinkedHashMap(java.util.LinkedHashMap)

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