001
014
015 package com.liferay.portal.service.impl;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.model.RepositoryEntry;
020 import com.liferay.portal.service.ServiceContext;
021 import com.liferay.portal.service.base.RepositoryEntryLocalServiceBaseImpl;
022
023
027 public class RepositoryEntryLocalServiceImpl
028 extends RepositoryEntryLocalServiceBaseImpl {
029
030 @Override
031 public RepositoryEntry addRepositoryEntry(
032 long groupId, long repositoryId, String mappedId,
033 ServiceContext serviceContext)
034 throws SystemException {
035
036 long repositoryEntryId = counterLocalService.increment();
037
038 RepositoryEntry repositoryEntry = repositoryEntryPersistence.create(
039 repositoryEntryId);
040
041 repositoryEntry.setGroupId(groupId);
042 repositoryEntry.setUuid(serviceContext.getUuid());
043 repositoryEntry.setRepositoryId(repositoryId);
044 repositoryEntry.setMappedId(mappedId);
045
046 repositoryEntryPersistence.update(repositoryEntry, false);
047
048 return repositoryEntry;
049 }
050
051 @Override
052 public RepositoryEntry updateRepositoryEntry(
053 long repositoryEntryId, String mappedId)
054 throws PortalException, SystemException {
055
056 RepositoryEntry repositoryEntry =
057 repositoryEntryPersistence.findByPrimaryKey(repositoryEntryId);
058
059 repositoryEntry.setMappedId(mappedId);
060
061 repositoryEntryPersistence.update(repositoryEntry, false);
062
063 return repositoryEntry;
064 }
065
066 }