从回收站恢复文章时,此方法不会调用。
@Override
public void restoreArticleFromTrash(long groupId, String articleId) throws PortalException {
// TODO Auto-generated method stub
System.out.println(":::::::::::::restote article from the trash::::::::::::");
super.restoreArticleFromTrash(groupId, articleId);
}
答案 0 :(得分:0)
JournalArticleTrashHandler
调用JournalArticleLocalService
' retoreArticleFromTrash
方法。我假设这是您在门户网站中采取的操作进入期刊文章服务层的入口点。由于该调用直接针对本地服务,因此我认为您需要为JournalArticleLocalService
而不是JournalArticleService
创建服务包装。
答案 1 :(得分:-1)
除了restoreArticleFromTrash之外,每个方法都在调用。 还有其他任何方式。
下面添加了完整的类文件
@Component(service = ServiceWrapper.class)
公共类CustomJournalArticleServiceWrapper扩展了JournalArticleServiceWrapper {
public CustomJournalArticleServiceWrapper() {
super(null);
}
@Override
public JournalArticle addArticle(long groupId, long folderId, long classNameId, long classPK, String articleId,
boolean autoArticleId, Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, String content,
String ddmStructureKey, String ddmTemplateKey, String layoutUuid, int displayDateMonth, int displayDateDay,
int displayDateYear, int displayDateHour, int displayDateMinute, int expirationDateMonth,
int expirationDateDay, int expirationDateYear, int expirationDateHour, int expirationDateMinute,
boolean neverExpire, int reviewDateMonth, int reviewDateDay, int reviewDateYear, int reviewDateHour,
int reviewDateMinute, boolean neverReview, boolean indexable, boolean smallImage, String smallImageURL,
File smallFile, Map<String, byte[]> images, String articleURL, ServiceContext serviceContext)
throws PortalException {
return super.addArticle(groupId, folderId, classNameId, classPK, articleId,
autoArticleId, titleMap, descriptionMap, content, ddmStructureKey, ddmTemplateKey, layoutUuid,
displayDateMonth, displayDateDay, displayDateYear, displayDateHour, displayDateMinute,
expirationDateMonth, expirationDateDay, expirationDateYear, expirationDateHour, expirationDateMinute,
neverExpire, reviewDateMonth, reviewDateDay, reviewDateYear, reviewDateHour, reviewDateMinute,
neverReview, indexable, smallImage, smallImageURL, smallFile, images, articleURL, serviceContext);
}
@Override
public JournalArticle updateArticle(long groupId, long folderId, String articleId, double version,
Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, String content, String ddmStructureKey,
String ddmTemplateKey, String layoutUuid, int displayDateMonth, int displayDateDay, int displayDateYear,
int displayDateHour, int displayDateMinute, int expirationDateMonth, int expirationDateDay,
int expirationDateYear, int expirationDateHour, int expirationDateMinute, boolean neverExpire,
int reviewDateMonth, int reviewDateDay, int reviewDateYear, int reviewDateHour, int reviewDateMinute,
boolean neverReview, boolean indexable, boolean smallImage, String smallImageURL, File smallFile,
Map<String, byte[]> images, String articleURL, ServiceContext serviceContext) throws PortalException {
return super.updateArticle(groupId, folderId, articleId, version, titleMap,
descriptionMap, content, ddmStructureKey, ddmTemplateKey, layoutUuid, displayDateMonth, displayDateDay,
displayDateYear, displayDateHour, displayDateMinute, expirationDateMonth, expirationDateDay,
expirationDateYear, expirationDateHour, expirationDateMinute, neverExpire, reviewDateMonth,
reviewDateDay, reviewDateYear, reviewDateHour, reviewDateMinute, neverReview, indexable, smallImage,
smallImageURL, smallFile, images, articleURL, serviceContext);
}
@Override
public JournalArticle moveArticleToTrash(long groupId, String articleId) throws PortalException {
// TODO Auto-generated method stub
System.out.println("::::::::::move article to the trash:::::::::::::");
return super.moveArticleToTrash(groupId, articleId);
}
@Override
public void restoreArticleFromTrash(long groupId, String articleId) throws PortalException {
// TODO Auto-generated method stub
System.out.println(":::::::::::::restote article from the trash::::::::::::");
super.restoreArticleFromTrash(groupId, articleId);
}
}