Examples of ModelListener


Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.Image remove(
    java.lang.String imageId)
    throws com.liferay.portal.NoSuchImageException,
      com.liferay.portal.SystemException {
    ImagePersistence persistence = (ImagePersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

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

    com.liferay.portal.model.Image image = persistence.remove(imageId);

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

    return image;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.Image update(
    com.liferay.portal.model.Image image)
    throws com.liferay.portal.SystemException {
    ImagePersistence persistence = (ImagePersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

    boolean isNew = image.isNew();

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

    image = persistence.update(image);

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

    return image;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portlet.polls.model.PollsQuestion remove(
    java.lang.String questionId)
    throws com.liferay.portlet.polls.NoSuchQuestionException,
      com.liferay.portal.SystemException {
    PollsQuestionPersistence persistence = (PollsQuestionPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

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

    com.liferay.portlet.polls.model.PollsQuestion pollsQuestion = persistence.remove(questionId);

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

    return pollsQuestion;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portlet.polls.model.PollsQuestion update(
    com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
    throws com.liferay.portal.SystemException {
    PollsQuestionPersistence persistence = (PollsQuestionPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

    boolean isNew = pollsQuestion.isNew();

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

    pollsQuestion = persistence.update(pollsQuestion);

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

    return pollsQuestion;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

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

Examples of com.liferay.portal.model.ModelListener

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

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portlet.polls.model.PollsChoice remove(
    com.liferay.portlet.polls.ejb.PollsChoicePK pollsChoicePK)
    throws com.liferay.portlet.polls.NoSuchChoiceException,
      com.liferay.portal.SystemException {
    PollsChoicePersistence persistence = (PollsChoicePersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

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

    com.liferay.portlet.polls.model.PollsChoice pollsChoice = persistence.remove(pollsChoicePK);

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

    return pollsChoice;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portlet.polls.model.PollsChoice update(
    com.liferay.portlet.polls.model.PollsChoice pollsChoice)
    throws com.liferay.portal.SystemException {
    PollsChoicePersistence persistence = (PollsChoicePersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

    boolean isNew = pollsChoice.isNew();

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

    pollsChoice = persistence.update(pollsChoice);

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

    return pollsChoice;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.User remove(
    java.lang.String userId)
    throws com.liferay.portal.NoSuchUserException,
      com.liferay.portal.SystemException {
    UserPersistence persistence = (UserPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

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

    com.liferay.portal.model.User user = persistence.remove(userId);

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

    return user;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.User update(
    com.liferay.portal.model.User user)
    throws com.liferay.portal.SystemException {
    UserPersistence persistence = (UserPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

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

    boolean isNew = user.isNew();

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

    user = persistence.update(user);

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

    return user;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.