use of com.liferay.knowledgebase.model.KBComment in project liferay-ide by liferay.
the class KBCommentLocalServiceImpl method deleteKBComments.
@Override
public void deleteKBComments(String className, long classPK) throws PortalException, SystemException {
long classNameId = classNameLocalService.getClassNameId(className);
List<KBComment> kbComments = kbCommentPersistence.findByC_C(classNameId, classPK);
for (KBComment kbComment : kbComments) {
kbCommentLocalService.deleteKBComment(kbComment);
}
}
use of com.liferay.knowledgebase.model.KBComment in project liferay-ide by liferay.
the class KBCommentModelImpl method toModel.
/**
* Converts the soap model instance into a normal model instance.
*
* @param soapModel the soap model instance to convert
* @return the normal model instance
*/
public static KBComment toModel(KBCommentSoap soapModel) {
if (soapModel == null) {
return null;
}
KBComment model = new KBCommentImpl();
model.setUuid(soapModel.getUuid());
model.setKbCommentId(soapModel.getKbCommentId());
model.setGroupId(soapModel.getGroupId());
model.setCompanyId(soapModel.getCompanyId());
model.setUserId(soapModel.getUserId());
model.setUserName(soapModel.getUserName());
model.setCreateDate(soapModel.getCreateDate());
model.setModifiedDate(soapModel.getModifiedDate());
model.setClassNameId(soapModel.getClassNameId());
model.setClassPK(soapModel.getClassPK());
model.setContent(soapModel.getContent());
model.setUserRating(soapModel.getUserRating());
model.setStatus(soapModel.getStatus());
return model;
}
use of com.liferay.knowledgebase.model.KBComment in project liferay-ide by liferay.
the class KBCommentExportActionableDynamicQuery method performAction.
@Override
@SuppressWarnings("unused")
protected void performAction(Object object) throws PortalException, SystemException {
KBComment stagedModel = (KBComment) object;
StagedModelDataHandlerUtil.exportStagedModel(_portletDataContext, stagedModel);
}
use of com.liferay.knowledgebase.model.KBComment in project liferay-ide by liferay.
the class KBCommentCreateDateComparator method compare.
@Override
public int compare(Object obj1, Object obj2) {
KBComment kbComment1 = (KBComment) obj1;
KBComment kbComment2 = (KBComment) obj2;
int value = DateUtil.compareTo(kbComment1.getCreateDate(), kbComment2.getCreateDate());
if (_ascending) {
return value;
} else {
return -value;
}
}
use of com.liferay.knowledgebase.model.KBComment in project liferay-ide by liferay.
the class KBCommentPersistenceImpl method findByUuid_First.
/**
* Returns the first k b comment 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 comment
* @throws com.liferay.knowledgebase.NoSuchCommentException if a matching k b comment could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public KBComment findByUuid_First(String uuid, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
KBComment kbComment = fetchByUuid_First(uuid, orderByComparator);
if (kbComment != null) {
return kbComment;
}
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 NoSuchCommentException(msg.toString());
}
Aggregations