001
014
015 package com.liferay.portal.service.impl;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.exception.PortalException;
020 import com.liferay.portal.model.LayoutSetBranch;
021 import com.liferay.portal.model.RecentLayoutSetBranch;
022 import com.liferay.portal.service.base.RecentLayoutSetBranchLocalServiceBaseImpl;
023
024
028 @ProviderType
029 public class RecentLayoutSetBranchLocalServiceImpl
030 extends RecentLayoutSetBranchLocalServiceBaseImpl {
031
032 @Override
033 public RecentLayoutSetBranch addRecentLayoutSetBranch(
034 long userId, long layoutSetBranchId, long layoutSetId)
035 throws PortalException {
036
037 LayoutSetBranch layoutSetBranch =
038 layoutSetBranchPersistence.findByPrimaryKey(layoutSetBranchId);
039
040 RecentLayoutSetBranch recentLayoutSetBranch =
041 recentLayoutSetBranchPersistence.create(
042 counterLocalService.increment());
043
044 recentLayoutSetBranch.setGroupId(layoutSetBranch.getGroupId());
045 recentLayoutSetBranch.setCompanyId(layoutSetBranch.getCompanyId());
046 recentLayoutSetBranch.setUserId(userId);
047 recentLayoutSetBranch.setLayoutSetBranchId(layoutSetBranchId);
048 recentLayoutSetBranch.setLayoutSetId(layoutSetId);
049
050 return recentLayoutSetBranchPersistence.update(recentLayoutSetBranch);
051 }
052
053 @Override
054 public void deleteRecentLayoutSetBranches(long layoutSetBranchId) {
055 recentLayoutSetBranchPersistence.removeByLayoutSetBranchId(
056 layoutSetBranchId);
057 }
058
059 @Override
060 public void deleteUserRecentLayoutSetBranches(long userId) {
061 recentLayoutSetBranchPersistence.removeByUserId(userId);
062 }
063
064 @Override
065 public RecentLayoutSetBranch fetchRecentLayoutSetBranch(
066 long userId, long layoutSetId) {
067
068 return recentLayoutSetBranchPersistence.fetchByU_L(userId, layoutSetId);
069 }
070
071 }