Beispiel #1
0
  protected static com.liferay.portlet.polls.model.PollsDisplay remove(
      com.liferay.portlet.polls.ejb.PollsDisplayPK pollsDisplayPK)
      throws com.liferay.portlet.polls.NoSuchDisplayException, com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener) Class.forName(LISTENER).newInstance();
      } catch (Exception e) {
        Logger.error(PollsDisplayUtil.class, e.getMessage(), e);
      }
    }

    if (listener != null) {
      listener.onBeforeRemove(findByPrimaryKey(pollsDisplayPK));
    }

    com.liferay.portlet.polls.model.PollsDisplay pollsDisplay = persistence.remove(pollsDisplayPK);

    if (listener != null) {
      listener.onAfterRemove(pollsDisplay);
    }

    return pollsDisplay;
  }
Beispiel #2
0
  public static com.liferay.portal.model.Address update(com.liferay.portal.model.Address address)
      throws com.liferay.portal.SystemException {
    AddressPersistence persistence = (AddressPersistence) InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener) Class.forName(LISTENER).newInstance();
      } catch (Exception e) {
        _log.error(e.getMessage());
      }
    }

    boolean isNew = address.isNew();

    if (listener != null) {
      if (isNew) {
        listener.onBeforeCreate(address);
      } else {
        listener.onBeforeUpdate(address);
      }
    }

    address = persistence.update(address);

    if (listener != null) {
      if (isNew) {
        listener.onAfterCreate(address);
      } else {
        listener.onAfterUpdate(address);
      }
    }

    return address;
  }
Beispiel #3
0
  public static com.liferay.portal.model.Address remove(java.lang.String addressId)
      throws com.liferay.portal.NoSuchAddressException, com.liferay.portal.SystemException {
    AddressPersistence persistence = (AddressPersistence) InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener) Class.forName(LISTENER).newInstance();
      } catch (Exception e) {
        _log.error(e.getMessage());
      }
    }

    if (listener != null) {
      listener.onBeforeRemove(findByPrimaryKey(addressId));
    }

    com.liferay.portal.model.Address address = persistence.remove(addressId);

    if (listener != null) {
      listener.onAfterRemove(address);
    }

    return address;
  }
  public ProGateMenuView remove(ProGateMenuView proGateMenuView) throws SystemException {
    for (ModelListener<ProGateMenuView> listener : listeners) {
      listener.onBeforeRemove(proGateMenuView);
    }

    proGateMenuView = removeImpl(proGateMenuView);

    for (ModelListener<ProGateMenuView> listener : listeners) {
      listener.onAfterRemove(proGateMenuView);
    }

    return proGateMenuView;
  }
  public DebateItemReference remove(DebateItemReference debateItemReference)
      throws SystemException {
    for (ModelListener<DebateItemReference> listener : listeners) {
      listener.onBeforeRemove(debateItemReference);
    }

    debateItemReference = removeImpl(debateItemReference);

    for (ModelListener<DebateItemReference> listener : listeners) {
      listener.onAfterRemove(debateItemReference);
    }

    return debateItemReference;
  }
    protected void remove(long hrOfficeId, long hrHolidayId) throws SystemException {
      if (_persistenceImpl.containsHRHoliday.contains(hrOfficeId, hrHolidayId)) {
        ModelListener<com.liferay.hr.model.HRHoliday>[] hrHolidayListeners =
            hrHolidayPersistence.getListeners();

        for (ModelListener<HROffice> listener : listeners) {
          listener.onBeforeRemoveAssociation(
              hrOfficeId, com.liferay.hr.model.HRHoliday.class.getName(), hrHolidayId);
        }

        for (ModelListener<com.liferay.hr.model.HRHoliday> listener : hrHolidayListeners) {
          listener.onBeforeRemoveAssociation(hrHolidayId, HROffice.class.getName(), hrOfficeId);
        }

        _sqlUpdate.update(new Object[] {new Long(hrOfficeId), new Long(hrHolidayId)});

        for (ModelListener<HROffice> listener : listeners) {
          listener.onAfterRemoveAssociation(
              hrOfficeId, com.liferay.hr.model.HRHoliday.class.getName(), hrHolidayId);
        }

        for (ModelListener<com.liferay.hr.model.HRHoliday> listener : hrHolidayListeners) {
          listener.onAfterRemoveAssociation(hrHolidayId, HROffice.class.getName(), hrOfficeId);
        }
      }
    }
  public ViewListTitleCompetencies remove(ViewListTitleCompetencies viewListTitleCompetencies)
      throws SystemException {
    for (ModelListener<ViewListTitleCompetencies> listener : listeners) {
      listener.onBeforeRemove(viewListTitleCompetencies);
    }

    viewListTitleCompetencies = removeImpl(viewListTitleCompetencies);

    for (ModelListener<ViewListTitleCompetencies> listener : listeners) {
      listener.onAfterRemove(viewListTitleCompetencies);
    }

    return viewListTitleCompetencies;
  }
  public PmlEdmLevelSend remove(PmlEdmLevelSend pmlEdmLevelSend) throws SystemException {
    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        listener.onBeforeRemove(pmlEdmLevelSend);
      }
    }

    pmlEdmLevelSend = removeImpl(pmlEdmLevelSend);

    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        listener.onAfterRemove(pmlEdmLevelSend);
      }
    }

    return pmlEdmLevelSend;
  }
  public SoPhongVanBanNoiBo remove(SoPhongVanBanNoiBo soPhongVanBanNoiBo) throws SystemException {
    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        listener.onBeforeRemove(soPhongVanBanNoiBo);
      }
    }

    soPhongVanBanNoiBo = removeImpl(soPhongVanBanNoiBo);

    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        listener.onAfterRemove(soPhongVanBanNoiBo);
      }
    }

    return soPhongVanBanNoiBo;
  }
  public LogVanBanNoiBo remove(LogVanBanNoiBo logVanBanNoiBo) throws SystemException {
    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        listener.onBeforeRemove(logVanBanNoiBo);
      }
    }

    logVanBanNoiBo = removeImpl(logVanBanNoiBo);

    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        listener.onAfterRemove(logVanBanNoiBo);
      }
    }

    return logVanBanNoiBo;
  }
  /**
   * Add, update, or merge, the entity. This method also calls the model listeners to trigger the
   * proper events associated with adding, deleting, or updating an entity.
   *
   * @param pmlEdmLevelSend the entity to add, update, or merge
   * @param merge boolean value for whether to merge the entity. The default value is false. Setting
   *     merge to true is more expensive and should only be true when pmlEdmLevelSend is transient.
   *     See LEP-5473 for a detailed discussion of this method.
   * @return true if the portlet can be displayed via Ajax
   */
  public PmlEdmLevelSend update(PmlEdmLevelSend pmlEdmLevelSend, boolean merge)
      throws SystemException {
    boolean isNew = pmlEdmLevelSend.isNew();

    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        if (isNew) {
          listener.onBeforeCreate(pmlEdmLevelSend);
        } else {
          listener.onBeforeUpdate(pmlEdmLevelSend);
        }
      }
    }

    pmlEdmLevelSend = updateImpl(pmlEdmLevelSend, merge);

    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        if (isNew) {
          listener.onAfterCreate(pmlEdmLevelSend);
        } else {
          listener.onAfterUpdate(pmlEdmLevelSend);
        }
      }
    }

    return pmlEdmLevelSend;
  }
  /**
   * Add, update, or merge, the entity. This method also calls the model listeners to trigger the
   * proper events associated with adding, deleting, or updating an entity.
   *
   * @param soPhongVanBanNoiBo the entity to add, update, or merge
   * @param merge boolean value for whether to merge the entity. The default value is false. Setting
   *     merge to true is more expensive and should only be true when soPhongVanBanNoiBo is
   *     transient. See LEP-5473 for a detailed discussion of this method.
   * @return true if the portlet can be displayed via Ajax
   */
  public SoPhongVanBanNoiBo update(SoPhongVanBanNoiBo soPhongVanBanNoiBo, boolean merge)
      throws SystemException {
    boolean isNew = soPhongVanBanNoiBo.isNew();

    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        if (isNew) {
          listener.onBeforeCreate(soPhongVanBanNoiBo);
        } else {
          listener.onBeforeUpdate(soPhongVanBanNoiBo);
        }
      }
    }

    soPhongVanBanNoiBo = updateImpl(soPhongVanBanNoiBo, merge);

    if (_listeners.length > 0) {
      for (ModelListener listener : _listeners) {
        if (isNew) {
          listener.onAfterCreate(soPhongVanBanNoiBo);
        } else {
          listener.onAfterUpdate(soPhongVanBanNoiBo);
        }
      }
    }

    return soPhongVanBanNoiBo;
  }
Beispiel #13
0
  protected static com.liferay.portlet.polls.model.PollsDisplay update(
      com.liferay.portlet.polls.model.PollsDisplay pollsDisplay)
      throws com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener) Class.forName(LISTENER).newInstance();
      } catch (Exception e) {
        Logger.error(PollsDisplayUtil.class, e.getMessage(), e);
      }
    }

    boolean isNew = pollsDisplay.isNew();

    if (listener != null) {
      if (isNew) {
        listener.onBeforeCreate(pollsDisplay);
      } else {
        listener.onBeforeUpdate(pollsDisplay);
      }
    }

    pollsDisplay = persistence.update(pollsDisplay);

    if (listener != null) {
      if (isNew) {
        listener.onAfterCreate(pollsDisplay);
      } else {
        listener.onAfterUpdate(pollsDisplay);
      }
    }

    return pollsDisplay;
  }
    protected void clear(long hrOfficeId) throws SystemException {
      ModelListener<com.liferay.hr.model.HRHoliday>[] hrHolidayListeners =
          hrHolidayPersistence.getListeners();

      List<com.liferay.hr.model.HRHoliday> hrHolidaies = null;

      if ((listeners.length > 0) || (hrHolidayListeners.length > 0)) {
        hrHolidaies = getHRHolidaies(hrOfficeId);

        for (com.liferay.hr.model.HRHoliday hrHoliday : hrHolidaies) {
          for (ModelListener<HROffice> listener : listeners) {
            listener.onBeforeRemoveAssociation(
                hrOfficeId,
                com.liferay.hr.model.HRHoliday.class.getName(),
                hrHoliday.getPrimaryKey());
          }

          for (ModelListener<com.liferay.hr.model.HRHoliday> listener : hrHolidayListeners) {
            listener.onBeforeRemoveAssociation(
                hrHoliday.getPrimaryKey(), HROffice.class.getName(), hrOfficeId);
          }
        }
      }

      _sqlUpdate.update(new Object[] {new Long(hrOfficeId)});

      if ((listeners.length > 0) || (hrHolidayListeners.length > 0)) {
        for (com.liferay.hr.model.HRHoliday hrHoliday : hrHolidaies) {
          for (ModelListener<HROffice> listener : listeners) {
            listener.onAfterRemoveAssociation(
                hrOfficeId,
                com.liferay.hr.model.HRHoliday.class.getName(),
                hrHoliday.getPrimaryKey());
          }

          for (ModelListener<com.liferay.hr.model.HRHoliday> listener : hrHolidayListeners) {
            listener.onAfterRemoveAssociation(
                hrHoliday.getPrimaryKey(), HROffice.class.getName(), hrOfficeId);
          }
        }
      }
    }
  public ProGateMenuView update(ProGateMenuView proGateMenuView, boolean merge)
      throws SystemException {
    boolean isNew = proGateMenuView.isNew();

    for (ModelListener<ProGateMenuView> listener : listeners) {
      if (isNew) {
        listener.onBeforeCreate(proGateMenuView);
      } else {
        listener.onBeforeUpdate(proGateMenuView);
      }
    }

    proGateMenuView = updateImpl(proGateMenuView, merge);

    for (ModelListener<ProGateMenuView> listener : listeners) {
      if (isNew) {
        listener.onAfterCreate(proGateMenuView);
      } else {
        listener.onAfterUpdate(proGateMenuView);
      }
    }

    return proGateMenuView;
  }
  public ViewListTitleCompetencies update(
      ViewListTitleCompetencies viewListTitleCompetencies, boolean merge) throws SystemException {
    boolean isNew = viewListTitleCompetencies.isNew();

    for (ModelListener<ViewListTitleCompetencies> listener : listeners) {
      if (isNew) {
        listener.onBeforeCreate(viewListTitleCompetencies);
      } else {
        listener.onBeforeUpdate(viewListTitleCompetencies);
      }
    }

    viewListTitleCompetencies = updateImpl(viewListTitleCompetencies, merge);

    for (ModelListener<ViewListTitleCompetencies> listener : listeners) {
      if (isNew) {
        listener.onAfterCreate(viewListTitleCompetencies);
      } else {
        listener.onAfterUpdate(viewListTitleCompetencies);
      }
    }

    return viewListTitleCompetencies;
  }
  /**
   * Add, update, or merge, the entity. This method also calls the model listeners to trigger the
   * proper events associated with adding, deleting, or updating an entity.
   *
   * @param debateItemReference the entity to add, update, or merge
   * @param merge boolean value for whether to merge the entity. The default value is false. Setting
   *     merge to true is more expensive and should only be true when debateItemReference is
   *     transient. See LEP-5473 for a detailed discussion of this method.
   * @return true if the portlet can be displayed via Ajax
   */
  public DebateItemReference update(DebateItemReference debateItemReference, boolean merge)
      throws SystemException {
    boolean isNew = debateItemReference.isNew();

    for (ModelListener<DebateItemReference> listener : listeners) {
      if (isNew) {
        listener.onBeforeCreate(debateItemReference);
      } else {
        listener.onBeforeUpdate(debateItemReference);
      }
    }

    debateItemReference = updateImpl(debateItemReference, merge);

    for (ModelListener<DebateItemReference> listener : listeners) {
      if (isNew) {
        listener.onAfterCreate(debateItemReference);
      } else {
        listener.onAfterUpdate(debateItemReference);
      }
    }

    return debateItemReference;
  }