forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPS-204267 Use model listener instead of service wrapper
- Loading branch information
1 parent
19e5a41
commit b6ce6f3
Showing
2 changed files
with
55 additions
and
93 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
...iferay/blogs/reading/time/internal/model/listener/BlogsEntryReadingTimeModelListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* SPDX-FileCopyrightText: (c) 2024 Liferay, Inc. https://liferay.com | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 | ||
*/ | ||
|
||
package com.liferay.blogs.reading.time.internal.model.listener; | ||
|
||
import com.liferay.blogs.model.BlogsEntry; | ||
import com.liferay.portal.kernel.exception.ModelListenerException; | ||
import com.liferay.portal.kernel.model.BaseModelListener; | ||
import com.liferay.portal.kernel.model.ModelListener; | ||
import com.liferay.reading.time.service.ReadingTimeEntryLocalService; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Reference; | ||
|
||
/** | ||
* @author Adolfo Pérez | ||
*/ | ||
@Component(service = ModelListener.class) | ||
public class BlogsEntryReadingTimeModelListener | ||
extends BaseModelListener<BlogsEntry> { | ||
|
||
@Override | ||
public void onAfterCreate(BlogsEntry blogsEntry) | ||
throws ModelListenerException { | ||
|
||
super.onAfterCreate(blogsEntry); | ||
|
||
_readingTimeEntryLocalService.updateReadingTimeEntry(blogsEntry); | ||
} | ||
|
||
@Override | ||
public void onAfterUpdate( | ||
BlogsEntry originalBlogsEntry, BlogsEntry blogsEntry) | ||
throws ModelListenerException { | ||
|
||
super.onAfterUpdate(originalBlogsEntry, blogsEntry); | ||
|
||
_readingTimeEntryLocalService.updateReadingTimeEntry(blogsEntry); | ||
} | ||
|
||
@Override | ||
public void onBeforeRemove(BlogsEntry blogsEntry) | ||
throws ModelListenerException { | ||
|
||
super.onBeforeRemove(blogsEntry); | ||
|
||
_readingTimeEntryLocalService.deleteReadingTimeEntry(blogsEntry); | ||
} | ||
|
||
@Reference | ||
private ReadingTimeEntryLocalService _readingTimeEntryLocalService; | ||
|
||
} |
93 changes: 0 additions & 93 deletions
93
...liferay/blogs/reading/time/internal/service/BlogsReadingTimeEntryLocalServiceWrapper.java
This file was deleted.
Oops, something went wrong.