Search in sources :

Example 1 with NoSuchTableException

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

the class UpgradeExpandoTable method updateExpandoTable.

protected void updateExpandoTable(long companyId) throws Exception {
    ExpandoTable expandoTable = null;
    try {
        expandoTable = ExpandoTableLocalServiceUtil.getTable(companyId, Subscription.class.getName(), "KB");
    } catch (NoSuchTableException nste) {
        return;
    }
    ExpandoTableLocalServiceUtil.deleteExpandoTable(expandoTable);
}
Also used : ExpandoTable(com.liferay.portlet.expando.model.ExpandoTable) NoSuchTableException(com.liferay.portlet.expando.NoSuchTableException)

Example 2 with NoSuchTableException

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

the class LiferayAppDataService method getExpandoColumn.

protected ExpandoColumn getExpandoColumn(long companyId, String columnName) throws Exception {
    ExpandoTable expandoTable = null;
    try {
        expandoTable = ExpandoTableLocalServiceUtil.getTable(companyId, User.class.getName(), ShindigUtil.getTableOpenSocial());
    } catch (NoSuchTableException nste) {
        _log.error(nste, nste);
    }
    ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(expandoTable.getTableId(), columnName);
    if (expandoColumn == null) {
        expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), columnName, ExpandoColumnConstants.STRING);
    }
    return expandoColumn;
}
Also used : ExpandoTable(com.liferay.portlet.expando.model.ExpandoTable) ExpandoColumn(com.liferay.portlet.expando.model.ExpandoColumn) NoSuchTableException(com.liferay.portlet.expando.NoSuchTableException)

Aggregations

NoSuchTableException (com.liferay.portlet.expando.NoSuchTableException)2 ExpandoTable (com.liferay.portlet.expando.model.ExpandoTable)2 ExpandoColumn (com.liferay.portlet.expando.model.ExpandoColumn)1