Package com.liferay.docs.guestbook.wrappers

Examples of com.liferay.docs.guestbook.wrappers.Guestbook


  private boolean editingEntry;

  public void add() {
    setOriginalGuestbook(getSelectedGuestbook());

    Guestbook guestbook = new Guestbook(GuestbookUtil.create(0L));
    LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance();
    guestbook.setGroupId(liferayFacesContext.getScopeGroupId());
    setSelectedGuestbook(guestbook);
    editGuestbook();
  }
View Full Code Here


      // Create the default guestbook if it does not exist in the database
      if (defaultGuestbook == null) {
        logger.info("postConstruct: creating a default guestbook named " + DEFAULT_GUESTBOOK_NAME + " ...");

        Guestbook guestbook = new Guestbook(GuestbookUtil.create(0L));
        guestbook.setName(DEFAULT_GUESTBOOK_NAME);
        guestbook.setGroupId(scopeGroupId);
        guestbook.setCompanyId(liferayFacesContext.getCompanyId());
        guestbook.setUserId(liferayFacesContext.getUserId());
        GuestbookLocalServiceUtil.addGuestbook(guestbook);
      }
    }
    catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public void postConstruct() {
    createMainGuestbook();
  }

  public void save() {
    Guestbook guestbook = getSelectedGuestbook();
    LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance();
    guestbook.setCompanyId(liferayFacesContext.getCompanyId());
    guestbook.setUserId(liferayFacesContext.getUserId());

    try {

      if (guestbook.getGuestbookId() == 0) {
        guestbook = new Guestbook(GuestbookLocalServiceUtil.addGuestbook(guestbook,
              liferayFacesContext.getUserId()));
      }
      else {
        guestbook = new Guestbook(GuestbookLocalServiceUtil.updateGuestbook(guestbook));
      }

      addGlobalSuccessInfoMessage();
    }
    catch (Exception e) {
View Full Code Here

  public List<Entry> getEntries() {

    if (entries == null) {
      long scopeGroupId = LiferayFacesContext.getInstance().getScopeGroupId();
      Guestbook selectedGuestbook = getSelectedGuestbook();

      try {
        entries = new ArrayList<Entry>();

        if (selectedGuestbook == null) {
          logger.info("getEntries: selectedGuestbook == null ... ");
        }
        else {
          List<com.liferay.docs.guestbook.model.Entry> list = EntryLocalServiceUtil.getEntries(scopeGroupId,
              selectedGuestbook.getGuestbookId());

          for (com.liferay.docs.guestbook.model.Entry entry : list) {
            entries.add(new Entry(entry));
          }
        }
View Full Code Here

        List<com.liferay.docs.guestbook.model.Guestbook> list = GuestbookLocalServiceUtil.getGuestbooks(
            scopeGroupId);

        for (com.liferay.docs.guestbook.model.Guestbook guestbook : list) {
          guestbooks.add(new Guestbook(guestbook));
        }
      }
      catch (SystemException e) {
        logger.error(e);
      }
View Full Code Here

        if (firstGuestbookByName == null) {
          logger.info("getSelectedGuestbook: No Guestbook named " + DEFAULT_GUESTBOOK_NAME);
        }
        else {
          selectedGuestbook = new Guestbook(firstGuestbookByName);
        }
      }
      catch (SystemException e) {
        logger.error(e);
      }
View Full Code Here

TOP

Related Classes of com.liferay.docs.guestbook.wrappers.Guestbook

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.