Package com.liferay.portal.model

Examples of com.liferay.portal.model.ModelListener


  protected 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) {
        Logger.error(AddressUtil.class,e.getMessage(),e);
      }
    }

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

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

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

    return address;
  }
View Full Code Here


  protected 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) {
        Logger.error(AddressUtil.class,e.getMessage(),e);
      }
    }

    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;
  }
View Full Code Here

  protected static com.liferay.portal.model.Release remove(
    java.lang.String releaseId)
    throws com.liferay.portal.NoSuchReleaseException,
      com.liferay.portal.SystemException {
    ReleasePersistence persistence = (ReleasePersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

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

    com.liferay.portal.model.Release release = persistence.remove(releaseId);

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

    return release;
  }
View Full Code Here

  protected static com.liferay.portal.model.Release update(
    com.liferay.portal.model.Release release)
    throws com.liferay.portal.SystemException {
    ReleasePersistence persistence = (ReleasePersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

    boolean isNew = release.isNew();

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

    release = persistence.update(release);

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

    return release;
  }
View Full Code Here

  protected static com.liferay.portal.model.PasswordTracker remove(
    java.lang.String passwordTrackerId)
    throws com.liferay.portal.NoSuchPasswordTrackerException,
      com.liferay.portal.SystemException {
    PasswordTrackerPersistence persistence = (PasswordTrackerPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

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

    com.liferay.portal.model.PasswordTracker passwordTracker = persistence.remove(passwordTrackerId);

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

    return passwordTracker;
  }
View Full Code Here

  protected static com.liferay.portal.model.PasswordTracker update(
    com.liferay.portal.model.PasswordTracker passwordTracker)
    throws com.liferay.portal.SystemException {
    PasswordTrackerPersistence persistence = (PasswordTrackerPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

    boolean isNew = passwordTracker.isNew();

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

    passwordTracker = persistence.update(passwordTracker);

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

    return passwordTracker;
  }
View Full Code Here

  protected static com.liferay.portal.model.Company remove(
    java.lang.String companyId)
    throws com.liferay.portal.NoSuchCompanyException,
      com.liferay.portal.SystemException {
    CompanyPersistence persistence = (CompanyPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

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

    com.liferay.portal.model.Company company = persistence.remove(companyId);

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

    return company;
  }
View Full Code Here

  protected static com.liferay.portal.model.Company update(
    com.liferay.portal.model.Company company)
    throws com.liferay.portal.SystemException {
    CompanyPersistence persistence = (CompanyPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

    boolean isNew = company.isNew();

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

    company = persistence.update(company);

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

    return company;
  }
View Full Code Here

      java.lang.String userTrackerId)
      throws com.liferay.portal.NoSuchUserTrackerException,
      com.liferay.portal.SystemException {
    UserTrackerPersistence persistence = (UserTrackerPersistence) InstancePool
        .get(PERSISTENCE);
    ModelListener listener = null;

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

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

    com.liferay.portal.model.UserTracker userTracker = persistence
        .remove(userTrackerId);

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

    return userTracker;
  }
View Full Code Here

  protected static com.liferay.portal.model.UserTracker update(
      com.liferay.portal.model.UserTracker userTracker)
      throws com.liferay.portal.SystemException {
    UserTrackerPersistence persistence = (UserTrackerPersistence) InstancePool
        .get(PERSISTENCE);
    ModelListener listener = null;

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

    boolean isNew = userTracker.isNew();

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

    userTracker = persistence.update(userTracker);

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

    return userTracker;
  }
View Full Code Here

TOP

Related Classes of com.liferay.portal.model.ModelListener

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.