Search in sources :

Example 36 with KBComment

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);
    }
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment)

Example 37 with 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;
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment)

Example 38 with KBComment

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);
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment)

Example 39 with KBComment

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;
    }
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment)

Example 40 with KBComment

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 = &#63;.
 *
 * @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());
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) NoSuchCommentException(com.liferay.knowledgebase.NoSuchCommentException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Aggregations

KBComment (com.liferay.knowledgebase.model.KBComment)60 NoSuchCommentException (com.liferay.knowledgebase.NoSuchCommentException)38 StringBundler (com.liferay.portal.kernel.util.StringBundler)36 Session (com.liferay.portal.kernel.dao.orm.Session)21 SystemException (com.liferay.portal.kernel.exception.SystemException)21 Query (com.liferay.portal.kernel.dao.orm.Query)19 QueryPos (com.liferay.portal.kernel.dao.orm.QueryPos)18 KBCommentImpl (com.liferay.knowledgebase.model.impl.KBCommentImpl)11 UnmodifiableList (com.liferay.portal.kernel.util.UnmodifiableList)11 ArrayList (java.util.ArrayList)11 List (java.util.List)11 FinderPath (com.liferay.portal.kernel.dao.orm.FinderPath)9 JSONObject (com.liferay.portal.kernel.json.JSONObject)2 ServiceContext (com.liferay.portal.service.ServiceContext)2 KBArticle (com.liferay.knowledgebase.model.KBArticle)1 KBTemplate (com.liferay.knowledgebase.model.KBTemplate)1 User (com.liferay.portal.model.User)1 ThemeDisplay (com.liferay.portal.theme.ThemeDisplay)1 Date (java.util.Date)1 Map (java.util.Map)1