use of com.liferay.knowledgebase.NoSuchTemplateException in project liferay-ide by liferay.
the class KBTemplatePersistenceImpl method findByUuid_First.
/**
* Returns the first k b template in the ordered set where uuid = ?.
*
* @param uuid the uuid
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching k b template
* @throws com.liferay.knowledgebase.NoSuchTemplateException if a matching k b template could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public KBTemplate findByUuid_First(String uuid, OrderByComparator orderByComparator) throws NoSuchTemplateException, SystemException {
KBTemplate kbTemplate = fetchByUuid_First(uuid, orderByComparator);
if (kbTemplate != null) {
return kbTemplate;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.append(uuid);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchTemplateException(msg.toString());
}
use of com.liferay.knowledgebase.NoSuchTemplateException in project liferay-ide by liferay.
the class KBTemplatePersistenceImpl method findByUUID_G.
/**
* Returns the k b template where uuid = ? and groupId = ? or throws a {@link com.liferay.knowledgebase.NoSuchTemplateException} if it could not be found.
*
* @param uuid the uuid
* @param groupId the group ID
* @return the matching k b template
* @throws com.liferay.knowledgebase.NoSuchTemplateException if a matching k b template could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public KBTemplate findByUUID_G(String uuid, long groupId) throws NoSuchTemplateException, SystemException {
KBTemplate kbTemplate = fetchByUUID_G(uuid, groupId);
if (kbTemplate == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.append(uuid);
msg.append(", groupId=");
msg.append(groupId);
msg.append(StringPool.CLOSE_CURLY_BRACE);
if (_log.isWarnEnabled()) {
_log.warn(msg.toString());
}
throw new NoSuchTemplateException(msg.toString());
}
return kbTemplate;
}
use of com.liferay.knowledgebase.NoSuchTemplateException in project liferay-ide by liferay.
the class KBTemplatePersistenceImpl method findByUuid_C_First.
/**
* Returns the first k b template in the ordered set where uuid = ? and companyId = ?.
*
* @param uuid the uuid
* @param companyId the company ID
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the first matching k b template
* @throws com.liferay.knowledgebase.NoSuchTemplateException if a matching k b template could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public KBTemplate findByUuid_C_First(String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchTemplateException, SystemException {
KBTemplate kbTemplate = fetchByUuid_C_First(uuid, companyId, orderByComparator);
if (kbTemplate != null) {
return kbTemplate;
}
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.append(uuid);
msg.append(", companyId=");
msg.append(companyId);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchTemplateException(msg.toString());
}
use of com.liferay.knowledgebase.NoSuchTemplateException in project liferay-ide by liferay.
the class KBTemplatePersistenceImpl method filterFindByGroupId_PrevAndNext.
/**
* Returns the k b templates before and after the current k b template in the ordered set of k b templates that the user has permission to view where groupId = ?.
*
* @param kbTemplateId the primary key of the current k b template
* @param groupId the group ID
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next k b template
* @throws com.liferay.knowledgebase.NoSuchTemplateException if a k b template with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public KBTemplate[] filterFindByGroupId_PrevAndNext(long kbTemplateId, long groupId, OrderByComparator orderByComparator) throws NoSuchTemplateException, SystemException {
if (!InlineSQLHelperUtil.isEnabled(groupId)) {
return findByGroupId_PrevAndNext(kbTemplateId, groupId, orderByComparator);
}
KBTemplate kbTemplate = findByPrimaryKey(kbTemplateId);
Session session = null;
try {
session = openSession();
KBTemplate[] array = new KBTemplateImpl[3];
array[0] = filterGetByGroupId_PrevAndNext(session, kbTemplate, groupId, orderByComparator, true);
array[1] = kbTemplate;
array[2] = filterGetByGroupId_PrevAndNext(session, kbTemplate, groupId, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
Aggregations