Package com.liferay.docs.guestbook.model

Examples of com.liferay.docs.guestbook.model.Entry


   */
  @Override
  public Entry findByUuid_Last(String uuid,
    OrderByComparator orderByComparator)
    throws NoSuchEntryException, SystemException {
    Entry entry = fetchByUuid_Last(uuid, orderByComparator);

    if (entry != null) {
      return entry;
    }

View Full Code Here


   */
  @Override
  public Entry[] findByUuid_PrevAndNext(long entryId, String uuid,
    OrderByComparator orderByComparator)
    throws NoSuchEntryException, SystemException {
    Entry entry = findByPrimaryKey(entryId);

    Session session = null;

    try {
      session = openSession();
View Full Code Here

   * @throws SystemException if a system exception occurred
   */
  @Override
  public Entry findByUUID_G(String uuid, long groupId)
    throws NoSuchEntryException, SystemException {
    Entry entry = fetchByUUID_G(uuid, groupId);

    if (entry == null) {
      StringBundler msg = new StringBundler(6);

      msg.append(_NO_SUCH_ENTITY_WITH_KEY);
View Full Code Here

      result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_UUID_G,
          finderArgs, this);
    }

    if (result instanceof Entry) {
      Entry entry = (Entry)result;

      if (!Validator.equals(uuid, entry.getUuid()) ||
          (groupId != entry.getGroupId())) {
        result = null;
      }
    }

    if (result == null) {
      StringBundler query = new StringBundler(4);

      query.append(_SQL_SELECT_ENTRY_WHERE);

      boolean bindUuid = false;

      if (uuid == null) {
        query.append(_FINDER_COLUMN_UUID_G_UUID_1);
      }
      else if (uuid.equals(StringPool.BLANK)) {
        query.append(_FINDER_COLUMN_UUID_G_UUID_3);
      }
      else {
        bindUuid = true;

        query.append(_FINDER_COLUMN_UUID_G_UUID_2);
      }

      query.append(_FINDER_COLUMN_UUID_G_GROUPID_2);

      String sql = query.toString();

      Session session = null;

      try {
        session = openSession();

        Query q = session.createQuery(sql);

        QueryPos qPos = QueryPos.getInstance(q);

        if (bindUuid) {
          qPos.add(uuid);
        }

        qPos.add(groupId);

        List<Entry> list = q.list();

        if (list.isEmpty()) {
          FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
            finderArgs, list);
        }
        else {
          Entry entry = list.get(0);

          result = entry;

          cacheResult(entry);

          if ((entry.getUuid() == null) ||
              !entry.getUuid().equals(uuid) ||
              (entry.getGroupId() != groupId)) {
            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
              finderArgs, entry);
          }
        }
      }
View Full Code Here

  }
 
  public Entry deleteEntry(long entryId, ServiceContext serviceContext)
      throws PortalException, SystemException {

    Entry entry = getEntry(entryId);

    resourceLocalService.deleteResource(serviceContext.getCompanyId(),
        Entry.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,
        entryId);
   
View Full Code Here

   
    validate(name, email, message);
   
    long entryId = counterLocalService.increment();
   
    Entry entry = entryPersistence.create(entryId);
   
    entry.setUuid(serviceContext.getUuid());
    entry.setUserId(userId);
    entry.setGroupId(groupId);
    entry.setCompanyId(user.getCompanyId());
    entry.setUserName(user.getFullName());
    entry.setCreateDate(serviceContext.getCreateDate(now));
    entry.setModifiedDate(serviceContext.getModifiedDate(now));
    entry.setExpandoBridgeAttributes(serviceContext);
    entry.setGuestbookId(guestbookId);
    entry.setName(name);
    entry.setEmail(email);
    entry.setMessage(message);
   
    entryPersistence.update(entry);
   
    resourceLocalService.addResources(user.getCompanyId(), groupId, userId,
        Entry.class.getName(), entryId, false, true, true);
   
    AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId,
        groupId, entry.getCreateDate(), entry.getModifiedDate(),
        Entry.class.getName(), entryId, entry.getUuid(), 0,
        serviceContext.getAssetCategoryIds(),
        serviceContext.getAssetTagNames(), true, null, null, null,
        ContentTypes.TEXT_HTML, entry.getMessage(), null, null, null,
        null, 0, 0, null, false);
   
    assetLinkLocalService.updateLinks(userId, assetEntry.getEntryId(),
        serviceContext.getAssetLinkEntryIds(),
        AssetLinkConstants.TYPE_RELATED);
View Full Code Here

    Date now = new Date();

    validate(name, email, message);

    Entry entry = getEntry(entryId);

    entry.setUserId(userId);
    entry.setUserName(user.getFullName());
    entry.setName(name);
    entry.setEmail(email);
    entry.setMessage(message);
    entry.setModifiedDate(serviceContext.getModifiedDate(now));
    entry.setExpandoBridgeAttributes(serviceContext);

    entryPersistence.update(entry);

    resourceLocalService.updateResources(user.getCompanyId(), groupId,
        Entry.class.getName(), entryId,
        serviceContext.getGroupPermissions(),
        serviceContext.getGuestPermissions());
   
    AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId,
        groupId, entry.getCreateDate(), entry.getModifiedDate(),
        Entry.class.getName(), entryId, entry.getUuid(), 0,
        serviceContext.getAssetCategoryIds(),
        serviceContext.getAssetTagNames(), true, null, null, null,
        ContentTypes.TEXT_HTML, entry.getMessage(), null, null, null,
        null, 0, 0, null, false);
   
    assetLinkLocalService.updateLinks(userId, assetEntry.getEntryId(),
        serviceContext.getAssetLinkEntryIds(),
        AssetLinkConstants.TYPE_RELATED);
View Full Code Here

  }

  @Override
  protected void doDelete(Object obj) throws Exception {
   
    Entry entry = (Entry)obj;
   
    deleteDocument(entry.getCompanyId(), entry.getEntryId());
  }
View Full Code Here

  }

  @Override
  protected Document doGetDocument(Object obj) throws Exception {
   
    Entry entry = (Entry)obj;

    Document document = getBaseModelDocument(PORTLET_ID, entry);

    document.addDate(Field.MODIFIED_DATE, entry.getModifiedDate());
    document.addText(Field.CONTENT, entry.getMessage());
    document.addText(Field.TITLE, entry.getName());
    document.addText("email", entry.getEmail());
    document.addKeyword(Field.GROUP_ID, getSiteGroupId(entry.getGroupId()));
    document.addKeyword(Field.SCOPE_GROUP_ID, entry.getGroupId());
   
    return document;
  }
View Full Code Here

  }

  @Override
  protected void doReindex(Object obj) throws Exception {
   
    Entry entry = (Entry)obj;

    Document document = getDocument(entry);

    SearchEngineUtil.updateDocument(
      getSearchEngineId(), entry.getCompanyId(), document);
  }
View Full Code Here

TOP

Related Classes of com.liferay.docs.guestbook.model.Entry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.